airtable

package
v0.0.0-...-9e48597 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AIRTABLE_API = "https://api.airtable.com/v0/{baseId}/{tableName}"

	PERSONAL_TOKEN_AUTHENTICATION = "personalToken"
	TOKEN_AUTHENTICATION          = "token"
	API_KEY_AUTHENTICATION        = "apiKey"

	LIST_METHOD       = "list"
	GET_METHOD        = "get"
	CREATE_METHOD     = "create"
	UPDATE_METHOD     = "update"
	BULKUPDATE_METHOD = "bulkUpdate"
	DELETE_METHOD     = "delete"
	BULKDELETE_METHOD = "bulkDelete"

	JSON_CELL_FORMAT   = "json"
	STRING_CELL_FORMAT = "string"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Method     string                 `mapstructure:"method" validate:"oneof=list get create update bulkUpdate delete bulkDelete"`
	BaseConfig BaseConfig             `mapstructure:"baseConfig"`
	Config     map[string]interface{} `mapstructure:"config" validate:"required"`
}

type BaseConfig

type BaseConfig struct {
	BaseID    string `mapstructure:"baseId"`
	TableName string `mapstructure:"tableName"`
}

type BulkDeleteConfig

type BulkDeleteConfig struct {
	RecordIDs []string `mapstructure:"recordIds" validate:"required,gt=0,lt=11"`
}

type BulkUpdateConfig

type BulkUpdateConfig struct {
	Records []map[string]interface{} `mapstructure:"records" validate:"required,gt=0,lt=11"`
}

type Connector

type Connector struct {
	Resource Resource
	Action   Action
}

func (*Connector) CreateRecords

func (a *Connector) CreateRecords() (common.RuntimeResult, error)

func (*Connector) DeleteMultipleRecords

func (a *Connector) DeleteMultipleRecords() (common.RuntimeResult, error)

func (*Connector) DeleteRecord

func (a *Connector) DeleteRecord() (common.RuntimeResult, error)

func (*Connector) GetMetaInfo

func (a *Connector) GetMetaInfo(resourceOptions map[string]interface{}) (common.MetaInfoResult, error)

func (*Connector) GetRecord

func (a *Connector) GetRecord() (common.RuntimeResult, error)

func (*Connector) ListRecords

func (a *Connector) ListRecords() (common.RuntimeResult, error)

func (*Connector) Run

func (a *Connector) Run(resourceOptions map[string]interface{}, actionOptions map[string]interface{}, rawActionOptions map[string]interface{}) (common.RuntimeResult, error)

func (*Connector) TestConnection

func (a *Connector) TestConnection(resourceOptions map[string]interface{}) (common.ConnectionResult, error)

func (*Connector) UpdateMultipleRecords

func (a *Connector) UpdateMultipleRecords() (common.RuntimeResult, error)

func (*Connector) UpdateRecord

func (a *Connector) UpdateRecord() (common.RuntimeResult, error)

func (*Connector) ValidateActionTemplate

func (a *Connector) ValidateActionTemplate(actionOptions map[string]interface{}) (common.ValidateResult, error)

func (*Connector) ValidateResourceOptions

func (a *Connector) ValidateResourceOptions(resourceOptions map[string]interface{}) (common.ValidateResult, error)

type CreateConfig

type CreateConfig struct {
	Records []map[string]interface{} `mapstructure:"records" validate:"required,gt=0,lt=11"`
}

type DeleteConfig

type DeleteConfig struct {
	RecordID string `mapstructure:"recordId" validate:"required"`
}

type GetConfig

type GetConfig struct {
	RecordID string `mapstructure:"recordId" validate:"required"`
}

type ListConfig

type ListConfig struct {
	Fields          []string     `mapstructure:"fields"`
	FilterByFormula string       `mapstructure:"filterByFormula"`
	MaxRecords      int          `mapstructure:"maxRecords"`
	PageSize        int          `mapstructure:"pageSize"`
	Sort            []SortObject `mapstructure:"sort"`
	View            string       `mapstructure:"view"`
	CellFormat      string       `mapstructure:"cellFormat"`
	TimeZone        string       `mapstructure:"timeZone"`
	UserLocale      string       `mapstructure:"userLocale"`
	Offset          string       `mapstructure:"offset"`
}

type Resource

type Resource struct {
	AuthenticationType   string            `mapstructure:"authenticationType" validate:"oneof=personalToken apiKey"`
	AuthenticationConfig map[string]string `mapstructure:"authenticationConfig" validate:"required"`
}

type SortObject

type SortObject struct {
	Field     string `mapstructure:"field"`
	Direction string `mapstructure:"direction" validate:"oneof=asc desc"`
}

type UpdateConfig

type UpdateConfig struct {
	RecordID string                 `mapstructure:"recordId" validate:"required"`
	Record   map[string]interface{} `mapstructure:"record" validate:"required"`
}

Jump to

Keyboard shortcuts

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