ml

package
v0.0.0-...-e2bdc13 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "1.3.0"

Version identifies the current library version. Should match the git tag

Variables

View Source
var ErrNotFound = errors.New("resource not found")

Functions

func GetUserAgent

func GetUserAgent() string

Types

type AttributeCount

type AttributeCount struct {
	// Number of attributes defined in the product type.
	ProductTypeAttributes int `json:"productTypeAttributes"`
	// Number of attributes defined in the variant.
	VariantAttributes int `json:"variantAttributes"`
	// Number of attributes missing values in the variant.
	MissingAttributeValues int `json:"missingAttributeValues"`
}

type AttributeCoverage

type AttributeCoverage struct {
	// The percentage of attributes from the product type defined in the product variant. A value of `1.0` indicates a product variant contains all attributes defined in the product type.
	Names float64 `json:"names"`
	// Represents the percentage of attributes in the product variant that contain values.
	Values float64 `json:"values"`
}

type ByProjectKeyImageSearchConfigRequestBuilder

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

func (*ByProjectKeyImageSearchConfigRequestBuilder) Get

* * Get the current image search config.

func (*ByProjectKeyImageSearchConfigRequestBuilder) Post

* * Endpoint to update the image search config.

type ByProjectKeyImageSearchConfigRequestMethodGet

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

func (*ByProjectKeyImageSearchConfigRequestMethodGet) Dump

func (r *ByProjectKeyImageSearchConfigRequestMethodGet) Dump() map[string]interface{}

func (*ByProjectKeyImageSearchConfigRequestMethodGet) Execute

* * Get the current image search config.

func (*ByProjectKeyImageSearchConfigRequestMethodGet) WithHeaders

type ByProjectKeyImageSearchConfigRequestMethodPost

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

func (*ByProjectKeyImageSearchConfigRequestMethodPost) Dump

func (r *ByProjectKeyImageSearchConfigRequestMethodPost) Dump() map[string]interface{}

func (*ByProjectKeyImageSearchConfigRequestMethodPost) Execute

* * Endpoint to update the image search config.

func (*ByProjectKeyImageSearchConfigRequestMethodPost) WithHeaders

type ByProjectKeyImageSearchRequestBuilder

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

func (*ByProjectKeyImageSearchRequestBuilder) Config

func (*ByProjectKeyImageSearchRequestBuilder) Post

* * Accepts an image file and returns similar products from product catalogue. *

type ByProjectKeyImageSearchRequestMethodPost

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

func (*ByProjectKeyImageSearchRequestMethodPost) Dump

func (r *ByProjectKeyImageSearchRequestMethodPost) Dump() map[string]interface{}

func (*ByProjectKeyImageSearchRequestMethodPost) Execute

* * Accepts an image file and returns similar products from product catalogue. *

func (*ByProjectKeyImageSearchRequestMethodPost) Limit

func (*ByProjectKeyImageSearchRequestMethodPost) Offset

func (*ByProjectKeyImageSearchRequestMethodPost) WithHeaders

type ByProjectKeyImageSearchRequestMethodPostInput

type ByProjectKeyImageSearchRequestMethodPostInput struct {
	Limit  *int
	Offset *int
}

func (*ByProjectKeyImageSearchRequestMethodPostInput) Values

type ByProjectKeyMissingDataAttributesRequestBuilder

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

func (*ByProjectKeyMissingDataAttributesRequestBuilder) Status

type ByProjectKeyMissingDataAttributesRequestMethodPost

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

func (*ByProjectKeyMissingDataAttributesRequestMethodPost) Dump

func (*ByProjectKeyMissingDataAttributesRequestMethodPost) Execute

func (*ByProjectKeyMissingDataAttributesRequestMethodPost) WithHeaders

type ByProjectKeyMissingDataAttributesStatusByTaskIdRequestBuilder

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

func (*ByProjectKeyMissingDataAttributesStatusByTaskIdRequestBuilder) Get

type ByProjectKeyMissingDataAttributesStatusByTaskIdRequestMethodGet

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

func (*ByProjectKeyMissingDataAttributesStatusByTaskIdRequestMethodGet) Dump

func (*ByProjectKeyMissingDataAttributesStatusByTaskIdRequestMethodGet) Execute

func (*ByProjectKeyMissingDataAttributesStatusByTaskIdRequestMethodGet) WithHeaders

type ByProjectKeyMissingDataAttributesStatusRequestBuilder

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

func (*ByProjectKeyMissingDataAttributesStatusRequestBuilder) WithTaskId

type ByProjectKeyMissingDataImagesRequestBuilder

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

func (*ByProjectKeyMissingDataImagesRequestBuilder) Post

func (*ByProjectKeyMissingDataImagesRequestBuilder) Status

type ByProjectKeyMissingDataImagesRequestMethodPost

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

func (*ByProjectKeyMissingDataImagesRequestMethodPost) Dump

func (r *ByProjectKeyMissingDataImagesRequestMethodPost) Dump() map[string]interface{}

func (*ByProjectKeyMissingDataImagesRequestMethodPost) Execute

func (*ByProjectKeyMissingDataImagesRequestMethodPost) WithHeaders

type ByProjectKeyMissingDataImagesStatusByTaskIdRequestBuilder

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

