qbclient

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: MIT Imports: 23 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"
	OptionTemporaryToken = "temp-token"
	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               = "userid"
	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. TODO set this with build tags.

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
	TemporaryToken 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) 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) 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) 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) 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) 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) 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) 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) 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) 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 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) TemporaryToken

func (c Config) TemporaryToken() string

TemporaryToken returns the configured log level.

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

	// TemporaryToken returns the configured log level.
	TemporaryToken() 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 usage='unique identifier of an app'"`
	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'"`
	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 usage='assign the user token to the app'"`
	ExcludeFiles      bool `json:"excludeFiles,omitempty" cliutil:"option=exclude-files usage='exclude attached files if --copy-data is passed'"`
	KeepData          bool `json:"keepData,omitempty" cliutil:"option=keep-data usage='copy data'"`
	KeepUsersAndRoles bool `json:"usersAndRoles,omitempty" cliutil:"option=keep-users-roles usage='copy users and 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 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 DeleteAppInput

type DeleteAppInput struct {
	AppID string `json:"-" validate:"required" cliutil:"option=app-id"`
	Name  string `json:"name" validate:"required" cliutil:"option=name usage='name of the app'"`
	// 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 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 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 iss true if we are creating the field.
	Create bool `json:"-"`

	// Basics
	Label    string `json:"label,omitempty" validate:"required" 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"`          // Defaults to true, so we cannot omitempty.
	AddToNewReports bool   `json:"appearsByDefault" cliutil:"option=add-to-reports"` // Defaults to true, so we cannot omitempty.
	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"`
	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 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 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"`
	TotalNumberOfRecordsProcessed int   `json:"totalNumberOfRecordsProcessed"`
	UnchangedRecordIDs            []int `json:"unchangedRecordIds"`
	IpdatedRecordIDs              []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 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"`
	// 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 QueryRecordsInputSortBy

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

QueryRecordsInputSortBy models the sortBy objects.

type QueryRecordsOutput

type QueryRecordsOutput struct {
	ErrorProperties

	Data     []map[int]*QueryRecordsOutputData `json:"data,omitempty"`
	Fields   []*QueryRecordsOutputFields       `json:"fields,omitempty"`
	Metadata *QueryRecordsOutputMetadata       `json:"metadata,omitempty"`
}

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.

type QueryRecordsOutputData

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

QueryRecordsOutputData models objects in the data property.

type QueryRecordsOutputFields

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

QueryRecordsOutputFields models the objects in the fields property.

type QueryRecordsOutputMetadata

type QueryRecordsOutputMetadata struct {
	TotalRecords int `json:"totalRecords"`
	NumRecords   int `json:"numRecords"`
	NumFields    int `json:"numFields"`
	Skip         int `json:"skip"`
}

QueryRecordsOutputMetadata models the metadata property.

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 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 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 unix timestamp in Quick Base.

func (Timestamp) MarshalJSON

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

MarshalJSON converts time.Time to a unix timestamp in microseconds.

func (*Timestamp) UnmarshalJSON

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

UnmarshalJSON converts a unix timestamp in microseconds 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 usage='name of the app'"`
	Description string      `json:"description,omitempty" cliutil:"option=description usage='description of the app'"`
	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 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
	Float64     float64
	String      string
	StringSlice []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 Quick base 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 string) *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 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.

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