qbclient

package
v0.2.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2021 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OptionAppID          = "app-id"
	OptionConfigDir      = "config-dir"
	OptionFieldID        = "field-id"
	OptionProfile        = "profile"
	OptionRealmHostname  = "realm-hostname"
	OptionRelationshipID = "relationship-id"
	OptionTableID        = "table-id"
	OptionUserToken      = "user-token"
)

Option* constants contain CLI options.

View Source
const (
	FieldRecordID           = "recordid"
	FieldText               = "text"
	FieldTextMultiLine      = "text-multi-line"
	FieldTextMultipleChoice = "text-multiple-choice"
	FieldRichText           = "rich-text"
	FieldMultiSelectText    = "multitext"
	FieldNumeric            = "numeric"
	FieldNumericCurrency    = "currency"
	FieldNumericPercent     = "percent"
	FieldNumericRating      = "rating"
	FieldDate               = "date"
	FieldDateTime           = "timestamp"
	FieldTimeOfDay          = "timeofday"
	FieldDuration           = "duration"
	FieldCheckbox           = "checkbox"
	FieldAddress            = "address"
	FieldAddressStreet1     = "text"
	FieldAddressStreet2     = "text"
	FieldAddressCity        = "text"
	FieldAddressStateRegion = "text"
	FieldAddressPostalCode  = "text"
	FieldAddressCountry     = "text"
	FieldPhoneNumber        = "phone"
	FieldEmailAddress       = "email"
	FieldUser               = "user"
	FieldUserList           = "multiuserid"
	FieldFileAttachment     = "file"
	FieldURL                = "url"
	FieldReportLink         = "dblink"
	FieldiCalendar          = "ICalendarButton"
	FieldvCard              = "vCardButton"
	FieldPredecessor        = "predecessor"
)

Field* constants contain the Quick Base field types.

View Source
const (
	AccumulationTypeAverage           = "AVG"
	AccumulationTypeSum               = "SUM"
	AccumulationTypeMaximum           = "MAX"
	AccumulationTypeMinimum           = "MIN"
	AccumulationTypeStandardDeviation = "STD-DEV"
	AccumulationTypeCount             = "COUNT"
	AccumulationTypeCombinedText      = "COMBINED-TEXT"
	AccumulationTypeDistinctCount     = "DISTINCT-COUNT"
)

AccumulationType* constants contain valid accumulation types for summary fields.

View Source
const (
	FormatDate      = "2006-01-02"
	FormatDateTime  = "2006-01-02T15:04:05Z"
	FormatTimeOfDay = "15:04:05"
)

Format* constants contain common format strings.

View Source
const (
	SortByASC  = "ASC"
	SortByDESC = "DESC"
)

SortBy* constants model values used in the the order property.

View Source
const ConfigFilename = "config.yml"

ConfigFilename is the name of the configuration file.

View Source
const EnvPrefix = "QUICKBASE"

EnvPrefix is the prefix for environment variables containing configuration.

Variables

View Source
var ErrInvalidType = errors.New("field type invalid")

ErrInvalidType is an invalid field type error.

View Source
var Version string

Version is the application version, set through ldflags.

Example build command: go build -ldflags "-X github.com/QuickBase/quickbase-cli/qbclient.Version=v0.0.0

Functions

func DirExists

func DirExists(dirname string) bool

DirExists returns true if dirname exists and is a directory.

func FileExists

func FileExists(filename string) bool

FileExists returns true if filename exists and is a file.

func Filepath

func Filepath(dirs ...string) string

Filepath is a cross-platform solution for generating filepaths.

func MaskUserToken

func MaskUserToken(b []byte) []byte

MaskUserToken masks user tokens in a byte slice.

func MaskUserTokenString

func MaskUserTokenString(s string) string

MaskUserTokenString masks user tokens in a string.

func NoValidation

func NoValidation(s string) error

NoValidation always returns a nil error.

func ParseList

func ParseList(in string) (out []string, err error)

ParseList parses a string into a string slice.

func ReadInConfig

func ReadInConfig(cfg *viper.Viper) error

ReadInConfig reads in configuration from the config file.

func TableAlias

func TableAlias(label string) string

TableAlias converts a label to a table alias.

func ValidateHostname

func ValidateHostname(hostname string) error

ValidateHostname validates the passed hostname.

func WriteConfigFile

func WriteConfigFile(dir string, cf ConfigFile) (err error)

WriteConfigFile writes a configuration file.

Types

type App

type App struct {
	AppID                    string      `json:"id,omitempty"`
	Name                     string      `json:"name,omitempty"`
	TimeZone                 string      `json:"timeZone,omitempty"`
	DateFormat               string      `json:"dateFormat,omitempty"`
	Created                  *Timestamp  `json:"created,omitempty"`
	Updated                  *Timestamp  `json:"updated,omitempty"`
	Variables                []*Variable `json:"variables,omitempty"`
	HasEveryoneOnTheInternet bool        `json:"hasEveryoneOnTheInternet,omitempty"`
}

App models an app. NOTE The description property is in ErrorProperties.

type Client

type Client struct {
	HTTPClient    *http.Client
	Plugins       []Plugin
	ReamlHostname string
	URL           string
	UserAgent     string
	UserToken     string
}

Client makes requests to the Quick Base API.

func New

func New(cfg ConfigIface) *Client

New returns a new Client.

func NewFromProfile

func NewFromProfile(profile string) (client *Client, err error)

NewFromProfile returns a new Client, initializing the config from the passed profile.

func (*Client) AddPlugin

func (c *Client) AddPlugin(p Plugin)

AddPlugin adds a Plugin to the stack.

func (*Client) CloneUserToken added in v0.2.0

func (c *Client) CloneUserToken(input *CloneUserTokenInput) (output *CloneUserTokenOutput, err error)

CloneUserToken sends a request to POST /v1/usertoken/clone. See https://api.quickbase.com/v1/usertoken/clone

func (*Client) CopyApp

func (c *Client) CopyApp(input *CopyAppInput) (output *CopyAppOutput, err error)

CopyApp sends a request to POST /v1/apps/{appId}/copy. See https://developer.quickbase.com/operation/copyApp

func (*Client) CreateApp

func (c *Client) CreateApp(input *CreateAppInput) (output *CreateAppOutput, err error)

CreateApp sends a request to POST /v1/apps. See https://developer.quickbase.com/operation/getApp

func (*Client) CreateField

func (c *Client) CreateField(input *CreateFieldInput) (output *CreateFieldOutput, err error)

CreateField sends a request to POST /v1/fields?tableId={tableId}. See https://developer.quickbase.com/operation/createField

func (*Client) CreateFile added in v0.1.3

func (c *Client) CreateFile(input *CreateFileInput) (output *CreateFileOutput, err error)

CreateFile makes an API_UploadFile call. See https://help.quickbase.com/api-guide/index.html#uploadfile.html

func (*Client) CreatePage added in v0.1.3

func (c *Client) CreatePage(input *CreatePageInput) (output *CreatePageOutput, err error)

CreatePage sends an XML API request to API_AddReplaceDBPage. See https://help.quickbase.com/api-guide/index.html#add_replace_dbpage.html

func (*Client) CreateRelationship

func (c *Client) CreateRelationship(input *CreateRelationshipInput) (output *CreateRelationshipOutput, err error)

CreateRelationship sends a request to POST /v1/tables/{tableId}/relationship. See https://developer.quickbase.com/operation/createRelationship

func (*Client) CreateTable

func (c *Client) CreateTable(input *CreateTableInput) (output *CreateTableOutput, err error)

CreateTable sends a request to POST /v1/tables?appId={appId}. See https://developer.quickbase.com/operation/createTable

func (*Client) DeactivateUserToken added in v0.2.0

func (c *Client) DeactivateUserToken(input *DeactivateUserTokenInput) (output *DeactivateUserTokenOutput, err error)

DeactivateUserToken sends a request to POST /v1/usertoken/deactivate. See https://developer.quickbase.com/operation/deactivateUserToken

func (*Client) DeleteApp

func (c *Client) DeleteApp(input *DeleteAppInput) (output *DeleteAppOutput, err error)

DeleteApp sends a request to DELETE /v1/apps/{appId}. See https://developer.quickbase.com/operation/deleteApp

func (*Client) DeleteFields

func (c *Client) DeleteFields(input *DeleteFieldsInput) (output *DeleteFieldsOutput, err error)

DeleteFields sends a request to DELETE v1/fields?tableId={tableId}. See https://developer.quickbase.com/operation/deleteFields

func (*Client) DeleteFile added in v0.1.3

func (c *Client) DeleteFile(input *DeleteFileInput) (output *DeleteFileOutput, err error)

DeleteFile sends a request to DELETE /v1/files/{tableId}/{recordId}/{fieldId}/{versionNumber}. See https://developer.quickbase.com/operation/deleteFile

func (*Client) DeleteRecords

func (c *Client) DeleteRecords(input *DeleteRecordsInput) (output *DeleteRecordsOutput, err error)

DeleteRecords sends a request to DELETE /v1/records. See https://developer.quickbase.com/operation/deleteRecords

func (*Client) DeleteRelationship

func (c *Client) DeleteRelationship(input *DeleteRelationshipInput) (output *DeleteRelationshipOutput, err error)

DeleteRelationship sends a request to DELETE /v1/tables/{tableId}/relationship/{relationshipId} See https://developer.quickbase.com/operation/deleteRelationship

func (*Client) DeleteTable

func (c *Client) DeleteTable(input *DeleteTableInput) (output *DeleteTableOutput, err error)

DeleteTable sends a request to DELETE /v1/tables/{tableId}?appId={appId}. See https://developer.quickbase.com/operation/deleteTable

func (*Client) DeleteUserToken added in v0.2.0

func (c *Client) DeleteUserToken(input *DeleteUserTokenInput) (output *DeleteUserTokenOutput, err error)

DeleteUserToken sends a request to DELETE /v1/usertoken. See https://developer.quickbase.com/operation/deleteUserToken

func (*Client) Do

func (c *Client) Do(input Input, output Output) error

Do sends an arbitrary request to the Quick Base API. TODO Improve the error handling.

func (*Client) GetApp

func (c *Client) GetApp(input *GetAppInput) (output *GetAppOutput, err error)

GetApp sends a request to GET /v1/apps/{appId}. See https://developer.quickbase.com/operation/getApp

func (*Client) GetAppByID

func (c *Client) GetAppByID(id string) (*GetAppOutput, error)

GetAppByID sends a request to GET /v1/apps/{appId} and gets an app by ID. See https://developer.quickbase.com/operation/getApp

func (*Client) GetField

func (c *Client) GetField(input *GetFieldInput) (output *GetFieldOutput, err error)

GetField sends a request to GET /v1/fields/{fieldId}?tableId={tableId}. See https://developer.quickbase.com/operation/getField