func (*ByProjectKeyMissingDataImagesStatusByTaskIdRequestBuilder) Get

type ByProjectKeyMissingDataImagesStatusByTaskIdRequestMethodGet

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

func (*ByProjectKeyMissingDataImagesStatusByTaskIdRequestMethodGet) Dump

func (*ByProjectKeyMissingDataImagesStatusByTaskIdRequestMethodGet) Execute

func (*ByProjectKeyMissingDataImagesStatusByTaskIdRequestMethodGet) WithHeaders

type ByProjectKeyMissingDataImagesStatusRequestBuilder

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

func (*ByProjectKeyMissingDataImagesStatusRequestBuilder) WithTaskId

type ByProjectKeyMissingDataPricesRequestBuilder

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

func (*ByProjectKeyMissingDataPricesRequestBuilder) Post

func (*ByProjectKeyMissingDataPricesRequestBuilder) Status

type ByProjectKeyMissingDataPricesRequestMethodPost

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

func (*ByProjectKeyMissingDataPricesRequestMethodPost) Dump

func (r *ByProjectKeyMissingDataPricesRequestMethodPost) Dump() map[string]interface{}

func (*ByProjectKeyMissingDataPricesRequestMethodPost) Execute

func (*ByProjectKeyMissingDataPricesRequestMethodPost) WithHeaders

type ByProjectKeyMissingDataPricesStatusByTaskIdRequestBuilder

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

func (*ByProjectKeyMissingDataPricesStatusByTaskIdRequestBuilder) Get

type ByProjectKeyMissingDataPricesStatusByTaskIdRequestMethodGet

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

func (*ByProjectKeyMissingDataPricesStatusByTaskIdRequestMethodGet) Dump

func (*ByProjectKeyMissingDataPricesStatusByTaskIdRequestMethodGet) Execute

func (*ByProjectKeyMissingDataPricesStatusByTaskIdRequestMethodGet) WithHeaders

type ByProjectKeyMissingDataPricesStatusRequestBuilder

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

func (*ByProjectKeyMissingDataPricesStatusRequestBuilder) WithTaskId

type ByProjectKeyMissingDataRequestBuilder

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

func (*ByProjectKeyMissingDataRequestBuilder) Attributes

func (*ByProjectKeyMissingDataRequestBuilder) Images

func (*ByProjectKeyMissingDataRequestBuilder) Prices

type ByProjectKeyRecommendationsGeneralCategoriesRequestBuilder

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

func (*ByProjectKeyRecommendationsGeneralCategoriesRequestBuilder) Get

