Documentation ¶
Index ¶
- type BulkOperationService
- type BulkOperationServiceOp
- func (s *BulkOperationServiceOp) BulkQuery(query string, out interface{}) error
- func (s *BulkOperationServiceOp) CancelRunningBulkQuery() error
- func (s *BulkOperationServiceOp) GetCurrentBulkQuery() (*model.BulkOperation, error)
- func (s *BulkOperationServiceOp) GetCurrentBulkQueryResultURL() (url string, err error)
- func (s *BulkOperationServiceOp) PostBulkQuery(query string) (null.String, error)
- func (s *BulkOperationServiceOp) ShouldGetBulkQueryResultURL(id null.String) (string, error)
- func (s *BulkOperationServiceOp) WaitForCurrentBulkQuery(interval time.Duration) (*model.BulkOperation, error)
- type Client
- type CollectionService
- type CollectionServiceOp
- func (s *CollectionServiceOp) Create(collection model.CollectionInput) (string, error)
- func (s *CollectionServiceOp) CreateBulk(collections []model.CollectionInput) error
- func (s *CollectionServiceOp) Get(id graphql.ID) (*model.Collection, error)
- func (s *CollectionServiceOp) ListAll() ([]model.Collection, error)
- func (s *CollectionServiceOp) Update(collection model.CollectionInput) error
- type File
- type FileCreateInput
- type FileError
- type FileOp
- type FileService
- type FileStatus
- type FulfillmentService
- type FulfillmentServiceOp
- type GQLClient
- type InventoryService
- type InventoryServiceOp
- type ListOptions
- type LocationService
- type LocationServiceOp
- type MetafieldService
- type MetafieldServiceOp
- func (s *MetafieldServiceOp) Delete(metafield model.MetafieldDeleteInput) error
- func (s *MetafieldServiceOp) DeleteBulk(metafields []model.MetafieldDeleteInput) error
- func (s *MetafieldServiceOp) GetShopMetafieldByKey(namespace, key string) (model.Metafield, error)
- func (s *MetafieldServiceOp) ListAllShopMetafields() ([]model.Metafield, error)
- func (s *MetafieldServiceOp) ListShopMetafieldsByNamespace(namespace string) ([]model.Metafield, error)
- type OrderService
- type OrderServiceOp
- func (s *OrderServiceOp) Get(id graphql.ID) (*model.Order, error)
- func (s *OrderServiceOp) GetFulfillmentOrdersAtLocation(orderID graphql.ID, locationID graphql.ID) ([]model.FulfillmentOrder, error)
- func (s *OrderServiceOp) List(opts ListOptions) ([]model.Order, error)
- func (s *OrderServiceOp) ListAfterCursor(opts ListOptions) ([]model.Order, string, string, error)
- func (s *OrderServiceOp) ListAll() ([]model.Order, error)
- func (s *OrderServiceOp) Update(input model.OrderInput) error
- type Parameter
- type PriceList
- type PriceListBulkQueryClient
- type PriceListMutationClient
- type PriceListPriceInput
- type PriceListService
- type PriceListServiceOp
- type ProductCreate
- type ProductService
- type ProductServiceOp
- func (s *ProductServiceOp) Create(product model.ProductInput, media []model.CreateMediaInput) (string, error)
- func (s *ProductServiceOp) CreateBulk(products []ProductCreate) error
- func (s *ProductServiceOp) Delete(product model.ProductDeleteInput) error
- func (s *ProductServiceOp) DeleteBulk(products []model.ProductDeleteInput) error
- func (s *ProductServiceOp) Get(id graphql.ID) (*model.Product, error)
- func (s *ProductServiceOp) List(query string) ([]model.Product, error)
- func (s *ProductServiceOp) ListAll() ([]model.Product, error)
- func (s *ProductServiceOp) Update(product model.ProductInput) error
- func (s *ProductServiceOp) UpdateBulk(products []model.ProductInput) error
- type StagedMediaUploadTarget
- type StagedUploadInput
- type StagedUploadMutationClient
- type StagedUploadOp
- type StagedUploadService
- type VariantService
- type VariantServiceOp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BulkOperationService ¶
type BulkOperationService interface { BulkQuery(query string, v interface{}) error PostBulkQuery(query string) (null.String, error) GetCurrentBulkQuery() (*model.BulkOperation, error) GetCurrentBulkQueryResultURL() (string, error) WaitForCurrentBulkQuery(interval time.Duration) (*model.BulkOperation, error) ShouldGetBulkQueryResultURL(id null.String) (string, error) CancelRunningBulkQuery() error }
type BulkOperationServiceOp ¶
type BulkOperationServiceOp struct {
// contains filtered or unexported fields
}
func (*BulkOperationServiceOp) BulkQuery ¶
func (s *BulkOperationServiceOp) BulkQuery(query string, out interface{}) error
func (*BulkOperationServiceOp) CancelRunningBulkQuery ¶
func (s *BulkOperationServiceOp) CancelRunningBulkQuery() error
func (*BulkOperationServiceOp) GetCurrentBulkQuery ¶
func (s *BulkOperationServiceOp) GetCurrentBulkQuery() (*model.BulkOperation, error)
func (*BulkOperationServiceOp) GetCurrentBulkQueryResultURL ¶
func (s *BulkOperationServiceOp) GetCurrentBulkQueryResultURL() (url string, err error)
func (*BulkOperationServiceOp) PostBulkQuery ¶
func (s *BulkOperationServiceOp) PostBulkQuery(query string) (null.String, error)
func (*BulkOperationServiceOp) ShouldGetBulkQueryResultURL ¶
func (s *BulkOperationServiceOp) ShouldGetBulkQueryResultURL(id null.String) (string, error)
func (*BulkOperationServiceOp) WaitForCurrentBulkQuery ¶
func (s *BulkOperationServiceOp) WaitForCurrentBulkQuery(interval time.Duration) (*model.BulkOperation, error)
type Client ¶
type Client struct { Product ProductService Variant VariantService Inventory InventoryService Collection CollectionService Order OrderService Fulfillment FulfillmentService Location LocationService Metafield MetafieldService PriceList PriceListService StagedUpload StagedUploadService File FileService BulkOperation BulkOperationService // contains filtered or unexported fields }
func NewClient ¶
NewClient returns a new client based on the configuration arguments received. Most of this client functionality is not enabled since it has no test coverage. Although it should, we cannot be sure that it works on the current api version since we haven't tested it. Enabling should require adding test coverage and proper testing. Calling any of the disabled (commented below) functionaly will likely result in a nil pointer de-reference.
func NewDefaultClient ¶
func NewDefaultClient() (shopClient *Client)
func (*Client) GraphQLClient ¶
type CollectionService ¶
type CollectionService interface { ListAll() ([]model.Collection, error) Get(id graphql.ID) (*model.Collection, error) Create(collection model.CollectionInput) (string, error) CreateBulk(collections []model.CollectionInput) error Update(collection model.CollectionInput) error }
type CollectionServiceOp ¶
type CollectionServiceOp struct {
// contains filtered or unexported fields
}
func (*CollectionServiceOp) Create ¶
func (s *CollectionServiceOp) Create(collection model.CollectionInput) (string, error)
func (*CollectionServiceOp) CreateBulk ¶
func (s *CollectionServiceOp) CreateBulk(collections []model.CollectionInput) error
func (*CollectionServiceOp) Get ¶
func (s *CollectionServiceOp) Get(id graphql.ID) (*model.Collection, error)
func (*CollectionServiceOp) ListAll ¶
func (s *CollectionServiceOp) ListAll() ([]model.Collection, error)
func (*CollectionServiceOp) Update ¶
func (s *CollectionServiceOp) Update(collection model.CollectionInput) error
type File ¶ added in v4.2.0
type File struct { Alt string `json:"alt"` CreatedAt string `json:"createdAt"` FileStatus string `json:"fileStatus"` FileErrors []FileError `json:"fileErrors"` }
File uploaded file
type FileCreateInput ¶ added in v4.2.0
type FileCreateInput struct { OriginalSource string `json:"originalSource"` ContentType string `json:"contentType"` }
FileCreateInput file creation params
type FileError ¶ added in v4.2.0
type FileError struct { Code string `json:"code"` Details string `json:"details"` Message string `json:"message"` }
FileError errors wrapper
type FileOp ¶ added in v4.2.0
type FileOp struct {
// contains filtered or unexported fields
}
FileOp wraps file GQL API
func (*FileOp) FileCreate ¶ added in v4.2.0
FileCreate encapsulates file creation API, returns limited set of parameters
func (*FileOp) GetFileStatusByName ¶ added in v4.2.0
GetFileStatusByName returns file upload processing status, assumes the file name is UNIQUE! For non-unique file name the first occurrence will be returned
type FileService ¶ added in v4.2.0
type FileService interface { FileCreate(ctx context.Context, files []FileCreateInput) ([]File, error) GetFileStatusByName(ctx context.Context, fileName string) (*FileStatus, error) }
FileService file operations
type FileStatus ¶ added in v4.2.0
type FileStatus struct { ID string `json:"id"` URL string `json:"url"` Status string `json:"fileStatus"` }
FileStatus represents file uploads processing status
type FulfillmentService ¶
type FulfillmentService interface {
Create(input model.FulfillmentV2Input) error
}
type FulfillmentServiceOp ¶
type FulfillmentServiceOp struct {
// contains filtered or unexported fields
}
func (*FulfillmentServiceOp) Create ¶
func (s *FulfillmentServiceOp) Create(fulfillment model.FulfillmentV2Input) error
type GQLClient ¶ added in v4.2.0
type GQLClient interface { Mutate(ctx context.Context, m interface{}, variables map[string]interface{}) error QueryString(ctx context.Context, q string, variables map[string]interface{}, v interface{}) error }
GQLClient defines the required mutation client operations.
type InventoryService ¶
type InventoryServiceOp ¶
type InventoryServiceOp struct {
// contains filtered or unexported fields
}
func (*InventoryServiceOp) ActivateInventory ¶
func (*InventoryServiceOp) Adjust ¶
func (s *InventoryServiceOp) Adjust(locationID graphql.ID, input []model.InventoryAdjustItemInput) error
func (*InventoryServiceOp) Update ¶
func (s *InventoryServiceOp) Update(id graphql.ID, input model.InventoryItemUpdateInput) error
type ListOptions ¶
type LocationService ¶
type LocationServiceOp ¶
type LocationServiceOp struct {
// contains filtered or unexported fields
}
type MetafieldService ¶
type MetafieldService interface { ListAllShopMetafields() ([]model.Metafield, error) ListShopMetafieldsByNamespace(namespace string) ([]model.Metafield, error) GetShopMetafieldByKey(namespace, key string) (model.Metafield, error) Delete(metafield model.MetafieldDeleteInput) error DeleteBulk(metafield []model.MetafieldDeleteInput) error }
type MetafieldServiceOp ¶
type MetafieldServiceOp struct {
// contains filtered or unexported fields
}
func (*MetafieldServiceOp) Delete ¶
func (s *MetafieldServiceOp) Delete(metafield model.MetafieldDeleteInput) error
func (*MetafieldServiceOp) DeleteBulk ¶
func (s *MetafieldServiceOp) DeleteBulk(metafields []model.MetafieldDeleteInput) error
func (*MetafieldServiceOp) GetShopMetafieldByKey ¶
func (s *MetafieldServiceOp) GetShopMetafieldByKey(namespace, key string) (model.Metafield, error)
func (*MetafieldServiceOp) ListAllShopMetafields ¶
func (s *MetafieldServiceOp) ListAllShopMetafields() ([]model.Metafield, error)
func (*MetafieldServiceOp) ListShopMetafieldsByNamespace ¶
func (s *MetafieldServiceOp) ListShopMetafieldsByNamespace(namespace string) ([]model.Metafield, error)
type OrderService ¶
type OrderService interface { Get(id graphql.ID) (*model.Order, error) List(opts ListOptions) ([]model.Order, error) ListAll() ([]model.Order, error) ListAfterCursor(opts ListOptions) ([]model.Order, string, string, error) Update(input model.OrderInput) error GetFulfillmentOrdersAtLocation(orderID graphql.ID, locationID graphql.ID) ([]model.FulfillmentOrder, error) }
type OrderServiceOp ¶
type OrderServiceOp struct {
// contains filtered or unexported fields
}
func (*OrderServiceOp) GetFulfillmentOrdersAtLocation ¶
func (s *OrderServiceOp) GetFulfillmentOrdersAtLocation(orderID graphql.ID, locationID graphql.ID) ([]model.FulfillmentOrder, error)
func (*OrderServiceOp) List ¶
func (s *OrderServiceOp) List(opts ListOptions) ([]model.Order, error)
func (*OrderServiceOp) ListAfterCursor ¶
func (s *OrderServiceOp) ListAfterCursor(opts ListOptions) ([]model.Order, string, string, error)
func (*OrderServiceOp) Update ¶
func (s *OrderServiceOp) Update(input model.OrderInput) error
type PriceList ¶
type PriceList struct { ID string `json:"id"` Name string `json:"name"` Currency string `json:"currency"` }
PriceList represents a price list.
type PriceListBulkQueryClient ¶
PriceListBulkQueryClient defines the required bulk query client operations.
type PriceListMutationClient ¶
type PriceListMutationClient interface {
Mutate(ctx context.Context, m interface{}, variables map[string]interface{}) error
}
PriceListMutationClient defines the required mutation client operations.
type PriceListPriceInput ¶
type PriceListPriceInput struct { CompareAtPrice model.MoneyInput `json:"compareAtPrice"` Price model.MoneyInput `json:"price"` VariantID string `json:"variantId"` }
PriceListPriceInput represents a price list price input.
type PriceListService ¶
type PriceListService interface { GetPriceLists(ctx context.Context) ([]PriceList, error) AddFixedPricesToPriceList(ctx context.Context, priceListID string, prices []PriceListPriceInput) error }
PriceListService defines the price list service operations.
type PriceListServiceOp ¶
type PriceListServiceOp struct {
// contains filtered or unexported fields
}
PriceListServiceOp represents a price list service.
func (*PriceListServiceOp) AddFixedPricesToPriceList ¶
func (s *PriceListServiceOp) AddFixedPricesToPriceList(ctx context.Context, priceListID string, prices []PriceListPriceInput) error
AddFixedPricesToPriceList adds fixed prices to a price list based on the arguments received.
func (*PriceListServiceOp) GetPriceLists ¶
func (s *PriceListServiceOp) GetPriceLists(_ context.Context) ([]PriceList, error)
GetPriceLists returns all price lists for the store.
type ProductCreate ¶
type ProductCreate struct { ProductInput model.ProductInput MediaInput []model.CreateMediaInput }
type ProductService ¶
type ProductService interface { List(query string) ([]model.Product, error) ListAll() ([]model.Product, error) Get(gid graphql.ID) (*model.Product, error) Create(product model.ProductInput, media []model.CreateMediaInput) (string, error) CreateBulk(products []ProductCreate) error Update(product model.ProductInput) error UpdateBulk(products []model.ProductInput) error Delete(product model.ProductDeleteInput) error DeleteBulk(products []model.ProductDeleteInput) error }
type ProductServiceOp ¶
type ProductServiceOp struct {
// contains filtered or unexported fields
}
func (*ProductServiceOp) Create ¶
func (s *ProductServiceOp) Create(product model.ProductInput, media []model.CreateMediaInput) (string, error)
func (*ProductServiceOp) CreateBulk ¶
func (s *ProductServiceOp) CreateBulk(products []ProductCreate) error
func (*ProductServiceOp) Delete ¶
func (s *ProductServiceOp) Delete(product model.ProductDeleteInput) error
func (*ProductServiceOp) DeleteBulk ¶
func (s *ProductServiceOp) DeleteBulk(products []model.ProductDeleteInput) error
func (*ProductServiceOp) List ¶
func (s *ProductServiceOp) List(query string) ([]model.Product, error)
func (*ProductServiceOp) Update ¶
func (s *ProductServiceOp) Update(product model.ProductInput) error
func (*ProductServiceOp) UpdateBulk ¶
func (s *ProductServiceOp) UpdateBulk(products []model.ProductInput) error
type StagedMediaUploadTarget ¶ added in v4.2.0
type StagedMediaUploadTarget struct { URL string `json:"url"` ResourceURL string `json:"resourceUrl"` Parameters []*Parameter `json:"parameters"` }
StagedMediaUploadTarget represents result of a staged upload
type StagedUploadInput ¶ added in v4.2.0
type StagedUploadInput struct { FileName string `json:"filename"` MimeType string `json:"mimeType"` Resource string `json:"resource"` }
StagedUploadInput represents staged upload request
type StagedUploadMutationClient ¶ added in v4.2.0
type StagedUploadMutationClient interface {
Mutate(ctx context.Context, m interface{}, variables map[string]interface{}) error
}
StagedUploadMutationClient defines the required mutation client operations.
type StagedUploadOp ¶ added in v4.2.0
type StagedUploadOp struct {
// contains filtered or unexported fields
}
func (*StagedUploadOp) CreateStagedUpload ¶ added in v4.2.0
func (s *StagedUploadOp) CreateStagedUpload( ctx context.Context, uploads []StagedUploadInput) ([]StagedMediaUploadTarget, error)
type StagedUploadService ¶ added in v4.2.0
type StagedUploadService interface {
CreateStagedUpload(ctx context.Context, uploads []StagedUploadInput) ([]StagedMediaUploadTarget, error)
}
StagedUploadService supports creation of staged upload targets
type VariantService ¶
type VariantService interface {
Update(variant model.ProductVariantInput) error
}
type VariantServiceOp ¶
type VariantServiceOp struct {
// contains filtered or unexported fields
}
func (*VariantServiceOp) Update ¶
func (s *VariantServiceOp) Update(variant model.ProductVariantInput) error