func (*Client) GetFieldByID

func (c *Client) GetFieldByID(fid int) (*GetFieldOutput, error)

GetFieldByID sends a request to GET /v1/fields/{fieldId}?tableId={tableId} and gets a field by its ID. See https://developer.quickbase.com/operation/getField

func (*Client) GetPage added in v0.1.3

func (c *Client) GetPage(input *GetPageInput) (output *GetPageOutput, err error)

GetPage makes an API_GetDBPage call. See https://help.quickbase.com/api-guide/index.html#get_db_page.html

func (*Client) GetReport added in v0.1.4

func (c *Client) GetReport(input *GetReportInput) (output *GetReportOutput, err error)

GetReport sends a request to GET /v1/reports/{reportId}?tableId={tableId}. See https://developer.quickbase.com/operation/getReport

func (*Client) GetTable

func (c *Client) GetTable(input *GetTableInput) (output *GetTableOutput, err error)

GetTable sends a request to GET /v1/tables/{tableId}?appId={appId}. See https://developer.quickbase.com/operation/getTable

func (*Client) GetVariable

func (c *Client) GetVariable(input *GetVariableInput) (output *GetVariableOutput, err error)

GetVariable sends an XML API request to API_GetDBvar. See https://help.quickbase.com/api-guide/index.html#getdbvar.html

func (*Client) InsertRecords

func (c *Client) InsertRecords(input *InsertRecordsInput) (output *InsertRecordsOutput, err error)

InsertRecords sends a request to POST /v1/records. See https://developer.quickbase.com/operation/upsert

func (*Client) ListAppEvents

func (c *Client) ListAppEvents(input *ListAppEventsInput) (output *ListAppEventsOutput, err error)

ListAppEvents sends a request to GET /v1/apps/{appId}/events. See https://developer.quickbase.com/operation/getAppEvents

func (*Client) ListApps

func (c *Client) ListApps(input *ListAppsInput) (output *ListAppsOutput, err error)

ListApps sends an XML API request to API_GrantedDBs. See https://help.quickbase.com/api-guide/granteddbs.html

func (*Client) ListFields

func (c *Client) ListFields(input *ListFieldsInput) (output *ListFieldsOutput, err error)

ListFields sends a request to GET /v1/fields?tableId={tableId}. See https://developer.quickbase.com/operation/getFields

func (*Client) ListFieldsByTableID

func (c *Client) ListFieldsByTableID(tableID string) (*ListFieldsOutput, error)

ListFieldsByTableID sends a request to GET /v1/fields?tableId={tableId} an lists fields for the passed table. See https://developer.quickbase.com/operation/getFields

func (*Client) ListRelationships

func (c *Client) ListRelationships(input *ListRelationshipsInput) (output *ListRelationshipsOutput, err error)

ListRelationships sends a request to GET /v1/tables/{tableId}/relationships. See https://developer.quickbase.com/operation/getRelationships

func (*Client) ListRelationshipsByTableID

func (c *Client) ListRelationshipsByTableID(id string) (*ListRelationshipsOutput, error)

ListRelationshipsByTableID sends a request to GET /v1/tables/{tableId}/relationships and gets a relationship by table ID. See https://developer.quickbase.com/operation/getTable

func (*Client) ListReports added in v0.1.4

func (c *Client) ListReports(input *ListReportsInput) (output *ListReportsOutput, err error)

ListReports sends a request to GET /v1/reports?tableId={tableId}. See https://developer.quickbase.com/operation/GetReportReports

func (*Client) ListTables

func (c *Client) ListTables(input *ListTablesInput) (output *ListTablesOutput, err error)

ListTables sends a request to GET /v1/tables?appId={appId}. See https://developer.quickbase.com/operation/getAppTables

func (*Client) ListTablesByAppID

func (c *Client) ListTablesByAppID(id string) (*ListTablesOutput, error)

ListTablesByAppID sends a request to GET /v1/tables?appId={appId} and gets a list of tables in an app by its ID. See https://developer.quickbase.com/operation/getAppTables

func (*Client) QueryRecords

func (c *Client) QueryRecords(input *QueryRecordsInput) (output *QueryRecordsOutput, err error)

QueryRecords sends a request to POST /v1/records/query. See https://developer.quickbase.com/operation/runQuery

func (*Client) RunFormula added in v0.2.1

func (c *Client) RunFormula(input *RunFormulaInput) (output *RunFormulaOutput, err error)

RunFormula sends a request to POST /v1/formula/run. See https://developer.quickbase.com/operation/runFormula

func (*Client) RunReport added in v0.1.4

func (c *Client) RunReport(input *RunReportInput) (output *RunReportOutput, err error)

RunReport sends a request to POST /v1/reports/{reportId}/run?tableId={tableId}. See https://developer.quickbase.com/operation/runReport

func (*Client) SetVariable

func (c *Client) SetVariable(input *SetVariableInput) (output *SetVariableOutput, err error)

SetVariable sends an XML API request to API_SetDBvar. See https://help.quickbase.com/api-guide/index.html#setdbvar.html

func (*Client) UpdateApp

func (c *Client) UpdateApp(input *UpdateAppInput) (output *UpdateAppOutput, err error)

UpdateApp sends a request to POST /v1/apps/{appId}. See https://developer.quickbase.com/operation/updateApp

func (*Client) UpdateField

func (c *Client) UpdateField(input *UpdateFieldInput) (output *UpdateFieldOutput, err error)

UpdateField sends a request to POST /v1/fields/{fieldId}?tableId={tableId}. See https://developer.quickbase.com/operation/updateField

func (*Client) UpdatePage added in v0.1.3

func (c *Client) UpdatePage(input *UpdatePageInput) (output *UpdatePageOutput, err error)

UpdatePage sends an XML API request to API_AddReplaceDBPage. See https://help.quickbase.com/api-guide/index.html#add_replace_dbpage.html

func (*Client) UpdateRelationship

func (c *Client) UpdateRelationship(input *UpdateRelationshipInput) (output *UpdateRelationshipOutput, err error)

UpdateRelationship sends a request to POST /v1/tables/{tableId}/relationship/{relationshipId}. See https://developer.quickbase.com/operation/updateRelationship

func (*Client) UpdateTable

func (c *Client) UpdateTable(input *UpdateTableInput) (output *UpdateTableOutput, err error)

UpdateTable sends a request to POST /v1/tables/{tableId}?appId={appId}. See https://developer.quickbase.com/operation/updateTable

type CloneUserTokenInput added in v0.2.0

type CloneUserTokenInput struct {
	Name        string `json:"name" cliutil:"option=name"`
	Description string `json:"description" cliutil:"option=description"`
	// contains filtered or unexported fields
}

CloneUserTokenInput models the input sent to POST /v1/usertoken/clone. See https://api.quickbase.com/v1/usertoken/clone

type CloneUserTokenOutput added in v0.2.0

type CloneUserTokenOutput struct {
	ErrorProperties

	Active bool                       `json:"active"`
	Apps   []*CloneUserTokenOutputApp `json:"apps"`
	ID     int                        `json:"id"`
	Name   string                     `json:"name"`
	Token  string                     `json:"token"`
}

CloneUserTokenOutput models the output returned by POST /v1/usertoken/clone. See https://api.quickbase.com/v1/usertoken/clone

type CloneUserTokenOutputApp added in v0.2.0

type CloneUserTokenOutputApp struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

CloneUserTokenOutputApp models the apps property.

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config contains configuration for the client.

func NewConfig

func NewConfig(cfg *viper.Viper) Config

NewConfig returns a new config

func (Config) ConfigDir

func (c Config) ConfigDir() string

ConfigDir returns the configuration directory.

func (Config) DefaultAppID

func (c Config) DefaultAppID() string

DefaultAppID returns the default app ID.

func (Config) DefaultFieldID

func (c Config) DefaultFieldID() int

DefaultFieldID returns the default field ID.

func (Config) DefaultTableID

func (c Config) DefaultTableID() string

DefaultTableID returns the default table ID.

func (Config) Profile

func (c Config) Profile() string

Profile returns the configured profile.

func (Config) RealmHostname

func (c Config) RealmHostname() string

RealmHostname returns the configured realm hostname.

func (Config) UserToken

func (c Config) UserToken() string

UserToken returns the configured log level.

type ConfigFile

type ConfigFile map[string]*ConfigFileProfile

ConfigFile models the configuration file.

func ReadConfigFile

func ReadConfigFile(dir string) (cf ConfigFile, err error)

ReadConfigFile reads and parses the configuration file.

type ConfigFileProfile

type ConfigFileProfile struct {
	RealmHostname  string `yaml:"realm_hostname,omitempty" json:"realm_hostname,omitempty"`
	UserToken      string `yaml:"user_token,omitempty" json:"user_token,omitempty"`
	TemporaryToken string `yaml:"temp_token,omitempty" json:"temp_token,omitempty"`
	AppID          string `yaml:"app_id,omitempty" json:"app_id,omitempty"`
	TableID        string `yaml:"table_id,omitempty" json:"table_id,omitempty"`
	FieldID        int    `yaml:"field_id,omitempty" json:"field_id,omitempty"`
}

ConfigFileProfile models the configuration for a profile.

type ConfigIface

type ConfigIface interface {

	// ConfigDir returns the configuration directory.
	ConfigDir() string

	// DefaultAppID returns the default app ID.
	DefaultAppID() string

	// Default FieldID returns the default field ID
	DefaultFieldID() int

	// DefaultTableID returns the default table ID.
	DefaultTableID() string

	// Profile returns the configured profile.
	Profile() string

	// RealmHostname returns the configured realm hostname.
	RealmHostname() string

	// UserToken returns the configured log level.
	UserToken() string
}

ConfigIface is implemented by structs used to configure the cleint.

type CopyAppInput

type CopyAppInput struct {
	AppID       string                  `json:"-" validate:"required" cliutil:"option=app-id"`
	Name        string                  `json:"name" validate:"required" cliutil:"option=name"`
	Description string                  `json:"description,omitempty" cliutil:"option=description"`
	Properties  *CopyAppInputProperties `json:"properties,omitempty"`
	// contains filtered or unexported fields
}

CopyAppInput models the input sent to POST /v1/apps/{appId}/copy. See https://developer.quickbase.com/operation/copyApp

type CopyAppInputProperties

type CopyAppInputProperties struct {
	AssignUserToken   bool `json:"assignUserToken,omitempty" cliutil:"option=assign-token"`
	ExcludeFiles      bool `json:"excludeFiles,omitempty" cliutil:"option=exclude-files"`
	KeepData          bool `json:"keepData,omitempty" cliutil:"option=keep-data"`
	KeepUsersAndRoles bool `json:"usersAndRoles,omitempty" cliutil:"option=keep-users-roles"`
}

CopyAppInputProperties models the properties property.