* * This endpoint takes arbitrary product names or image URLs and generates recommendations from a general set of categories, which cover a broad range of industries. The full list of supported categories can be found [here](https://docs.commercetools.com/category_recommendations_supported_categories.txt). These are independent of the categories that are actually defined in your project. The main purpose of this API is to provide a quick way to test the behavior of the category recommendations engine for different names and images. In contrast to the [project-specific endpoint](https://docs.commercetools.com/http-api-projects-categoryrecommendations#project-specific-category-recommendations), this endpoint does not have [activation criteria](https://docs.commercetools.com/http-api-projects-categoryrecommendations#activating-the-api) and is enabled for all projects. *

type ByProjectKeyRecommendationsGeneralCategoriesRequestMethodGet

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

func (*ByProjectKeyRecommendationsGeneralCategoriesRequestMethodGet) ConfidenceMax

func (*ByProjectKeyRecommendationsGeneralCategoriesRequestMethodGet) ConfidenceMin

func (*ByProjectKeyRecommendationsGeneralCategoriesRequestMethodGet) Dump

func (*ByProjectKeyRecommendationsGeneralCategoriesRequestMethodGet) Execute

* * This endpoint takes arbitrary product names or image URLs and generates recommendations from a general set of categories, which cover a broad range of industries. The full list of supported categories can be found [here](https://docs.commercetools.com/category_recommendations_supported_categories.txt). These are independent of the categories that are actually defined in your project. The main purpose of this API is to provide a quick way to test the behavior of the category recommendations engine for different names and images. In contrast to the [project-specific endpoint](https://docs.commercetools.com/http-api-projects-categoryrecommendations#project-specific-category-recommendations), this endpoint does not have [activation criteria](https://docs.commercetools.com/http-api-projects-categoryrecommendations#activating-the-api) and is enabled for all projects. *

func (*ByProjectKeyRecommendationsGeneralCategoriesRequestMethodGet) Limit

func (*ByProjectKeyRecommendationsGeneralCategoriesRequestMethodGet) Offset

func (*ByProjectKeyRecommendationsGeneralCategoriesRequestMethodGet) ProductImageUrl

func (*ByProjectKeyRecommendationsGeneralCategoriesRequestMethodGet) ProductName

func (*ByProjectKeyRecommendationsGeneralCategoriesRequestMethodGet) WithHeaders

type ByProjectKeyRecommendationsGeneralCategoriesRequestMethodGetInput

type ByProjectKeyRecommendationsGeneralCategoriesRequestMethodGetInput struct {
	ProductImageUrl *string
	ProductName     string
	Limit           *int
	Offset          *int
	ConfidenceMin   *float64
	ConfidenceMax   *float64
}

func (*ByProjectKeyRecommendationsGeneralCategoriesRequestMethodGetInput) Values

type ByProjectKeyRecommendationsProjectCategoriesByProductIdRequestBuilder

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

func (*ByProjectKeyRecommendationsProjectCategoriesByProductIdRequestBuilder) Get

* * Response Representation: PagedQueryResult with a results array of ProjectCategoryrecommendation, sorted by confidence scores in descending order and the meta information of ProjectCategoryrecommendationMeta. *

type ByProjectKeyRecommendationsProjectCategoriesByProductIdRequestMethodGet

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

func (*ByProjectKeyRecommendationsProjectCategoriesByProductIdRequestMethodGet) ConfidenceMax

func (*ByProjectKeyRecommendationsProjectCategoriesByProductIdRequestMethodGet) ConfidenceMin

func (*ByProjectKeyRecommendationsProjectCategoriesByProductIdRequestMethodGet) Dump

func (*ByProjectKeyRecommendationsProjectCategoriesByProductIdRequestMethodGet) Execute

* * Response Representation: PagedQueryResult with a results array of ProjectCategoryrecommendation, sorted by confidence scores in descending order and the meta information of ProjectCategoryrecommendationMeta. *

func (*ByProjectKeyRecommendationsProjectCategoriesByProductIdRequestMethodGet) Limit

func (*ByProjectKeyRecommendationsProjectCategoriesByProductIdRequestMethodGet) Offset

func (*ByProjectKeyRecommendationsProjectCategoriesByProductIdRequestMethodGet) Staged

func (*ByProjectKeyRecommendationsProjectCategoriesByProductIdRequestMethodGet) WithHeaders

type ByProjectKeyRecommendationsProjectCategoriesByProductIdRequestMethodGetInput

type ByProjectKeyRecommendationsProjectCategoriesByProductIdRequestMethodGetInput struct {
	Limit         *int
	Offset        *int
	Staged        *bool
	ConfidenceMin *float64
	ConfidenceMax *float64
}

func (*ByProjectKeyRecommendationsProjectCategoriesByProductIdRequestMethodGetInput) Values

type ByProjectKeyRecommendationsProjectCategoriesRequestBuilder

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

func (*ByProjectKeyRecommendationsProjectCategoriesRequestBuilder) WithProductId

type ByProjectKeyRecommendationsRequestBuilder

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

func (*ByProjectKeyRecommendationsRequestBuilder) GeneralCategories

func (*ByProjectKeyRecommendationsRequestBuilder) ProjectCategories

type ByProjectKeyRequestBuilder

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

func (*ByProjectKeyRequestBuilder) ImageSearch

* * Search for similar products using an image as search input. *

func (*ByProjectKeyRequestBuilder) MissingData

func (*ByProjectKeyRequestBuilder) Recommendations

func (*ByProjectKeyRequestBuilder) Similarities

type ByProjectKeySimilaritiesProductsRequestBuilder

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

func (*ByProjectKeySimilaritiesProductsRequestBuilder) Status

type ByProjectKeySimilaritiesProductsRequestMethodPost

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

func (*ByProjectKeySimilaritiesProductsRequestMethodPost) Dump

func (*ByProjectKeySimilaritiesProductsRequestMethodPost) Execute

func (*ByProjectKeySimilaritiesProductsRequestMethodPost) WithHeaders

type ByProjectKeySimilaritiesProductsStatusByTaskIdRequestBuilder

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

func (*ByProjectKeySimilaritiesProductsStatusByTaskIdRequestBuilder) Get

type ByProjectKeySimilaritiesProductsStatusByTaskIdRequestMethodGet

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

func (*ByProjectKeySimilaritiesProductsStatusByTaskIdRequestMethodGet) Dump

func (*ByProjectKeySimilaritiesProductsStatusByTaskIdRequestMethodGet) Execute

func (*ByProjectKeySimilaritiesProductsStatusByTaskIdRequestMethodGet) WithHeaders

type ByProjectKeySimilaritiesProductsStatusRequestBuilder

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

func (*ByProjectKeySimilaritiesProductsStatusRequestBuilder) WithTaskId

type ByProjectKeySimilaritiesRequestBuilder

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

func (*ByProjectKeySimilaritiesRequestBuilder) Products

type CategoryReference

type CategoryReference struct {
	ID string `json:"id"`
}

func (CategoryReference) MarshalJSON

func (obj CategoryReference) MarshalJSON() ([]byte, error)

MarshalJSON override to set the discriminator value or remove optional nil slices

type ChangeStatusUpdateAction

type ChangeStatusUpdateAction struct {
	Status ImageSearchConfigStatus `json:"status"`
}

func (ChangeStatusUpdateAction) MarshalJSON

func (obj ChangeStatusUpdateAction) MarshalJSON() ([]byte, error)

MarshalJSON override to set the discriminator value or remove optional nil slices

type Client

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

func NewClient

func NewClient(cfg *ClientConfig) (*Client, error)

NewClient creates a new client based on the provided ClientConfig

func (*Client) WithProjectKey

func (c *Client) WithProjectKey(projectKey string) *ByProjectKeyRequestBuilder

type ClientConfig

type ClientConfig struct {
	URL         string
	Credentials *clientcredentials.Config
	LogLevel    int
	HTTPClient  *http.Client
	UserAgent   string
}

type Date

type Date struct {
	Year  int
	Month time.Month
	Day   int
}

Date holds date information for Commercetools API format

func NewDate

func NewDate(year int, month time.Month, day int) Date

NewDate initializes a Date struct

func (*Date) MarshalJSON

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

MarshalJSON marshals into the commercetools date format

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON data into a Date struct

type DecodeStruct

type DecodeStruct interface {
	DecodeStruct(map[string]interface{}) error
}

type GeneralCategoryRecommendation

type GeneralCategoryRecommendation struct {
	// An English category name that is recommended for a product.
	CategoryName string `json:"categoryName"`
	// Probability score for the category recommendation.
	Confidence float64 `json:"confidence"`
}

type GeneralCategoryRecommendationPagedQueryResponse

type GeneralCategoryRecommendationPagedQueryResponse struct {
	Count int `json:"count"`
	Total int `json:"total"`
	// Number of [elements skipped](/../api/general-concepts#offset).
	Offset  int                             `json:"offset"`
	Results []GeneralCategoryRecommendation `json:"results"`
}

type GenericRequestError

type GenericRequestError struct {
	Content    []byte
	StatusCode int
	Response   *http.Response
}

func (GenericRequestError) Error

func (e GenericRequestError) Error() string

type ImageSearchConfigRequest

type ImageSearchConfigRequest struct {
	// The list of update actions to be performed on the project.
	Actions []ImageSearchConfigUpdateAction `json:"actions"`
}

func (*ImageSearchConfigRequest) UnmarshalJSON

func (obj *ImageSearchConfigRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON override to deserialize correct attribute types based on the discriminator value

type ImageSearchConfigResponse

type ImageSearchConfigResponse struct {
	// The image search activation status.
	Status         ImageSearchConfigStatus `json:"status"`
	LastModifiedAt time.Time               `json:"lastModifiedAt"`
}

type ImageSearchConfigStatus

type ImageSearchConfigStatus string
const (
	ImageSearchConfigStatusOn  ImageSearchConfigStatus = "on"
	ImageSearchConfigStatusOff ImageSearchConfigStatus = "off"
)

type ImageSearchConfigUpdateAction

type ImageSearchConfigUpdateAction interface{}

type ImageSearchResponse

type ImageSearchResponse struct {
	// The maximum number of results to return from a query.
	Count int `json:"count"`
	// Number of [elements skipped](/../api/general-concepts#offset).
	Offset float64 `json:"offset"`
	// The total number of product images that were have been analyzed.
	Total int `json:"total"`
	// An array of image URLs of images that are similar to the query image. If no matching images are found, results is empty.
	Results []ResultItem `json:"results"`
}

* * Response format from image search endpoint. *

type LocalizedString

type LocalizedString map[string]string

type MissingAttributes

type MissingAttributes struct {
	Product     ProductReference     `json:"product"`
	ProductType ProductTypeReference `json:"productType"`
	// ID of a ProductVariant.
	VariantId int `json:"variantId"`
	// The names of the attributes of the product type that the variant is missing, sorted by attribute importance in descending order.
	MissingAttributeValues []string `json:"missingAttributeValues"`
	// The names of the attributes of the product type that the variant is missing, sorted by attribute importance in descending order.
	MissingAttributeNames []string           `json:"missingAttributeNames"`
	AttributeCount        *AttributeCount    `json:"attributeCount,omitempty"`
	AttributeCoverage     *AttributeCoverage `json:"attributeCoverage,omitempty"`
}

func (MissingAttributes) MarshalJSON

func (obj MissingAttributes) MarshalJSON() ([]byte, error)

MarshalJSON override to set the discriminator value or remove optional nil slices

type MissingAttributesDetails

type MissingAttributesDetails struct {
	// Number of products scanned.
	Total int `json:"total"`
	// Number of products missing attribute names.
	MissingAttributeNames int `json:"missingAttributeNames"`
	// Number of products missing attribute values.
	MissingAttributeValues int `json:"missingAttributeValues"`
}

type MissingAttributesMeta

type MissingAttributesMeta struct {
	ProductLevel MissingAttributesDetails `json:"productLevel"`
	VariantLevel MissingAttributesDetails `json:"variantLevel"`
	// The IDs of the product types containing the requested `attributeName`.
	ProductTypeIds []string `json:"productTypeIds"`
}

func (MissingAttributesMeta) MarshalJSON

func (obj MissingAttributesMeta) MarshalJSON() ([]byte, error)

MarshalJSON override to set the discriminator value or remove optional nil slices

type MissingAttributesPagedQueryResult

type MissingAttributesPagedQueryResult struct {
	Count int `json:"count"`
	Total int `json:"total"`
	// Number of [elements skipped](/../api/general-concepts#offset).
	Offset  int                   `json:"offset"`
	Results []MissingAttributes   `json:"results"`
	Meta    MissingAttributesMeta `json:"meta"`
}

type MissingAttributesSearchRequest

type MissingAttributesSearchRequest struct {
	// Number of [results requested](/../api/general-concepts#limit).
	Limit *int `json:"limit,omitempty"`
	// Number of [elements skipped](/../api/general-concepts#offset).
	Offset *int `json:"offset,omitempty"`
	// If true, searches data from staged products in addition to published products.
	Staged *bool `json:"staged,omitempty"`
	// Maximum number of products to scan.
	ProductSetLimit *int `json:"productSetLimit,omitempty"`
	// If true, searches all product variants. If false, only searches master variants.
	IncludeVariants *bool `json:"includeVariants,omitempty"`
	// Minimum attribute coverage of variants to display, applied to both coverage types.
	CoverageMin *float64 `json:"coverageMin,omitempty"`
	// Maximum attribute coverage of variants to display, applied to both coverage types.
	CoverageMax *float64 `json:"coverageMax,omitempty"`
	// Default value: `coverageAttributeValues` - Allowed values: [`coverageAttributeValues`, `coverageAttributeNames`]
	// `coverageAttributeValues` shows the product variants with the most missing attribute values first and `coverageAttributeNames` the ones with the most missing attribute names.
	SortBy *string `json:"sortBy,omitempty"`
	// If true, the `missingAttributeNames` will be included in the results.
	ShowMissingAttributeNames *bool `json:"showMissingAttributeNames,omitempty"`
	// Filters results by the provided Product IDs.
	// Cannot be applied in combination with any other filter.
	ProductIds []string `json:"productIds"`
	// Filters results by the provided product type IDs.
	// Cannot be applied in combination with any other filter.
	ProductTypeIds []string `json:"productTypeIds"`
	// Filters results by the provided attribute name. If provided,  products are only checked for this attribute. Therefore, only products of product types which define the attribute name are considered. These product type IDs
	// are then listed in `MissingAttributesMeta`. The  `attributeCount` and `attributeCoverage` fields are not part of the response when using this filter. Cannot be applied in combination with any other filter.
	AttributeName *string `json:"attributeName,omitempty"`
}

func (MissingAttributesSearchRequest) MarshalJSON

func (obj MissingAttributesSearchRequest) MarshalJSON() ([]byte, error)

MarshalJSON override to set the discriminator value or remove optional nil slices

type MissingDataTaskStatus

type MissingDataTaskStatus struct {
	State TaskStatusEnum `json:"state"`
	// The expiry date of the result. You cannot access the result after the expiry date. Default: 1 day after the result first becomes available. This is only available when the TaskStatus state is SUCCESS.
	Expires time.Time `json:"expires"`
	// The response to an asynchronous request. The type depends on the request initiated. Only populated when the status is `SUCCESS`.
	Result MissingAttributesPagedQueryResult `json:"result"`
}

* * Represents a URL path to poll to get the results of an Asynchronous Request.

type MissingImages

type MissingImages struct {
	Product ProductReference `json:"product"`
	// ID of the variant
	VariantId int `json:"variantId"`
	// Number of images the variant contains.
	ImageCount int `json:"imageCount"`
}

type MissingImagesCount

type MissingImagesCount struct {
	MissingImages int `json:"missingImages"`
	// Number of products scanned.
	Total int `json:"total"`
}

type MissingImagesMeta

type MissingImagesMeta struct {
	ProductLevel MissingImagesProductLevel `json:"productLevel"`
	VariantLevel MissingImagesVariantLevel `json:"variantLevel"`
	// The minimum number of images a product variant must have. Anything below this value is considered a product variant with missing images.
	Threshold int `json:"threshold"`
}

type MissingImagesPagedQueryResult

type MissingImagesPagedQueryResult struct {
	Count int `json:"count"`
	Total int `json:"total"`
	// Number of [elements skipped](/../api/general-concepts#offset).
	Offset  int               `json:"offset"`
	Results []MissingImages   `json:"results"`
	Meta    MissingImagesMeta `json:"meta"`
}

type MissingImagesProductLevel

type MissingImagesProductLevel struct {
	// Number of products missing images.
	MissingImages int `json:"missingImages"`
	// Number of products scanned.
	Total int `json:"total"`
}

type MissingImagesSearchRequest

type MissingImagesSearchRequest struct {
	// Number of [results requested](/../api/general-concepts#limit).
	Limit *int `json:"limit,omitempty"`
	// Number of [elements skipped](/../api/general-concepts#offset).
	Offset *int `json:"offset,omitempty"`
	// If true, searches data from staged products in addition to published products.
	Staged *bool `json:"staged,omitempty"`
	// Maximum number of products to scan.
	ProductSetLimit *int `json:"productSetLimit,omitempty"`
	// If true, searches all product variants. If false, only searches master variants.
	IncludeVariants *bool `json:"includeVariants,omitempty"`
	// If true, uses the median number of images per product variant as a threshold value.
	AutoThreshold *bool `json:"autoThreshold,omitempty"`
	// The minimum number of images a product variant must have. Anything below this value is considered a product variant with missing images.
	Threshold *int `json:"threshold,omitempty"`
	// Filters results by the provided Product IDs. Cannot be applied in combination with any other filter.
	ProductIds []string `json:"productIds"`
	// Filters results by the provided product type IDs. It cannot be applied in combination with any other filter.
	ProductTypeIds []string `json:"productTypeIds"`
}

func (MissingImagesSearchRequest) MarshalJSON

func (obj MissingImagesSearchRequest) MarshalJSON() ([]byte, error)

MarshalJSON override to set the discriminator value or remove optional nil slices

type MissingImagesTaskStatus

type MissingImagesTaskStatus struct {
	State TaskStatusEnum `json:"state"`
	// The expiry date of the result. You cannot access the result after the expiry date. Default: 1 day after the result first becomes available. This is only available when the TaskStatus state is SUCCESS.
	Expires time.Time `json:"expires"`
	// The response to an asynchronous request. The type depends on the request initiated. Only populated when the status is `SUCCESS`.
	Result MissingImagesPagedQueryResult `json:"result"`
}

* * Represents a URL path to poll to get the results of an Asynchronous Request.

type MissingImagesVariantLevel

type MissingImagesVariantLevel struct {
	// Number of product variants missing images.
	MissingImages int `json:"missingImages"`
	// Number of products scanned.
	Total int `json:"total"`
}

type MissingPrices

type MissingPrices struct {
	Product ProductReference `json:"product"`
	// Id of the `ProductVariant`.
	VariantId int `json:"variantId"`
}

type MissingPricesMeta

type MissingPricesMeta struct {
	ProductLevel MissingPricesProductLevel `json:"productLevel"`
	VariantLevel MissingPricesVariantLevel `json:"variantLevel"`
}

type MissingPricesPagedQueryResult

type MissingPricesPagedQueryResult struct {
	Count int `json:"count"`
	Total int `json:"total"`
	// Number of [elements skipped](/../api/general-concepts#offset).
	Offset  int               `json:"offset"`
	Results []MissingPrices   `json:"results"`
	Meta    MissingPricesMeta `json:"meta"`
}

type MissingPricesProductCount

type MissingPricesProductCount struct {
	Total         int `json:"total"`
	MissingPrices int `json:"missingPrices"`
}

type MissingPricesProductLevel

type MissingPricesProductLevel struct {
	// Number of products scanned.
	Total int `json:"total"`
	// Number of products missing prices.
	MissingPrices int `json:"missingPrices"`
}

type MissingPricesSearchRequest

type MissingPricesSearchRequest struct {
	// Number of [results requested](/../api/general-concepts#limit).
	Limit *int `json:"limit,omitempty"`
	// Number of [elements skipped](/../api/general-concepts#offset).
	Offset *int `json:"offset,omitempty"`
	// If true, searches data from staged products in addition to published products.
	Staged *bool `json:"staged,omitempty"`
	// Maximum number of products to scan.
	ProductSetLimit *int `json:"productSetLimit,omitempty"`
	// If true, searches all product variants. If false, only searches master variants.
	IncludeVariants *bool `json:"includeVariants,omitempty"`
	// If used, only checks if a product variant has a price in the provided currency code.
	CurrencyCode *string `json:"currencyCode,omitempty"`
	// If true, checks if there are prices for the specified date range and time.
	CheckDate *bool `json:"checkDate,omitempty"`
	// Starting date of the range to check. If no value is given, checks prices valid at the time the search is initiated.
	ValidFrom *time.Time `json:"validFrom,omitempty"`
	// Ending date of the range to check. If no value is given, it is equal to `validFrom`.
	ValidUntil *time.Time `json:"validUntil,omitempty"`
	// Filters results by the provided Product IDs. Cannot be applied in combination with the `productTypeIds` filter.
	ProductIds []string `json:"productIds"`
	// Filters results by the provided product type IDs. Cannot be applied in combination with the `productIds` filter.
	ProductTypeIds []string `json:"productTypeIds"`
}

func (MissingPricesSearchRequest) MarshalJSON

func (obj MissingPricesSearchRequest) MarshalJSON() ([]byte, error)

MarshalJSON override to set the discriminator value or remove optional nil slices

type MissingPricesTaskStatus

type MissingPricesTaskStatus struct {
	State TaskStatusEnum `json:"state"`
	// The expiry date of the result. You cannot access the result after the expiry date. Default: 1 day after the result first becomes available. This is only available when the TaskStatus state is SUCCESS.
	Expires time.Time `json:"expires"`
	// The response to an asynchronous request. The type depends on the request initiated. Only populated when the status is `SUCCESS`.
	Result MissingPricesPagedQueryResult `json:"result"`
}

* * Represents a URL path to poll to get the results of an Asynchronous Request.

type MissingPricesVariantLevel

type MissingPricesVariantLevel struct {
	// Number of product variants scanned.
	Total int `json:"total"`
	// Number of product variants missing prices.
	MissingPrices int `json:"missingPrices"`
}

type Money

type Money struct {
	CentAmount int `json:"centAmount"`
	// The currency code compliant to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217).
	CurrencyCode string `json:"currencyCode"`
}

type ProductReference

type ProductReference struct {
	ID string `json:"id"`
}

func (ProductReference) MarshalJSON

func (obj ProductReference) MarshalJSON() ([]byte, error)

MarshalJSON override to set the discriminator value or remove optional nil slices

type ProductSetSelector

type ProductSetSelector struct {
	// The project containing the project set.
	ProjectKey string `json:"projectKey"`
	// An array of Product IDs to compare. If unspecified, no Product ID filter is applied.
	ProductIds []string `json:"productIds"`
	// An array of product type IDs. Only products with product types in this array are compared. If unspecified, no product type filter is applied.
	ProductTypeIds []string `json:"productTypeIds"`
	// Specifies use of staged or current product data.
	Staged *bool `json:"staged,omitempty"`
	// Specifies use of product variants. If set to `true`, all product variants are compared, not just the master variant.
	IncludeVariants *bool `json:"includeVariants,omitempty"`
	// Maximum number of products to check (if unspecified, all products are considered). Note that the maximum number of product comparisons between two productSets is 20,000,000. This limit cannot be exceeded. If you need a higher limit, contact https://support.commercetools.com
	ProductSetLimit *int `json:"productSetLimit,omitempty"`
}

* * A set of ProductData for comparison. If no optional attributes are specified, all `current` ProductData are selected for comparison.

func (ProductSetSelector) MarshalJSON

func (obj ProductSetSelector) MarshalJSON() ([]byte, error)

MarshalJSON override to set the discriminator value or remove optional nil slices

type ProductTypeReference

type ProductTypeReference struct {
	ID string `json:"id"`
}

func (ProductTypeReference) MarshalJSON

func (obj ProductTypeReference) MarshalJSON() ([]byte, error)

MarshalJSON override to set the discriminator value or remove optional nil slices

type ProductVariant

type ProductVariant struct {
	// The product that contains this variant.
	Product ProductReference `json:"product"`
	// The state of the product variant.
	Staged bool `json:"staged"`
	// The id of the product variant.
	VariantId int `json:"variantId"`
}

* * The product variant that contains the image.

type ProjectCategoryRecommendation

type ProjectCategoryRecommendation struct {
	// A category that is recommended for a product.
	Category CategoryReference `json:"category"`
	// Probability score for the category recommendation.
	Confidence float64 `json:"confidence"`
	// Breadcrumb path to the recommended category. This only picks up one language, not all available languages for the category. English is prioritized, but if English data is not available, an arbitrary language is selected. Do not use this to identify a category,use the category ID from the category reference instead.
	Path string `json:"path"`
}

type ProjectCategoryRecommendationMeta

type ProjectCategoryRecommendationMeta struct {
	// The product name that was used to generate recommendations.
	ProductName *string `json:"productName,omitempty"`
	// The product image that was used to generate recommendations.
	ProductImageUrl *string `json:"productImageUrl,omitempty"`
	// Top 5 general categories that were used internally to generate the project-specific categories. These category names are not related to the categories defined in the project, but they provide additional information to understand the project-specific categories in the results section.
	GeneralCategoryNames []string `json:"generalCategoryNames"`
}

type ProjectCategoryRecommendationPagedQueryResponse

type ProjectCategoryRecommendationPagedQueryResponse struct {
	Count int `json:"count"`
	Total int `json:"total"`
	// Number of [elements skipped](/../api/general-concepts#offset).
	Offset  int                               `json:"offset"`
	Results []ProjectCategoryRecommendation   `json:"results"`
	Meta    ProjectCategoryRecommendationMeta `json:"meta"`
}

type Reference

type Reference interface{}

type ReferenceTypeId

type ReferenceTypeId string
const (
	ReferenceTypeIdCart             ReferenceTypeId = "cart"
	ReferenceTypeIdCartDiscount     ReferenceTypeId = "cart-discount"
	ReferenceTypeIdCategory         ReferenceTypeId = "category"
	ReferenceTypeIdChannel          ReferenceTypeId = "channel"
	ReferenceTypeIdCustomer         ReferenceTypeId = "customer"
	ReferenceTypeIdCustomerGroup    ReferenceTypeId = "customer-group"
	ReferenceTypeIdDiscountCode     ReferenceTypeId = "discount-code"
	ReferenceTypeIdKeyValueDocument ReferenceTypeId = "key-value-document"
	ReferenceTypeIdPayment          ReferenceTypeId = "payment"
	ReferenceTypeIdProduct          ReferenceTypeId = "product"
	ReferenceTypeIdProductType      ReferenceTypeId = "product-type"
	ReferenceTypeIdProductDiscount  ReferenceTypeId = "product-discount"
	ReferenceTypeIdOrder            ReferenceTypeId = "order"
	ReferenceTypeIdReview           ReferenceTypeId = "review"
	ReferenceTypeIdShoppingList     ReferenceTypeId = "shopping-list"
	ReferenceTypeIdShippingMethod   ReferenceTypeId = "shipping-method"
	ReferenceTypeIdState            ReferenceTypeId = "state"
	ReferenceTypeIdStore            ReferenceTypeId = "store"
	ReferenceTypeIdTaxCategory      ReferenceTypeId = "tax-category"
	ReferenceTypeIdType             ReferenceTypeId = "type"
	ReferenceTypeIdZone             ReferenceTypeId = "zone"
	ReferenceTypeIdInventoryEntry   ReferenceTypeId = "inventory-entry"
	ReferenceTypeIdOrderEdit        ReferenceTypeId = "order-edit"
)

type ResultItem

type ResultItem struct {
	// The URL of the image.
	ImageUrl string `json:"imageUrl"`
	// An array of product variants containing the image URL.
	ProductVariants []ProductVariant `json:"productVariants"`
}

* * An image URL and the product variants it is contained in. If no matching images are found, ResultItem is not present.

type SetUserAgentTransport

type SetUserAgentTransport struct {
	T http.RoundTripper
	// contains filtered or unexported fields
}

func (*SetUserAgentTransport) RoundTrip

func (sat *SetUserAgentTransport) RoundTrip(req *http.Request) (*http.Response, error)

type SimilarProduct

type SimilarProduct struct {
	// Reference to Product
	Product *ProductReference `json:"product,omitempty"`
	// ID of the ProductVariant that was compared.
	VariantId *int `json:"variantId,omitempty"`
	// Supplementary information about the data used for similarity estimation. This information helps you understand the estimated confidence score, but it should not be used to identify a product.
	Meta *SimilarProductMeta `json:"meta,omitempty"`
}

* * One part of a SimilarProductPair. Refers to a specific ProductVariant.

type SimilarProductMeta

type SimilarProductMeta struct {
	// Localized product name used for similarity estimation.
	Name *LocalizedString `json:"name,omitempty"`
	// Localized product description used for similarity estimation.
	Description *LocalizedString `json:"description,omitempty"`
	// The product price in cents using the currency defined in SimilarProductSearchRequest If multiple prices exist, the median value is taken as a representative amount.
	Price *Money `json:"price,omitempty"`
	// Total number of variants associated with the product.
	VariantCount *int `json:"variantCount,omitempty"`
}

type SimilarProductPair

type SimilarProductPair struct {
	// The probability of product similarity.
	Confidence float64          `json:"confidence"`
	Products   []SimilarProduct `json:"products"`
}

* * A pair of SimilarProducts

type SimilarProductSearchRequest

type SimilarProductSearchRequest struct {
	// Number of [results requested](/../api/general-concepts#limit).
	Limit *int `json:"limit,omitempty"`
	// Number of [elements skipped](/../api/general-concepts#offset).
	Offset *int `json:"offset,omitempty"`
	// language tag used to prioritize language for text comparisons.
	Language *string `json:"language,omitempty"`
	// The three-digit  currency code to compare prices in. When a product has multiple prices, all prices for the product are converted to the currency provided by the currency attribute and the median price is calculated for comparison. Currencies are converted using the ECB currency exchange rates at the time the request is made. Of the currency codes, only currencies with currency exchange rates provided by the ECB are supported.
	CurrencyCode *string `json:"currencyCode,omitempty"`
	// `similarityMeasures` defines the attributes taken into account to measure product similarity.
	SimilarityMeasures *SimilarityMeasures `json:"similarityMeasures,omitempty"`
	// Array of length 2 of ProductSetSelector
	ProductSetSelectors []ProductSetSelector `json:"productSetSelectors"`
	ConfidenceMin       *float64             `json:"confidenceMin,omitempty"`
	ConfidenceMax       *float64             `json:"confidenceMax,omitempty"`
}

func (SimilarProductSearchRequest) MarshalJSON

func (obj SimilarProductSearchRequest) MarshalJSON() ([]byte, error)

MarshalJSON override to set the discriminator value or remove optional nil slices

type SimilarProductSearchRequestMeta

type SimilarProductSearchRequestMeta struct {
	// The SimilarityMeasures used in this search.
	SimilarityMeasures SimilarityMeasures `json:"similarityMeasures"`
}

type SimilarProductsPagedQueryResult

type SimilarProductsPagedQueryResult struct {
	Count int `json:"count"`
	Total int `json:"total"`
	// Number of [elements skipped](/../api/general-concepts#offset).
	Offset  int                             `json:"offset"`
	Results []SimilarProductPair            `json:"results"`
	Meta    SimilarProductSearchRequestMeta `json:"meta"`
}

type SimilarProductsTaskStatus

type SimilarProductsTaskStatus struct {
	State TaskStatusEnum `json:"state"`
	// The expiry date of the result. You cannot access the result after the expiry date. Default: 1 day after the result first becomes available. This is only available when the TaskStatus state is SUCCESS.
	Expires *time.Time `json:"expires,omitempty"`
	// The response to an asynchronous request. The type depends on the request initiated. Only populated when the status is `SUCCESS`.
	Result SimilarProductsPagedQueryResult `json:"result"`
}

* * Represents a URL path to poll to get the results of an Asynchronous Request.

type SimilarityMeasures

type SimilarityMeasures struct {
	// Importance of the `name` attribute in overall similarity.
	Name *int `json:"name,omitempty"`
	// Importance of the `description` attribute in overall similarity.
	Description *int `json:"description,omitempty"`
	// Importance of the `description` attribute in overall similarity.
	Attribute *int `json:"attribute,omitempty"`
	// Importance of the number of product variants in overall similarity.
	VariantCount *int `json:"variantCount,omitempty"`
	// Importance of the `price` attribute in overall similarity.
	Price *int `json:"price,omitempty"`
}

* * Specify which ProductData attributes to use for estimating similarity and how to weigh them. An attribute's weight can be any whole positive integer, starting with 0. The larger the integer, the higher its weight.

type TaskStatusEnum

type TaskStatusEnum string
const (
	TaskStatusEnumPENDING TaskStatusEnum = "PENDING"
	TaskStatusEnumSUCCESS TaskStatusEnum = "SUCCESS"
)

type TaskToken

type TaskToken struct {
	// The ID for the task. Used to find the status of the task.
	TaskId string `json:"taskId"`
	// The URI path to poll for the status of the task.
	UriPath string `json:"uriPath"`
}

* * Represents a URL path to poll to get the results of an Asynchronous Request.

Source Files

Jump to

Keyboard shortcuts

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