type CopyAppOutput

type CopyAppOutput struct {
	ErrorProperties
	App

	AncestorID string `json:"ancestorId,omitempty"`
}

CopyAppOutput models the output returned by POST /v1/apps/{appId}/copy. See https://developer.quickbase.com/operation/copyApp

type CreateAppInput

type CreateAppInput struct {
	Name            string      `json:"name" validate:"required" cliutil:"option=name usage='name of the app'"`
	Description     string      `json:"description,omitempty" cliutil:"option=description usage='description of the app'"`
	AssignUserToken bool        `json:"assignToken,omitempty" cliutil:"option=assign-token usage='assign the user token to the app'"`
	Variable        []*Variable `json:"variables,omitempty"`
	// contains filtered or unexported fields
}

CreateAppInput models the input sent to POST /v1/apps. See https://developer.quickbase.com/operation/createApp

type CreateAppOutput

type CreateAppOutput struct {
	ErrorProperties
	App
}

CreateAppOutput models the output returned by POST /v1/apps. See https://developer.quickbase.com/operation/createApp

type CreateFieldInput

type CreateFieldInput struct {
	Field

	TableID    string                      `json:"-" validate:"required" cliutil:"option=table-id"`
	Properties *CreateFieldInputProperties `json:"properties,omitempty"`
	// contains filtered or unexported fields
}

CreateFieldInput models the input sent to POST /v1/fields?tableId={tableId}. See https://developer.quickbase.com/operation/createField

type CreateFieldInputProperties

type CreateFieldInputProperties struct {
	FieldProperties
}

CreateFieldInputProperties models the "properties" property.

type CreateFieldOutput

type CreateFieldOutput struct {
	ErrorProperties
	Field

	FieldID    int                          `json:"id"`
	Properties *CreateFieldOutputProperties `json:"properties,omitempty"`
}

CreateFieldOutput models the output returned by POST /v1/fields?tableId={tableId}. See https://developer.quickbase.com/operation/createField

type CreateFieldOutputProperties

type CreateFieldOutputProperties struct {
	FieldProperties
}

CreateFieldOutputProperties models the "properties" property.

type CreateFileInput added in v0.1.3

type CreateFileInput struct {
	XMLRequestParameters
	XMLCredentialParameters

	TableID  string                  `xml:"-" validate:"required" cliutil:"option=table-id"`
	Fields   []*CreateFileInputField `xml:"field"`
	RecordID int                     `xml:"rid" validate:"required" cliutil:"option=record-id"`
	// contains filtered or unexported fields
}

CreateFileInput models the XML API request sent to API_UploadFile See https://help.quickbase.com/api-guide/index.html#uploadfile.html

type CreateFileInputField added in v0.1.3

type CreateFileInputField struct {
	FieldID  int    `xml:"fid,attr" validate:"required" cliutil:"option=field-id"`
	FileData string `xml:",chardata" validate:"required" cliutil:"option=file-data func=ioreader"`
	Name     string `xml:"filename,attr" validate:"required" cliutil:"option=file-name"`
}

CreateFileInputField models the field element.

type CreateFileOutput added in v0.1.3

type CreateFileOutput struct {
	XMLResponseParameters

	Fields []*CreateFileOutputField `xml:"file_fields>field"`
}

CreateFileOutput models the XML API response returned by API_UploadFile See https://help.quickbase.com/api-guide/index.html#uploadfile.html

type CreateFileOutputField added in v0.1.3

type CreateFileOutputField struct {
	FileID int    `xml:"id,attr"`
	URL    string `xml:"url"`
}

CreateFileOutputField models the file_fields element.

type CreatePageInput added in v0.1.3

type CreatePageInput struct {
	XMLRequestParameters
	XMLCredentialParameters

	AppID string               `xml:"-" validate:"required" cliutil:"option=app-id"`
	Body  *CreatePageInputBody `xml:"pagebody"`
	Name  string               `xml:"pagename" validate:"required" cliutil:"option=page-name"`
	Type  int                  `xml:"pagetype" validate:"required" cliutil:"option=page-type default=1"`
	// contains filtered or unexported fields
}

CreatePageInput models the XML API request sent to API_AddReplaceDBPage See https://help.quickbase.com/api-guide/index.html#add_replace_dbpage.html

type CreatePageInputBody added in v0.1.3

type CreatePageInputBody struct {
	Data string `xml:",cdata" validate:"required" cliutil:"option=page-body func=ioreader"`
}

CreatePageInputBody models the pagebody element.

type CreatePageOutput added in v0.1.3

type CreatePageOutput struct {
	XMLResponseParameters

	PageID int `xml:"pageID"`
}

CreatePageOutput models the XML API response returned by API_AddReplaceDBPage See https://help.quickbase.com/api-guide/index.html#add_replace_dbpage.html

type CreateRelationshipInput

type CreateRelationshipInput struct {
	ChildTableID    string                                  `json:"-" validate:"required" cliutil:"option=child-table-id"`
	ParentTableID   string                                  `json:"parentTableId,omitempty" validate:"required" cliutil:"option=parent-table-id"`
	ForeignKeyField *CreateRelationshipInputForeignKeyField `json:"foreignKeyField,omitempty"`
	LookupFieldIDs  []int                                   `json:"lookupFieldIds,omitempty" cliutil:"option=lookup-field-ids"`
	SummaryFields   []*RelationshipSummaryField             `json:"summaryFields,omitempty"`
	// contains filtered or unexported fields
}

CreateRelationshipInput models the input sent to POST /v1/tables/{tableId}/relationship. See https://developer.quickbase.com/operation/createRelationship

type CreateRelationshipInputForeignKeyField

type CreateRelationshipInputForeignKeyField struct {
	Label string `json:"label,omitempty" cliutil:"option=foreign-key-label"`
}

CreateRelationshipInputForeignKeyField models the summaryFields property.

type CreateRelationshipOutput

type CreateRelationshipOutput struct {
	ErrorProperties
	Relationship
}

CreateRelationshipOutput models the output returned by POST /v1/tables/{tableId}/relationship. See https://developer.quickbase.com/operation/createRelationship

type CreateTableInput

type CreateTableInput struct {
	AppID        string `json:"-" validate:"required" cliutil:"option=app-id"`
	Name         string `json:"name" validate:"required" cliutil:"option=name"`
	Description  string `json:"description" cliutil:"option=description"`
	IconName     string `json:"iconName" cliutil:"option=icon-name"`
	SingularNoun string `json:"singularNoun" cliutil:"option=singular-noun"`
	PluralNoun   string `json:"pluralNoun" cliutil:"option=plural-noun"`
	// contains filtered or unexported fields
}

CreateTableInput models the input sent to POST /v1/tables?appId={appId}. See https://developer.quickbase.com/operation/createTable

type CreateTableOutput

type CreateTableOutput struct {
	ErrorProperties

	TableID      string `json:"id,omitempty"`
	Name         string `json:"name,omitempty"`
	IconName     string `json:"iconName,omitempty"`
	SingularNoun string `json:"singularNoun,omitempty"`
	PluralNoun   string `json:"pluralNoun,omitempty"`
}

CreateTableOutput models the output returned by POST /v1/tables?appId={appId}. See https://developer.quickbase.com/operation/createTable

type Date added in v0.1.4

type Date struct {
	time.Time
}

Date models a Quickbase date.

func (Date) MarshalJSON added in v0.1.4

func (d Date) MarshalJSON() ([]byte, error)

MarshalJSON formats time.Time according to FormatDate.

func (*Date) UnmarshalJSON added in v0.1.4

func (d *Date) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON converts a date to a time.Time.

type DeactivateUserTokenInput added in v0.2.0

type DeactivateUserTokenInput struct {
	Token string `json:"-" validate:"required" cliutil:"option=token"`
	// contains filtered or unexported fields
}

DeactivateUserTokenInput models the input sent to POST /v1/usertoken/deactivate. See https://developer.quickbase.com/operation/deactivateUserToken

type DeactivateUserTokenOutput added in v0.2.0

type DeactivateUserTokenOutput struct {
	ErrorProperties

	ID int `json:"id"`
}

DeactivateUserTokenOutput models the output returned by POST /v1/usertoken/deactivate. See https://developer.quickbase.com/operation/deactivateUserToken

type DeleteAppInput

type DeleteAppInput struct {
	AppID string `json:"-" validate:"required" cliutil:"option=app-id"`
	Name  string `json:"name" validate:"required" cliutil:"option=name"`
	// contains filtered or unexported fields
}

DeleteAppInput models the input sent to DELETE /v1/apps/{appId}. See https://developer.quickbase.com/operation/deleteApp

type DeleteAppOutput

type DeleteAppOutput struct {
	ErrorProperties

	ID string `json:"deletedAppId,omitempty"`
}

DeleteAppOutput models the output returned by DELETE /v1/apps/{appId}. See https://developer.quickbase.com/operation/deleteApp

type DeleteFieldsInput

type DeleteFieldsInput struct {
	TableID  string `json:"-" validate:"required" cliutil:"option=table-id"`
	FieldIDs []int  `json:"fieldIds" validate:"required,min=1" cliutil:"option=field-id"`
	// contains filtered or unexported fields
}

DeleteFieldsInput models the input sent to DELETE v1/fields?tableId={tableId}. See https://developer.quickbase.com/operation/deleteFields

type DeleteFieldsOutput

type DeleteFieldsOutput struct {
	ErrorProperties

	DeletedFieldIDs []int    `json:"deletedFieldIds,omitempty"`
	Errors          []string `json:"errors,omitempty"`
}

DeleteFieldsOutput models the output returned by DELETE v1/fields?tableId={tableId}. See https://developer.quickbase.com/operation/deleteFields

type DeleteFileInput added in v0.1.3

type DeleteFileInput struct {
	TableID  string `json:"-" validate:"required" cliutil:"option=table-id"`
	RecordID int    `json:"-" validate:"required" cliutil:"option=record-id"`
	FieldID  int    `json:"-" validate:"required" cliutil:"option=field-id"`
	Version  int    `json:"-" validate:"required" cliutil:"option=version"`
	// contains filtered or unexported fields
}

DeleteFileInput models the input sent to DELETE /v1/files/{tableId}/{recordId}/{fieldId}/{versionNumber}. See https://developer.quickbase.com/operation/deleteFile

type DeleteFileOutput added in v0.1.3

type DeleteFileOutput struct {
	ErrorProperties

	Version  int                      `json:"versionNumber,omitempty"`
	FileName string                   `json:"fileName,omitempty"`
	Uploaded *Timestamp               `json:"uploaded,omitempty"`
	Creator  *DeleteFileOutputCreator `json:"creator,omitempty"`
}

DeleteFileOutput models the output returned by DELETE /v1/files/{tableId}/{recordId}/{fieldId}/{versionNumber}. See https://developer.quickbase.com/operation/deleteFile

type DeleteFileOutputCreator added in v0.1.3

type DeleteFileOutputCreator struct {
	Email  string `json:"email,omitempty"`
	UserID string `json:"id,omitempty"`
	Name   string `json:"name,omitempty"`
}

DeleteFileOutputCreator models the creator object.

type DeleteRecordsInput

type DeleteRecordsInput struct {
	From  string `json:"from" validate:"required" cliutil:"option=from"`
	Where string `json:"where" validate:"required" cliutil:"option=where func=query"`
	// contains filtered or unexported fields
}

DeleteRecordsInput models the input sent to DELETE /v1/records. See https://developer.quickbase.com/operation/deleteRecords

type DeleteRecordsOutput

type DeleteRecordsOutput struct {
	ErrorProperties

	NumberDeleted int `json:"numberDeleted,omitempty"`
}

DeleteRecordsOutput models the output returned by DELETE /v1/records. See https://developer.quickbase.com/operation/deleteRecords

type DeleteRelationshipInput

type DeleteRelationshipInput struct {
	ChildTableID   string `json:"-" validate:"required" cliutil:"option=child-table-id"`
	RelationshipID int    `json:"-" validate:"required" cliutil:"option=relationship-id"`
	// contains filtered or unexported fields
}

DeleteRelationshipInput models the input sent to DELETE /v1/tables/{tableId}/relationship/{relationshipId} See https://developer.quickbase.com/operation/deleteRelationship

type DeleteRelationshipOutput

type DeleteRelationshipOutput struct {
	ErrorProperties

	RelationshipID int `json:"relationshipId,omitempty"`
}

DeleteRelationshipOutput models the output returned by DELETE /v1/tables/{tableId}/relationship/{relationshipId} See https://developer.quickbase.com/operation/deleteRelationship

type DeleteTableInput

type DeleteTableInput struct {
	AppID   string `json:"-" validate:"required" cliutil:"option=app-id"`
	TableID string `json:"-" validate:"required" cliutil:"option=table-id"`
	// contains filtered or unexported fields
}

DeleteTableInput models the input sent to DELETE /v1/tables/{tableId}?appId={appId}. See https://developer.quickbase.com/operation/deleteTable

type DeleteTableOutput

type DeleteTableOutput struct {
	ErrorProperties

	TableID string `json:"deletedTableId,omitempty"`
}

DeleteTableOutput models the output returned by DELETE /v1/tables/{tableId}?appId={appId}. See https://developer.quickbase.com/operation/deleteTable

type DeleteUserTokenInput added in v0.2.0

type DeleteUserTokenInput struct {
	Token string `json:"-" validate:"required" cliutil:"option=token"`
	// contains filtered or unexported fields
}

DeleteUserTokenInput models the input sent to DELETE /v1/usertoken. See https://developer.quickbase.com/operation/deleteUserToken

type DeleteUserTokenOutput added in v0.2.0

type DeleteUserTokenOutput struct {
	ErrorProperties

	ID int `json:"id"`
}

DeleteUserTokenOutput models the output returned by DELETE /v1/usertoken. See https://developer.quickbase.com/operation/deleteUserToken

type ErrorProperties

type ErrorProperties struct {
	Message     string `json:"message,omitempty"`
	Description string `json:"description,omitempty"`
}

ErrorProperties contains properties returned during errors.

type Field

type Field struct {
	// Create is true if we are creating the field.
	Create bool `json:"-"`

	// Basics
	Label    string `json:"label,omitempty" validate:"required_if=Create true" cliutil:"option=label"`
	Type     string `json:"fieldType,omitempty" validate:"required_if=Create true" cliutil:"option=type"`
	Required bool   `json:"required,omitempty" cliutil:"option=required"`
	Unique   bool   `json:"unique,omitempty" cliutil:"option=unique"`

	// Display
	DisplayInBold          bool `json:"bold,omitempty" cliutil:"option=bold"`
	DisplayWithoutWrapping bool `json:"noWrap,omitempty" cliutil:"option=no-wrap"`

	// Advanced
	AutoFill        bool   `json:"doesDataCopy,omitempty" cliutil:"option=auto-fill"`
	Searchable      bool   `json:"findEnabled" cliutil:"option=searchable default=true func=boolstring"`
	AddToNewReports bool   `json:"appearsByDefault" cliutil:"option=add-to-reports default=true func=boolstring"`
	FieldHelpText   string `json:"fieldHelp,omitempty" cliutil:"option=help-text"`
	TrackField      bool   `json:"audited,omitempty" cliutil:"option=track-field"`

	// No UI
	AddToForms bool `json:"addToForms,omitempty" cliutil:"option=add-to-forms"`
}

Field models a field.

type FieldPermission

type FieldPermission struct {
	Role   string `json:"role"`
	Type   string `json:"permissionType"`
	RoleID int    `json:"roleId"`
}

FieldPermission models the permissions properties.

type FieldProperties

type FieldProperties struct {

	// Basics
	DefaultValue string `json:"defaultValue,omitempty" cliutil:"option=default"`

	// Text - Multiple Choice field options
	AllowNewChoices    bool `json:"allowNewChoices,omitempty" cliutil:"option=allow-new-choices"`
	SortChoicesAsGiven bool `json:"sortAsGiven,omitempty" cliutil:"option=sort-as-given"`

	// Display
	NumberOfLines   int `json:"numLines,omitempty" cliutil:"option=num-lines"`
	MaxCharacters   int `json:"maxLength,omitempty" cliutil:"option=max"`
	WidthOfInputBox int `json:"width,omitempty" cliutil:"option=width"`

	// No UI
	ExactMatch   bool   `json:"exact,omitempty" cliutil:"option=exact-match"`
	ForeignKey   bool   `json:"foreignKey,omitempty" cliutil:"option=foreign-key"`
	Formula      string `json:"formula,omitempty" cliutil:"option=formula"`
	FormulaFile  string `json:"-" cliutil:"option=formula-file func=ioreader"`
	ParentTable  string `json:"masterTableTag,omitempty" cliutil:"option=parent-table"`
	PrimaryKey   bool   `json:"primaryKey,omitempty" cliutil:"option=primary-key"`
	RelatedField int    `json:"targetFieldId,omitempty" cliutil:"option=related-field"`

	// Comments
	Comments string `json:"comments,omitempty" cliutil:"option=comments"`
}

FieldProperties models field properties. TODO Make a custom unmarshaler to not show properties if the struct ie empty. SEE https://stackoverflow.com/a/28447372

type File added in v0.1.3

type File struct {
	URL     string         `json:"url,omitempty"`
	Version []*FileVersion `json:"versions,omitempty"`
}

File models a file attachment.

type FileCreator added in v0.1.3

type FileCreator struct {
	Email  string `json:"email"`
	Name   string `json:"name"`
	UserID string `json:"id"`
}

FileCreator models the "version.creator" property.

type FileVersion added in v0.1.3

type FileVersion struct {
	Creator  *FileCreator `json:"creator"`
	FileName string       `json:"name"`
	Uploaded *Timestamp   `json:"uploaded"`
	Version  int          `json:"versionNumber"`
}

FileVersion models the "version" property.

type GetAppInput

type GetAppInput struct {
	AppID string `json:"-" validate:"required" cliutil:"option=app-id"`
	// contains filtered or unexported fields
}

GetAppInput models the input sent to GET /v1/apps/{appId}. See https://developer.quickbase.com/operation/getApp

type GetAppOutput

type GetAppOutput struct {
	ErrorProperties
	App
}

GetAppOutput models the output returned by GET /v1/apps/{appId}. See https://developer.quickbase.com/operation/getApp

type GetFieldInput

type GetFieldInput struct {
	TableID string `json:"-" validate:"required" cliutil:"option=table-id"`
	FieldID int    `json:"-" validate:"required" cliutil:"option=field-id"`
	// contains filtered or unexported fields
}

GetFieldInput models the input sent to GET /v1/fields/{fieldId}?tableId={tableId}. See https://developer.quickbase.com/operation/getField

type GetFieldOutput

type GetFieldOutput struct {
	ErrorProperties
	Field

	FieldID    int                       `json:"id,omitempty"`
	Properties *GetFieldOutputProperties `json:"properties,omitempty"`
}

GetFieldOutput models the output returned by GET /v1/fields/{fieldId}?tableId={tableId}. See https://developer.quickbase.com/operation/getField

type GetFieldOutputProperties

type GetFieldOutputProperties struct {
	FieldProperties
}

GetFieldOutputProperties models the "properties" property.

type GetPageInput added in v0.1.3

type GetPageInput struct {
	XMLRequestParameters
	XMLCredentialParameters

	AppID  string `xml:"-" validate:"required" cliutil:"option=app-id"`
	PageID string `xml:"pageID" validate:"required" cliutil:"option=page-id"`
	// contains filtered or unexported fields
}

GetPageInput models the XML API request sent to API_GetDBPage See https://help.quickbase.com/api-guide/index.html#get_db_page.html

type GetPageOutput added in v0.1.3

type GetPageOutput struct {
	XMLResponseParameters

	Body string `xml:"pagebody"`
}

GetPageOutput models the XML API response returned by API_GetDBPage See https://help.quickbase.com/api-guide/index.html#get_db_page.html

type GetReportInput added in v0.1.4

type GetReportInput struct {
	TableID  string `json:"-" validate:"required" cliutil:"option=table-id"`
	ReportID string `json:"-" validate:"required" cliutil:"option=report-id"`
	// contains filtered or unexported fields
}

GetReportInput models the input sent to GET /v1/reports/{reportId}?tableId={tableId}. See https://developer.quickbase.com/operation/getReport

type GetReportOutput added in v0.1.4

type GetReportOutput struct {
	ErrorProperties
	Report
}

GetReportOutput models the output returned by GET /v1/reports/{reportId}?tableId={tableId}. See https://developer.quickbase.com/operation/getReport

type GetTableInput

type GetTableInput struct {
	AppID   string `json:"-" validate:"required" cliutil:"option=app-id"`
	TableID string `json:"-" validate:"required" cliutil:"option=table-id"`
	// contains filtered or unexported fields
}

GetTableInput models the input sent to GET /v1/tables/{tableId}?appId={appId}s. See https://developer.quickbase.com/operation/getTable

type GetTableOutput

type GetTableOutput struct {
	ErrorProperties

	Name               string     `json:"name,omitempty"`
	TableID            string     `json:"id,omitempty"`
	Alias              string     `json:"alias,omitempty"`
	Created            *Timestamp `json:"created,omitempty"`
	Updated            *Timestamp `json:"updated,omitempty"`
	NextRecordID       int        `json:"nextRecordId,omitempty"`
	NextFieldID        int        `json:"nextFieldId,omitempty"`
	DefaultSortFieldID int        `json:"defaultSortFieldId,omitempty"`
	DefaultSortOrder   string     `json:"defaultSortOrder,omitempty"`
	KeyFieldID         int        `json:"keyFieldId,omitempty"`
	SingleRecordName   string     `json:"singleRecordName,omitempty"`
	PluralRecordName   string     `json:"pluralRecordName,omitempty"`
	TimeZone           string     `json:"timeZone,omitempty"`
	DateFormat         string     `json:"dateFormat,omitempty"`
}

GetTableOutput models the output returned by GET /v1/tables/{tableId}?appId={appId}. See https://developer.quickbase.com/operation/getTable

type GetVariableInput

type GetVariableInput struct {
	XMLRequestParameters
	XMLCredentialParameters

	AppID string `xml:"-" validate:"required" cliutil:"option=app-id"`
	Name  string `xml:"varname" validate:"required" cliutil:"option=variable-name"`
	// contains filtered or unexported fields
}

GetVariableInput models the XML API request sent to API_GetDBvar See https://help.quickbase.com/api-guide/index.html#getdbvar.html

type GetVariableOutput

type GetVariableOutput struct {
	XMLResponseParameters
	Variable
}

GetVariableOutput models the XML API response returned by API_GetDBvar. See https://help.quickbase.com/api-guide/index.html#getdbvar.html

type Input

type Input interface {
	// contains filtered or unexported methods
}

Input models the payload of API requests.

type InsertRecordsInput

type InsertRecordsInput struct {
	Data           []map[int]*InsertRecordsInputData `json:"data" validate:"required,min=1" cliutil:"option=data func=record"`
	To             string                            `json:"to" validate:"required" cliutil:"option=to"`
	MergeFieldID   int                               `json:"mergeFieldId,omitempty" cliutil:"option=merge-field-id"`
	FieldsToReturn []int                             `json:"fieldsToReturn,omitempty" cliutil:"option=fields-to-return "`
	// contains filtered or unexported fields
}

InsertRecordsInput models the input sent to POST /v1/records. See https://developer.quickbase.com/operation/upsert

func (*InsertRecordsInput) SetRecords

func (i *InsertRecordsInput) SetRecords(records []*Record)

SetRecords sets the records to insert.

This function converts the a Records slice and sets it as the InsertRecordsInput.Data property.

type InsertRecordsInputData

type InsertRecordsInputData struct {
	Value *Value `json:"value" validate:"required"`
}

InsertRecordsInputData models the data property.

type InsertRecordsOutput

type InsertRecordsOutput struct {
	ErrorProperties

	Metadata *InsertRecordsOutputMetadata `json:"metadata,omitempty"`
}

InsertRecordsOutput models the output returned by POST /v1/records. See https://developer.quickbase.com/operation/upsert

type InsertRecordsOutputMetadata

type InsertRecordsOutputMetadata struct {
	CreatedRecordIDs              []int               `json:"createdRecordIds"`
	LineErrors                    map[string][]string `json:"lineErrors,omitempty"`
	TotalNumberOfRecordsProcessed int                 `json:"totalNumberOfRecordsProcessed"`
	UnchangedRecordIDs            []int               `json:"unchangedRecordIds"`
	UpdatedRecordIDs              []int               `json:"updatedRecordIds"`
}

InsertRecordsOutputMetadata models the metadata property.

type ListAppEventsInput

type ListAppEventsInput struct {
	AppID string `json:"-" validate:"required" cliutil:"option=app-id"`
	// contains filtered or unexported fields
}

ListAppEventsInput models the input sent to GET /v1/apps/{appId}/events. See https://developer.quickbase.com/operation/getAppEvents

type ListAppEventsOutput

type ListAppEventsOutput struct {
	ErrorProperties

	Events []*ListAppEventsOutputEvent `json:"events,omitempty"`
}

ListAppEventsOutput models the output returned by GET /v1/apps/{appId}/events. See https://developer.quickbase.com/operation/getAppEvents

func (*ListAppEventsOutput) MarshalJSON

func (o *ListAppEventsOutput) MarshalJSON() ([]byte, error)

MarshalJSON implements json.MarshalJSON by marshaling output.Tables.

func (*ListAppEventsOutput) UnmarshalJSON

func (o *ListAppEventsOutput) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implements json.UnmarshalJSON by unmarshaling the payload into ListTablesOutput.Events.

type ListAppEventsOutputEvent

type ListAppEventsOutputEvent struct {
	Type     string `json:"type"`
	Owner    *User  `json:"owner"`
	IsActive bool   `json:"isActive"`
	TableID  string `json:"tableId"`
	Name     string `json:"name"`
	URL      string `json:"url,omitempty"`
}

ListAppEventsOutputEvent models the event object.

type ListAppsInput

type ListAppsInput struct {
	XMLRequestParameters
	XMLCredentialParameters

	AdminOnly          bool `xml:"adminOnly,omitempty" cliutil:"option=admin-only"`
	ExcludeParents     bool `xml:"excludeparents,int,omitempty" cliutil:"option=exclude-parents"`
	IncludeAncestors   bool `xml:"includeancestors,int,omitempty" cliutil:"option=include-ancestors"`
	RealmAppsOnly      bool `xml:"realmAppsOnly,omitempty" cliutil:"option=realm-apps-only"`
	WithEmbeddedTables bool `xml:"withembeddedtables,int" cliutil:"option=with-embedded-tables"`
	// contains filtered or unexported fields
}

ListAppsInput models the XML API request sent to API_GrantedDBs. See https://help.quickbase.com/api-guide/granteddbs.html

type ListAppsOutput

type ListAppsOutput struct {
	XMLResponseParameters

	Databases []*ListAppsOutputDatabases `xml:"databases>dbinfo" json:"apps,omitempty"`
}

ListAppsOutput models the XML API response returned by API_GrantedDBs. See https://help.quickbase.com/api-guide/granteddbs.html

type ListAppsOutputDatabases

type ListAppsOutputDatabases struct {
	AncestorAppID       string `xml:"ancestorappid,omitempty" json:"ancestorAppId,omitempty"`
	ID                  string `xml:"dbid" json:"appId"`
	Name                string `xml:"dbname" json:"name"`
	OldestAncestorAppID string `xml:"oldestancestorappid,omitempty" json:"oldAncestorAppId,omitempty"`
}

ListAppsOutputDatabases modesl the databases propertie.

type ListFieldsInput

type ListFieldsInput struct {
	TableID                 string `json:"-" validate:"required" cliutil:"option=table-id"`
	IncludeFieldPermissions bool   `json:"includeFieldPerms" cliutil:"option=include-field-permissions"`
	// contains filtered or unexported fields
}

ListFieldsInput models the input sent to GET /v1/fields?tableId={tableId}. See https://developer.quickbase.com/operation/getFields

type ListFieldsOutput

type ListFieldsOutput struct {
	ErrorProperties

	Fields []*ListFieldsOutputField `json:"fields,omitempty"`
}

ListFieldsOutput models the output returned by GET /v1/fields?tableId={tableId}. See https://developer.quickbase.com/operation/getFields

func (*ListFieldsOutput) UnmarshalJSON

func (o *ListFieldsOutput) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implements json.UnmarshalJSON by unmarshaling the payload into ListFieldsOutput.Fields.

type ListFieldsOutputField

type ListFieldsOutputField struct {
	Field
	FieldID    int                              `json:"id,omitempty"`
	Properties *ListFieldsOutputFieldProperties `json:"properties,omitempty"`
}

ListFieldsOutputField models the field object.

type ListFieldsOutputFieldProperties

type ListFieldsOutputFieldProperties struct {
	FieldProperties
}

ListFieldsOutputFieldProperties models the field object properties.

type ListRelationshipsInput

type ListRelationshipsInput struct {
	ChildTableID string `json:"-" validate:"required" cliutil:"option=child-table-id"`
	// contains filtered or unexported fields
}

ListRelationshipsInput models the input sent to GET /v1/tables/{tableId}/relationships. See https://developer.quickbase.com/operation/getRelationships

type ListRelationshipsOutput

type ListRelationshipsOutput struct {
	ErrorProperties

	Metadata      *ListRelationshipsOutputMetadata `json:"metadata,omitempty"`
	Relationships []*Relationship                  `json:"relationships,omitempty"`
}

ListRelationshipsOutput models the output returned by GET /v1/tables/{tableId}/relationships. See https://developer.quickbase.com/operation/getRelationships

type ListRelationshipsOutputMetadata

type ListRelationshipsOutputMetadata struct {
	NumberOfRelationships int `json:"numRelationships,omitempty"`
	Skip                  int `json:"skip,omitempty"`
	TotalRelationships    int `json:"totalRelationships,omitempty"`
}

ListRelationshipsOutputMetadata models the metadata property.

type ListReportsInput added in v0.1.4

type ListReportsInput struct {
	TableID string `json:"-" validate:"required" cliutil:"option=table-id"`
	// contains filtered or unexported fields
}

ListReportsInput models the input sent to GET /v1/reports?tableId={tableId}. See https://developer.quickbase.com/operation/GetReportReports

type ListReportsOutput added in v0.1.4

type ListReportsOutput struct {
	ErrorProperties

	Reports []*ReportWithDescripton
}

ListReportsOutput models the input sent to GET /v1/reports?tableId={tableId}. See https://developer.quickbase.com/operation/GetReportReports

func (*ListReportsOutput) MarshalJSON added in v0.1.4

func (o *ListReportsOutput) MarshalJSON() ([]byte, error)

MarshalJSON implements json.MarshalJSON by marshaling output.Tables.

func (*ListReportsOutput) UnmarshalJSON added in v0.1.4

func (o *ListReportsOutput) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implements json.UnmarshalJSON by unmarshaling the payload into ListTablesOutput.Tables.

type ListTablesInput

type ListTablesInput struct {
	AppID string `json:"-" validate:"required" cliutil:"option=app-id"`
	// contains filtered or unexported fields
}

ListTablesInput models the input sent to GET /v1/tables?appId={appId}. See https://developer.quickbase.com/operation/getAppTables

type ListTablesOutput

type ListTablesOutput struct {
	ErrorProperties

	Tables []*ListTablesOutputTable `json:"tables,omitempty"`
}

ListTablesOutput models the input sent to GET /v1/tables?appId={appId}. See https://developer.quickbase.com/operation/getAppTables

func (*ListTablesOutput) MarshalJSON

func (o *ListTablesOutput) MarshalJSON() ([]byte, error)

MarshalJSON implements json.MarshalJSON by marshaling output.Tables.

func (*ListTablesOutput) UnmarshalJSON

func (o *ListTablesOutput) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implements json.UnmarshalJSON by unmarshaling the payload into ListTablesOutput.Tables.

type ListTablesOutputTable

type ListTablesOutputTable struct {
	Name               string     `json:"name"`
	TableID            string     `json:"id"`
	Alias              string     `json:"alias"`
	Description        string     `json:"description"`
	Created            *Timestamp `json:"created"`
	Updated            *Timestamp `json:"updated"`
	NextRecordID       int        `json:"nextRecordId"`
	NextFieldID        int        `json:"nextFieldId"`
	DefaultSortFieldID int        `json:"defaultSortFieldId"`
	DefaultSortOrder   string     `json:"defaultSortOrder"`
	KeyFieldID         int        `json:"keyFieldId"`
	SingleRecordName   string     `json:"singleRecordName"`
	PluralRecordName   string     `json:"pluralRecordName"`
	TimeZone           string     `json:"timeZone"`
	DateFormat         string     `json:"dateFormat"`
	SizeLimit          string     `json:"sizeLimit"`
	SpaceRemaining     string     `json:"spaceRemaining"`
	SpaceUsed          string     `json:"spaceUsed"`
}

ListTablesOutputTable models the table object.

type Output

type Output interface {
	// contains filtered or unexported methods
}

Output models the payload of API responses.

type Plugin

type Plugin interface {
	PreRequest(req *http.Request)
	PostResponse(resp *http.Response)
}

Plugin is implemented by plugins that intercept the HTTP request and response when consuming the Quick Base API.

type QueryRecordsInput

type QueryRecordsInput struct {
	Select  []int                       `json:"select" validate:"required,min=1" cliutil:"option=select"`
	From    string                      `json:"from" validate:"required" cliutil:"option=from"`
	Where   string                      `json:"where" cliutil:"option=where func=query"`
	GroupBy []*QueryRecordsInputGroupBy `json:"groupBy,omitempty" cliutil:"option=group-by func=group"`
	SortBy  []*QueryRecordsInputSortBy  `json:"sortBy,omitempty" cliutil:"option=sort-by func=sort"`
	Options *QueryRecordsInputOptions   `json:"options,omitempty"`
	// contains filtered or unexported fields
}

QueryRecordsInput models the input sent to POST /v1/records/query. See https://developer.quickbase.com/operation/runQuery

type QueryRecordsInputGroupBy

type QueryRecordsInputGroupBy struct {
	FieldID  int    `json:"fieldId"`
	Grouping string `json:"grouping"`
}

QueryRecordsInputGroupBy models the groupBy objects.

type QueryRecordsInputOptions added in v0.1.4

type QueryRecordsInputOptions struct {
	Skip       int  `json:"skip" cliutil:"option=skip"`
	Top        int  `json:"top" cliutil:"option=top"`
	UseAppTime bool `json:"compareWithAppLocalTime" cliutil:"option=use-app-time"`
}

QueryRecordsInputOptions models the options object.

type QueryRecordsInputSortBy

type QueryRecordsInputSortBy struct {
	FieldID int    `json:"fieldId"`
	Order   string `json:"order"`
}

QueryRecordsInputSortBy models the sortBy objects.

type QueryRecordsOutput

type QueryRecordsOutput struct {
	ErrorProperties
	Records
}

QueryRecordsOutput models the output returned by POST /v1/records/query. See https://developer.quickbase.com/operation/runQuery

func (*QueryRecordsOutput) UnmarshalJSON

func (output *QueryRecordsOutput) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implements json.UnmarshalJSON by using the field type to decode the "value" parameter into the appropriate data type.

TODO DRY up the code, see below.

type Record

type Record struct {
	Fields map[int]*Value
}

Record models a record in Quick Base.

func (*Record) SetValue

func (r *Record) SetValue(fid int, val *Value)

SetValue sets a value for a field.

type Records added in v0.1.4

type Records struct {
	Data     []map[int]*RecordsData `json:"data,omitempty"`
	Fields   []*RecordsField        `json:"fields,omitempty"`
	Metadata *RecordsMetadata       `json:"metadata,omitempty"`
}

Records models output that returns records.

type RecordsData added in v0.1.4

type RecordsData struct {
	Value *Value `json:"value"`
}

RecordsData models objects in the data array.

type RecordsField added in v0.1.4

type RecordsField struct {
	FieldID int    `json:"id"`
	Label   string `json:"label"`
	Type    string `json:"type"`
}

RecordsField models objects in the fields array.

type RecordsMetadata added in v0.1.4

type RecordsMetadata struct {
	TotalRecords int `json:"totalRecords"`
	NumRecords   int `json:"numRecords"`
	NumFields    int `json:"numFields"`
	Skip         int `json:"skip"`
	Top          int `json:"top,omitempty"`
}

RecordsMetadata models the metadata object.

type Relationship

type Relationship struct {
	ChildTableID    string               `json:"childTableId,omitempty"`
	ForeignKeyField *RelationshipField   `json:"foreignKeyField,omitempty"`
	RelationshipID  int                  `json:"id,omitempty"`
	IsCrossApp      bool                 `json:"isCrossApp,omitempty"`
	LookupFields    []*RelationshipField `json:"lookupFields,omitempty"`
	ParentTableID   string               `json:"parentTableId,omitempty"`
	SummaryFields   []*RelationshipField `json:"summaryFields,omitempty"`
}

Relationship models a relationship.

type RelationshipField

type RelationshipField struct {
	FieldID int    `json:"id,omitempty"`
	Label   string `json:"label,omitempty"`
	Type    string `json:"type,omitempty"`
}

RelationshipField models fields in relationship output.

type RelationshipSummaryField

type RelationshipSummaryField struct {
	SummaryFieldID   int    `json:"summaryFid,omitempty" cliutil:"option=field-id"`
	Label            string `json:"label,omitempty" cliutil:"option=label"`
	AccumulationType string `json:"accumulationType,omitempty" cliutil:"option=accumulation-type"`
	Where            string `json:"where,omitempty" cliutil:"option=where"`
}

RelationshipSummaryField models summary fields in relationship input/output.

type Report added in v0.1.4

type Report struct {
	ReportID   string            `json:"id,omitempty"`
	Name       string            `json:"name,omitempty"`
	Type       string            `json:"type,omitempty"`
	Query      *ReportQuery      `json:"query,omitempty"`
	Properties *ReportProperties `json:"properties,omitempty"`
	UsedLast   *Timestamp        `json:"usedLast,omitempty"`
	UsedCount  int               `json:"usedCount,omitempty"`
	OwnerID    int               `json:"ownerId,omitempty"`
}

Report models the report object.

type ReportProperties added in v0.1.4

type ReportProperties struct {
	DisplayOnlyNewOrChanged   bool                          `json:"displayOnlyNewOrChangedRecords,omitempty"`
	Column                    *ReportPropertiesColumn       `json:"columnProperties,omitempty"`
	StartDate                 *Date                         `json:"startDate,omitempty"`
	EndDate                   *Date                         `json:"endDate,omitempty"`
	StartingFieldID           int                           `json:"startingFieldId,omitempty"`
	EndingFieldID             int                           `json:"endingFieldId,omitempty"`
	MilestoneFieldID          int                           `json:"milestoneFieldId,omitempty"`
	SortByStartingField       bool                          `json:"sortByStartingField,omitempty"`
	Crosstab                  *ReportPropertiesCrosstab     `json:"crosstabs,omitempty"`
	Summmarize                *[]ReportPropertiesSummmarize `json:"summmarize,omitempty"`
	SortBy                    *[]ReportPropertiesSortBy     `json:"sortBy,omitempty"`
	AddressFieldID            int                           `json:"addressFieldId,omitempty"`
	MapViewType               string                        `json:"mapViewType,omitempty"`
	Stages                    []string                      `json:"stages,omitempty"`
	ManualOrdering            bool                          `json:"manualOrdering,omitempty"`
	StagesFromFieldID         int                           `json:"stagesFromFieldId,omitempty"`
	StartDateFieldID          int                           `json:"startDateField,omitempty"`
	EndDateFieldID            int                           `json:"endDateFieldId,omitempty"`
	DataLabel                 string                        `json:"dataLabel,omitempty"`
	Categories                *ReportPropertiesCategories   `json:"categories,omitempty"`
	DataSources               []*ReportPropertiesDataSource `json:"dataSources,omitempty"`
	ChartType                 string                        `json:"chartType,omitempty"`
	Series                    *ReportPropertiesSeries       `json:"series,omitempty"`
	Bubbles                   *ReportPropertiesBubbles      `json:"bubbles,omitempty"`
	DataSourcesLabel          string                        `json:"dataSourcesLabel,omitempty"`
	SecondaryDataSourcesLabel string                        `json:"secondaryDataSourcesLabel,omitempty"`
	SecondaryDataSources      []*ReportPropertiesDataSource `json:"secondaryDataSources,omitempty"`
	LineLabel                 string                        `json:"lineLabel,omitempty"`
	BarLabel                  string                        `json:"barLabel,omitempty"`
	BarDataSources            []*ReportPropertiesDataSource `json:"barDataSources,omitempty"`
	LineDataSources           []*ReportPropertiesDataSource `json:"lineDataSources,omitempty"`
	Goal                      *ReportPropertiesGoal         `json:"goal,omitempty"`
	Range                     *ReportPropertiesRange        `json:"range,omitempty"`
}

ReportProperties models the properties object.

type ReportPropertiesBubbles added in v0.1.4

type ReportPropertiesBubbles struct {
	Type        string `json:"type,omitempty"`
	FieldID     int    `json:"fieldId,omitempty"`
	Aggregation string `json:"aggregation,omitempty"`
}

ReportPropertiesBubbles models the bubbles object.

type ReportPropertiesCategories added in v0.1.4

type ReportPropertiesCategories struct {
	FieldID  int    `json:"fieldId,omitempty"`
	Label    string `json:"label,omitempty"`
	Grouping string `json:"grouping,omitempty"`
}

ReportPropertiesCategories models the categories object.

type ReportPropertiesColumn added in v0.1.4

type ReportPropertiesColumn struct {
	FieldID       int    `json:"fieldId,omitempty"`
	LabelOverride string `json:"labelOverride,omitempty"`
}

ReportPropertiesColumn models the columnProperties object.

type ReportPropertiesCrosstab added in v0.1.4

type ReportPropertiesCrosstab struct {
	FieldID  int    `json:"fieldId,omitempty"`
	Grouping string `json:"grouping,omitempty"`
}

ReportPropertiesCrosstab models the crosstabs object.

type ReportPropertiesDataSource added in v0.1.4

type ReportPropertiesDataSource struct {
	Type        string `json:"type,omitempty"`
	FieldID     int    `json:"fieldId,omitempty"`
	Label       string `json:"label,omitempty"`
	Aggregation string `json:"aggregation,omitempty"`
}

ReportPropertiesDataSource models the dataSource object.

type ReportPropertiesGoal added in v0.1.4

type ReportPropertiesGoal struct {
	Value int    `json:"number,omitempty"`
	Label string `json:"label,omitempty"`
}

ReportPropertiesGoal models the goal object.

type ReportPropertiesRange added in v0.1.4

type ReportPropertiesRange struct {
	Type                string  `json:"type,omitempty"`
	SmallestValue       float64 `json:"smallestValue,omitempty"`
	LargestValue        float64 `json:"largestValue,omitempty"`
	FieldID             int     `json:"fieldId,omitempty"`
	CalculationMethod   string  `json:"calculationMethod,omitempty"`
	IntervalsPercentage []int   `json:"intervalsPercentage,omitempty"`
}

ReportPropertiesRange models the range object.

type ReportPropertiesSeries added in v0.1.4

type ReportPropertiesSeries struct {
	FieldID  int    `json:"fieldId,omitempty"`
	Grouping string `json:"grouping,omitempty"`
}

ReportPropertiesSeries models the series object.

type ReportPropertiesSortBy added in v0.1.4

type ReportPropertiesSortBy struct {
	ElementIndex int    `json:"summarizationElementIndex,omitempty"`
	Order        string `json:"order,omitempty"`
	By           string `json:"by,omitempty"`
}

ReportPropertiesSortBy models the sortBy object.

type ReportPropertiesSummmarize added in v0.1.4

type ReportPropertiesSummmarize struct {
	Type        string `json:"type,omitempty"`
	FieldID     int    `json:"fieldId,omitempty"`
	Aggregation string `json:"aggregation,omitempty"`
	ShowAs      int    `json:"showAs,omitempty"`
}

ReportPropertiesSummmarize models the summmarize object.

type ReportQuery added in v0.1.4

type ReportQuery struct {
	TableID       string                      `json:"tableId,omitempty"`
	Filter        string                      `json:"filter,omitempty"`
	FormulaFields []*ReportQueryFormulaFields `json:"formulaFields,omitempty"`
	Fields        []int                       `json:"fields,omitempty"`
	SortBy        []*ReportQuerySortBy        `json:"sortBy,omitempty"`
	GroupBy       []*ReportQueryGroupBy       `json:"groupBy,omitempty"`
}

ReportQuery models the query object.

type ReportQueryFormulaFields added in v0.1.4

type ReportQueryFormulaFields struct {
	FormulaFieldID   int    `json:"id,omitempty"`
	Label            string `json:"label,omitempty"`
	Type             string `json:"fieldType,omitempty"`
	Formula          string `json:"formula,omitempty"`
	DecimalPrecision int    `json:"decimalPrecision,omitempty"`
}

ReportQueryFormulaFields models the formulaFields

type ReportQueryGroupBy added in v0.1.4

type ReportQueryGroupBy struct {
	FieldID  int    `json:"fieldId,omitempty"`
	Grouping string `json:"grouping,omitempty"`
}

ReportQueryGroupBy models the sortBy object.

type ReportQuerySortBy added in v0.1.4

type ReportQuerySortBy struct {
	FieldID int    `json:"fieldId,omitempty"`
	Order   string `json:"order,omitempty"`
}

ReportQuerySortBy models the sortBy object.

type ReportWithDescripton added in v0.1.4

type ReportWithDescripton struct {
	Report
	Description string `json:"description,omitempty"`
}

ReportWithDescripton is a Report with a Description property. This prevents conflicts with ErrorProperties.

type RunFormulaInput added in v0.2.1

type RunFormulaInput struct {
	From     string `json:"from" validate:"required" cliutil:"option=from"`
	RecordID int    `json:"rid" validate:"required" cliutil:"option=record-id"`
	Formula  string `json:"formula" validate:"required" cliutil:"option=formula func=stdin"`
	// contains filtered or unexported fields
}

RunFormulaInput models the input sent to POST /v1/formula/run. See https://developer.quickbase.com/operation/runFormula

type RunFormulaOutput added in v0.2.1

type RunFormulaOutput struct {
	ErrorProperties

	Result string `json:"result,omitempty"`
}

RunFormulaOutput models the output returned by POST /v1/formula/run. See https://developer.quickbase.com/operation/runFormula

type RunReportInput added in v0.1.4

type RunReportInput struct {
	TableID  string `json:"-" validate:"required" cliutil:"option=table-id"`
	ReportID string `json:"-" validate:"required" cliutil:"option=report-id"`
	Skip     int    `json:"-" cliutil:"option=skip"`
	Top      int    `json:"-" cliutil:"option=top"`
	// contains filtered or unexported fields
}

RunReportInput models the input sent to POST /v1/reports/{reportId}/run?tableId={tableId}. See https://developer.quickbase.com/operation/runReport

type RunReportOutput added in v0.1.4

type RunReportOutput struct {
	ErrorProperties
	Records
}

RunReportOutput models the output returned by POST /v1/reports/{reportId}/run?tableId={tableId}. See https://developer.quickbase.com/operation/runReport

func (*RunReportOutput) UnmarshalJSON added in v0.1.4

func (output *RunReportOutput) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implements json.UnmarshalJSON by using the field type to decode the "value" parameter into the appropriate data type.

TODO DRY up the code, see above.

type SetVariableInput

type SetVariableInput struct {
	XMLRequestParameters
	XMLCredentialParameters

	AppID string `xml:"-" validate:"required" cliutil:"option=app-id"`
	Name  string `xml:"varname" validate:"required" cliutil:"option=variable-name"`
	Value string `xml:"value" cliutil:"option=variable-value"`
	// contains filtered or unexported fields
}

SetVariableInput models a request sent to API_SetDBvar via the XML API. See https://help.quickbase.com/api-guide/index.html#setdbvar.html

type SetVariableOutput

type SetVariableOutput struct {
	XMLResponseParameters

	Name  string `xml:"-" json:"name,omitempty"`
	Value string `xml:"-" json:"value,omitempty"`
}

SetVariableOutput models the XML API response returned by API_SetDBvar See https://help.quickbase.com/api-guide/index.html#setdbvar.html

type Timestamp

type Timestamp struct {
	time.Time
}

Timestamp models a Quickbase timestamp.

func (Timestamp) MarshalJSON

func (t Timestamp) MarshalJSON() ([]byte, error)

MarshalJSON formats time.Time according to FormatDateTime.

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON converts a timestamp to a time.Time.

type UpdateAppInput

type UpdateAppInput struct {
	AppID       string      `json:"-" validate:"required" cliutil:"option=app-id"`
	Name        string      `json:"name,omitempty" cliutil:"option=name"`
	Description string      `json:"description,omitempty" cliutil:"option=description"`
	Variable    []*Variable `json:"variables,omitempty"`
	// contains filtered or unexported fields
}

UpdateAppInput models the input sent to POST /v1/apps/{appId}. See https://developer.quickbase.com/operation/updateApp

type UpdateAppOutput

type UpdateAppOutput struct {
	ErrorProperties
	App
}

UpdateAppOutput models the output returned by POST /v1/apps/{appId}. See https://developer.quickbase.com/operation/updateApp

type UpdateFieldInput

type UpdateFieldInput struct {
	Field

	TableID    string                      `json:"-" validate:"required" cliutil:"option=table-id"`
	FieldID    int                         `json:"-" validate:"required" cliutil:"option=field-id"`
	Properties *UpdateFieldInputProperties `json:"properties,omitempty"`
	// contains filtered or unexported fields
}

UpdateFieldInput models the input sent to POST /v1/fields/{fieldId}?tableId={tableId}. See https://developer.quickbase.com/operation/updateField

type UpdateFieldInputProperties

type UpdateFieldInputProperties struct {
	FieldProperties
}

UpdateFieldInputProperties models the "properties" property.

type UpdateFieldOutput

type UpdateFieldOutput struct {
	ErrorProperties
	Field

	FieldID    int                          `json:"id"`
	Properties *CreateFieldOutputProperties `json:"properties,omitempty"`
}

UpdateFieldOutput models the output returned by POST /v1/fields/{fieldId}?tableId={tableId}. See https://developer.quickbase.com/operation/updateField

type UpdatePageInput added in v0.1.3

type UpdatePageInput struct {
	XMLRequestParameters
	XMLCredentialParameters

	AppID  string               `xml:"-" validate:"required" cliutil:"option=app-id"`
	PageID int                  `xml:"pageid" cliutil:"option=page-id"`
	Name   string               `xml:"pagename" cliutil:"option=page-name"`
	Body   *UpdatePageInputBody `xml:"pagebody"`
	// contains filtered or unexported fields
}

UpdatePageInput models the XML API request sent to API_AddReplaceDBPage See https://help.quickbase.com/api-guide/index.html#add_replace_dbpage.html

type UpdatePageInputBody added in v0.1.3

type UpdatePageInputBody struct {
	Data string `xml:",cdata" validate:"required" cliutil:"option=page-body func=ioreader"`
}

UpdatePageInputBody models the pagebody element.

type UpdatePageOutput added in v0.1.3

type UpdatePageOutput struct {
	XMLResponseParameters

	PageID int `xml:"pageID"`
}

UpdatePageOutput models the XML API response returned by API_AddReplaceDBPage See https://help.quickbase.com/api-guide/index.html#add_replace_dbpage.html

type UpdateRelationshipInput

type UpdateRelationshipInput struct {
	ChildTableID   string                      `json:"-" validate:"required" cliutil:"option=child-table-id"`
	RelationshipID int                         `json:"-" validate:"required" cliutil:"option=relationship-id"`
	LookupFieldIDs []int                       `json:"lookupFieldIds,omitempty" cliutil:"option=lookup-field-ids"`
	SummaryFields  []*RelationshipSummaryField `json:"summaryFields,omitempty"`
	// contains filtered or unexported fields
}

UpdateRelationshipInput models the input sent to POST /v1/tables/{tableId}/relationship/{relationshipId}. See https://developer.quickbase.com/operation/updateRelationship

type UpdateRelationshipOutput

type UpdateRelationshipOutput struct {
	ErrorProperties
	Relationship
}

UpdateRelationshipOutput models the output returned by POST /v1/tables/{tableId}/relationship/{relationshipId}. See https://developer.quickbase.com/operation/updateRelationship

type UpdateTableInput

type UpdateTableInput struct {
	AppID        string `json:"-" validate:"required" cliutil:"option=app-id"`
	TableID      string `json:"-" validate:"required" cliutil:"option=table-id"`
	Name         string `json:"name,omitempty" cliutil:"option=name"`
	Description  string `json:"description,omitempty" cliutil:"option=description"`
	IconName     string `json:"iconName,omitempty" cliutil:"option=icon-name"`
	SingularNoun string `json:"singularNoun,omitempty" cliutil:"option=singular-noun"`
	PluralNoun   string `json:"pluralNoun,omitempty" cliutil:"option=plural-noun"`
	// contains filtered or unexported fields
}

UpdateTableInput models the input sent to POST /v1/tables/{tableId}?appId={appId}. See https://developer.quickbase.com/operation/updateTable

type UpdateTableOutput

type UpdateTableOutput struct {
	ErrorProperties

	TableID      string `json:"id,omitempty"`
	Name         string `json:"name,omitempty"`
	IconName     string `json:"iconName,omitempty"`
	SingularNoun string `json:"singularNoun,omitempty"`
	PluralNoun   string `json:"pluralNoun,omitempty"`
}

UpdateTableOutput models the output returned by POST /v1/tables/{tableId}?appId={appId}. See https://developer.quickbase.com/operation/updateTable

type User

type User struct {
	ID    string `json:"id"`
	Email string `json:"email"`
	Name  string `json:"name"`
}

User models a user in Quick Base.

type ValidateStringFn

type ValidateStringFn func(string) error

ValidateStringFn validates a string.

func ValidateNotEmptyFn

func ValidateNotEmptyFn(label string) ValidateStringFn

ValidateNotEmptyFn returns a function that validates a string isn't empty.

type Value

type Value struct {
	Bool      bool
	Duration  time.Duration
	File      *File
	Float64   float64
	Str       string
	StrSlice  []string
	Time      time.Time
	URL       *url.URL
	User      *User
	UserSlice []*User

	QuickBaseType string
}

Value models the value of fields in Quick Base. This struct effectively handles the Quickbase field type / Golang type transformations.

func NewAddressCityValue

func NewAddressCityValue(val string) *Value

NewAddressCityValue returns a new Value of the FieldAddressCity type.

func NewAddressCountryValue

func NewAddressCountryValue(val string) *Value

NewAddressCountryValue returns a new Value of the FieldAddressCountry type.

func NewAddressPostalCodeValue

func NewAddressPostalCodeValue(val string) *Value

NewAddressPostalCodeValue returns a new Value of the FieldAddressPostalCode type.

func NewAddressStateRegionValue

func NewAddressStateRegionValue(val string) *Value

NewAddressStateRegionValue returns a new Value of the FieldAddressStateRegion type.

func NewAddressStreet1Value

func NewAddressStreet1Value(val string) *Value

NewAddressStreet1Value returns a new Value of the FieldAddressStreet1 type.

func NewAddressStreet2Value

func NewAddressStreet2Value(val string) *Value

NewAddressStreet2Value returns a new Value of the FieldAddressStreet2 type.

func NewAddressValue

func NewAddressValue(val string) *Value

NewAddressValue returns a new Value of the FieldAddress type.

func NewCheckboxValue

func NewCheckboxValue(val bool) *Value

NewCheckboxValue returns a new Value of the FieldCheckbox type.

func NewCheckboxValueFromString

func NewCheckboxValueFromString(val string) (v *Value, err error)

NewCheckboxValueFromString returns a new Value of the FieldCheckbox type given a passed string.

func NewDateTimeValue

func NewDateTimeValue(val time.Time) *Value

NewDateTimeValue returns a new Value of the FieldDateTime type.

func NewDateTimeValueFromString

func NewDateTimeValueFromString(val string) (*Value, error)

NewDateTimeValueFromString returns a new Value of the FieldDate type, parsing the passed string into a time.Time.

func NewDateValue

func NewDateValue(val time.Time) *Value

NewDateValue returns a new Value of the FieldDate type.

func NewDateValueFromString

func NewDateValueFromString(val string) (*Value, error)

NewDateValueFromString returns a new Value of the FieldDate type, parsing the passed string into a time.Time.

func NewDurationValue

func NewDurationValue(val time.Duration) *Value

NewDurationValue returns a new Value of the FieldDuration type.

func NewDurationValueFromFloat64

func NewDurationValueFromFloat64(val float64) *Value

NewDurationValueFromFloat64 returns a new Value of the FieldDuration type, converting the passed float64 into a duration. We assume that the float64 is the duration in milliseconds.

func NewDurationValueFromString

func NewDurationValueFromString(val string) (v *Value, err error)

NewDurationValueFromString returns a new Value of the FieldDuration type given a passed string.

func NewEmailAddressValue

func NewEmailAddressValue(val string) *Value

NewEmailAddressValue returns a new Value of the FieldEmailAddress type.

func NewFileAttachmentValue

func NewFileAttachmentValue(val *File) *Value

NewFileAttachmentValue returns a new Value of the FieldFileAttachment type.

func NewListUserValue

func NewListUserValue(val []*User) *Value

NewListUserValue returns a new Value of the FieldUserList type.

func NewListUserValueFromString

func NewListUserValueFromString(val string) *Value

NewListUserValueFromString returns a new Value of the FieldUserList type given a passed string.

func NewMultiSelectTextValue

func NewMultiSelectTextValue(val []string) *Value

NewMultiSelectTextValue returns a new Value of the FieldMultiSelectText type.

func NewMultiSelectTextValueFromString

func NewMultiSelectTextValueFromString(val string) (v *Value, err error)

NewMultiSelectTextValueFromString returns a new Value of the FieldMultiSelectText type given a string with a comma-separated list of values.

func NewNumericCurrencyValue

func NewNumericCurrencyValue(val float64) *Value

NewNumericCurrencyValue returns a new Value of the FieldNumericCurrency type.

func NewNumericCurrencyValueFromString

func NewNumericCurrencyValueFromString(val string) (*Value, error)

NewNumericCurrencyValueFromString returns a new Value of the FieldNumericCurrency type given a string

func NewNumericPercentValue

func NewNumericPercentValue(val float64) *Value

NewNumericPercentValue returns a new Value of the FieldNumericPercent type.

func NewNumericPercentValueFromString

func NewNumericPercentValueFromString(val string) (*Value, error)

NewNumericPercentValueFromString returns a new Value of the FieldNumericPercent type given a string.

func NewNumericRatingValue

func NewNumericRatingValue(val float64) *Value

NewNumericRatingValue returns a new Value of the FieldNumericRating type.

func NewNumericRatingValueFromString

func NewNumericRatingValueFromString(val string) (*Value, error)

NewNumericRatingValueFromString returns a new Value of the FieldNumericRating type given a string.

func NewNumericValue

func NewNumericValue(val float64) *Value

NewNumericValue returns a new Value of the FieldNumeric type.

func NewNumericValueFromString

func NewNumericValueFromString(val string) (*Value, error)

NewNumericValueFromString returns a new Value of the FieldNumeric type given a string.

func NewPhoneNumberValue

func NewPhoneNumberValue(val string) *Value

NewPhoneNumberValue returns a new Value of the FieldPhoneNumber type.

func NewPredecessorValue

func NewPredecessorValue(val string) *Value

NewPredecessorValue returns a new Value of the FieldPredecessor type.

func NewRecordIDValue

func NewRecordIDValue(val float64) *Value

NewRecordIDValue returns a new Value of the FieldRecordID type.

func NewRecordIDValueFromString added in v0.2.0

func NewRecordIDValueFromString(val string) (*Value, error)

NewRecordIDValueFromString returns a new Value of the FieldRecordID type.

func NewReportLinkValue

func NewReportLinkValue(val string) *Value

NewReportLinkValue returns a new Value of the FieldReportLink type.

func NewRichTextValue

func NewRichTextValue(val string) *Value

NewRichTextValue returns a new Value of the FieldRichText type.

func NewTextMultiLineValue

func NewTextMultiLineValue(val string) *Value

NewTextMultiLineValue returns a new Value of the FieldTextMultiLine type.

func NewTextMultipleChoiceValue

func NewTextMultipleChoiceValue(val string) *Value

NewTextMultipleChoiceValue returns a new Value of the FieldTextMultipleChoice type.

func NewTextValue

func NewTextValue(val string) *Value

NewTextValue returns a new Value of the FieldText type.

func NewTimeOfDayValue

func NewTimeOfDayValue(val time.Time) *Value

NewTimeOfDayValue returns a new Value of the FieldTimeOfDay type.

func NewTimeOfDayValueFromString

func NewTimeOfDayValueFromString(val string) (*Value, error)

NewTimeOfDayValueFromString returns a new Value of the FieldDate type, parsing the passed string into a time.Time.

func NewURLValue

func NewURLValue(val *url.URL) *Value

NewURLValue returns a new Value of the FieldURL type.

func NewURLValueFromString

func NewURLValueFromString(val string) (v *Value, err error)

NewURLValueFromString returns a new Value of the FieldURL type.

func NewUserValue

func NewUserValue(val *User) *Value

NewUserValue returns a new Value of the FieldUser type.

func NewUserValueFromString

func NewUserValueFromString(val string) *Value

NewUserValueFromString returns a new Value of the FieldUser type given a passed string.

func NewValueFromString

func NewValueFromString(val, ftype string) (v *Value, err error)

NewValueFromString returns a new *Value from a string given the Quick Base field type.

func NewiCalendarValue

func NewiCalendarValue(val string) *Value

NewiCalendarValue returns a new Value of the FieldiCalendar type. Make this a URL?

func NewvCardValue

func NewvCardValue(val string) *Value

NewvCardValue returns a new Value of the FieldvCard type. Make this a URL?

func (*Value) MarshalJSON

func (v *Value) MarshalJSON() ([]byte, error)

MarshalJSON implements json.MarshalJSON and JSON encodes the value. TODO Marshal by Quick Base type instead, because we have to format dates differently.

func (*Value) String

func (v *Value) String() string

String returns Value as a string.

type Variable

type Variable struct {
	Name  string `xml:"-" json:"name,omitempty"`
	Value string `xml:"value,omitempty" json:"value,omitempty"`
}

Variable models a variable.

type XMLCredentialParameters

type XMLCredentialParameters struct {
	AppToken  string `xml:"apptoken,omitempty"`
	Ticket    string `xml:"ticket,omitempty"`
	UserToken string `xml:"usertoken,omitempty"`
}

XMLCredentialParameters models XML API credentials parameters and implements XMLInput.

type XMLInput

type XMLInput interface {
	Input
	// contains filtered or unexported methods
}

XMLInput is implemented by requests to the XML API.

type XMLRequestParameters

type XMLRequestParameters struct {
	XMLName  xml.Name `xml:"qdbapi"`
	UserData string   `xml:"udata,omitempty"`
}

XMLRequestParameters models common XML API request parameters.

type XMLResponseParameters

type XMLResponseParameters struct {
	XMLName     xml.Name `xml:"qdbapi" json:"-"`
	Action      string   `xml:"action" json:"-"`
	ErrorCode   int      `xml:"errcode" json:"errorCode,omitempty"`
	ErrorText   string   `xml:"errtext" json:"errorMessage,omitempty"`
	ErrorDetail string   `xml:"errdetail" json:"errorDetail,omitempty"`
	UserData    string   `xml:"udata,omitempty" json:"userData,omitempty"`
}

XMLResponseParameters models common XML API response parameters and implements Output.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL