diff --git a/.changes/unreleased/Added-20240813-083004.yaml b/.changes/unreleased/Added-20240813-083004.yaml new file mode 100644 index 00000000..4d318f43 --- /dev/null +++ b/.changes/unreleased/Added-20240813-083004.yaml @@ -0,0 +1,3 @@ +kind: Added +body: Updated SDK to 12-08-2024 version +time: 2024-08-13T08:30:04.437105095+02:00 diff --git a/Taskfile.yaml b/Taskfile.yaml index 2829cf26..d00a459f 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -46,7 +46,7 @@ tasks: generate-importapi: cmds: - task: generate-api - vars: {apiName: importapi, path: importapi} + vars: {apiName: importapi, path: import} generate-frontend: cmds: diff --git a/connect/client_deployments_by_project_key_deployments_get.go b/connect/client_deployments_by_project_key_deployments_get.go index ca0f3968..32167d18 100644 --- a/connect/client_deployments_by_project_key_deployments_get.go +++ b/connect/client_deployments_by_project_key_deployments_get.go @@ -28,6 +28,7 @@ func (r *ByProjectKeyDeploymentsRequestMethodGet) Dump() map[string]interface{} type ByProjectKeyDeploymentsRequestMethodGetInput struct { IntegrationTypes []IntegrationType + DeploymentType *DeploymentType Limit *int Offset *int Sort []string @@ -38,6 +39,9 @@ func (input *ByProjectKeyDeploymentsRequestMethodGetInput) Values() url.Values { for _, v := range input.IntegrationTypes { values.Add("integrationTypes", fmt.Sprintf("%v", v)) } + if input.DeploymentType != nil { + values.Add("deploymentType", fmt.Sprintf("%v", *input.DeploymentType)) + } if input.Limit != nil { values.Add("limit", strconv.Itoa(*input.Limit)) } @@ -58,6 +62,14 @@ func (rb *ByProjectKeyDeploymentsRequestMethodGet) IntegrationTypes(v []Integrat return rb } +func (rb *ByProjectKeyDeploymentsRequestMethodGet) DeploymentType(v DeploymentType) *ByProjectKeyDeploymentsRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyDeploymentsRequestMethodGetInput{} + } + rb.params.DeploymentType = &v + return rb +} + func (rb *ByProjectKeyDeploymentsRequestMethodGet) Limit(v int) *ByProjectKeyDeploymentsRequestMethodGet { if rb.params == nil { rb.params = &ByProjectKeyDeploymentsRequestMethodGetInput{} diff --git a/connect/types_common.go b/connect/types_common.go index 8acc292f..22ab31dd 100644 --- a/connect/types_common.go +++ b/connect/types_common.go @@ -107,7 +107,7 @@ type ApplicationDeployment struct { ApplicationName string `json:"applicationName"` // Contains values of keys that are saved in plain text. Can be accessed after being set. StandardConfiguration []ConfigurationValue `json:"standardConfiguration"` - // Contains values of secret keys. Cannot be accessed after being set. + // Contains values of secret keys. After being set, these values are encrypted and cannot be accessed. SecuredConfiguration []ConfigurationValue `json:"securedConfiguration"` // URL generated after deployment of service applications. Url *string `json:"url,omitempty"` @@ -167,14 +167,14 @@ const ( ) /** -* Reference to a Connector. Either `id` or `key` is required. +* Reference to a [Connector](ctp:connect:type:Connector) or [ConnectorStaged](ctp:connect:type:ConnectorStaged). Either `id` or `key` is required. */ type ConnectorReference struct { // Unique identifier of the referenced Connector. ID *string `json:"id,omitempty"` // User-defined unique identifier of the referenced Connector. Key *string `json:"key,omitempty"` - // If `true`, the previewable [ConnectorStaged](ctp:connect:type:ConnectorStaged) will be referenced instead of the published Connector. The `isPreviewable` field of the [ConnectorStaged](ctp:connect:type:ConnectorStaged) must be `true` to reference a previewable ConnectorStaged. + // If `true`, a previewable [ConnectorStaged](ctp:connect:type:ConnectorStaged) must be referenced in `id` or `key` instead of the published Connector. The `isPreviewable` field of the [ConnectorStaged](ctp:connect:type:ConnectorStaged) must be `true` to reference a previewable ConnectorStaged. Staged *bool `json:"staged,omitempty"` // Version of the referenced Connector. Version *int `json:"version,omitempty"` @@ -326,7 +326,7 @@ const ( ) /** -* The host Region of a commercetools Composable Commerce Project. For more information, see [Hosts](hosts-and-authorization#hosts). +* The Region of a commercetools Composable Commerce Project or Deployment. For more information, see [Hosts](/hosts-and-authorization#hosts). * */ type Region string @@ -338,7 +338,7 @@ const ( ) /** -* The type of integration provided by a Connector. +* Integration type of the Connector. * */ type IntegrationType string @@ -359,6 +359,17 @@ const ( IntegrationTypeOther IntegrationType = "other" ) +/** +* Deployment type of the Connector. +* + */ +type DeploymentType string + +const ( + DeploymentTypePreview DeploymentType = "preview" + DeploymentTypeProduction DeploymentType = "production" +) + /** * Details of the GitHub repository that contains the Connect applications. * diff --git a/connect/types_connector.go b/connect/types_connector.go index ed53f1ef..b63df40d 100644 --- a/connect/types_connector.go +++ b/connect/types_connector.go @@ -18,7 +18,7 @@ type Connector struct { Name string `json:"name"` // Description of the Connector. Description *string `json:"description,omitempty"` - // Type of integration provided by the Connector. Can be used to filter search and query results. + // Integration types of the Connector. Can be used to filter search and query results. IntegrationTypes []IntegrationType `json:"integrationTypes"` // Owner of the Connector. Creator Creator `json:"creator"` @@ -67,7 +67,7 @@ type ConnectorDraft struct { Name string `json:"name"` // Description of the Connector. Description *string `json:"description,omitempty"` - // Type of integration provided by the Connector. Can be used to filter search and query results. + // Integration types of the Connector. Can be used to filter search and query results. IntegrationTypes []IntegrationType `json:"integrationTypes"` // Owner of the Connector. Creator Creator `json:"creator"` @@ -124,7 +124,7 @@ type ConnectorStaged struct { Name string `json:"name"` // Description of the Connector. Description string `json:"description"` - // Type of integration provided by the Connector. Can be used to filter search and query results. + // Integration types of the Connector. Can be used to filter search and query results. IntegrationTypes []IntegrationType `json:"integrationTypes"` // Owner of the Connector. Creator Creator `json:"creator"` @@ -675,10 +675,10 @@ func (obj ConnectorAddCertificationCommentAction) MarshalJSON() ([]byte, error) } /** -* Requests the previewable status of a ConnectorStaged. A previewable ConnectorStaged can be used in a Deployment for testing and preview purposes. +* Requests the previewable status of a ConnectorStaged. Previewable ConnectorStaged should be deployed for testing and preview purposes. You can only deploy previewable ConnectorStaged to Projects listed in `privateProjects`. * * After using this update action, the status of `isPreviewable` will change to `pending`. Following validation, the status of `isPreviewable` will change to `true` if the previewable status is granted, or `false` if it is rejected. -* In the case of a `false` status, contact our [support team](https://commercetools.atlassian.net/servicedesk/customer/portal/27) regarding any issues raised during the validation process. +* In the case of a `false` status, contact the [Connect support team](https://support.commercetools.com/) regarding any issues raised during the validation process. * * Requesting the previewable status for a ConnectorStaged that is currently being reviewed returns the [ConnectorStagedPreviewRequestUnderProcess](ctp:connect:type:ConnectorStagedPreviewRequestUnderProcessError) error. * @@ -698,10 +698,13 @@ func (obj ConnectorUpdatePreviewableAction) MarshalJSON() ([]byte, error) { /** * Starts the Connector publishing process. You will be unable to update the Connector until the process completes. +* +* `certification` should only be `true` if you want to make the Connector publicly available. * */ type ConnectorPublishAction struct { - // If `true`, the ConnectorStaged enters the certification process. After completing the certification process, the Connector will become publicly available. If `false`, the published Connector becomes private and is available for deployment to Projects listed in `ConnectorStaged.privateProjects`. + // - Set to `false` to make the Connector private and skip the [certification process](/certification). The published Connector will only be deployable on Projects listed in `ConnectorStaged.privateProjects`. + // - Set to `true` to make the Connector public. This will submit the ConnectorStaged to the [certification process](/certification). After completing the certification process, the Connector will become publicly available. Certification bool `json:"certification"` } diff --git a/connect/types_deployment.go b/connect/types_deployment.go index 3c9ce98d..66a56e44 100644 --- a/connect/types_deployment.go +++ b/connect/types_deployment.go @@ -49,7 +49,7 @@ type DeploymentPagedQueryResponse struct { type DeploymentDraft struct { // User-defined unique identifier for the Deployment. Key *string `json:"key,omitempty"` - // Reference to the [Connector](ctp:connect:type:Connector) being deployed. + // Reference to the [Connector](ctp:connect:type:Connector) or [ConnectorStaged](ctp:connect:type:ConnectorStaged) being deployed. Connector ConnectorReference `json:"connector"` // Configuration values needed by the [Connector](ctp:connect:type:Connector) for hosting. Keys should match those in the Connector's `configurations` field. Configurations []DeploymentConfigurationApplication `json:"configurations"` diff --git a/connect/types_error.go b/connect/types_error.go index 97ecd910..e8308158 100644 --- a/connect/types_error.go +++ b/connect/types_error.go @@ -722,7 +722,7 @@ func (obj FieldValueNotFoundError) Error() string { /** * Returned when a server-side problem occurs before or after data persistence. In some cases, the requested action may successfully complete after the error is returned. Therefore, it is recommended to verify the status of the requested resource after receiving a 500 error. * -* If you encounter this error, report it using the [Support Portal](https://commercetools.atlassian.net/servicedesk/customer/portal/27). +* If you encounter this error, report it to the [Connect support team](https://support.commercetools.com/). * */ type GeneralError struct { diff --git a/history/types_change_history.go b/history/types_change_history.go index c6b459c7..e2f5f90b 100644 --- a/history/types_change_history.go +++ b/history/types_change_history.go @@ -24,7 +24,7 @@ type Record struct { Type string `json:"type"` // Information about the user or API Client who performed the change. ModifiedBy ModifiedBy `json:"modifiedBy"` - // Date and time (UTC) when the change was made. + // Date and time (UTC) the change was made. ModifiedAt string `json:"modifiedAt"` // Information that describes the resource after the change. Label Label `json:"label"` diff --git a/importapi/client_by_project_key.go b/importapi/client_by_project_key.go index f231f3f5..184be681 100644 --- a/importapi/client_by_project_key.go +++ b/importapi/client_by_project_key.go @@ -97,3 +97,9 @@ func (rb *ByProjectKeyRequestBuilder) Types() *ByProjectKeyTypesRequestBuilder { client: rb.client, } } +func (rb *ByProjectKeyRequestBuilder) DiscountCodes() *ByProjectKeyDiscountCodesRequestBuilder { + return &ByProjectKeyDiscountCodesRequestBuilder{ + projectKey: rb.projectKey, + client: rb.client, + } +} diff --git a/importapi/client_discount_codes_by_project_key_discount_codes.go b/importapi/client_discount_codes_by_project_key_discount_codes.go new file mode 100644 index 00000000..8b1b9723 --- /dev/null +++ b/importapi/client_discount_codes_by_project_key_discount_codes.go @@ -0,0 +1,15 @@ +package importapi + +// Generated file, please do not change!!! + +type ByProjectKeyDiscountCodesRequestBuilder struct { + projectKey string + client *Client +} + +func (rb *ByProjectKeyDiscountCodesRequestBuilder) ImportContainers() *ByProjectKeyDiscountCodesImportContainersRequestBuilder { + return &ByProjectKeyDiscountCodesImportContainersRequestBuilder{ + projectKey: rb.projectKey, + client: rb.client, + } +} diff --git a/importapi/client_import_containers_by_project_key_discount_codes_import_containers.go b/importapi/client_import_containers_by_project_key_discount_codes_import_containers.go new file mode 100644 index 00000000..7725c05e --- /dev/null +++ b/importapi/client_import_containers_by_project_key_discount_codes_import_containers.go @@ -0,0 +1,16 @@ +package importapi + +// Generated file, please do not change!!! + +type ByProjectKeyDiscountCodesImportContainersRequestBuilder struct { + projectKey string + client *Client +} + +func (rb *ByProjectKeyDiscountCodesImportContainersRequestBuilder) WithImportContainerKeyValue(importContainerKey string) *ByProjectKeyDiscountCodesImportContainersByImportContainerKeyRequestBuilder { + return &ByProjectKeyDiscountCodesImportContainersByImportContainerKeyRequestBuilder{ + importContainerKey: importContainerKey, + projectKey: rb.projectKey, + client: rb.client, + } +} diff --git a/importapi/client_import_containers_by_project_key_discount_codes_import_containers_by_import_container_key.go b/importapi/client_import_containers_by_project_key_discount_codes_import_containers_by_import_container_key.go new file mode 100644 index 00000000..ff95b717 --- /dev/null +++ b/importapi/client_import_containers_by_project_key_discount_codes_import_containers_by_import_container_key.go @@ -0,0 +1,24 @@ +package importapi + +// Generated file, please do not change!!! + +import ( + "fmt" +) + +type ByProjectKeyDiscountCodesImportContainersByImportContainerKeyRequestBuilder struct { + projectKey string + importContainerKey string + client *Client +} + +/** +* Creates a request for creating new Discount Codes or updating existing ones. + */ +func (rb *ByProjectKeyDiscountCodesImportContainersByImportContainerKeyRequestBuilder) Post(body DiscountCodeImportRequest) *ByProjectKeyDiscountCodesImportContainersByImportContainerKeyRequestMethodPost { + return &ByProjectKeyDiscountCodesImportContainersByImportContainerKeyRequestMethodPost{ + body: body, + url: fmt.Sprintf("/%s/discount-codes/import-containers/%s", rb.projectKey, rb.importContainerKey), + client: rb.client, + } +} diff --git a/importapi/client_import_containers_by_project_key_discount_codes_import_containers_by_import_container_key_post.go b/importapi/client_import_containers_by_project_key_discount_codes_import_containers_by_import_container_key_post.go new file mode 100644 index 00000000..db5f40fe --- /dev/null +++ b/importapi/client_import_containers_by_project_key_discount_codes_import_containers_by_import_container_key_post.go @@ -0,0 +1,79 @@ +package importapi + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyDiscountCodesImportContainersByImportContainerKeyRequestMethodPost struct { + body DiscountCodeImportRequest + url string + client *Client + headers http.Header +} + +func (r *ByProjectKeyDiscountCodesImportContainersByImportContainerKeyRequestMethodPost) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + } +} + +func (rb *ByProjectKeyDiscountCodesImportContainersByImportContainerKeyRequestMethodPost) WithHeaders(headers http.Header) *ByProjectKeyDiscountCodesImportContainersByImportContainerKeyRequestMethodPost { + rb.headers = headers + return rb +} + +/** +* Creates a request for creating new Discount Codes or updating existing ones. + */ +func (rb *ByProjectKeyDiscountCodesImportContainersByImportContainerKeyRequestMethodPost) Execute(ctx context.Context) (result *ImportResponse, err error) { + data, err := serializeInput(rb.body) + if err != nil { + return nil, err + } + queryParams := url.Values{} + resp, err := rb.client.post( + ctx, + rb.url, + queryParams, + rb.headers, + data, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 201: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/importapi/types_common.go b/importapi/types_common.go index 31887532..27fb6707 100644 --- a/importapi/types_common.go +++ b/importapi/types_common.go @@ -764,6 +764,7 @@ const ( ImportResourceTypeProductVariantPatch ImportResourceType = "product-variant-patch" ImportResourceTypeStandalonePrice ImportResourceType = "standalone-price" ImportResourceTypeType ImportResourceType = "type" + ImportResourceTypeDiscountCode ImportResourceType = "discount-code" ) /** diff --git a/importapi/types_discount_codes.go b/importapi/types_discount_codes.go new file mode 100644 index 00000000..751ec04e --- /dev/null +++ b/importapi/types_discount_codes.go @@ -0,0 +1,65 @@ +package importapi + +// Generated file, please do not change!!! + +import ( + "encoding/json" + "time" +) + +/** +* The data representation for a Discount Code to be imported that is persisted as a [Discount Code](/../api/projects/discountCodes#discountcode) in the Project. +* + */ +type DiscountCodeImport struct { + // User-defined unique identifier. If a [Discount Code](/../api/projects/discountCodes#discountcode) with this `key` exists, it will be updated with the imported data. + Key string `json:"key"` + // Maps to `DiscountCode.name`. + Name *LocalizedString `json:"name,omitempty"` + // Maps to `DiscountCode.description`. + Description *LocalizedString `json:"description,omitempty"` + // User-defined unique identifier of the DiscountCode that is used by the customer to apply the discount. + Code string `json:"code"` + // Reference to CartDiscounts that can be applied to the Cart once the DiscountCode is applied. + CartDiscounts []CartDiscountKeyReference `json:"cartDiscounts"` + // DiscountCode can only be applied to Carts that match this predicate. + CartPredicate *string `json:"cartPredicate,omitempty"` + // Indicates if the DiscountCode is active and can be applied to the Cart. + IsActive bool `json:"isActive"` + // Number of times the DiscountCode can be applied. DiscountCode application is counted at the time of Order creation or update. However, Order cancellation or deletion does not decrement the count. + MaxApplications *int `json:"maxApplications,omitempty"` + // Number of times the DiscountCode can be applied per Customer (anonymous Carts are not supported). DiscountCode application is counted at the time of Order creation or update. However, Order cancellation or deletion does not decrement the count. + MaxApplicationsPerCustomer *int `json:"maxApplicationsPerCustomer,omitempty"` + // Groups to which the DiscountCode belongs. + Groups []string `json:"groups"` + // Date and time (UTC) from which the DiscountCode is effective. + ValidFrom *time.Time `json:"validFrom,omitempty"` + // Date and time (UTC) until which the DiscountCode is effective. + ValidUntil *time.Time `json:"validUntil,omitempty"` + // Custom Fields of the DiscountCode. + Custom *Custom `json:"custom,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj DiscountCodeImport) MarshalJSON() ([]byte, error) { + type Alias DiscountCodeImport + data, err := json.Marshal(struct { + *Alias + }{Alias: (*Alias)(&obj)}) + if err != nil { + return nil, err + } + + raw := make(map[string]interface{}) + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + if raw["groups"] == nil { + delete(raw, "groups") + } + + return json.Marshal(raw) + +} diff --git a/importapi/types_errors.go b/importapi/types_errors.go index c7b46d6b..b83793f1 100644 --- a/importapi/types_errors.go +++ b/importapi/types_errors.go @@ -12,7 +12,7 @@ import ( * */ type ErrorResponse struct { - // The http status code of the response. + // The HTTP status code of the response. StatusCode int `json:"statusCode"` // Describes the error. Message string `json:"message"` diff --git a/importapi/types_importrequests.go b/importapi/types_importrequests.go index eafbaf18..b15f610e 100644 --- a/importapi/types_importrequests.go +++ b/importapi/types_importrequests.go @@ -103,6 +103,12 @@ func mapDiscriminatorImportRequest(input interface{}) (ImportRequest, error) { return nil, err } return obj, nil + case "discount-code": + obj := DiscountCodeImportRequest{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil } return nil, nil } @@ -212,7 +218,7 @@ func (obj ProductVariantImportRequest) MarshalJSON() ([]byte, error) { } /** -* The request body to [import Embedded Prices](#import-embedded-prices). Contains data for [Embedded Prices](/../api/projects/products#embedded-price) to be created or updated in a Project. +* The request body to [import Embedded Prices](#import-embedded-prices). Contains data for [Embedded Prices](/../api/types#price) to be created or updated in a Project. * */ type PriceImportRequest struct { @@ -362,3 +368,22 @@ func (obj TypeImportRequest) MarshalJSON() ([]byte, error) { *Alias }{Action: "type", Alias: (*Alias)(&obj)}) } + +/** +* The request body to [import Discount Codes](#import-discount-codes). Contains data for [Discount Codes](/../api/projects/discountCodes#discountcode) to be created or updated in a Project. +* + */ +type DiscountCodeImportRequest struct { + // The Discount Code import resources of this request. + Resources []DiscountCodeImport `json:"resources"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj DiscountCodeImportRequest) MarshalJSON() ([]byte, error) { + type Alias DiscountCodeImportRequest + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "discount-code", Alias: (*Alias)(&obj)}) +} diff --git a/importapi/types_orders.go b/importapi/types_orders.go index 0982a0e1..9b673bd2 100644 --- a/importapi/types_orders.go +++ b/importapi/types_orders.go @@ -854,7 +854,7 @@ func (obj ScoreShippingRateInput) MarshalJSON() ([]byte, error) { * The data representation for an Order to be imported that is persisted as an [Order](/../api/projects/orders#top) in the Project. * * In commercetools, you can import an Order using the -* [Create Order by Import](ctp:importapi:endpoint:/{projectKey}/orders/import:POST) +* [Create Order by Import](ctp:import:endpoint:/{projectKey}/orders/import:POST) * endpoint method instead of creating it from a Cart. * * An OrderImport is a snapshot of an order at the time it was imported. diff --git a/importapi/types_prices.go b/importapi/types_prices.go index ea84c293..04b0a641 100644 --- a/importapi/types_prices.go +++ b/importapi/types_prices.go @@ -70,17 +70,20 @@ type PriceImport struct { Channel *ChannelKeyReference `json:"channel,omitempty"` // Sets a discounted price from an external service. Discounted *DiscountedPrice `json:"discounted,omitempty"` - // Only the [Embedded Price](/../api/projects/products#embedded-price) updates will be published to `staged` and `current` projection. + // Only the [Embedded Price](/../api/types#price) updates will be published to `staged` and `current` projection. Publish *bool `json:"publish,omitempty"` + // - Set to `false` to update both the [current and staged projections](/../api/projects/productProjections#current--staged) of the [Product](/../api/projects/products#product) with the new Price data. + // - Leave empty or set to `true` to only update the staged projection. + Staged *bool `json:"staged,omitempty"` // The tiered prices for this price. Tiers []PriceTier `json:"tiers"` // The custom fields for this price. Custom *Custom `json:"custom,omitempty"` - // The ProductVariant in which this [Embedded Price](/../api/projects/products#embedded-price) is contained. + // The ProductVariant in which this [Embedded Price](/../api/types#price) is contained. // The Reference to the [ProductVariant](/../api/projects/products#productvariant) with which the [Price](/../api/types#price) is associated. // If referenced ProductVariant does not exist, the `state` of the [ImportOperation](/import-operation#importoperation) will be set to `unresolved` until the necessary ProductVariant is created. ProductVariant ProductVariantKeyReference `json:"productVariant"` - // The Product in which the Product Variant containing this [Embedded Price](/../api/projects/products#embedded-price) is contained. Maps to `ProductVariant.product`. + // The Product in which the Product Variant containing this [Embedded Price](/../api/types#price) is contained. Maps to `ProductVariant.product`. // The Reference to the [Product](/../api/projects/products#product) with which the [Price](/../api/types#price) is associated. // If referenced Product does not exist, the `state` of the [ImportOperation](/import-operation#importoperation) will be set to `unresolved` until the necessary Product is created. Product ProductKeyReference `json:"product"` diff --git a/importapi/types_productdrafts.go b/importapi/types_productdrafts.go index c9905bfe..564ecf3c 100644 --- a/importapi/types_productdrafts.go +++ b/importapi/types_productdrafts.go @@ -82,9 +82,7 @@ type ProductDraftImport struct { // The Reference to the [State](/../api/projects/states#state) with which the ProductDraft is associated. // If referenced State does not exist, the `state` of the [ImportOperation](/import-operation#importoperation) will be set to `unresolved` until the necessary State is created. State *StateKeyReference `json:"state,omitempty"` - // If `publish` is set to either `true` or `false`, both staged and current projections are set to the same value provided by the import data. - // If `publish` is not set, the staged projection is set to the provided import data, but the current projection stays unchanged. - // However, if the import data contains no update, that is, if it matches the staged projection of the existing Product, the import induces no change in the existing Product whether `publish` is set or not. + // Determines the published status and current/staged projection of the Product. For more information, see [Managing the published state of Products](/best-practices#managing-the-published-state-of-products). Publish *bool `json:"publish,omitempty"` // Determines the type of Prices the API uses. See [ProductPriceMode](/../api/projects/products#productpricemode) for more details. If not provided, the existing `Product.priceMode` is not changed. PriceMode *ProductPriceModeEnum `json:"priceMode,omitempty"` diff --git a/importapi/types_products.go b/importapi/types_products.go index 9fdfb312..788d8e4e 100644 --- a/importapi/types_products.go +++ b/importapi/types_products.go @@ -31,7 +31,7 @@ import ( type SearchKeywords map[string][]SearchKeyword type SearchKeyword struct { Text string `json:"text"` - // The tokenizer defines the tokens that are used to match against the [Suggest Query](/../products-suggestions#suggest-query) input. + // The tokenizer defines the tokens that are used to match against the [Suggest Query](/../products-suggestions#query-suggestions) input. SuggestTokenizer SuggestTokenizer `json:"suggestTokenizer,omitempty"` } @@ -54,7 +54,7 @@ func (obj *SearchKeyword) UnmarshalJSON(data []byte) error { } /** -* The tokenizer defines the tokens that are used to match against the [Suggest Query](/../products-suggestions#suggest-query) input. +* The tokenizer defines the tokens that are used to match against the [Suggest Query](/../products-suggestions#query-suggestions) input. * */ type SuggestTokenizer interface{} @@ -188,9 +188,7 @@ type ProductImport struct { // The Reference to the [State](/../api/projects/states#state) with which the Product is associated. // If referenced State does not exist, the `state` of the [ImportOperation](/import-operation#importoperation) will be set to `unresolved` until the necessary State is created. State *StateKeyReference `json:"state,omitempty"` - // If `publish` is set to either `true` or `false`, both staged and current projections are set to the same value provided by the import data. - // If `publish` is not set, the staged projection is set to the provided import data, but the current projection stays unchanged. - // However, if the import data contains no update, that is, if it matches the staged projection of the existing Product, the import induces no change in the existing Product whether `publish` is set or not. + // Determines the published status and current/staged projection of the Product. For more information, see [Managing the published state of Products](/best-practices#managing-the-published-state-of-products). Publish *bool `json:"publish,omitempty"` // Determines the type of Prices the API uses. See [ProductPriceMode](/../api/projects/products#productpricemode) for more details. If not provided, the existing `Product.priceMode` is not changed. PriceMode *ProductPriceModeEnum `json:"priceMode,omitempty"` diff --git a/importapi/types_productvariants.go b/importapi/types_productvariants.go index b2fd8714..69eb196e 100644 --- a/importapi/types_productvariants.go +++ b/importapi/types_productvariants.go @@ -781,6 +781,9 @@ type ProductVariantImport struct { // If `publish` is not set, the staged projection is set to the provided import data, but the current projection stays unchanged. // However, if the import data contains no update, that is, if it matches the staged projection of the existing Product, the import induces no change in the existing Product whether `publish` is set or not. Publish *bool `json:"publish,omitempty"` + // - Set to `false` to update both the [current and staged projections](/../api/projects/productProjections#current--staged) of the [Product](/../api/projects/products#product) with the new Product Variant data. + // - Leave empty or set to `true` to only update the staged projection. + Staged *bool `json:"staged,omitempty"` // The [Product](/../api/projects/products#productvariant) to which this Product Variant belongs. Maps to `ProductVariant.product`. // The Reference to the [Product](/../api/projects/products#product) with which the ProductVariant is associated. // If referenced Product does not exist, the `state` of the [ImportOperation](/import-operation#importoperation) will be set to `unresolved` until the necessary Product is created. diff --git a/importapi/types_types.go b/importapi/types_types.go index 3b14c147..3c4fe5b0 100644 --- a/importapi/types_types.go +++ b/importapi/types_types.go @@ -336,6 +336,7 @@ const ( CustomFieldReferenceValueCategory CustomFieldReferenceValue = "category" CustomFieldReferenceValueChannel CustomFieldReferenceValue = "channel" CustomFieldReferenceValueCustomer CustomFieldReferenceValue = "customer" + CustomFieldReferenceValueCustomerGroup CustomFieldReferenceValue = "customer-group" CustomFieldReferenceValueKeyValueDocument CustomFieldReferenceValue = "key-value-document" CustomFieldReferenceValueOrder CustomFieldReferenceValue = "order" CustomFieldReferenceValueProduct CustomFieldReferenceValue = "product" diff --git a/platform/client_active_cart_by_project_key_in_store_key_by_store_key_me_active_cart.go b/platform/client_active_cart_by_project_key_in_store_key_by_store_key_me_active_cart.go index e1378d1f..d4a3d138 100644 --- a/platform/client_active_cart_by_project_key_in_store_key_by_store_key_me_active_cart.go +++ b/platform/client_active_cart_by_project_key_in_store_key_by_store_key_me_active_cart.go @@ -13,11 +13,15 @@ type ByProjectKeyInStoreKeyByStoreKeyMeActiveCartRequestBuilder struct { } /** -* Retrieves the Customer's most recently modified active Cart in the Store specified by the `storeKey` path parameter. +* Retrieves the Customer's most recently modified [active Cart](ctp:api:type:CartState) in a Store. Returns a `200 OK` status if successful. * * Carts with `Merchant` or `Quote` [CartOrigin](ctp:api:type:CartOrigin) are ignored. * -* If no active Cart exists, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no active Cart exists. +* - If an active Cart exists but does not have a `store` specified, or the `store` field references a different Store. +* - If an active Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeActiveCartRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyMeActiveCartRequestMethodGet { @@ -28,7 +32,14 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeActiveCartRequestBuilder) Get() *ByP } /** -* Checks if an active Cart exists. Returns a `200 OK` status if an active Cart exists or a `404 Not Found` otherwise. +* Checks if an active Cart exists in a Store. Returns `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no active Cart exists in a Store. +* - If an active Cart exists but does not have a `store` specified, or the `store` field references a different Store. +* - If an active Cart exists but does not contain a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeActiveCartRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyMeActiveCartRequestMethodHead { return &ByProjectKeyInStoreKeyByStoreKeyMeActiveCartRequestMethodHead{ diff --git a/platform/client_active_cart_by_project_key_in_store_key_by_store_key_me_active_cart_get.go b/platform/client_active_cart_by_project_key_in_store_key_by_store_key_me_active_cart_get.go index f324112b..ff7bfbec 100644 --- a/platform/client_active_cart_by_project_key_in_store_key_by_store_key_me_active_cart_get.go +++ b/platform/client_active_cart_by_project_key_in_store_key_by_store_key_me_active_cart_get.go @@ -55,11 +55,15 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeActiveCartRequestMethodGet) WithHead } /** -* Retrieves the Customer's most recently modified active Cart in the Store specified by the `storeKey` path parameter. +* Retrieves the Customer's most recently modified [active Cart](ctp:api:type:CartState) in a Store. Returns a `200 OK` status if successful. * * Carts with `Merchant` or `Quote` [CartOrigin](ctp:api:type:CartOrigin) are ignored. * -* If no active Cart exists, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no active Cart exists. +* - If an active Cart exists but does not have a `store` specified, or the `store` field references a different Store. +* - If an active Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeActiveCartRequestMethodGet) Execute(ctx context.Context) (result *Cart, err error) { diff --git a/platform/client_active_cart_by_project_key_in_store_key_by_store_key_me_active_cart_head.go b/platform/client_active_cart_by_project_key_in_store_key_by_store_key_me_active_cart_head.go index 739928ae..76e3a888 100644 --- a/platform/client_active_cart_by_project_key_in_store_key_by_store_key_me_active_cart_head.go +++ b/platform/client_active_cart_by_project_key_in_store_key_by_store_key_me_active_cart_head.go @@ -28,7 +28,14 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeActiveCartRequestMethodHead) WithHea } /** -* Checks if an active Cart exists. Returns a `200 OK` status if an active Cart exists or a `404 Not Found` otherwise. +* Checks if an active Cart exists in a Store. Returns `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no active Cart exists in a Store. +* - If an active Cart exists but does not have a `store` specified, or the `store` field references a different Store. +* - If an active Cart exists but does not contain a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeActiveCartRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_active_cart_by_project_key_me_active_cart.go b/platform/client_active_cart_by_project_key_me_active_cart.go index f7c3437d..69486946 100644 --- a/platform/client_active_cart_by_project_key_me_active_cart.go +++ b/platform/client_active_cart_by_project_key_me_active_cart.go @@ -12,10 +12,14 @@ type ByProjectKeyMeActiveCartRequestBuilder struct { } /** -* Retrieves the Customer's most recently modified active Cart. +* Retrieves the Customer's most recently modified [active Cart](ctp:api:type:CartState). Returns a `200 OK` status if successful. +* * Carts with `Merchant` or `Quote` [CartOrigin](ctp:api:type:CartOrigin) are ignored. * -* If no active Cart exists, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no active Cart exists. +* - If an active Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. * */ func (rb *ByProjectKeyMeActiveCartRequestBuilder) Get() *ByProjectKeyMeActiveCartRequestMethodGet { @@ -26,7 +30,13 @@ func (rb *ByProjectKeyMeActiveCartRequestBuilder) Get() *ByProjectKeyMeActiveCar } /** -* Checks if an active Cart exists. Returns a `200 OK` status if an active Cart exists or a `404 Not Found` otherwise. +* Checks if an active Cart exists. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no active Cart exists. +* - If an active Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* */ func (rb *ByProjectKeyMeActiveCartRequestBuilder) Head() *ByProjectKeyMeActiveCartRequestMethodHead { return &ByProjectKeyMeActiveCartRequestMethodHead{ diff --git a/platform/client_active_cart_by_project_key_me_active_cart_get.go b/platform/client_active_cart_by_project_key_me_active_cart_get.go index c36ad7dd..7cc5ef77 100644 --- a/platform/client_active_cart_by_project_key_me_active_cart_get.go +++ b/platform/client_active_cart_by_project_key_me_active_cart_get.go @@ -55,10 +55,14 @@ func (rb *ByProjectKeyMeActiveCartRequestMethodGet) WithHeaders(headers http.Hea } /** -* Retrieves the Customer's most recently modified active Cart. +* Retrieves the Customer's most recently modified [active Cart](ctp:api:type:CartState). Returns a `200 OK` status if successful. +* * Carts with `Merchant` or `Quote` [CartOrigin](ctp:api:type:CartOrigin) are ignored. * -* If no active Cart exists, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no active Cart exists. +* - If an active Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. * */ func (rb *ByProjectKeyMeActiveCartRequestMethodGet) Execute(ctx context.Context) (result *Cart, err error) { diff --git a/platform/client_active_cart_by_project_key_me_active_cart_head.go b/platform/client_active_cart_by_project_key_me_active_cart_head.go index d6a02967..fff86532 100644 --- a/platform/client_active_cart_by_project_key_me_active_cart_head.go +++ b/platform/client_active_cart_by_project_key_me_active_cart_head.go @@ -28,7 +28,13 @@ func (rb *ByProjectKeyMeActiveCartRequestMethodHead) WithHeaders(headers http.He } /** -* Checks if an active Cart exists. Returns a `200 OK` status if an active Cart exists or a `404 Not Found` otherwise. +* Checks if an active Cart exists. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no active Cart exists. +* - If an active Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* */ func (rb *ByProjectKeyMeActiveCartRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_business_units_by_project_key_me_business_units.go b/platform/client_business_units_by_project_key_me_business_units.go index 208b10de..49fa21b0 100644 --- a/platform/client_business_units_by_project_key_me_business_units.go +++ b/platform/client_business_units_by_project_key_me_business_units.go @@ -25,6 +25,11 @@ func (rb *ByProjectKeyMeBusinessUnitsRequestBuilder) WithKey(key string) *ByProj client: rb.client, } } + +/** +* Returns all of the authenticated Customer’s Business Units in a Project. Returns a `200 OK` status if successful, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. +* + */ func (rb *ByProjectKeyMeBusinessUnitsRequestBuilder) Get() *ByProjectKeyMeBusinessUnitsRequestMethodGet { return &ByProjectKeyMeBusinessUnitsRequestMethodGet{ url: fmt.Sprintf("/%s/me/business-units", rb.projectKey), @@ -33,7 +38,8 @@ func (rb *ByProjectKeyMeBusinessUnitsRequestBuilder) Get() *ByProjectKeyMeBusine } /** -* Checks if a BusinessUnit exists for a given Query Predicate. Returns a `200 OK` status if any BusinessUnits match the Query Predicate or a `404 Not Found` otherwise. +* Checks if a BusinessUnit exists for a given Query Predicate. Returns a `200 OK` status if any BusinessUnits match the Query Predicate and the Customer has access to them, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. +* */ func (rb *ByProjectKeyMeBusinessUnitsRequestBuilder) Head() *ByProjectKeyMeBusinessUnitsRequestMethodHead { return &ByProjectKeyMeBusinessUnitsRequestMethodHead{ diff --git a/platform/client_business_units_by_project_key_me_business_units_by_id.go b/platform/client_business_units_by_project_key_me_business_units_by_id.go index b9d47284..a2b9c887 100644 --- a/platform/client_business_units_by_project_key_me_business_units_by_id.go +++ b/platform/client_business_units_by_project_key_me_business_units_by_id.go @@ -12,6 +12,10 @@ type ByProjectKeyMeBusinessUnitsByIDRequestBuilder struct { client *Client } +/** +* Returns a Business Unit for a given `id`. Returns a `200 OK` status if the Business Unit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. +* + */ func (rb *ByProjectKeyMeBusinessUnitsByIDRequestBuilder) Get() *ByProjectKeyMeBusinessUnitsByIDRequestMethodGet { return &ByProjectKeyMeBusinessUnitsByIDRequestMethodGet{ url: fmt.Sprintf("/%s/me/business-units/%s", rb.projectKey, rb.id), @@ -20,7 +24,7 @@ func (rb *ByProjectKeyMeBusinessUnitsByIDRequestBuilder) Get() *ByProjectKeyMeBu } /** -* Checks if a BusinessUnit exists for a given `id`. Returns a `200 OK` status if the BusinessUnit exists or a `404 Not Found` otherwise. +* Checks if a BusinessUnit exists for a given `id`. Returns a `200 OK` status if the BusinessUnit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyMeBusinessUnitsByIDRequestBuilder) Head() *ByProjectKeyMeBusinessUnitsByIDRequestMethodHead { return &ByProjectKeyMeBusinessUnitsByIDRequestMethodHead{ @@ -29,6 +33,10 @@ func (rb *ByProjectKeyMeBusinessUnitsByIDRequestBuilder) Head() *ByProjectKeyMeB } } +/** +* Updates a Business Unit for a given `id`. Returns a `200 OK` status if the Business Unit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. +* + */ func (rb *ByProjectKeyMeBusinessUnitsByIDRequestBuilder) Post(body MyBusinessUnitUpdate) *ByProjectKeyMeBusinessUnitsByIDRequestMethodPost { return &ByProjectKeyMeBusinessUnitsByIDRequestMethodPost{ body: body, @@ -36,10 +44,3 @@ func (rb *ByProjectKeyMeBusinessUnitsByIDRequestBuilder) Post(body MyBusinessUni client: rb.client, } } - -func (rb *ByProjectKeyMeBusinessUnitsByIDRequestBuilder) Delete() *ByProjectKeyMeBusinessUnitsByIDRequestMethodDelete { - return &ByProjectKeyMeBusinessUnitsByIDRequestMethodDelete{ - url: fmt.Sprintf("/%s/me/business-units/%s", rb.projectKey, rb.id), - client: rb.client, - } -} diff --git a/platform/client_business_units_by_project_key_me_business_units_by_id_get.go b/platform/client_business_units_by_project_key_me_business_units_by_id_get.go index 6c0ca039..b5e63f70 100644 --- a/platform/client_business_units_by_project_key_me_business_units_by_id_get.go +++ b/platform/client_business_units_by_project_key_me_business_units_by_id_get.go @@ -53,6 +53,11 @@ func (rb *ByProjectKeyMeBusinessUnitsByIDRequestMethodGet) WithHeaders(headers h rb.headers = headers return rb } + +/** +* Returns a Business Unit for a given `id`. Returns a `200 OK` status if the Business Unit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. +* + */ func (rb *ByProjectKeyMeBusinessUnitsByIDRequestMethodGet) Execute(ctx context.Context) (result *BusinessUnit, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_business_units_by_project_key_me_business_units_by_id_head.go b/platform/client_business_units_by_project_key_me_business_units_by_id_head.go index 69a56ed5..9f3a6e05 100644 --- a/platform/client_business_units_by_project_key_me_business_units_by_id_head.go +++ b/platform/client_business_units_by_project_key_me_business_units_by_id_head.go @@ -28,7 +28,7 @@ func (rb *ByProjectKeyMeBusinessUnitsByIDRequestMethodHead) WithHeaders(headers } /** -* Checks if a BusinessUnit exists for a given `id`. Returns a `200 OK` status if the BusinessUnit exists or a `404 Not Found` otherwise. +* Checks if a BusinessUnit exists for a given `id`. Returns a `200 OK` status if the BusinessUnit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyMeBusinessUnitsByIDRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_business_units_by_project_key_me_business_units_by_id_post.go b/platform/client_business_units_by_project_key_me_business_units_by_id_post.go index f6f9c42b..5a9df12b 100644 --- a/platform/client_business_units_by_project_key_me_business_units_by_id_post.go +++ b/platform/client_business_units_by_project_key_me_business_units_by_id_post.go @@ -54,6 +54,11 @@ func (rb *ByProjectKeyMeBusinessUnitsByIDRequestMethodPost) WithHeaders(headers rb.headers = headers return rb } + +/** +* Updates a Business Unit for a given `id`. Returns a `200 OK` status if the Business Unit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. +* + */ func (rb *ByProjectKeyMeBusinessUnitsByIDRequestMethodPost) Execute(ctx context.Context) (result *BusinessUnit, err error) { data, err := serializeInput(rb.body) if err != nil { diff --git a/platform/client_business_units_by_project_key_me_business_units_get.go b/platform/client_business_units_by_project_key_me_business_units_get.go index c0bad072..8a1c7395 100644 --- a/platform/client_business_units_by_project_key_me_business_units_get.go +++ b/platform/client_business_units_by_project_key_me_business_units_get.go @@ -132,6 +132,11 @@ func (rb *ByProjectKeyMeBusinessUnitsRequestMethodGet) WithHeaders(headers http. rb.headers = headers return rb } + +/** +* Returns all of the authenticated Customer’s Business Units in a Project. Returns a `200 OK` status if successful, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. +* + */ func (rb *ByProjectKeyMeBusinessUnitsRequestMethodGet) Execute(ctx context.Context) (result *BusinessUnitPagedQueryResponse, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_business_units_by_project_key_me_business_units_head.go b/platform/client_business_units_by_project_key_me_business_units_head.go index 5c026708..b401811c 100644 --- a/platform/client_business_units_by_project_key_me_business_units_head.go +++ b/platform/client_business_units_by_project_key_me_business_units_head.go @@ -55,7 +55,8 @@ func (rb *ByProjectKeyMeBusinessUnitsRequestMethodHead) WithHeaders(headers http } /** -* Checks if a BusinessUnit exists for a given Query Predicate. Returns a `200 OK` status if any BusinessUnits match the Query Predicate or a `404 Not Found` otherwise. +* Checks if a BusinessUnit exists for a given Query Predicate. Returns a `200 OK` status if any BusinessUnits match the Query Predicate and the Customer has access to them, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. +* */ func (rb *ByProjectKeyMeBusinessUnitsRequestMethodHead) Execute(ctx context.Context) error { var queryParams url.Values diff --git a/platform/client_business_units_by_project_key_me_business_units_key_by_key.go b/platform/client_business_units_by_project_key_me_business_units_key_by_key.go index ac993823..d9dbc911 100644 --- a/platform/client_business_units_by_project_key_me_business_units_key_by_key.go +++ b/platform/client_business_units_by_project_key_me_business_units_key_by_key.go @@ -12,6 +12,9 @@ type ByProjectKeyMeBusinessUnitsKeyByKeyRequestBuilder struct { client *Client } +/** +* Returns a Business Unit for a given `key`. Returns a `200 OK` status if the Business Unit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + */ func (rb *ByProjectKeyMeBusinessUnitsKeyByKeyRequestBuilder) Get() *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodGet { return &ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodGet{ url: fmt.Sprintf("/%s/me/business-units/key=%s", rb.projectKey, rb.key), @@ -20,7 +23,7 @@ func (rb *ByProjectKeyMeBusinessUnitsKeyByKeyRequestBuilder) Get() *ByProjectKey } /** -* Checks if a BusinessUnit exists for a given `key`. Returns a `200 OK` status if the BusinessUnit exists or a `404 Not Found` otherwise. +* Checks if a BusinessUnit exists for a given `key`. Returns a `200 OK` status if the Business Unit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyMeBusinessUnitsKeyByKeyRequestBuilder) Head() *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodHead { return &ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodHead{ @@ -29,6 +32,9 @@ func (rb *ByProjectKeyMeBusinessUnitsKeyByKeyRequestBuilder) Head() *ByProjectKe } } +/** +* Updates a Business Unit for a given `key`. Returns a `200 OK` status if the Business Unit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + */ func (rb *ByProjectKeyMeBusinessUnitsKeyByKeyRequestBuilder) Post(body MyBusinessUnitUpdate) *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodPost { return &ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodPost{ body: body, @@ -36,10 +42,3 @@ func (rb *ByProjectKeyMeBusinessUnitsKeyByKeyRequestBuilder) Post(body MyBusines client: rb.client, } } - -func (rb *ByProjectKeyMeBusinessUnitsKeyByKeyRequestBuilder) Delete() *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodDelete { - return &ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodDelete{ - url: fmt.Sprintf("/%s/me/business-units/key=%s", rb.projectKey, rb.key), - client: rb.client, - } -} diff --git a/platform/client_business_units_by_project_key_me_business_units_key_by_key_get.go b/platform/client_business_units_by_project_key_me_business_units_key_by_key_get.go index a030cc76..23937241 100644 --- a/platform/client_business_units_by_project_key_me_business_units_key_by_key_get.go +++ b/platform/client_business_units_by_project_key_me_business_units_key_by_key_get.go @@ -53,6 +53,10 @@ func (rb *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodGet) WithHeaders(heade rb.headers = headers return rb } + +/** +* Returns a Business Unit for a given `key`. Returns a `200 OK` status if the Business Unit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + */ func (rb *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodGet) Execute(ctx context.Context) (result *BusinessUnit, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_business_units_by_project_key_me_business_units_key_by_key_head.go b/platform/client_business_units_by_project_key_me_business_units_key_by_key_head.go index 4f18ff78..f91ad1c3 100644 --- a/platform/client_business_units_by_project_key_me_business_units_key_by_key_head.go +++ b/platform/client_business_units_by_project_key_me_business_units_key_by_key_head.go @@ -28,7 +28,7 @@ func (rb *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodHead) WithHeaders(head } /** -* Checks if a BusinessUnit exists for a given `key`. Returns a `200 OK` status if the BusinessUnit exists or a `404 Not Found` otherwise. +* Checks if a BusinessUnit exists for a given `key`. Returns a `200 OK` status if the Business Unit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_business_units_by_project_key_me_business_units_key_by_key_post.go b/platform/client_business_units_by_project_key_me_business_units_key_by_key_post.go index 39afc36e..9c820da9 100644 --- a/platform/client_business_units_by_project_key_me_business_units_key_by_key_post.go +++ b/platform/client_business_units_by_project_key_me_business_units_key_by_key_post.go @@ -54,6 +54,10 @@ func (rb *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodPost) WithHeaders(head rb.headers = headers return rb } + +/** +* Updates a Business Unit for a given `key`. Returns a `200 OK` status if the Business Unit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + */ func (rb *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodPost) Execute(ctx context.Context) (result *BusinessUnit, err error) { data, err := serializeInput(rb.body) if err != nil { diff --git a/platform/client_carts_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_carts.go b/platform/client_carts_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_carts.go index e136709f..8a3aef96 100644 --- a/platform/client_carts_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_carts.go +++ b/platform/client_carts_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_carts.go @@ -59,6 +59,13 @@ func (rb *ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKey /** * Creates a [Cart](ctp:api:type:Cart) in the [BusinessUnit](ctp:api:type:BusinessUnit) referenced by `businessUnitKey`. As such, the `businessUnit` field on [CartDraft](ctp:api:type:CartDraft) is ignored for this request. * Creating a Cart can fail with an [InvalidOperation](ctp:api:type:InvalidOperationError) if the referenced [ShippingMethod](ctp:api:type:ShippingMethod) in the [CartDraft](ctp:api:type:CartDraft) has a predicate that does not match the Cart. +* +* Specific Error Codes: +* +* - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) +* - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * */ func (rb *ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyCartsRequestBuilder) Post(body CartDraft) *ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyCartsRequestMethodPost { diff --git a/platform/client_carts_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_carts_post.go b/platform/client_carts_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_carts_post.go index 0ffe0403..47cf8f1c 100644 --- a/platform/client_carts_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_carts_post.go +++ b/platform/client_carts_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_carts_post.go @@ -58,6 +58,13 @@ func (rb *ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKey /** * Creates a [Cart](ctp:api:type:Cart) in the [BusinessUnit](ctp:api:type:BusinessUnit) referenced by `businessUnitKey`. As such, the `businessUnit` field on [CartDraft](ctp:api:type:CartDraft) is ignored for this request. * Creating a Cart can fail with an [InvalidOperation](ctp:api:type:InvalidOperationError) if the referenced [ShippingMethod](ctp:api:type:ShippingMethod) in the [CartDraft](ctp:api:type:CartDraft) has a predicate that does not match the Cart. +* +* Specific Error Codes: +* +* - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) +* - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * */ func (rb *ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyCartsRequestMethodPost) Execute(ctx context.Context) (result *Cart, err error) { diff --git a/platform/client_carts_by_project_key_carts.go b/platform/client_carts_by_project_key_carts.go index dd5203ca..32b2c909 100644 --- a/platform/client_carts_by_project_key_carts.go +++ b/platform/client_carts_by_project_key_carts.go @@ -56,9 +56,14 @@ func (rb *ByProjectKeyCartsRequestBuilder) Head() *ByProjectKeyCartsRequestMetho } /** -* Creating a Cart fails with an [InvalidOperation](ctp:api:type:InvalidOperationError) error if the -* [ShippingMethod](ctp:api:type:ShippingMethod) referenced in the CartDraft -* has a `predicate` that does not match the Cart. +* If the referenced [ShippingMethod](ctp:api:type:ShippingMethod) in the [CartDraft](ctp:api:type:CartDraft) has a predicate that does not match, or if the Shipping Method is not active, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned. +* +* Specific Error Codes: +* +* - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) +* - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * */ func (rb *ByProjectKeyCartsRequestBuilder) Post(body CartDraft) *ByProjectKeyCartsRequestMethodPost { diff --git a/platform/client_carts_by_project_key_carts_customer_id_by_customer_id.go b/platform/client_carts_by_project_key_carts_customer_id_by_customer_id.go index 6ea8de39..4e287b62 100644 --- a/platform/client_carts_by_project_key_carts_customer_id_by_customer_id.go +++ b/platform/client_carts_by_project_key_carts_customer_id_by_customer_id.go @@ -13,7 +13,7 @@ type ByProjectKeyCartsCustomerIdByCustomerIdRequestBuilder struct { } /** -* Retrieves the recently modified active Cart of a Customer with [CartOrigin](ctp:api:type:CartOrigin) `Customer`. If no active Cart exists, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* Retrieves the most recently modified active Cart of a Customer with [CartOrigin](ctp:api:type:CartOrigin) `Customer`. If no active Cart exists, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * * To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action. * diff --git a/platform/client_carts_by_project_key_carts_customer_id_by_customer_id_get.go b/platform/client_carts_by_project_key_carts_customer_id_by_customer_id_get.go index 4c9ca9dd..6df46c40 100644 --- a/platform/client_carts_by_project_key_carts_customer_id_by_customer_id_get.go +++ b/platform/client_carts_by_project_key_carts_customer_id_by_customer_id_get.go @@ -55,7 +55,7 @@ func (rb *ByProjectKeyCartsCustomerIdByCustomerIdRequestMethodGet) WithHeaders(h } /** -* Retrieves the recently modified active Cart of a Customer with [CartOrigin](ctp:api:type:CartOrigin) `Customer`. If no active Cart exists, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* Retrieves the most recently modified active Cart of a Customer with [CartOrigin](ctp:api:type:CartOrigin) `Customer`. If no active Cart exists, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * * To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action. * diff --git a/platform/client_carts_by_project_key_carts_post.go b/platform/client_carts_by_project_key_carts_post.go index bdc248cf..599bf420 100644 --- a/platform/client_carts_by_project_key_carts_post.go +++ b/platform/client_carts_by_project_key_carts_post.go @@ -56,9 +56,14 @@ func (rb *ByProjectKeyCartsRequestMethodPost) WithHeaders(headers http.Header) * } /** -* Creating a Cart fails with an [InvalidOperation](ctp:api:type:InvalidOperationError) error if the -* [ShippingMethod](ctp:api:type:ShippingMethod) referenced in the CartDraft -* has a `predicate` that does not match the Cart. +* If the referenced [ShippingMethod](ctp:api:type:ShippingMethod) in the [CartDraft](ctp:api:type:CartDraft) has a predicate that does not match, or if the Shipping Method is not active, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned. +* +* Specific Error Codes: +* +* - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) +* - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * */ func (rb *ByProjectKeyCartsRequestMethodPost) Execute(ctx context.Context) (result *Cart, err error) { diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts.go index 6a38ee8a..0a7be226 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts.go @@ -45,7 +45,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsRequestBuilder) WithId(id string) } /** -* Queries carts in a specific [Store](ctp:api:type:Store). +* Queries Carts in a specific [Store](ctp:api:type:Store). */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyCartsRequestMethodGet { return &ByProjectKeyInStoreKeyByStoreKeyCartsRequestMethodGet{ @@ -55,7 +55,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsRequestBuilder) Get() *ByProjectK } /** -* Checks if a Cart exists for a given Query Predicate. Returns a `200 OK` status if any Carts match the Query Predicate or a `404 Not Found` otherwise. +* Checks if a Cart exists for a given Query Predicate. Returns a `200 OK` status if any Carts match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyCartsRequestMethodHead { return &ByProjectKeyInStoreKeyByStoreKeyCartsRequestMethodHead{ @@ -66,8 +66,16 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsRequestBuilder) Head() *ByProject /** * Creates a [Cart](ctp:api:type:Cart) in the [Store](ctp:api:type:Store) specified by `storeKey`. -* When using this endpoint the Cart's `store` field is always set to the [Store](ctp:api:type:Store) specified in the path parameter. -* If the referenced [ShippingMethod](ctp:api:type:ShippingMethod) in the [CartDraft](ctp:api:type:CartDraft) has a predicate that does not match, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned. +* +* If the referenced [ShippingMethod](ctp:api:type:ShippingMethod) in the [CartDraft](ctp:api:type:CartDraft) has a predicate that does not match, or if the Shipping Method is not active, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned. +* +* Specific Error Codes: +* +* - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) +* - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) +* - [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsRequestBuilder) Post(body CartDraft) *ByProjectKeyInStoreKeyByStoreKeyCartsRequestMethodPost { diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_by_id.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_by_id.go index 06cb8230..6c402fb9 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_by_id.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_by_id.go @@ -14,7 +14,7 @@ type ByProjectKeyInStoreKeyByStoreKeyCartsByIDRequestBuilder struct { } /** -* If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Cart exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * * To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action. * @@ -27,7 +27,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsByIDRequestBuilder) Get() *ByProj } /** -* Checks if a Cart exists for a given `id`. Returns a `200 OK` status if the Cart exists or a `404 Not Found` otherwise. +* Checks if a Cart exists for a given `id`. Returns a `200 OK` status if the Cart exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsByIDRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyCartsByIDRequestMethodHead { return &ByProjectKeyInStoreKeyByStoreKeyCartsByIDRequestMethodHead{ @@ -38,7 +38,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsByIDRequestBuilder) Head() *ByPro /** * Updates a [Cart](ctp:api:type:Cart) in the [Store](ctp:api:type:Store) specified by `storeKey`. -* If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Cart exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsByIDRequestBuilder) Post(body CartUpdate) *ByProjectKeyInStoreKeyByStoreKeyCartsByIDRequestMethodPost { @@ -50,7 +50,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsByIDRequestBuilder) Post(body Car } /** -* If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Cart exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsByIDRequestBuilder) Delete() *ByProjectKeyInStoreKeyByStoreKeyCartsByIDRequestMethodDelete { diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_by_id_delete.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_by_id_delete.go index 8ffed8c1..bce36b90 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_by_id_delete.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_by_id_delete.go @@ -82,7 +82,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsByIDRequestMethodDelete) WithHead } /** -* If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Cart exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsByIDRequestMethodDelete) Execute(ctx context.Context) (result *Cart, err error) { diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_by_id_get.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_by_id_get.go index cbb2af79..7801e7e2 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_by_id_get.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_by_id_get.go @@ -55,7 +55,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsByIDRequestMethodGet) WithHeaders } /** -* If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Cart exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * * To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action. * diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_by_id_head.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_by_id_head.go index a57064ec..dfb7a24b 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_by_id_head.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_by_id_head.go @@ -28,7 +28,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsByIDRequestMethodHead) WithHeader } /** -* Checks if a Cart exists for a given `id`. Returns a `200 OK` status if the Cart exists or a `404 Not Found` otherwise. +* Checks if a Cart exists for a given `id`. Returns a `200 OK` status if the Cart exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsByIDRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_by_id_post.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_by_id_post.go index 9b52142e..08205bf2 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_by_id_post.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_by_id_post.go @@ -57,7 +57,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsByIDRequestMethodPost) WithHeader /** * Updates a [Cart](ctp:api:type:Cart) in the [Store](ctp:api:type:Store) specified by `storeKey`. -* If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Cart exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsByIDRequestMethodPost) Execute(ctx context.Context) (result *Cart, err error) { diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_customer_id_by_customer_id.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_customer_id_by_customer_id.go index ae939f65..f211624d 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_customer_id_by_customer_id.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_customer_id_by_customer_id.go @@ -14,9 +14,9 @@ type ByProjectKeyInStoreKeyByStoreKeyCartsCustomerIdByCustomerIdRequestBuilder s } /** -* Retrieves the recently modified active Cart of a Customer with [CartOrigin](ctp:api:type:CartOrigin) `Customer`. If no active Cart exists, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* Retrieves the most recently modified [active Cart](ctp:api:type:CartState) of a Customer with [CartOrigin](ctp:api:type:CartOrigin) `Customer`. If no active Cart exists, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * -* If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Cart exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * * To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action. * @@ -29,7 +29,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsCustomerIdByCustomerIdRequestBuil } /** -* Checks if a Cart of a Customer exists. Returns a `200 OK` status if the Cart exists or a `404 Not Found` otherwise. +* Checks if a Cart of a Customer exists. Returns a `200 OK` status if the Cart exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsCustomerIdByCustomerIdRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyCartsCustomerIdByCustomerIdRequestMethodHead { return &ByProjectKeyInStoreKeyByStoreKeyCartsCustomerIdByCustomerIdRequestMethodHead{ diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_customer_id_by_customer_id_get.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_customer_id_by_customer_id_get.go index a703ab5f..7c2d5122 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_customer_id_by_customer_id_get.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_customer_id_by_customer_id_get.go @@ -55,9 +55,9 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsCustomerIdByCustomerIdRequestMeth } /** -* Retrieves the recently modified active Cart of a Customer with [CartOrigin](ctp:api:type:CartOrigin) `Customer`. If no active Cart exists, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* Retrieves the most recently modified [active Cart](ctp:api:type:CartState) of a Customer with [CartOrigin](ctp:api:type:CartOrigin) `Customer`. If no active Cart exists, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * -* If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Cart exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * * To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action. * diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_customer_id_by_customer_id_head.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_customer_id_by_customer_id_head.go index 24e29143..dbcf6cf0 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_customer_id_by_customer_id_head.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_customer_id_by_customer_id_head.go @@ -28,7 +28,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsCustomerIdByCustomerIdRequestMeth } /** -* Checks if a Cart of a Customer exists. Returns a `200 OK` status if the Cart exists or a `404 Not Found` otherwise. +* Checks if a Cart of a Customer exists. Returns a `200 OK` status if the Cart exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsCustomerIdByCustomerIdRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_get.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_get.go index 3bf87c17..216a327d 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_get.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_get.go @@ -134,7 +134,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsRequestMethodGet) WithHeaders(hea } /** -* Queries carts in a specific [Store](ctp:api:type:Store). +* Queries Carts in a specific [Store](ctp:api:type:Store). */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsRequestMethodGet) Execute(ctx context.Context) (result *CartPagedQueryResponse, err error) { var queryParams url.Values diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_head.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_head.go index be220b49..115d7ba0 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_head.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_head.go @@ -55,7 +55,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsRequestMethodHead) WithHeaders(he } /** -* Checks if a Cart exists for a given Query Predicate. Returns a `200 OK` status if any Carts match the Query Predicate or a `404 Not Found` otherwise. +* Checks if a Cart exists for a given Query Predicate. Returns a `200 OK` status if any Carts match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsRequestMethodHead) Execute(ctx context.Context) error { var queryParams url.Values diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_key_by_key.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_key_by_key.go index 4c0cf0c2..3208c373 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_key_by_key.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_key_by_key.go @@ -14,7 +14,7 @@ type ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyRequestBuilder struct { } /** -* If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Cart exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * * To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action. * @@ -27,7 +27,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyRequestBuilder) Get() *By } /** -* Checks if a Cart exists for a given `key`. Returns a `200 OK` status if the Cart exists or a `404 Not Found` otherwise. +* Checks if a Cart exists for a given `key`. Returns a `200 OK` status if the Cart exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyRequestMethodHead { return &ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyRequestMethodHead{ @@ -37,7 +37,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyRequestBuilder) Head() *B } /** -* If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Cart exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyRequestBuilder) Post(body CartUpdate) *ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyRequestMethodPost { @@ -49,7 +49,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyRequestBuilder) Post(body } /** -* If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Cart exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyRequestBuilder) Delete() *ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyRequestMethodDelete { diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_key_by_key_delete.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_key_by_key_delete.go index 3ea89488..dd438e64 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_key_by_key_delete.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_key_by_key_delete.go @@ -82,7 +82,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyRequestMethodDelete) With } /** -* If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Cart exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyRequestMethodDelete) Execute(ctx context.Context) (result *Cart, err error) { diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_key_by_key_get.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_key_by_key_get.go index 40b8f94d..95ab6777 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_key_by_key_get.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_key_by_key_get.go @@ -55,7 +55,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyRequestMethodGet) WithHea } /** -* If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Cart exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * * To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action. * diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_key_by_key_head.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_key_by_key_head.go index f8c98570..c65f8209 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_key_by_key_head.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_key_by_key_head.go @@ -28,7 +28,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyRequestMethodHead) WithHe } /** -* Checks if a Cart exists for a given `key`. Returns a `200 OK` status if the Cart exists or a `404 Not Found` otherwise. +* Checks if a Cart exists for a given `key`. Returns a `200 OK` status if the Cart exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_key_by_key_post.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_key_by_key_post.go index 8dd30abd..8ebee7c5 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_key_by_key_post.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_key_by_key_post.go @@ -56,7 +56,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyRequestMethodPost) WithHe } /** -* If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Cart exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyRequestMethodPost) Execute(ctx context.Context) (result *Cart, err error) { diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_post.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_post.go index 59d1e343..58edb9c0 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_post.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_carts_post.go @@ -57,8 +57,16 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsRequestMethodPost) WithHeaders(he /** * Creates a [Cart](ctp:api:type:Cart) in the [Store](ctp:api:type:Store) specified by `storeKey`. -* When using this endpoint the Cart's `store` field is always set to the [Store](ctp:api:type:Store) specified in the path parameter. -* If the referenced [ShippingMethod](ctp:api:type:ShippingMethod) in the [CartDraft](ctp:api:type:CartDraft) has a predicate that does not match, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned. +* +* If the referenced [ShippingMethod](ctp:api:type:ShippingMethod) in the [CartDraft](ctp:api:type:CartDraft) has a predicate that does not match, or if the Shipping Method is not active, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned. +* +* Specific Error Codes: +* +* - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) +* - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) +* - [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsRequestMethodPost) Execute(ctx context.Context) (result *Cart, err error) { diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts.go index d418713e..5f4ae568 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts.go @@ -20,6 +20,11 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsRequestBuilder) WithId(id strin client: rb.client, } } + +/** +* Returns all Carts that match a given Query Predicate and contain either a matching `customerId` or `anonymousId` in a Store. +* + */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyMeCartsRequestMethodGet { return &ByProjectKeyInStoreKeyByStoreKeyMeCartsRequestMethodGet{ url: fmt.Sprintf("/%s/in-store/key=%s/me/carts", rb.projectKey, rb.storeKey), @@ -28,7 +33,8 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsRequestBuilder) Get() *ByProjec } /** -* Checks if a Cart exists for a given Query Predicate. Returns a `200 OK` status if any Carts match the Query Predicate or a `404 Not Found` otherwise. +* Checks if a Cart exists for a Store that matches the given Query Predicate, and contains a matching `customerId` or `anonymousId`. Returns a `200 OK` status if any Carts match these conditions, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. +* */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyMeCartsRequestMethodHead { return &ByProjectKeyInStoreKeyByStoreKeyMeCartsRequestMethodHead{ @@ -38,9 +44,18 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsRequestBuilder) Head() *ByProje } /** +* +* Creates a Cart in a Store for the Customer or anonymous user. The `customerId` or `anonymousId` field on the Cart is automatically set based on the [customer:{id}](/scopes#customer_idid) or [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* * The `store` field in the created [Cart](ctp:api:type:Cart) is set to the Store specified by the `storeKey` path parameter. * -* Specific Error Codes: [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) +* Specific Error Codes: +* +* - [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) +* - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) +* - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsRequestBuilder) Post(body MyCartDraft) *ByProjectKeyInStoreKeyByStoreKeyMeCartsRequestMethodPost { diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_by_id.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_by_id.go index a53fe0c8..ce86570c 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_by_id.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_by_id.go @@ -13,6 +13,16 @@ type ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestBuilder struct { client *Client } +/** +* Returns a Cart for a given `id` in a Store. Returns a `200 OK` status if the Cart exists. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Cart exists in the Store for the given `id`. +* - If the Cart exists but does not belong to a Store, or the Cart's `store` field references a different Store. +* - If the Cart exists but does not have either a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* + */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestMethodGet { return &ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestMethodGet{ url: fmt.Sprintf("/%s/in-store/key=%s/me/carts/%s", rb.projectKey, rb.storeKey, rb.id), @@ -20,9 +30,6 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestBuilder) Get() *ByPr } } -/** -* Checks ifa My Cart exists for a given `id`. Returns a `200 OK` status if the My Cart exists or a `404 Not Found` otherwise. - */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestMethodHead { return &ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestMethodHead{ url: fmt.Sprintf("/%s/in-store/key=%s/me/carts/%s", rb.projectKey, rb.storeKey, rb.id), @@ -31,7 +38,13 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestBuilder) Head() *ByP } /** -* If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* Updates the Cart for a given `id` in a Store. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Cart exists in the Store for the given `id`. +* - If the Cart exists but does not belong to a Store, or the Cart's `store` field references a different Store. +* - If the Cart exists but does not have either a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestBuilder) Post(body MyCartUpdate) *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestMethodPost { @@ -42,6 +55,16 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestBuilder) Post(body M } } +/** +* Deletes the Cart for a given `id` in a Store. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Cart exists in the Store for the given `id`. +* - If the Cart exists in the Project but does not belong to a Store, or the Cart's `store` field references a different Store. +* - If the Cart exists in the Project but does not have either a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* + */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestBuilder) Delete() *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestMethodDelete { return &ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestMethodDelete{ url: fmt.Sprintf("/%s/in-store/key=%s/me/carts/%s", rb.projectKey, rb.storeKey, rb.id), diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_by_id_delete.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_by_id_delete.go index 42d737dd..c2aa7eab 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_by_id_delete.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_by_id_delete.go @@ -64,6 +64,17 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestMethodDelete) WithHe rb.headers = headers return rb } + +/** +* Deletes the Cart for a given `id` in a Store. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Cart exists in the Store for the given `id`. +* - If the Cart exists in the Project but does not belong to a Store, or the Cart's `store` field references a different Store. +* - If the Cart exists in the Project but does not have either a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* + */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestMethodDelete) Execute(ctx context.Context) (result *Cart, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_by_id_get.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_by_id_get.go index 94b5a22b..d167aefa 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_by_id_get.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_by_id_get.go @@ -53,6 +53,17 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestMethodGet) WithHeade rb.headers = headers return rb } + +/** +* Returns a Cart for a given `id` in a Store. Returns a `200 OK` status if the Cart exists. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Cart exists in the Store for the given `id`. +* - If the Cart exists but does not belong to a Store, or the Cart's `store` field references a different Store. +* - If the Cart exists but does not have either a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* + */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestMethodGet) Execute(ctx context.Context) (result *Cart, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_by_id_head.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_by_id_head.go index 9f25dc05..b3415122 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_by_id_head.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_by_id_head.go @@ -26,10 +26,6 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestMethodHead) WithHead rb.headers = headers return rb } - -/** -* Checks ifa My Cart exists for a given `id`. Returns a `200 OK` status if the My Cart exists or a `404 Not Found` otherwise. - */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} resp, err := rb.client.head( diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_by_id_post.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_by_id_post.go index 2a07c87d..799c8217 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_by_id_post.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_by_id_post.go @@ -56,7 +56,13 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestMethodPost) WithHead } /** -* If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* Updates the Cart for a given `id` in a Store. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Cart exists in the Store for the given `id`. +* - If the Cart exists but does not belong to a Store, or the Cart's `store` field references a different Store. +* - If the Cart exists but does not have either a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestMethodPost) Execute(ctx context.Context) (result *Cart, err error) { diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_get.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_get.go index c8ce5f15..08c1d4e3 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_get.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_get.go @@ -132,6 +132,11 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsRequestMethodGet) WithHeaders(h rb.headers = headers return rb } + +/** +* Returns all Carts that match a given Query Predicate and contain either a matching `customerId` or `anonymousId` in a Store. +* + */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsRequestMethodGet) Execute(ctx context.Context) (result *CartPagedQueryResponse, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_head.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_head.go index c894f256..29df4dff 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_head.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_head.go @@ -55,7 +55,8 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsRequestMethodHead) WithHeaders( } /** -* Checks if a Cart exists for a given Query Predicate. Returns a `200 OK` status if any Carts match the Query Predicate or a `404 Not Found` otherwise. +* Checks if a Cart exists for a Store that matches the given Query Predicate, and contains a matching `customerId` or `anonymousId`. Returns a `200 OK` status if any Carts match these conditions, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. +* */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsRequestMethodHead) Execute(ctx context.Context) error { var queryParams url.Values diff --git a/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_post.go b/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_post.go index 19ce166f..eed46365 100644 --- a/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_post.go +++ b/platform/client_carts_by_project_key_in_store_key_by_store_key_me_carts_post.go @@ -56,9 +56,18 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsRequestMethodPost) WithHeaders( } /** +* +* Creates a Cart in a Store for the Customer or anonymous user. The `customerId` or `anonymousId` field on the Cart is automatically set based on the [customer:{id}](/scopes#customer_idid) or [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* * The `store` field in the created [Cart](ctp:api:type:Cart) is set to the Store specified by the `storeKey` path parameter. * -* Specific Error Codes: [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) +* Specific Error Codes: +* +* - [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) +* - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) +* - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsRequestMethodPost) Execute(ctx context.Context) (result *Cart, err error) { diff --git a/platform/client_carts_by_project_key_me_carts.go b/platform/client_carts_by_project_key_me_carts.go index 550bf84a..6b8f711a 100644 --- a/platform/client_carts_by_project_key_me_carts.go +++ b/platform/client_carts_by_project_key_me_carts.go @@ -11,13 +11,6 @@ type ByProjectKeyMeCartsRequestBuilder struct { client *Client } -func (rb *ByProjectKeyMeCartsRequestBuilder) WithKey(key string) *ByProjectKeyMeCartsKeyByKeyRequestBuilder { - return &ByProjectKeyMeCartsKeyByKeyRequestBuilder{ - key: key, - projectKey: rb.projectKey, - client: rb.client, - } -} func (rb *ByProjectKeyMeCartsRequestBuilder) WithId(id string) *ByProjectKeyMeCartsByIDRequestBuilder { return &ByProjectKeyMeCartsByIDRequestBuilder{ id: id, @@ -31,6 +24,11 @@ func (rb *ByProjectKeyMeCartsRequestBuilder) Replicate() *ByProjectKeyMeCartsRep client: rb.client, } } + +/** +* Returns all Carts that match a given Query Predicate and contain either a matching `customerId` or `anonymousId`. +* + */ func (rb *ByProjectKeyMeCartsRequestBuilder) Get() *ByProjectKeyMeCartsRequestMethodGet { return &ByProjectKeyMeCartsRequestMethodGet{ url: fmt.Sprintf("/%s/me/carts", rb.projectKey), @@ -39,7 +37,8 @@ func (rb *ByProjectKeyMeCartsRequestBuilder) Get() *ByProjectKeyMeCartsRequestMe } /** -* Checks if a Cart exists for a given Query Predicate. Returns a `200 OK` status if any Carts match the Query Predicate or a `404 Not Found` otherwise. +* Checks if a Cart exists that matches a given Query Predicate and contains either a matching `customerId` or `anonymousId`. Returns a `200 OK` status if the Cart exists, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. +* */ func (rb *ByProjectKeyMeCartsRequestBuilder) Head() *ByProjectKeyMeCartsRequestMethodHead { return &ByProjectKeyMeCartsRequestMethodHead{ @@ -48,6 +47,18 @@ func (rb *ByProjectKeyMeCartsRequestBuilder) Head() *ByProjectKeyMeCartsRequestM } } +/** +* +* Creates a Cart for the Customer or anonymous user. The `customerId` or `anonymousId` field on the Cart is automatically set based on the [customer:{id}](/scopes#customer_idid) or [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* +* Specific Error Codes: +* +* - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) +* - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) +* + */ func (rb *ByProjectKeyMeCartsRequestBuilder) Post(body MyCartDraft) *ByProjectKeyMeCartsRequestMethodPost { return &ByProjectKeyMeCartsRequestMethodPost{ body: body, diff --git a/platform/client_carts_by_project_key_me_carts_by_id.go b/platform/client_carts_by_project_key_me_carts_by_id.go index 7704a235..4a4557b1 100644 --- a/platform/client_carts_by_project_key_me_carts_by_id.go +++ b/platform/client_carts_by_project_key_me_carts_by_id.go @@ -12,6 +12,15 @@ type ByProjectKeyMeCartsByIDRequestBuilder struct { client *Client } +/** +* Returns a Cart for a given `id`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Cart exists for a given `id`. +* - If the Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* + */ func (rb *ByProjectKeyMeCartsByIDRequestBuilder) Get() *ByProjectKeyMeCartsByIDRequestMethodGet { return &ByProjectKeyMeCartsByIDRequestMethodGet{ url: fmt.Sprintf("/%s/me/carts/%s", rb.projectKey, rb.id), @@ -20,7 +29,13 @@ func (rb *ByProjectKeyMeCartsByIDRequestBuilder) Get() *ByProjectKeyMeCartsByIDR } /** -* Checks if a Cart exists for a given `id`. Returns a `200 OK` status if the Cart exists or a `404 Not Found` otherwise. +* Checks if a Cart exists for a given `id`. Returns a `200 OK` status if the Cart exists. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Cart exists for a given `id`. +* - If the Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* */ func (rb *ByProjectKeyMeCartsByIDRequestBuilder) Head() *ByProjectKeyMeCartsByIDRequestMethodHead { return &ByProjectKeyMeCartsByIDRequestMethodHead{ @@ -29,6 +44,15 @@ func (rb *ByProjectKeyMeCartsByIDRequestBuilder) Head() *ByProjectKeyMeCartsByID } } +/** +* Updates the Cart for a given `id`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Cart exists for a given `id`. +* - If the Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* + */ func (rb *ByProjectKeyMeCartsByIDRequestBuilder) Post(body MyCartUpdate) *ByProjectKeyMeCartsByIDRequestMethodPost { return &ByProjectKeyMeCartsByIDRequestMethodPost{ body: body, @@ -37,6 +61,15 @@ func (rb *ByProjectKeyMeCartsByIDRequestBuilder) Post(body MyCartUpdate) *ByProj } } +/** +* Deletes the Cart for a given `id`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Cart exists for a given `id`. +* - If the Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* + */ func (rb *ByProjectKeyMeCartsByIDRequestBuilder) Delete() *ByProjectKeyMeCartsByIDRequestMethodDelete { return &ByProjectKeyMeCartsByIDRequestMethodDelete{ url: fmt.Sprintf("/%s/me/carts/%s", rb.projectKey, rb.id), diff --git a/platform/client_carts_by_project_key_me_carts_by_id_delete.go b/platform/client_carts_by_project_key_me_carts_by_id_delete.go index 282bdb4b..7315a302 100644 --- a/platform/client_carts_by_project_key_me_carts_by_id_delete.go +++ b/platform/client_carts_by_project_key_me_carts_by_id_delete.go @@ -64,6 +64,16 @@ func (rb *ByProjectKeyMeCartsByIDRequestMethodDelete) WithHeaders(headers http.H rb.headers = headers return rb } + +/** +* Deletes the Cart for a given `id`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Cart exists for a given `id`. +* - If the Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* + */ func (rb *ByProjectKeyMeCartsByIDRequestMethodDelete) Execute(ctx context.Context) (result *Cart, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_carts_by_project_key_me_carts_by_id_get.go b/platform/client_carts_by_project_key_me_carts_by_id_get.go index 8df7fd8f..cc4b8418 100644 --- a/platform/client_carts_by_project_key_me_carts_by_id_get.go +++ b/platform/client_carts_by_project_key_me_carts_by_id_get.go @@ -53,6 +53,16 @@ func (rb *ByProjectKeyMeCartsByIDRequestMethodGet) WithHeaders(headers http.Head rb.headers = headers return rb } + +/** +* Returns a Cart for a given `id`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Cart exists for a given `id`. +* - If the Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* + */ func (rb *ByProjectKeyMeCartsByIDRequestMethodGet) Execute(ctx context.Context) (result *Cart, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_carts_by_project_key_me_carts_by_id_head.go b/platform/client_carts_by_project_key_me_carts_by_id_head.go index 09cee9f8..393a22b6 100644 --- a/platform/client_carts_by_project_key_me_carts_by_id_head.go +++ b/platform/client_carts_by_project_key_me_carts_by_id_head.go @@ -28,7 +28,13 @@ func (rb *ByProjectKeyMeCartsByIDRequestMethodHead) WithHeaders(headers http.Hea } /** -* Checks if a Cart exists for a given `id`. Returns a `200 OK` status if the Cart exists or a `404 Not Found` otherwise. +* Checks if a Cart exists for a given `id`. Returns a `200 OK` status if the Cart exists. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Cart exists for a given `id`. +* - If the Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* */ func (rb *ByProjectKeyMeCartsByIDRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_carts_by_project_key_me_carts_by_id_post.go b/platform/client_carts_by_project_key_me_carts_by_id_post.go index 12a6dd1c..523ac1ca 100644 --- a/platform/client_carts_by_project_key_me_carts_by_id_post.go +++ b/platform/client_carts_by_project_key_me_carts_by_id_post.go @@ -54,6 +54,16 @@ func (rb *ByProjectKeyMeCartsByIDRequestMethodPost) WithHeaders(headers http.Hea rb.headers = headers return rb } + +/** +* Updates the Cart for a given `id`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Cart exists for a given `id`. +* - If the Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* + */ func (rb *ByProjectKeyMeCartsByIDRequestMethodPost) Execute(ctx context.Context) (result *Cart, err error) { data, err := serializeInput(rb.body) if err != nil { diff --git a/platform/client_carts_by_project_key_me_carts_get.go b/platform/client_carts_by_project_key_me_carts_get.go index 19cdf8ce..51aa3fec 100644 --- a/platform/client_carts_by_project_key_me_carts_get.go +++ b/platform/client_carts_by_project_key_me_carts_get.go @@ -132,6 +132,11 @@ func (rb *ByProjectKeyMeCartsRequestMethodGet) WithHeaders(headers http.Header) rb.headers = headers return rb } + +/** +* Returns all Carts that match a given Query Predicate and contain either a matching `customerId` or `anonymousId`. +* + */ func (rb *ByProjectKeyMeCartsRequestMethodGet) Execute(ctx context.Context) (result *CartPagedQueryResponse, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_carts_by_project_key_me_carts_head.go b/platform/client_carts_by_project_key_me_carts_head.go index 8d7fa05b..5e104566 100644 --- a/platform/client_carts_by_project_key_me_carts_head.go +++ b/platform/client_carts_by_project_key_me_carts_head.go @@ -55,7 +55,8 @@ func (rb *ByProjectKeyMeCartsRequestMethodHead) WithHeaders(headers http.Header) } /** -* Checks if a Cart exists for a given Query Predicate. Returns a `200 OK` status if any Carts match the Query Predicate or a `404 Not Found` otherwise. +* Checks if a Cart exists that matches a given Query Predicate and contains either a matching `customerId` or `anonymousId`. Returns a `200 OK` status if the Cart exists, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. +* */ func (rb *ByProjectKeyMeCartsRequestMethodHead) Execute(ctx context.Context) error { var queryParams url.Values diff --git a/platform/client_carts_by_project_key_me_carts_key_by_key.go b/platform/client_carts_by_project_key_me_carts_key_by_key.go deleted file mode 100644 index ae711a05..00000000 --- a/platform/client_carts_by_project_key_me_carts_key_by_key.go +++ /dev/null @@ -1,45 +0,0 @@ -package platform - -// Generated file, please do not change!!! - -import ( - "fmt" -) - -type ByProjectKeyMeCartsKeyByKeyRequestBuilder struct { - projectKey string - key string - client *Client -} - -func (rb *ByProjectKeyMeCartsKeyByKeyRequestBuilder) Get() *ByProjectKeyMeCartsKeyByKeyRequestMethodGet { - return &ByProjectKeyMeCartsKeyByKeyRequestMethodGet{ - url: fmt.Sprintf("/%s/me/carts/key=%s", rb.projectKey, rb.key), - client: rb.client, - } -} - -/** -* Checks if a Cart exists for a given `key`. Returns a `200 OK` status if the Cart exists or a `404 Not Found` otherwise. - */ -func (rb *ByProjectKeyMeCartsKeyByKeyRequestBuilder) Head() *ByProjectKeyMeCartsKeyByKeyRequestMethodHead { - return &ByProjectKeyMeCartsKeyByKeyRequestMethodHead{ - url: fmt.Sprintf("/%s/me/carts/key=%s", rb.projectKey, rb.key), - client: rb.client, - } -} - -func (rb *ByProjectKeyMeCartsKeyByKeyRequestBuilder) Post(body MyCartUpdate) *ByProjectKeyMeCartsKeyByKeyRequestMethodPost { - return &ByProjectKeyMeCartsKeyByKeyRequestMethodPost{ - body: body, - url: fmt.Sprintf("/%s/me/carts/key=%s", rb.projectKey, rb.key), - client: rb.client, - } -} - -func (rb *ByProjectKeyMeCartsKeyByKeyRequestBuilder) Delete() *ByProjectKeyMeCartsKeyByKeyRequestMethodDelete { - return &ByProjectKeyMeCartsKeyByKeyRequestMethodDelete{ - url: fmt.Sprintf("/%s/me/carts/key=%s", rb.projectKey, rb.key), - client: rb.client, - } -} diff --git a/platform/client_carts_by_project_key_me_carts_post.go b/platform/client_carts_by_project_key_me_carts_post.go index ebe5776c..97591e7f 100644 --- a/platform/client_carts_by_project_key_me_carts_post.go +++ b/platform/client_carts_by_project_key_me_carts_post.go @@ -54,6 +54,19 @@ func (rb *ByProjectKeyMeCartsRequestMethodPost) WithHeaders(headers http.Header) rb.headers = headers return rb } + +/** +* +* Creates a Cart for the Customer or anonymous user. The `customerId` or `anonymousId` field on the Cart is automatically set based on the [customer:{id}](/scopes#customer_idid) or [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* +* Specific Error Codes: +* +* - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) +* - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) +* + */ func (rb *ByProjectKeyMeCartsRequestMethodPost) Execute(ctx context.Context) (result *Cart, err error) { data, err := serializeInput(rb.body) if err != nil { diff --git a/platform/client_channels_by_project_key_channels_by_id.go b/platform/client_channels_by_project_key_channels_by_id.go index e405c072..0df3ad78 100644 --- a/platform/client_channels_by_project_key_channels_by_id.go +++ b/platform/client_channels_by_project_key_channels_by_id.go @@ -37,6 +37,10 @@ func (rb *ByProjectKeyChannelsByIDRequestBuilder) Post(body ChannelUpdate) *ByPr } } +/** +* Returns a [ReferenceExists](ctp:api:type:ReferenceExistsError) error if other resources reference the Channel to be deleted. +* + */ func (rb *ByProjectKeyChannelsByIDRequestBuilder) Delete() *ByProjectKeyChannelsByIDRequestMethodDelete { return &ByProjectKeyChannelsByIDRequestMethodDelete{ url: fmt.Sprintf("/%s/channels/%s", rb.projectKey, rb.id), diff --git a/platform/client_channels_by_project_key_channels_by_id_delete.go b/platform/client_channels_by_project_key_channels_by_id_delete.go index 0a24ec41..dde7dedc 100644 --- a/platform/client_channels_by_project_key_channels_by_id_delete.go +++ b/platform/client_channels_by_project_key_channels_by_id_delete.go @@ -64,6 +64,11 @@ func (rb *ByProjectKeyChannelsByIDRequestMethodDelete) WithHeaders(headers http. rb.headers = headers return rb } + +/** +* Returns a [ReferenceExists](ctp:api:type:ReferenceExistsError) error if other resources reference the Channel to be deleted. +* + */ func (rb *ByProjectKeyChannelsByIDRequestMethodDelete) Execute(ctx context.Context) (result *Channel, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_confirm_by_project_key_in_store_key_by_store_key_me_email_confirm.go b/platform/client_confirm_by_project_key_in_store_key_by_store_key_me_email_confirm.go index 4d7f6455..c60652e7 100644 --- a/platform/client_confirm_by_project_key_in_store_key_by_store_key_me_email_confirm.go +++ b/platform/client_confirm_by_project_key_in_store_key_by_store_key_me_email_confirm.go @@ -13,7 +13,12 @@ type ByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmRequestBuilder struct { } /** -* This is the last step in the [email verification process of a Customer](/../api/projects/customers#email-verification-of-customer-in-store). +* This is the last step in the [email verification process of a Customer](/../api/projects/customers#email-verification-of-customer-in-store). Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Customer exists with the `id` specified in the [customer:{id}](/scopes#customer_idid) scope. +* - If the Customer exists but is associated with a different Store than what is specified in the `manage_my_profile:{projectKey}:{storeKey}` scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmRequestBuilder) Post(body MyCustomerEmailVerify) *ByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmRequestMethodPost { diff --git a/platform/client_confirm_by_project_key_in_store_key_by_store_key_me_email_confirm_post.go b/platform/client_confirm_by_project_key_in_store_key_by_store_key_me_email_confirm_post.go index 66020802..8c2c7d9e 100644 --- a/platform/client_confirm_by_project_key_in_store_key_by_store_key_me_email_confirm_post.go +++ b/platform/client_confirm_by_project_key_in_store_key_by_store_key_me_email_confirm_post.go @@ -29,7 +29,12 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmRequestMethodPost) WithH } /** -* This is the last step in the [email verification process of a Customer](/../api/projects/customers#email-verification-of-customer-in-store). +* This is the last step in the [email verification process of a Customer](/../api/projects/customers#email-verification-of-customer-in-store). Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Customer exists with the `id` specified in the [customer:{id}](/scopes#customer_idid) scope. +* - If the Customer exists but is associated with a different Store than what is specified in the `manage_my_profile:{projectKey}:{storeKey}` scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeEmailConfirmRequestMethodPost) Execute(ctx context.Context) (result *Customer, err error) { diff --git a/platform/client_customers_by_project_key_customers.go b/platform/client_customers_by_project_key_customers.go index 6f72d11e..12397465 100644 --- a/platform/client_customers_by_project_key_customers.go +++ b/platform/client_customers_by_project_key_customers.go @@ -73,6 +73,28 @@ func (rb *ByProjectKeyCustomersRequestBuilder) WithId(id string) *ByProjectKeyCu client: rb.client, } } + +/** +* This endpoint provides high-performance search queries over Customers. +* + */ +func (rb *ByProjectKeyCustomersRequestBuilder) Search() *ByProjectKeyCustomersSearchRequestBuilder { + return &ByProjectKeyCustomersSearchRequestBuilder{ + projectKey: rb.projectKey, + client: rb.client, + } +} + +/** +* This endpoint provides information on the status of a Customer search for a project +* + */ +func (rb *ByProjectKeyCustomersRequestBuilder) SearchIndexingStatus() *ByProjectKeyCustomersSearchIndexingStatusRequestBuilder { + return &ByProjectKeyCustomersSearchIndexingStatusRequestBuilder{ + projectKey: rb.projectKey, + client: rb.client, + } +} func (rb *ByProjectKeyCustomersRequestBuilder) Get() *ByProjectKeyCustomersRequestMethodGet { return &ByProjectKeyCustomersRequestMethodGet{ url: fmt.Sprintf("/%s/customers", rb.projectKey), @@ -93,7 +115,8 @@ func (rb *ByProjectKeyCustomersRequestBuilder) Head() *ByProjectKeyCustomersRequ /** * If the `anonymousCart` field is set on the [CustomerDraft](ctp:api:type:CustomerDraft), then the newly created Customer will be assigned to that [Cart](ctp:api:type:Cart). * Similarly, if the `anonymousId` field is set, the Customer will be set on all [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [ShoppingLists](ctp:api:type:ShoppingList) and [Payments](ctp:api:type:Payment) with the same `anonymousId`. -* Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. +* +* Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. Simultaneously creating two Customers with the same email address can return a [LockedField](ctp:api:type:LockedFieldError) error. * */ func (rb *ByProjectKeyCustomersRequestBuilder) Post(body CustomerDraft) *ByProjectKeyCustomersRequestMethodPost { diff --git a/platform/client_customers_by_project_key_customers_by_id.go b/platform/client_customers_by_project_key_customers_by_id.go index 2439c898..0f500aa6 100644 --- a/platform/client_customers_by_project_key_customers_by_id.go +++ b/platform/client_customers_by_project_key_customers_by_id.go @@ -29,6 +29,9 @@ func (rb *ByProjectKeyCustomersByIDRequestBuilder) Head() *ByProjectKeyCustomers } } +/** +* Simultaneously updating two Customers with the same email address can return a [LockedField](ctp:api:type:LockedFieldError) error. + */ func (rb *ByProjectKeyCustomersByIDRequestBuilder) Post(body CustomerUpdate) *ByProjectKeyCustomersByIDRequestMethodPost { return &ByProjectKeyCustomersByIDRequestMethodPost{ body: body, diff --git a/platform/client_customers_by_project_key_customers_by_id_post.go b/platform/client_customers_by_project_key_customers_by_id_post.go index 3394a55f..9be6ab22 100644 --- a/platform/client_customers_by_project_key_customers_by_id_post.go +++ b/platform/client_customers_by_project_key_customers_by_id_post.go @@ -54,6 +54,10 @@ func (rb *ByProjectKeyCustomersByIDRequestMethodPost) WithHeaders(headers http.H rb.headers = headers return rb } + +/** +* Simultaneously updating two Customers with the same email address can return a [LockedField](ctp:api:type:LockedFieldError) error. + */ func (rb *ByProjectKeyCustomersByIDRequestMethodPost) Execute(ctx context.Context) (result *Customer, err error) { data, err := serializeInput(rb.body) if err != nil { diff --git a/platform/client_customers_by_project_key_customers_key_by_key.go b/platform/client_customers_by_project_key_customers_key_by_key.go index f6824e4f..80b2ba1a 100644 --- a/platform/client_customers_by_project_key_customers_key_by_key.go +++ b/platform/client_customers_by_project_key_customers_key_by_key.go @@ -29,6 +29,9 @@ func (rb *ByProjectKeyCustomersKeyByKeyRequestBuilder) Head() *ByProjectKeyCusto } } +/** +* Simultaneously updating two Customers with the same email address can return a [LockedField](ctp:api:type:LockedFieldError) error. + */ func (rb *ByProjectKeyCustomersKeyByKeyRequestBuilder) Post(body CustomerUpdate) *ByProjectKeyCustomersKeyByKeyRequestMethodPost { return &ByProjectKeyCustomersKeyByKeyRequestMethodPost{ body: body, diff --git a/platform/client_customers_by_project_key_customers_key_by_key_post.go b/platform/client_customers_by_project_key_customers_key_by_key_post.go index 386b0be7..4654112a 100644 --- a/platform/client_customers_by_project_key_customers_key_by_key_post.go +++ b/platform/client_customers_by_project_key_customers_key_by_key_post.go @@ -54,6 +54,10 @@ func (rb *ByProjectKeyCustomersKeyByKeyRequestMethodPost) WithHeaders(headers ht rb.headers = headers return rb } + +/** +* Simultaneously updating two Customers with the same email address can return a [LockedField](ctp:api:type:LockedFieldError) error. + */ func (rb *ByProjectKeyCustomersKeyByKeyRequestMethodPost) Execute(ctx context.Context) (result *Customer, err error) { data, err := serializeInput(rb.body) if err != nil { diff --git a/platform/client_customers_by_project_key_customers_post.go b/platform/client_customers_by_project_key_customers_post.go index cb24b1e9..4b149eee 100644 --- a/platform/client_customers_by_project_key_customers_post.go +++ b/platform/client_customers_by_project_key_customers_post.go @@ -58,7 +58,8 @@ func (rb *ByProjectKeyCustomersRequestMethodPost) WithHeaders(headers http.Heade /** * If the `anonymousCart` field is set on the [CustomerDraft](ctp:api:type:CustomerDraft), then the newly created Customer will be assigned to that [Cart](ctp:api:type:Cart). * Similarly, if the `anonymousId` field is set, the Customer will be set on all [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [ShoppingLists](ctp:api:type:ShoppingList) and [Payments](ctp:api:type:Payment) with the same `anonymousId`. -* Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. +* +* Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. Simultaneously creating two Customers with the same email address can return a [LockedField](ctp:api:type:LockedFieldError) error. * */ func (rb *ByProjectKeyCustomersRequestMethodPost) Execute(ctx context.Context) (result *CustomerSignInResult, err error) { diff --git a/platform/client_customers_by_project_key_in_store_key_by_store_key_customers.go b/platform/client_customers_by_project_key_in_store_key_by_store_key_customers.go index 59b2d542..1008a628 100644 --- a/platform/client_customers_by_project_key_in_store_key_by_store_key_customers.go +++ b/platform/client_customers_by_project_key_in_store_key_by_store_key_customers.go @@ -87,7 +87,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCustomersRequestBuilder) Get() *ByProj } /** -* Checks if a Customer exists for a given Query Predicate. Returns a `200 OK` status if any Customers match the Query Predicate or a `404 Not Found` otherwise. +* Checks if a Customer exists for a given Query Predicate. Returns a `200 OK` status if any Customers match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCustomersRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyCustomersRequestMethodHead { return &ByProjectKeyInStoreKeyByStoreKeyCustomersRequestMethodHead{ @@ -102,7 +102,8 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCustomersRequestBuilder) Head() *ByPro * If the `anonymousCart` field is set on the [CustomerDraft](ctp:api:type:CustomerDraft), then the newly created Customer will be assigned to that [Cart](ctp:api:type:Cart). * Similarly, if the `anonymousId` field is set, the Customer will be set on all [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [ShoppingLists](ctp:api:type:ShoppingList) and [Payments](ctp:api:type:Payment) with the same `anonymousId`. * If a Cart with a `store` field specified, the `store` field must reference the same [Store](ctp:api:type:Store) specified in the `{storeKey}` path parameter. -* Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. +* +* Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. Simultaneously creating two Customers with the same email address can return a [LockedField](ctp:api:type:LockedFieldError) error. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCustomersRequestBuilder) Post(body CustomerDraft) *ByProjectKeyInStoreKeyByStoreKeyCustomersRequestMethodPost { diff --git a/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_by_id.go b/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_by_id.go index 5ab46b8c..4ddff21f 100644 --- a/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_by_id.go +++ b/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_by_id.go @@ -36,6 +36,8 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCustomersByIDRequestBuilder) Head() *B /** * If the Customer exists in the Project but the `stores` field references a different [Store](ctp:api:type:Store), this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* +* Simultaneously updating two Customers with the same email address can return a [LockedField](ctp:api:type:LockedFieldError) error. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCustomersByIDRequestBuilder) Post(body CustomerUpdate) *ByProjectKeyInStoreKeyByStoreKeyCustomersByIDRequestMethodPost { diff --git a/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_by_id_post.go b/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_by_id_post.go index 7e833832..474b8602 100644 --- a/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_by_id_post.go +++ b/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_by_id_post.go @@ -57,6 +57,8 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCustomersByIDRequestMethodPost) WithHe /** * If the Customer exists in the Project but the `stores` field references a different [Store](ctp:api:type:Store), this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* +* Simultaneously updating two Customers with the same email address can return a [LockedField](ctp:api:type:LockedFieldError) error. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCustomersByIDRequestMethodPost) Execute(ctx context.Context) (result *Customer, err error) { diff --git a/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_head.go b/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_head.go index d8655bd5..3a0a588f 100644 --- a/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_head.go +++ b/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_head.go @@ -55,7 +55,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCustomersRequestMethodHead) WithHeader } /** -* Checks if a Customer exists for a given Query Predicate. Returns a `200 OK` status if any Customers match the Query Predicate or a `404 Not Found` otherwise. +* Checks if a Customer exists for a given Query Predicate. Returns a `200 OK` status if any Customers match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCustomersRequestMethodHead) Execute(ctx context.Context) error { var queryParams url.Values diff --git a/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_key_by_key.go b/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_key_by_key.go index 8c4b3d72..5ddce599 100644 --- a/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_key_by_key.go +++ b/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_key_by_key.go @@ -36,6 +36,8 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyRequestBuilder) Head( /** * If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* +* Simultaneously updating two Customers with the same email address can return a [LockedField](ctp:api:type:LockedFieldError) error. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyRequestBuilder) Post(body CustomerUpdate) *ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyRequestMethodPost { diff --git a/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_key_by_key_post.go b/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_key_by_key_post.go index 8ca03f18..d3940ee9 100644 --- a/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_key_by_key_post.go +++ b/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_key_by_key_post.go @@ -57,6 +57,8 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyRequestMethodPost) Wi /** * If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* +* Simultaneously updating two Customers with the same email address can return a [LockedField](ctp:api:type:LockedFieldError) error. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyRequestMethodPost) Execute(ctx context.Context) (result *Customer, err error) { diff --git a/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_post.go b/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_post.go index b1e00fdd..1426f7e6 100644 --- a/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_post.go +++ b/platform/client_customers_by_project_key_in_store_key_by_store_key_customers_post.go @@ -61,7 +61,8 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCustomersRequestMethodPost) WithHeader * If the `anonymousCart` field is set on the [CustomerDraft](ctp:api:type:CustomerDraft), then the newly created Customer will be assigned to that [Cart](ctp:api:type:Cart). * Similarly, if the `anonymousId` field is set, the Customer will be set on all [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [ShoppingLists](ctp:api:type:ShoppingList) and [Payments](ctp:api:type:Payment) with the same `anonymousId`. * If a Cart with a `store` field specified, the `store` field must reference the same [Store](ctp:api:type:Store) specified in the `{storeKey}` path parameter. -* Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. +* +* Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. Simultaneously creating two Customers with the same email address can return a [LockedField](ctp:api:type:LockedFieldError) error. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCustomersRequestMethodPost) Execute(ctx context.Context) (result *CustomerSignInResult, err error) { diff --git a/platform/client_edits_by_project_key_orders_edits.go b/platform/client_edits_by_project_key_orders_edits.go index e8eca32a..cd6aaf9f 100644 --- a/platform/client_edits_by_project_key_orders_edits.go +++ b/platform/client_edits_by_project_key_orders_edits.go @@ -44,6 +44,8 @@ func (rb *ByProjectKeyOrdersEditsRequestBuilder) Head() *ByProjectKeyOrdersEdits /** * You can either create multiple Order Edits for an Order and apply them sequentially to an Order, or create multiple Order Edits parallelly (as alternatives to each other) and apply one of them to the Order. +* +* You can only create an Order Edit if the [InventoryMode](/projects/carts#inventorymode) of the Order and its [LineItems](/projects/carts#lineitem) is `None`. * */ func (rb *ByProjectKeyOrdersEditsRequestBuilder) Post(body OrderEditDraft) *ByProjectKeyOrdersEditsRequestMethodPost { diff --git a/platform/client_edits_by_project_key_orders_edits_post.go b/platform/client_edits_by_project_key_orders_edits_post.go index 0094e2b3..8fb00cc6 100644 --- a/platform/client_edits_by_project_key_orders_edits_post.go +++ b/platform/client_edits_by_project_key_orders_edits_post.go @@ -57,6 +57,8 @@ func (rb *ByProjectKeyOrdersEditsRequestMethodPost) WithHeaders(headers http.Hea /** * You can either create multiple Order Edits for an Order and apply them sequentially to an Order, or create multiple Order Edits parallelly (as alternatives to each other) and apply one of them to the Order. +* +* You can only create an Order Edit if the [InventoryMode](/projects/carts#inventorymode) of the Order and its [LineItems](/projects/carts#lineitem) is `None`. * */ func (rb *ByProjectKeyOrdersEditsRequestMethodPost) Execute(ctx context.Context) (result *OrderEdit, err error) { diff --git a/platform/client_images_by_project_key_in_store_key_by_store_key_products_by_product_id_product_tailoring_images.go b/platform/client_images_by_project_key_in_store_key_by_store_key_products_by_product_id_product_tailoring_images.go new file mode 100644 index 00000000..decbce3b --- /dev/null +++ b/platform/client_images_by_project_key_in_store_key_by_store_key_products_by_product_id_product_tailoring_images.go @@ -0,0 +1,27 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "fmt" + "io" +) + +type ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestBuilder struct { + projectKey string + storeKey string + productId string + client *Client +} + +/** +* Upload a JPEG, PNG and GIF file to a [ProductTailoringVariant](ctp:api:type:ProductTailoringVariant). The maximum file size of the image is 10MB. `variant` or `sku` is required to update a specific ProductVariant. Produces the [ProductTailoringImageAdded](/projects/messages#product-tailoring-image-added) Message when the `Small` version of the image has been uploaded to the CDN. +* + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestBuilder) Post(body io.Reader) *ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPost { + return &ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPost{ + body: body, + url: fmt.Sprintf("/%s/in-store/key=%s/products/%s/product-tailoring/images", rb.projectKey, rb.storeKey, rb.productId), + client: rb.client, + } +} diff --git a/platform/client_images_by_project_key_in_store_key_by_store_key_products_by_product_id_product_tailoring_images_post.go b/platform/client_images_by_project_key_in_store_key_by_store_key_products_by_product_id_product_tailoring_images_post.go new file mode 100644 index 00000000..6a66a7cb --- /dev/null +++ b/platform/client_images_by_project_key_in_store_key_by_store_key_products_by_product_id_product_tailoring_images_post.go @@ -0,0 +1,144 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io" + "io/ioutil" + "net/http" + "net/url" + "strconv" +) + +type ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPost struct { + body io.Reader + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPostInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPost) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPostInput struct { + Filename *string + Variant *int + Sku *string + Staged *bool +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPostInput) Values() url.Values { + values := url.Values{} + if input.Filename != nil { + values.Add("filename", fmt.Sprintf("%v", *input.Filename)) + } + if input.Variant != nil { + values.Add("variant", strconv.Itoa(*input.Variant)) + } + if input.Sku != nil { + values.Add("sku", fmt.Sprintf("%v", *input.Sku)) + } + if input.Staged != nil { + if *input.Staged { + values.Add("staged", "true") + } else { + values.Add("staged", "false") + } + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPost) Filename(v string) *ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPost { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPostInput{} + } + rb.params.Filename = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPost) Variant(v int) *ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPost { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPostInput{} + } + rb.params.Variant = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPost) Sku(v string) *ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPost { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPostInput{} + } + rb.params.Sku = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPost) Staged(v bool) *ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPost { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPostInput{} + } + rb.params.Staged = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPost) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPostInput) *ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPost { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPost) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPost { + rb.headers = headers + return rb +} + +/** +* Upload a JPEG, PNG and GIF file to a [ProductTailoringVariant](ctp:api:type:ProductTailoringVariant). The maximum file size of the image is 10MB. `variant` or `sku` is required to update a specific ProductVariant. Produces the [ProductTailoringImageAdded](/projects/messages#product-tailoring-image-added) Message when the `Small` version of the image has been uploaded to the CDN. +* + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestMethodPost) Execute(ctx context.Context) (result *ProductTailoring, err error) { + data := rb.body + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.post( + ctx, + rb.url, + queryParams, + rb.headers, + data, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_images_by_project_key_in_store_key_by_store_key_products_key_by_product_key_product_tailoring_images.go b/platform/client_images_by_project_key_in_store_key_by_store_key_products_key_by_product_key_product_tailoring_images.go new file mode 100644 index 00000000..b2945716 --- /dev/null +++ b/platform/client_images_by_project_key_in_store_key_by_store_key_products_key_by_product_key_product_tailoring_images.go @@ -0,0 +1,27 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "fmt" + "io" +) + +type ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestBuilder struct { + projectKey string + storeKey string + productKey string + client *Client +} + +/** +* Upload a JPEG, PNG and GIF file to a [ProductTailoringVariant](ctp:api:type:ProductTailoringVariant). The maximum file size of the image is 10MB. `variant` or `sku` is required to update a specific ProductVariant. Produces the [ProductTailoringImageAdded](/projects/messages#product-tailoring-image-added) Message when the `Small` version of the image has been uploaded to the CDN. +* + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestBuilder) Post(body io.Reader) *ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPost { + return &ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPost{ + body: body, + url: fmt.Sprintf("/%s/in-store/key=%s/products/key=%s/product-tailoring/images", rb.projectKey, rb.storeKey, rb.productKey), + client: rb.client, + } +} diff --git a/platform/client_images_by_project_key_in_store_key_by_store_key_products_key_by_product_key_product_tailoring_images_post.go b/platform/client_images_by_project_key_in_store_key_by_store_key_products_key_by_product_key_product_tailoring_images_post.go new file mode 100644 index 00000000..f987eaf7 --- /dev/null +++ b/platform/client_images_by_project_key_in_store_key_by_store_key_products_key_by_product_key_product_tailoring_images_post.go @@ -0,0 +1,144 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io" + "io/ioutil" + "net/http" + "net/url" + "strconv" +) + +type ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPost struct { + body io.Reader + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPostInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPost) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPostInput struct { + Filename *string + Variant *int + Sku *string + Staged *bool +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPostInput) Values() url.Values { + values := url.Values{} + if input.Filename != nil { + values.Add("filename", fmt.Sprintf("%v", *input.Filename)) + } + if input.Variant != nil { + values.Add("variant", strconv.Itoa(*input.Variant)) + } + if input.Sku != nil { + values.Add("sku", fmt.Sprintf("%v", *input.Sku)) + } + if input.Staged != nil { + if *input.Staged { + values.Add("staged", "true") + } else { + values.Add("staged", "false") + } + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPost) Filename(v string) *ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPost { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPostInput{} + } + rb.params.Filename = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPost) Variant(v int) *ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPost { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPostInput{} + } + rb.params.Variant = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPost) Sku(v string) *ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPost { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPostInput{} + } + rb.params.Sku = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPost) Staged(v bool) *ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPost { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPostInput{} + } + rb.params.Staged = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPost) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPostInput) *ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPost { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPost) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPost { + rb.headers = headers + return rb +} + +/** +* Upload a JPEG, PNG and GIF file to a [ProductTailoringVariant](ctp:api:type:ProductTailoringVariant). The maximum file size of the image is 10MB. `variant` or `sku` is required to update a specific ProductVariant. Produces the [ProductTailoringImageAdded](/projects/messages#product-tailoring-image-added) Message when the `Small` version of the image has been uploaded to the CDN. +* + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestMethodPost) Execute(ctx context.Context) (result *ProductTailoring, err error) { + data := rb.body + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.post( + ctx, + rb.url, + queryParams, + rb.headers, + data, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_in_store_by_project_key_in_store_key_by_store_key.go b/platform/client_in_store_by_project_key_in_store_key_by_store_key.go index 6abed3c8..b5a4b445 100644 --- a/platform/client_in_store_by_project_key_in_store_key_by_store_key.go +++ b/platform/client_in_store_by_project_key_in_store_key_by_store_key.go @@ -118,3 +118,36 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyRequestBuilder) Products() *ByProjectK client: rb.client, } } + +/** +* A request for a Quote holds product variants and can be ordered. + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyRequestBuilder) QuoteRequests() *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestBuilder { + return &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestBuilder{ + projectKey: rb.projectKey, + storeKey: rb.storeKey, + client: rb.client, + } +} + +/** +* A staged quote holds the negotiation between the [Buyer](/../api/quotes-overview#buyer) and the [Seller](/../api/quotes-overview#seller). + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyRequestBuilder) StagedQuotes() *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestBuilder { + return &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestBuilder{ + projectKey: rb.projectKey, + storeKey: rb.storeKey, + client: rb.client, + } +} + +/** +* A quote holds the negotiated offer. + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyRequestBuilder) Quotes() *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestBuilder { + return &ByProjectKeyInStoreKeyByStoreKeyQuotesRequestBuilder{ + projectKey: rb.projectKey, + storeKey: rb.storeKey, + client: rb.client, + } +} diff --git a/platform/client_indexing_status_by_project_key_customers_search_indexing_status.go b/platform/client_indexing_status_by_project_key_customers_search_indexing_status.go new file mode 100644 index 00000000..f490c6ee --- /dev/null +++ b/platform/client_indexing_status_by_project_key_customers_search_indexing_status.go @@ -0,0 +1,19 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "fmt" +) + +type ByProjectKeyCustomersSearchIndexingStatusRequestBuilder struct { + projectKey string + client *Client +} + +func (rb *ByProjectKeyCustomersSearchIndexingStatusRequestBuilder) Get() *ByProjectKeyCustomersSearchIndexingStatusRequestMethodGet { + return &ByProjectKeyCustomersSearchIndexingStatusRequestMethodGet{ + url: fmt.Sprintf("/%s/customers/search/indexing-status", rb.projectKey), + client: rb.client, + } +} diff --git a/platform/client_indexing_status_by_project_key_customers_search_indexing_status_get.go b/platform/client_indexing_status_by_project_key_customers_search_indexing_status_get.go new file mode 100644 index 00000000..f18136dc --- /dev/null +++ b/platform/client_indexing_status_by_project_key_customers_search_indexing_status_get.go @@ -0,0 +1,106 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyCustomersSearchIndexingStatusRequestMethodGet struct { + url string + client *Client + headers http.Header +} + +func (r *ByProjectKeyCustomersSearchIndexingStatusRequestMethodGet) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + } +} + +func (rb *ByProjectKeyCustomersSearchIndexingStatusRequestMethodGet) WithHeaders(headers http.Header) *ByProjectKeyCustomersSearchIndexingStatusRequestMethodGet { + rb.headers = headers + return rb +} +func (rb *ByProjectKeyCustomersSearchIndexingStatusRequestMethodGet) Execute(ctx context.Context) (result *CustomerSearchIndexingStatusResponse, err error) { + queryParams := url.Values{} + resp, err := rb.client.get( + ctx, + rb.url, + queryParams, + rb.headers, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 404: + return nil, ErrNotFound + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_login_by_project_key_in_store_key_by_store_key_login.go b/platform/client_login_by_project_key_in_store_key_by_store_key_login.go index fcffbd1a..31f60291 100644 --- a/platform/client_login_by_project_key_in_store_key_by_store_key_login.go +++ b/platform/client_login_by_project_key_in_store_key_by_store_key_login.go @@ -15,6 +15,8 @@ type ByProjectKeyInStoreKeyByStoreKeyLoginRequestBuilder struct { /** * Authenticates a Customer associated with a [Store](ctp:api:type:Store). For more information, see [Global versus Store-specific Customers](/../api/customers-overview#global-versus-store-specific-customers). * +* A Cart returned in the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) has any invalid Line Items removed and is [updated](/api/carts-orders-overview#cart-updates) with the latest prices, taxes, and discounts. During these updates, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError). +* * Triggers [Cart merge during sign-in](/../api/customers-overview#cart-merge-during-sign-in). * * If the Customer exists in the Project but the `stores` field references a different [Store](ctp:api:type:Store), this method returns an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error. diff --git a/platform/client_login_by_project_key_in_store_key_by_store_key_login_post.go b/platform/client_login_by_project_key_in_store_key_by_store_key_login_post.go index 0986dc45..01c93dcf 100644 --- a/platform/client_login_by_project_key_in_store_key_by_store_key_login_post.go +++ b/platform/client_login_by_project_key_in_store_key_by_store_key_login_post.go @@ -31,6 +31,8 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyLoginRequestMethodPost) WithHeaders(he /** * Authenticates a Customer associated with a [Store](ctp:api:type:Store). For more information, see [Global versus Store-specific Customers](/../api/customers-overview#global-versus-store-specific-customers). * +* A Cart returned in the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) has any invalid Line Items removed and is [updated](/api/carts-orders-overview#cart-updates) with the latest prices, taxes, and discounts. During these updates, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError). +* * Triggers [Cart merge during sign-in](/../api/customers-overview#cart-merge-during-sign-in). * * If the Customer exists in the Project but the `stores` field references a different [Store](ctp:api:type:Store), this method returns an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error. diff --git a/platform/client_login_by_project_key_in_store_key_by_store_key_me_login.go b/platform/client_login_by_project_key_in_store_key_by_store_key_me_login.go index df6bb3c1..7e76180c 100644 --- a/platform/client_login_by_project_key_in_store_key_by_store_key_me_login.go +++ b/platform/client_login_by_project_key_in_store_key_by_store_key_me_login.go @@ -13,12 +13,15 @@ type ByProjectKeyInStoreKeyByStoreKeyMeLoginRequestBuilder struct { } /** +* * Retrieves the authenticated Customer (that matches the given email/password pair) if they are part of a specific [Store](ctp:api:type:Store). * +* If used with an optional [access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the `anonymousId` are assigned to the newly logged-in Customer. +* * - If the Customer does not have a Cart, the most recently modified anonymous cart becomes the Customer's Cart. * - If the Customer already has a Cart, the most recently modified anonymous cart is handled according to [AnonymousCartSignInMode](ctp:api:type:AnonymousCartSignInMode). * -* If a Cart is returned as part of [CustomerSignInResult](ctp:api:type:CustomerSignInResult), it has been [recalculated](ctp:api:type:MyCartRecalculateAction) with up-to-date prices, taxes, discounts, and invalid line items removed. +* A Cart returned in the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) has any invalid Line Items removed and is [updated](/api/carts-orders-overview#cart-updates) with the latest prices, taxes, and discounts. During these updates, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError). * * If an account with the given credentials is not found, an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error is returned. * diff --git a/platform/client_login_by_project_key_in_store_key_by_store_key_me_login_post.go b/platform/client_login_by_project_key_in_store_key_by_store_key_me_login_post.go index 754c3204..2c14e2ae 100644 --- a/platform/client_login_by_project_key_in_store_key_by_store_key_me_login_post.go +++ b/platform/client_login_by_project_key_in_store_key_by_store_key_me_login_post.go @@ -29,12 +29,15 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeLoginRequestMethodPost) WithHeaders( } /** +* * Retrieves the authenticated Customer (that matches the given email/password pair) if they are part of a specific [Store](ctp:api:type:Store). * +* If used with an optional [access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the `anonymousId` are assigned to the newly logged-in Customer. +* * - If the Customer does not have a Cart, the most recently modified anonymous cart becomes the Customer's Cart. * - If the Customer already has a Cart, the most recently modified anonymous cart is handled according to [AnonymousCartSignInMode](ctp:api:type:AnonymousCartSignInMode). * -* If a Cart is returned as part of [CustomerSignInResult](ctp:api:type:CustomerSignInResult), it has been [recalculated](ctp:api:type:MyCartRecalculateAction) with up-to-date prices, taxes, discounts, and invalid line items removed. +* A Cart returned in the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) has any invalid Line Items removed and is [updated](/api/carts-orders-overview#cart-updates) with the latest prices, taxes, and discounts. During these updates, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError). * * If an account with the given credentials is not found, an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error is returned. * diff --git a/platform/client_login_by_project_key_login.go b/platform/client_login_by_project_key_login.go index a47e51ed..4d977721 100644 --- a/platform/client_login_by_project_key_login.go +++ b/platform/client_login_by_project_key_login.go @@ -18,6 +18,8 @@ type ByProjectKeyLoginRequestBuilder struct { * * Triggers [Cart merge during sign-in](/../api/customers-overview#cart-merge-during-sign-in). * +* A Cart returned in the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) has any invalid Line Items removed and is [updated](/api/carts-orders-overview#cart-updates) with the latest prices, taxes, and discounts. During these updates, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError). +* * If an account with the given credentials is not found, an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error is returned. * */ diff --git a/platform/client_login_by_project_key_login_post.go b/platform/client_login_by_project_key_login_post.go index 829051af..cbacaa27 100644 --- a/platform/client_login_by_project_key_login_post.go +++ b/platform/client_login_by_project_key_login_post.go @@ -35,6 +35,8 @@ func (rb *ByProjectKeyLoginRequestMethodPost) WithHeaders(headers http.Header) * * * Triggers [Cart merge during sign-in](/../api/customers-overview#cart-merge-during-sign-in). * +* A Cart returned in the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) has any invalid Line Items removed and is [updated](/api/carts-orders-overview#cart-updates) with the latest prices, taxes, and discounts. During these updates, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError). +* * If an account with the given credentials is not found, an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error is returned. * */ diff --git a/platform/client_login_by_project_key_me_login.go b/platform/client_login_by_project_key_me_login.go index 8929d1e4..f7cc4868 100644 --- a/platform/client_login_by_project_key_me_login.go +++ b/platform/client_login_by_project_key_me_login.go @@ -14,12 +14,12 @@ type ByProjectKeyMeLoginRequestBuilder struct { /** * Retrieves the authenticated customer (that matches the given email/password pair). * -* If used with [an access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the `anonymousId` are assigned to the newly logged-in Customer. +* If used with an optional [access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the `anonymousId` are assigned to the newly logged-in Customer. * * - If the Customer does not have a Cart yet, the most recently modified anonymous cart becomes the Customer's Cart. * - If the Customer already has a Cart, the most recently modified anonymous cart is handled in accordance with [AnonymousCartSignInMode](ctp:api:type:AnonymousCartSignInMode). * -* A Cart returned as part of the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) is [recalculated](ctp:api:type:MyCartRecalculateAction) with up-to-date prices, taxes, discounts, and invalid line items removed. +* A Cart returned in the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) has any invalid Line Items removed and is [updated](/api/carts-orders-overview#cart-updates) with the latest prices, taxes, and discounts. During these updates, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError). * * If an account with the given credentials is not found, an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error is returned. * diff --git a/platform/client_login_by_project_key_me_login_post.go b/platform/client_login_by_project_key_me_login_post.go index 01a73061..aa223e3c 100644 --- a/platform/client_login_by_project_key_me_login_post.go +++ b/platform/client_login_by_project_key_me_login_post.go @@ -31,12 +31,12 @@ func (rb *ByProjectKeyMeLoginRequestMethodPost) WithHeaders(headers http.Header) /** * Retrieves the authenticated customer (that matches the given email/password pair). * -* If used with [an access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the `anonymousId` are assigned to the newly logged-in Customer. +* If used with an optional [access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the `anonymousId` are assigned to the newly logged-in Customer. * * - If the Customer does not have a Cart yet, the most recently modified anonymous cart becomes the Customer's Cart. * - If the Customer already has a Cart, the most recently modified anonymous cart is handled in accordance with [AnonymousCartSignInMode](ctp:api:type:AnonymousCartSignInMode). * -* A Cart returned as part of the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) is [recalculated](ctp:api:type:MyCartRecalculateAction) with up-to-date prices, taxes, discounts, and invalid line items removed. +* A Cart returned in the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) has any invalid Line Items removed and is [updated](/api/carts-orders-overview#cart-updates) with the latest prices, taxes, and discounts. During these updates, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError). * * If an account with the given credentials is not found, an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error is returned. * diff --git a/platform/client_matching_cart_by_project_key_in_store_key_by_store_key_shipping_methods_matching_cart.go b/platform/client_matching_cart_by_project_key_in_store_key_by_store_key_shipping_methods_matching_cart.go index e60be84d..5fbffe2d 100644 --- a/platform/client_matching_cart_by_project_key_in_store_key_by_store_key_shipping_methods_matching_cart.go +++ b/platform/client_matching_cart_by_project_key_in_store_key_by_store_key_shipping_methods_matching_cart.go @@ -13,7 +13,7 @@ type ByProjectKeyInStoreKeyByStoreKeyShippingMethodsMatchingCartRequestBuilder s } /** -* Retrieves all the ShippingMethods that can ship to the shipping address of the given Cart in a given [Store](ctp:api:type:Store). +* Retrieves all the active ShippingMethods that can ship to the shipping address of the given Cart in a given [Store](ctp:api:type:Store). * Each ShippingMethod contains exactly one ShippingRate with the flag `isMatching` set to `true`. * This ShippingRate is used when the ShippingMethod is [added to the Cart](ctp:api:type:CartSetShippingMethodAction). * @@ -26,7 +26,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyShippingMethodsMatchingCartRequestBuil } /** -* Checks if a ShippingMethod that can ship to the shipping address of the given Cart exists in the given [Store](ctp:api:type:Store). Returns a `200 OK` status if the ShippingMethod exists or a `404 Not Found` otherwise. +* Checks if an active ShippingMethod that can ship to the shipping address of the given Cart exists in the given [Store](ctp:api:type:Store). Returns a `200 OK` status if the ShippingMethod exists or a `404 Not Found` otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyShippingMethodsMatchingCartRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyShippingMethodsMatchingCartRequestMethodHead { return &ByProjectKeyInStoreKeyByStoreKeyShippingMethodsMatchingCartRequestMethodHead{ diff --git a/platform/client_matching_cart_by_project_key_in_store_key_by_store_key_shipping_methods_matching_cart_get.go b/platform/client_matching_cart_by_project_key_in_store_key_by_store_key_shipping_methods_matching_cart_get.go index c3003939..e027310c 100644 --- a/platform/client_matching_cart_by_project_key_in_store_key_by_store_key_shipping_methods_matching_cart_get.go +++ b/platform/client_matching_cart_by_project_key_in_store_key_by_store_key_shipping_methods_matching_cart_get.go @@ -65,7 +65,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyShippingMethodsMatchingCartRequestMeth } /** -* Retrieves all the ShippingMethods that can ship to the shipping address of the given Cart in a given [Store](ctp:api:type:Store). +* Retrieves all the active ShippingMethods that can ship to the shipping address of the given Cart in a given [Store](ctp:api:type:Store). * Each ShippingMethod contains exactly one ShippingRate with the flag `isMatching` set to `true`. * This ShippingRate is used when the ShippingMethod is [added to the Cart](ctp:api:type:CartSetShippingMethodAction). * diff --git a/platform/client_matching_cart_by_project_key_in_store_key_by_store_key_shipping_methods_matching_cart_head.go b/platform/client_matching_cart_by_project_key_in_store_key_by_store_key_shipping_methods_matching_cart_head.go index f4e3afae..f240219c 100644 --- a/platform/client_matching_cart_by_project_key_in_store_key_by_store_key_shipping_methods_matching_cart_head.go +++ b/platform/client_matching_cart_by_project_key_in_store_key_by_store_key_shipping_methods_matching_cart_head.go @@ -53,7 +53,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyShippingMethodsMatchingCartRequestMeth } /** -* Checks if a ShippingMethod that can ship to the shipping address of the given Cart exists in the given [Store](ctp:api:type:Store). Returns a `200 OK` status if the ShippingMethod exists or a `404 Not Found` otherwise. +* Checks if an active ShippingMethod that can ship to the shipping address of the given Cart exists in the given [Store](ctp:api:type:Store). Returns a `200 OK` status if the ShippingMethod exists or a `404 Not Found` otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyShippingMethodsMatchingCartRequestMethodHead) Execute(ctx context.Context) error { var queryParams url.Values diff --git a/platform/client_matching_cart_by_project_key_shipping_methods_matching_cart.go b/platform/client_matching_cart_by_project_key_shipping_methods_matching_cart.go index 99432f72..acb7f0ae 100644 --- a/platform/client_matching_cart_by_project_key_shipping_methods_matching_cart.go +++ b/platform/client_matching_cart_by_project_key_shipping_methods_matching_cart.go @@ -12,7 +12,7 @@ type ByProjectKeyShippingMethodsMatchingCartRequestBuilder struct { } /** -* Retrieves all the ShippingMethods that can ship to the shipping address of the given Cart. +* Retrieves all the active ShippingMethods that can ship to the shipping address of the given Cart. * Each ShippingMethod contains exactly one ShippingRate with the flag `isMatching` set to `true`. * This ShippingRate is used when the ShippingMethod is [added to the Cart](ctp:api:type:CartSetShippingMethodAction). * @@ -25,7 +25,7 @@ func (rb *ByProjectKeyShippingMethodsMatchingCartRequestBuilder) Get() *ByProjec } /** -* Checks if a ShippingMethod exists for the given Cart. Returns a `200 OK` status if the ShippingMethod exists or a `404 Not Found` otherwise. +* Checks if an active ShippingMethod exists for the given Cart. Returns a `200 OK` status if the ShippingMethod exists or a `404 Not Found` otherwise. */ func (rb *ByProjectKeyShippingMethodsMatchingCartRequestBuilder) Head() *ByProjectKeyShippingMethodsMatchingCartRequestMethodHead { return &ByProjectKeyShippingMethodsMatchingCartRequestMethodHead{ diff --git a/platform/client_matching_cart_by_project_key_shipping_methods_matching_cart_get.go b/platform/client_matching_cart_by_project_key_shipping_methods_matching_cart_get.go index 8aecc507..9681328d 100644 --- a/platform/client_matching_cart_by_project_key_shipping_methods_matching_cart_get.go +++ b/platform/client_matching_cart_by_project_key_shipping_methods_matching_cart_get.go @@ -65,7 +65,7 @@ func (rb *ByProjectKeyShippingMethodsMatchingCartRequestMethodGet) WithHeaders(h } /** -* Retrieves all the ShippingMethods that can ship to the shipping address of the given Cart. +* Retrieves all the active ShippingMethods that can ship to the shipping address of the given Cart. * Each ShippingMethod contains exactly one ShippingRate with the flag `isMatching` set to `true`. * This ShippingRate is used when the ShippingMethod is [added to the Cart](ctp:api:type:CartSetShippingMethodAction). * diff --git a/platform/client_matching_cart_by_project_key_shipping_methods_matching_cart_head.go b/platform/client_matching_cart_by_project_key_shipping_methods_matching_cart_head.go index f5ec04cb..361d56b0 100644 --- a/platform/client_matching_cart_by_project_key_shipping_methods_matching_cart_head.go +++ b/platform/client_matching_cart_by_project_key_shipping_methods_matching_cart_head.go @@ -53,7 +53,7 @@ func (rb *ByProjectKeyShippingMethodsMatchingCartRequestMethodHead) WithHeaders( } /** -* Checks if a ShippingMethod exists for the given Cart. Returns a `200 OK` status if the ShippingMethod exists or a `404 Not Found` otherwise. +* Checks if an active ShippingMethod exists for the given Cart. Returns a `200 OK` status if the ShippingMethod exists or a `404 Not Found` otherwise. */ func (rb *ByProjectKeyShippingMethodsMatchingCartRequestMethodHead) Execute(ctx context.Context) error { var queryParams url.Values diff --git a/platform/client_matching_cart_location_by_project_key_shipping_methods_matching_cart_location.go b/platform/client_matching_cart_location_by_project_key_shipping_methods_matching_cart_location.go index 5247d4ad..8c842aa1 100644 --- a/platform/client_matching_cart_location_by_project_key_shipping_methods_matching_cart_location.go +++ b/platform/client_matching_cart_location_by_project_key_shipping_methods_matching_cart_location.go @@ -12,7 +12,7 @@ type ByProjectKeyShippingMethodsMatchingCartLocationRequestBuilder struct { } /** -* Retrieves all the ShippingMethods that can ship to the given [Location](ctp:api:type:Location) +* Retrieves all the active ShippingMethods that can ship to the given [Location](ctp:api:type:Location) * with a `predicate` that matches the given Cart. * Each ShippingMethod contains exactly one ShippingRate with the flag `isMatching` set to `true`. * This ShippingRate is used when the ShippingMethod is [added to the Cart](ctp:api:type:CartSetShippingMethodAction). @@ -26,7 +26,7 @@ func (rb *ByProjectKeyShippingMethodsMatchingCartLocationRequestBuilder) Get() * } /** -* Checks if a ShippingMethod that can ship to the given [Location](ctp:api:type:Location) exists for the given Cart. Returns a `200 OK` status if the ShippingMethod exists or a `404 Not Found` otherwise. +* Checks if an active ShippingMethod that can ship to the given [Location](ctp:api:type:Location) exists for the given Cart. Returns a `200 OK` status if the ShippingMethod exists or a `404 Not Found` otherwise. */ func (rb *ByProjectKeyShippingMethodsMatchingCartLocationRequestBuilder) Head() *ByProjectKeyShippingMethodsMatchingCartLocationRequestMethodHead { return &ByProjectKeyShippingMethodsMatchingCartLocationRequestMethodHead{ diff --git a/platform/client_matching_cart_location_by_project_key_shipping_methods_matching_cart_location_get.go b/platform/client_matching_cart_location_by_project_key_shipping_methods_matching_cart_location_get.go index 85767581..cda31548 100644 --- a/platform/client_matching_cart_location_by_project_key_shipping_methods_matching_cart_location_get.go +++ b/platform/client_matching_cart_location_by_project_key_shipping_methods_matching_cart_location_get.go @@ -87,7 +87,7 @@ func (rb *ByProjectKeyShippingMethodsMatchingCartLocationRequestMethodGet) WithH } /** -* Retrieves all the ShippingMethods that can ship to the given [Location](ctp:api:type:Location) +* Retrieves all the active ShippingMethods that can ship to the given [Location](ctp:api:type:Location) * with a `predicate` that matches the given Cart. * Each ShippingMethod contains exactly one ShippingRate with the flag `isMatching` set to `true`. * This ShippingRate is used when the ShippingMethod is [added to the Cart](ctp:api:type:CartSetShippingMethodAction). diff --git a/platform/client_matching_cart_location_by_project_key_shipping_methods_matching_cart_location_head.go b/platform/client_matching_cart_location_by_project_key_shipping_methods_matching_cart_location_head.go index 562b9408..447af56a 100644 --- a/platform/client_matching_cart_location_by_project_key_shipping_methods_matching_cart_location_head.go +++ b/platform/client_matching_cart_location_by_project_key_shipping_methods_matching_cart_location_head.go @@ -75,7 +75,7 @@ func (rb *ByProjectKeyShippingMethodsMatchingCartLocationRequestMethodHead) With } /** -* Checks if a ShippingMethod that can ship to the given [Location](ctp:api:type:Location) exists for the given Cart. Returns a `200 OK` status if the ShippingMethod exists or a `404 Not Found` otherwise. +* Checks if an active ShippingMethod that can ship to the given [Location](ctp:api:type:Location) exists for the given Cart. Returns a `200 OK` status if the ShippingMethod exists or a `404 Not Found` otherwise. */ func (rb *ByProjectKeyShippingMethodsMatchingCartLocationRequestMethodHead) Execute(ctx context.Context) error { var queryParams url.Values diff --git a/platform/client_matching_location_by_project_key_shipping_methods_matching_location.go b/platform/client_matching_location_by_project_key_shipping_methods_matching_location.go index 2745e47c..ed9879f7 100644 --- a/platform/client_matching_location_by_project_key_shipping_methods_matching_location.go +++ b/platform/client_matching_location_by_project_key_shipping_methods_matching_location.go @@ -12,7 +12,7 @@ type ByProjectKeyShippingMethodsMatchingLocationRequestBuilder struct { } /** -* Retrieves all the ShippingMethods that can ship to the given [Location](/projects/zones#location). +* Retrieves all the active ShippingMethods that can ship to the given [Location](/projects/zones#location). * ShippingMethods that have a `predicate` defined are automatically disqualified. * If the `currency` parameter is given, then the ShippingMethods must also have a rate defined in the specified currency. * Each ShippingMethod contains at least one ShippingRate with the flag `isMatching` set to `true`. @@ -27,7 +27,7 @@ func (rb *ByProjectKeyShippingMethodsMatchingLocationRequestBuilder) Get() *ByPr } /** -* Checks if a ShippingMethod that can ship to the given [Location](ctp:api:type:Location) exists. Returns a `200 OK` status if the ShippingMethod exists or a `404 Not Found` otherwise. +* Checks if an active ShippingMethod that can ship to the given [Location](ctp:api:type:Location) exists. Returns a `200 OK` status if the ShippingMethod exists or a `404 Not Found` otherwise. */ func (rb *ByProjectKeyShippingMethodsMatchingLocationRequestBuilder) Head() *ByProjectKeyShippingMethodsMatchingLocationRequestMethodHead { return &ByProjectKeyShippingMethodsMatchingLocationRequestMethodHead{ diff --git a/platform/client_matching_location_by_project_key_shipping_methods_matching_location_get.go b/platform/client_matching_location_by_project_key_shipping_methods_matching_location_get.go index 3ef7b653..c0e17eea 100644 --- a/platform/client_matching_location_by_project_key_shipping_methods_matching_location_get.go +++ b/platform/client_matching_location_by_project_key_shipping_methods_matching_location_get.go @@ -101,7 +101,7 @@ func (rb *ByProjectKeyShippingMethodsMatchingLocationRequestMethodGet) WithHeade } /** -* Retrieves all the ShippingMethods that can ship to the given [Location](/projects/zones#location). +* Retrieves all the active ShippingMethods that can ship to the given [Location](/projects/zones#location). * ShippingMethods that have a `predicate` defined are automatically disqualified. * If the `currency` parameter is given, then the ShippingMethods must also have a rate defined in the specified currency. * Each ShippingMethod contains at least one ShippingRate with the flag `isMatching` set to `true`. diff --git a/platform/client_matching_location_by_project_key_shipping_methods_matching_location_head.go b/platform/client_matching_location_by_project_key_shipping_methods_matching_location_head.go index cd221505..c9fd8f41 100644 --- a/platform/client_matching_location_by_project_key_shipping_methods_matching_location_head.go +++ b/platform/client_matching_location_by_project_key_shipping_methods_matching_location_head.go @@ -77,7 +77,7 @@ func (rb *ByProjectKeyShippingMethodsMatchingLocationRequestMethodHead) WithHead } /** -* Checks if a ShippingMethod that can ship to the given [Location](ctp:api:type:Location) exists. Returns a `200 OK` status if the ShippingMethod exists or a `404 Not Found` otherwise. +* Checks if an active ShippingMethod that can ship to the given [Location](ctp:api:type:Location) exists. Returns a `200 OK` status if the ShippingMethod exists or a `404 Not Found` otherwise. */ func (rb *ByProjectKeyShippingMethodsMatchingLocationRequestMethodHead) Execute(ctx context.Context) error { var queryParams url.Values diff --git a/platform/client_matching_orderedit_by_project_key_shipping_methods_matching_orderedit.go b/platform/client_matching_orderedit_by_project_key_shipping_methods_matching_orderedit.go index 1b9db264..05c55c39 100644 --- a/platform/client_matching_orderedit_by_project_key_shipping_methods_matching_orderedit.go +++ b/platform/client_matching_orderedit_by_project_key_shipping_methods_matching_orderedit.go @@ -12,7 +12,7 @@ type ByProjectKeyShippingMethodsMatchingOrdereditRequestBuilder struct { } /** -* Retrieves all the ShippingMethods that can ship to the given [Location](ctp:api:type:Location) for an [OrderEdit](ctp:api:type:OrderEdit). +* Retrieves all the active ShippingMethods that can ship to the given [Location](ctp:api:type:Location) for an [OrderEdit](ctp:api:type:OrderEdit). * * If the OrderEdit preview cannot be generated, an [EditPreviewFailed](ctp:api:type:EditPreviewFailedError) error is returned. * @@ -25,7 +25,7 @@ func (rb *ByProjectKeyShippingMethodsMatchingOrdereditRequestBuilder) Get() *ByP } /** -* Checks if a ShippingMethod that can ship to the given [Location](ctp:api:type:Location) exists for the given [OrderEdit](ctp:api:type:OrderEdit). Returns a `200 OK` status if the ShippingMethod exists or a `404 Not Found` otherwise. +* Checks if an active ShippingMethod that can ship to the given [Location](ctp:api:type:Location) exists for the given [OrderEdit](ctp:api:type:OrderEdit). Returns a `200 OK` status if the ShippingMethod exists or a `404 Not Found` otherwise. */ func (rb *ByProjectKeyShippingMethodsMatchingOrdereditRequestBuilder) Head() *ByProjectKeyShippingMethodsMatchingOrdereditRequestMethodHead { return &ByProjectKeyShippingMethodsMatchingOrdereditRequestMethodHead{ diff --git a/platform/client_matching_orderedit_by_project_key_shipping_methods_matching_orderedit_get.go b/platform/client_matching_orderedit_by_project_key_shipping_methods_matching_orderedit_get.go index 49929866..8e51a3a8 100644 --- a/platform/client_matching_orderedit_by_project_key_shipping_methods_matching_orderedit_get.go +++ b/platform/client_matching_orderedit_by_project_key_shipping_methods_matching_orderedit_get.go @@ -75,7 +75,7 @@ func (rb *ByProjectKeyShippingMethodsMatchingOrdereditRequestMethodGet) WithHead } /** -* Retrieves all the ShippingMethods that can ship to the given [Location](ctp:api:type:Location) for an [OrderEdit](ctp:api:type:OrderEdit). +* Retrieves all the active ShippingMethods that can ship to the given [Location](ctp:api:type:Location) for an [OrderEdit](ctp:api:type:OrderEdit). * * If the OrderEdit preview cannot be generated, an [EditPreviewFailed](ctp:api:type:EditPreviewFailedError) error is returned. * diff --git a/platform/client_matching_orderedit_by_project_key_shipping_methods_matching_orderedit_head.go b/platform/client_matching_orderedit_by_project_key_shipping_methods_matching_orderedit_head.go index ec14b179..ae276818 100644 --- a/platform/client_matching_orderedit_by_project_key_shipping_methods_matching_orderedit_head.go +++ b/platform/client_matching_orderedit_by_project_key_shipping_methods_matching_orderedit_head.go @@ -75,7 +75,7 @@ func (rb *ByProjectKeyShippingMethodsMatchingOrdereditRequestMethodHead) WithHea } /** -* Checks if a ShippingMethod that can ship to the given [Location](ctp:api:type:Location) exists for the given [OrderEdit](ctp:api:type:OrderEdit). Returns a `200 OK` status if the ShippingMethod exists or a `404 Not Found` otherwise. +* Checks if an active ShippingMethod that can ship to the given [Location](ctp:api:type:Location) exists for the given [OrderEdit](ctp:api:type:OrderEdit). Returns a `200 OK` status if the ShippingMethod exists or a `404 Not Found` otherwise. */ func (rb *ByProjectKeyShippingMethodsMatchingOrdereditRequestMethodHead) Execute(ctx context.Context) error { var queryParams url.Values diff --git a/platform/client_me_by_project_key_in_store_key_by_store_key_me.go b/platform/client_me_by_project_key_in_store_key_by_store_key_me.go index 75649eef..5f1177cb 100644 --- a/platform/client_me_by_project_key_in_store_key_by_store_key_me.go +++ b/platform/client_me_by_project_key_in_store_key_by_store_key_me.go @@ -80,6 +80,17 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeRequestBuilder) Login() *ByProjectKe client: rb.client, } } + +/** +* Returns a Customer for a given Query Predicate in a [Store](ctp:api:type:Store). Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Customer exists in the Store for the given Query Predicate. +* - If a Customer exists in the Store for the given Query Predicate, but does not have an `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* - If a Customer exists for the given Query Predicate but is associated with a different Store than what is specified in the `manage_my_profile:{projectKey}:{storeKey}` scope. +* + */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyMeRequestMethodGet { return &ByProjectKeyInStoreKeyByStoreKeyMeRequestMethodGet{ url: fmt.Sprintf("/%s/in-store/key=%s/me", rb.projectKey, rb.storeKey), @@ -87,6 +98,15 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeRequestBuilder) Get() *ByProjectKeyI } } +/** +* Updates the Customer in a [Store](ctp:api:type:Store). Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Customer exists with the `id` specified in the [customer:{id}](/scopes#customer_idid) scope. +* - If the Customer exists but is associated with a different Store than what is specified in the `manage_my_profile:{projectKey}:{storeKey}` scope. +* + */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeRequestBuilder) Post(body MyCustomerUpdate) *ByProjectKeyInStoreKeyByStoreKeyMeRequestMethodPost { return &ByProjectKeyInStoreKeyByStoreKeyMeRequestMethodPost{ body: body, @@ -95,6 +115,15 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeRequestBuilder) Post(body MyCustomer } } +/** +* Deletes the Customer in a [Store](ctp:api:type:Store). Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Customer exists with the `id` specified in the [customer:{id}](/scopes#customer_idid) scope. +* - If the Customer exists but is associated with a different Store than what is specified in the `manage_my_profile:{projectKey}:{storeKey}` scope. +* + */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeRequestBuilder) Delete() *ByProjectKeyInStoreKeyByStoreKeyMeRequestMethodDelete { return &ByProjectKeyInStoreKeyByStoreKeyMeRequestMethodDelete{ url: fmt.Sprintf("/%s/in-store/key=%s/me", rb.projectKey, rb.storeKey), diff --git a/platform/client_me_by_project_key_in_store_key_by_store_key_me_delete.go b/platform/client_me_by_project_key_in_store_key_by_store_key_me_delete.go index dea8dd6a..44c846c5 100644 --- a/platform/client_me_by_project_key_in_store_key_by_store_key_me_delete.go +++ b/platform/client_me_by_project_key_in_store_key_by_store_key_me_delete.go @@ -51,6 +51,16 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeRequestMethodDelete) WithHeaders(hea rb.headers = headers return rb } + +/** +* Deletes the Customer in a [Store](ctp:api:type:Store). Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Customer exists with the `id` specified in the [customer:{id}](/scopes#customer_idid) scope. +* - If the Customer exists but is associated with a different Store than what is specified in the `manage_my_profile:{projectKey}:{storeKey}` scope. +* + */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeRequestMethodDelete) Execute(ctx context.Context) (result *Customer, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_me_by_project_key_in_store_key_by_store_key_me_get.go b/platform/client_me_by_project_key_in_store_key_by_store_key_me_get.go index ad86d1d8..35c41d9a 100644 --- a/platform/client_me_by_project_key_in_store_key_by_store_key_me_get.go +++ b/platform/client_me_by_project_key_in_store_key_by_store_key_me_get.go @@ -132,6 +132,17 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeRequestMethodGet) WithHeaders(header rb.headers = headers return rb } + +/** +* Returns a Customer for a given Query Predicate in a [Store](ctp:api:type:Store). Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Customer exists in the Store for the given Query Predicate. +* - If a Customer exists in the Store for the given Query Predicate, but does not have an `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* - If a Customer exists for the given Query Predicate but is associated with a different Store than what is specified in the `manage_my_profile:{projectKey}:{storeKey}` scope. +* + */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeRequestMethodGet) Execute(ctx context.Context) (result *Customer, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_me_by_project_key_in_store_key_by_store_key_me_post.go b/platform/client_me_by_project_key_in_store_key_by_store_key_me_post.go index 24c75727..bcfc9443 100644 --- a/platform/client_me_by_project_key_in_store_key_by_store_key_me_post.go +++ b/platform/client_me_by_project_key_in_store_key_by_store_key_me_post.go @@ -27,6 +27,16 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeRequestMethodPost) WithHeaders(heade rb.headers = headers return rb } + +/** +* Updates the Customer in a [Store](ctp:api:type:Store). Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Customer exists with the `id` specified in the [customer:{id}](/scopes#customer_idid) scope. +* - If the Customer exists but is associated with a different Store than what is specified in the `manage_my_profile:{projectKey}:{storeKey}` scope. +* + */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeRequestMethodPost) Execute(ctx context.Context) (result *Customer, err error) { data, err := serializeInput(rb.body) if err != nil { diff --git a/platform/client_me_by_project_key_me.go b/platform/client_me_by_project_key_me.go index af100fb3..13762395 100644 --- a/platform/client_me_by_project_key_me.go +++ b/platform/client_me_by_project_key_me.go @@ -111,6 +111,16 @@ func (rb *ByProjectKeyMeRequestBuilder) ShoppingLists() *ByProjectKeyMeShoppingL client: rb.client, } } + +/** +* Returns a Customer for a given Query Predicate. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Customer exists for the given Query Predicate. +* - If a Customer exists for the given Query Predicate, but does not have an `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* + */ func (rb *ByProjectKeyMeRequestBuilder) Get() *ByProjectKeyMeRequestMethodGet { return &ByProjectKeyMeRequestMethodGet{ url: fmt.Sprintf("/%s/me", rb.projectKey), @@ -118,6 +128,10 @@ func (rb *ByProjectKeyMeRequestBuilder) Get() *ByProjectKeyMeRequestMethodGet { } } +/** +* Updates the Customer specified in the [customer:{id}](/scopes#customer_idid) scope. Returns a `200 OK` status if successful. +* + */ func (rb *ByProjectKeyMeRequestBuilder) Post(body MyCustomerUpdate) *ByProjectKeyMeRequestMethodPost { return &ByProjectKeyMeRequestMethodPost{ body: body, @@ -126,6 +140,9 @@ func (rb *ByProjectKeyMeRequestBuilder) Post(body MyCustomerUpdate) *ByProjectKe } } +/** +* Deletes the Customer specified in the [customer:{id}](/scopes#customer_idid) scope. Returns a `200 OK` status if successful. + */ func (rb *ByProjectKeyMeRequestBuilder) Delete() *ByProjectKeyMeRequestMethodDelete { return &ByProjectKeyMeRequestMethodDelete{ url: fmt.Sprintf("/%s/me", rb.projectKey), diff --git a/platform/client_me_by_project_key_me_delete.go b/platform/client_me_by_project_key_me_delete.go index 5618243d..4f7872a5 100644 --- a/platform/client_me_by_project_key_me_delete.go +++ b/platform/client_me_by_project_key_me_delete.go @@ -51,6 +51,10 @@ func (rb *ByProjectKeyMeRequestMethodDelete) WithHeaders(headers http.Header) *B rb.headers = headers return rb } + +/** +* Deletes the Customer specified in the [customer:{id}](/scopes#customer_idid) scope. Returns a `200 OK` status if successful. + */ func (rb *ByProjectKeyMeRequestMethodDelete) Execute(ctx context.Context) (result *Customer, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_me_by_project_key_me_get.go b/platform/client_me_by_project_key_me_get.go index b6d47371..9242ceef 100644 --- a/platform/client_me_by_project_key_me_get.go +++ b/platform/client_me_by_project_key_me_get.go @@ -132,6 +132,16 @@ func (rb *ByProjectKeyMeRequestMethodGet) WithHeaders(headers http.Header) *ByPr rb.headers = headers return rb } + +/** +* Returns a Customer for a given Query Predicate. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Customer exists for the given Query Predicate. +* - If a Customer exists for the given Query Predicate, but does not have an `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* + */ func (rb *ByProjectKeyMeRequestMethodGet) Execute(ctx context.Context) (result *Customer, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_me_by_project_key_me_post.go b/platform/client_me_by_project_key_me_post.go index 0b1ea99a..1848362b 100644 --- a/platform/client_me_by_project_key_me_post.go +++ b/platform/client_me_by_project_key_me_post.go @@ -27,6 +27,11 @@ func (rb *ByProjectKeyMeRequestMethodPost) WithHeaders(headers http.Header) *ByP rb.headers = headers return rb } + +/** +* Updates the Customer specified in the [customer:{id}](/scopes#customer_idid) scope. Returns a `200 OK` status if successful. +* + */ func (rb *ByProjectKeyMeRequestMethodPost) Execute(ctx context.Context) (result *Customer, err error) { data, err := serializeInput(rb.body) if err != nil { diff --git a/platform/client_orders_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_orders.go b/platform/client_orders_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_orders.go index 88e353d7..22380d14 100644 --- a/platform/client_orders_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_orders.go +++ b/platform/client_orders_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_orders.go @@ -60,6 +60,16 @@ func (rb *ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKey * Creates an Order from a [Cart](ctp:api:type:Cart) in a [BusinessUnit](ctp:api:type:BusinessUnit). * The Cart must have a shipping address set before creating an Order. * Creating an Order fails with an [InvalidOperation](ctp:api:type:InvalidOperationError) if the Cart does not reference the same BusinessUnit as the `businessUnitKey` path parameter. +* +* Specific Error Codes: +* +* - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) +* - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +* - [OutOfStock](ctp:api:type:OutOfStockError) +* - [PriceChanged](ctp:api:type:PriceChangedError) +* - [ShippingMethodDoesNotMatchCart](ctp:api:type:ShippingMethodDoesNotMatchCartError) +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * */ func (rb *ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyOrdersRequestBuilder) Post(body OrderFromCartDraft) *ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyOrdersRequestMethodPost { diff --git a/platform/client_orders_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_orders_post.go b/platform/client_orders_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_orders_post.go index 3e9f6d97..814a5447 100644 --- a/platform/client_orders_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_orders_post.go +++ b/platform/client_orders_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_orders_post.go @@ -59,6 +59,16 @@ func (rb *ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKey * Creates an Order from a [Cart](ctp:api:type:Cart) in a [BusinessUnit](ctp:api:type:BusinessUnit). * The Cart must have a shipping address set before creating an Order. * Creating an Order fails with an [InvalidOperation](ctp:api:type:InvalidOperationError) if the Cart does not reference the same BusinessUnit as the `businessUnitKey` path parameter. +* +* Specific Error Codes: +* +* - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) +* - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +* - [OutOfStock](ctp:api:type:OutOfStockError) +* - [PriceChanged](ctp:api:type:PriceChangedError) +* - [ShippingMethodDoesNotMatchCart](ctp:api:type:ShippingMethodDoesNotMatchCartError) +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * */ func (rb *ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyOrdersRequestMethodPost) Execute(ctx context.Context) (result *Order, err error) { diff --git a/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders.go b/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders.go index 80f37fcc..428172dc 100644 --- a/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders.go +++ b/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders.go @@ -20,6 +20,11 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeOrdersRequestBuilder) WithId(id stri client: rb.client, } } + +/** +* Returns all Orders in a Store that match a given Query Predicate and contain either a `customerId` that matches the [customer_id:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* + */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeOrdersRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyMeOrdersRequestMethodGet { return &ByProjectKeyInStoreKeyByStoreKeyMeOrdersRequestMethodGet{ url: fmt.Sprintf("/%s/in-store/key=%s/me/orders", rb.projectKey, rb.storeKey), @@ -28,7 +33,14 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeOrdersRequestBuilder) Get() *ByProje } /** -* Checks if an Order exists for a given Query Predicate. Returns a `200 OK` status if any Orders match the Query Predicate or a `404 Not Found` otherwise. +* Checks if an Order exists for a given Query Predicate in a Store. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Orders exist in the Store that match the Query Predicate. +* - If an Order matches the Query Predicate, but no `store` is specified, or the `store` field references a different Store. +* - If an Order matches the Query Predicate, but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeOrdersRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyMeOrdersRequestMethodHead { return &ByProjectKeyInStoreKeyByStoreKeyMeOrdersRequestMethodHead{ @@ -38,17 +50,26 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeOrdersRequestBuilder) Head() *ByProj } /** +* +* Creates an Order in a Store from a Cart for the Customer or anonymous user. The `customerId` or `anonymousId` field on the Order is automatically set based on the [customer:{id}](/scopes#customer_idid) or [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* * The Cart must have a [shipping address set](ctp:api:type:CartSetShippingAddressAction) for taxes to be calculated. When creating [B2B Orders](/associates-overview#b2b-resources), the Customer must have the `CreateMyOrdersFromMyCarts` [Permission](ctp:api:type:Permission). * +* If the Cart's `customerId` does not match the [customer:{id}](/scopes#customer_idid) scope, or the `anonymousId` does not match the [anonymous_id:{id}](/scopes#anonymous_idid) scope, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. +* * Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. * * Specific Error Codes: * +* - [AssociateMissingPermission](ctp:api:type:AssociateMissingPermissionError) +* - [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) +* - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) +* - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * - [OutOfStock](ctp:api:type:OutOfStockError) * - [PriceChanged](ctp:api:type:PriceChangedError) -* - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) -* - [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) -* - [AssociateMissingPermission](ctp:api:type:AssociateMissingPermissionError) +* - [ShippingMethodDoesNotMatchCart](ctp:api:type:ShippingMethodDoesNotMatchCartError) * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeOrdersRequestBuilder) Post(body MyOrderFromCartDraft) *ByProjectKeyInStoreKeyByStoreKeyMeOrdersRequestMethodPost { diff --git a/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_by_id.go b/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_by_id.go index ed1dcf6b..e4b3c6fb 100644 --- a/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_by_id.go +++ b/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_by_id.go @@ -14,7 +14,13 @@ type ByProjectKeyInStoreKeyByStoreKeyMeOrdersByIDRequestBuilder struct { } /** -* If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* Returns an Order for a given `id` in a Store. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Order exists in the Store for the given `id`. +* - If the Order exists but does not have a `store` specified, or the `store` field references a different Store. +* - If the Order exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeOrdersByIDRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyMeOrdersByIDRequestMethodGet { @@ -25,7 +31,14 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeOrdersByIDRequestBuilder) Get() *ByP } /** -* Checks if an Order exists for a given `id`. Returns a `200 OK` status if the My Order exists or a `404 Not Found` otherwise. +* Checks if an Order exists for a given `id` in a Store. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Order exists in the Store for the given `id`. +* - If the Order exists but does not have a `store` specified, or the `store` field references a different Store. +* - If the Order exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeOrdersByIDRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyMeOrdersByIDRequestMethodHead { return &ByProjectKeyInStoreKeyByStoreKeyMeOrdersByIDRequestMethodHead{ diff --git a/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_by_id_get.go b/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_by_id_get.go index a5252646..116cbd7e 100644 --- a/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_by_id_get.go +++ b/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_by_id_get.go @@ -55,7 +55,13 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeOrdersByIDRequestMethodGet) WithHead } /** -* If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* Returns an Order for a given `id` in a Store. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Order exists in the Store for the given `id`. +* - If the Order exists but does not have a `store` specified, or the `store` field references a different Store. +* - If the Order exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeOrdersByIDRequestMethodGet) Execute(ctx context.Context) (result *Order, err error) { diff --git a/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_by_id_head.go b/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_by_id_head.go index d82c1bc1..bdf03f26 100644 --- a/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_by_id_head.go +++ b/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_by_id_head.go @@ -28,7 +28,14 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeOrdersByIDRequestMethodHead) WithHea } /** -* Checks if an Order exists for a given `id`. Returns a `200 OK` status if the My Order exists or a `404 Not Found` otherwise. +* Checks if an Order exists for a given `id` in a Store. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Order exists in the Store for the given `id`. +* - If the Order exists but does not have a `store` specified, or the `store` field references a different Store. +* - If the Order exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeOrdersByIDRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_get.go b/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_get.go index 1e6f4955..2501bab1 100644 --- a/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_get.go +++ b/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_get.go @@ -132,6 +132,11 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeOrdersRequestMethodGet) WithHeaders( rb.headers = headers return rb } + +/** +* Returns all Orders in a Store that match a given Query Predicate and contain either a `customerId` that matches the [customer_id:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* + */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeOrdersRequestMethodGet) Execute(ctx context.Context) (result *OrderPagedQueryResponse, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_head.go b/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_head.go index 092559ed..bf14a918 100644 --- a/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_head.go +++ b/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_head.go @@ -55,7 +55,14 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeOrdersRequestMethodHead) WithHeaders } /** -* Checks if an Order exists for a given Query Predicate. Returns a `200 OK` status if any Orders match the Query Predicate or a `404 Not Found` otherwise. +* Checks if an Order exists for a given Query Predicate in a Store. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Orders exist in the Store that match the Query Predicate. +* - If an Order matches the Query Predicate, but no `store` is specified, or the `store` field references a different Store. +* - If an Order matches the Query Predicate, but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeOrdersRequestMethodHead) Execute(ctx context.Context) error { var queryParams url.Values diff --git a/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_post.go b/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_post.go index a2637681..babffb08 100644 --- a/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_post.go +++ b/platform/client_orders_by_project_key_in_store_key_by_store_key_me_orders_post.go @@ -56,17 +56,26 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeOrdersRequestMethodPost) WithHeaders } /** +* +* Creates an Order in a Store from a Cart for the Customer or anonymous user. The `customerId` or `anonymousId` field on the Order is automatically set based on the [customer:{id}](/scopes#customer_idid) or [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* * The Cart must have a [shipping address set](ctp:api:type:CartSetShippingAddressAction) for taxes to be calculated. When creating [B2B Orders](/associates-overview#b2b-resources), the Customer must have the `CreateMyOrdersFromMyCarts` [Permission](ctp:api:type:Permission). * +* If the Cart's `customerId` does not match the [customer:{id}](/scopes#customer_idid) scope, or the `anonymousId` does not match the [anonymous_id:{id}](/scopes#anonymous_idid) scope, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. +* * Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. * * Specific Error Codes: * +* - [AssociateMissingPermission](ctp:api:type:AssociateMissingPermissionError) +* - [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) +* - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) +* - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * - [OutOfStock](ctp:api:type:OutOfStockError) * - [PriceChanged](ctp:api:type:PriceChangedError) -* - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) -* - [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) -* - [AssociateMissingPermission](ctp:api:type:AssociateMissingPermissionError) +* - [ShippingMethodDoesNotMatchCart](ctp:api:type:ShippingMethodDoesNotMatchCartError) * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeOrdersRequestMethodPost) Execute(ctx context.Context) (result *Order, err error) { diff --git a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders.go b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders.go index eac35a46..b3219141 100644 --- a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders.go +++ b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders.go @@ -12,6 +12,13 @@ type ByProjectKeyInStoreKeyByStoreKeyOrdersRequestBuilder struct { client *Client } +func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersRequestBuilder) OrderQuote() *ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesRequestBuilder { + return &ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesRequestBuilder{ + projectKey: rb.projectKey, + storeKey: rb.storeKey, + client: rb.client, + } +} func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersRequestBuilder) WithOrderNumber(orderNumber string) *ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberRequestBuilder { return &ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberRequestBuilder{ orderNumber: orderNumber, @@ -36,7 +43,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersRequestBuilder) Get() *ByProject } /** -* Checks if an Order exists for a given Query Predicate. Returns a `200 OK` status if any Orders match the Query Predicate or a `404 Not Found` otherwise. +* Checks if an Order exists for a given Query Predicate. Returns a `200 OK` status if any Orders match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyOrdersRequestMethodHead { return &ByProjectKeyInStoreKeyByStoreKeyOrdersRequestMethodHead{ @@ -50,6 +57,8 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersRequestBuilder) Head() *ByProjec * The shipping address is used for tax calculation for a Cart with `Platform` [TaxMode](ctp:api:type:TaxMode). * * Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. +* If a server-side problem occurs, indicated by a 500 Internal Server Error HTTP response, the Order creation may still successfully complete after the error is returned. +* If you receive this error, you should verify the status of the Order by querying a unique identifier supplied during the creation request, such as the Order number. * * Specific Error Codes: * @@ -58,6 +67,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersRequestBuilder) Head() *ByProjec * - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) * - [ShippingMethodDoesNotMatchCart](ctp:api:type:ShippingMethodDoesNotMatchCartError) * - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +* - [InvalidOperation](ctp:api:type:InvalidOperationError) * - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) * - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * - [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) diff --git a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_by_id.go b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_by_id.go index 82e2c0e2..ef9f2ce4 100644 --- a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_by_id.go +++ b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_by_id.go @@ -14,7 +14,7 @@ type ByProjectKeyInStoreKeyByStoreKeyOrdersByIDRequestBuilder struct { } /** -* If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Order exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersByIDRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyOrdersByIDRequestMethodGet { @@ -25,7 +25,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersByIDRequestBuilder) Get() *ByPro } /** -* Checks if an Order exists for a given `id`. Returns a `200 OK` status if the Order exists or a `404 Not Found` otherwise. +* Checks if an Order exists for a given `id`. Returns a `200 OK` status if the Order exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersByIDRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyOrdersByIDRequestMethodHead { return &ByProjectKeyInStoreKeyByStoreKeyOrdersByIDRequestMethodHead{ @@ -35,7 +35,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersByIDRequestBuilder) Head() *ByPr } /** -* If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Order exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersByIDRequestBuilder) Post(body OrderUpdate) *ByProjectKeyInStoreKeyByStoreKeyOrdersByIDRequestMethodPost { @@ -47,7 +47,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersByIDRequestBuilder) Post(body Or } /** -* If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Order exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * * Deleting an Order produces the [OrderDeleted](ctp:api:type:OrderDeletedMessage) Message. * diff --git a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_by_id_delete.go b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_by_id_delete.go index ddd7dff0..b3da9733 100644 --- a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_by_id_delete.go +++ b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_by_id_delete.go @@ -82,7 +82,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersByIDRequestMethodDelete) WithHea } /** -* If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Order exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * * Deleting an Order produces the [OrderDeleted](ctp:api:type:OrderDeletedMessage) Message. * diff --git a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_by_id_get.go b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_by_id_get.go index 741c5020..1f3003c9 100644 --- a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_by_id_get.go +++ b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_by_id_get.go @@ -55,7 +55,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersByIDRequestMethodGet) WithHeader } /** -* If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Order exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersByIDRequestMethodGet) Execute(ctx context.Context) (result *Order, err error) { diff --git a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_by_id_head.go b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_by_id_head.go index b2f07800..33df9132 100644 --- a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_by_id_head.go +++ b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_by_id_head.go @@ -28,7 +28,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersByIDRequestMethodHead) WithHeade } /** -* Checks if an Order exists for a given `id`. Returns a `200 OK` status if the Order exists or a `404 Not Found` otherwise. +* Checks if an Order exists for a given `id`. Returns a `200 OK` status if the Order exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersByIDRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_by_id_post.go b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_by_id_post.go index 356b1f65..82e9697c 100644 --- a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_by_id_post.go +++ b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_by_id_post.go @@ -56,7 +56,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersByIDRequestMethodPost) WithHeade } /** -* If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Order exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersByIDRequestMethodPost) Execute(ctx context.Context) (result *Order, err error) { diff --git a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_head.go b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_head.go index 87b0f5bf..06cade27 100644 --- a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_head.go +++ b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_head.go @@ -55,7 +55,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersRequestMethodHead) WithHeaders(h } /** -* Checks if an Order exists for a given Query Predicate. Returns a `200 OK` status if any Orders match the Query Predicate or a `404 Not Found` otherwise. +* Checks if an Order exists for a given Query Predicate. Returns a `200 OK` status if any Orders match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersRequestMethodHead) Execute(ctx context.Context) error { var queryParams url.Values diff --git a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_order_number_by_order_number.go b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_order_number_by_order_number.go index 8991d39b..a3176f6a 100644 --- a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_order_number_by_order_number.go +++ b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_order_number_by_order_number.go @@ -14,7 +14,7 @@ type ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberRequestBuilde } /** -* If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Order exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberRequestMethodGet { @@ -25,7 +25,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberRequestB } /** -* Checks if an Order exists for a given `orderNumber`. Returns a `200 OK` status if the Order exists or a `404 Not Found` otherwise. +* Checks if an Order exists for a given `orderNumber`. Returns a `200 OK` status if the Order exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberRequestMethodHead { return &ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberRequestMethodHead{ @@ -35,7 +35,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberRequestB } /** -* If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Order exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberRequestBuilder) Post(body OrderUpdate) *ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberRequestMethodPost { @@ -47,7 +47,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberRequestB } /** -* If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Order exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * * Deleting an Order produces the [OrderDeleted](ctp:api:type:OrderDeletedMessage) Message. * diff --git a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_order_number_by_order_number_delete.go b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_order_number_by_order_number_delete.go index 01192507..67de0674 100644 --- a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_order_number_by_order_number_delete.go +++ b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_order_number_by_order_number_delete.go @@ -82,7 +82,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberRequestM } /** -* If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Order exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * * Deleting an Order produces the [OrderDeleted](ctp:api:type:OrderDeletedMessage) Message. * diff --git a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_order_number_by_order_number_get.go b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_order_number_by_order_number_get.go index 3383fc44..a86ff23c 100644 --- a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_order_number_by_order_number_get.go +++ b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_order_number_by_order_number_get.go @@ -55,7 +55,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberRequestM } /** -* If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Order exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberRequestMethodGet) Execute(ctx context.Context) (result *Order, err error) { diff --git a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_order_number_by_order_number_head.go b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_order_number_by_order_number_head.go index a6e58bb9..2f4fb7d3 100644 --- a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_order_number_by_order_number_head.go +++ b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_order_number_by_order_number_head.go @@ -28,7 +28,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberRequestM } /** -* Checks if an Order exists for a given `orderNumber`. Returns a `200 OK` status if the Order exists or a `404 Not Found` otherwise. +* Checks if an Order exists for a given `orderNumber`. Returns a `200 OK` status if the Order exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_order_number_by_order_number_post.go b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_order_number_by_order_number_post.go index f35e2741..020a3c00 100644 --- a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_order_number_by_order_number_post.go +++ b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_order_number_by_order_number_post.go @@ -56,7 +56,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberRequestM } /** -* If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +* If the Order exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberRequestMethodPost) Execute(ctx context.Context) (result *Order, err error) { diff --git a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_post.go b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_post.go index 71a9d792..e057e90c 100644 --- a/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_post.go +++ b/platform/client_orders_by_project_key_in_store_key_by_store_key_orders_post.go @@ -60,6 +60,8 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersRequestMethodPost) WithHeaders(h * The shipping address is used for tax calculation for a Cart with `Platform` [TaxMode](ctp:api:type:TaxMode). * * Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. +* If a server-side problem occurs, indicated by a 500 Internal Server Error HTTP response, the Order creation may still successfully complete after the error is returned. +* If you receive this error, you should verify the status of the Order by querying a unique identifier supplied during the creation request, such as the Order number. * * Specific Error Codes: * @@ -68,6 +70,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersRequestMethodPost) WithHeaders(h * - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) * - [ShippingMethodDoesNotMatchCart](ctp:api:type:ShippingMethodDoesNotMatchCartError) * - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +* - [InvalidOperation](ctp:api:type:InvalidOperationError) * - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) * - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * - [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) diff --git a/platform/client_orders_by_project_key_me_orders.go b/platform/client_orders_by_project_key_me_orders.go index 3237a2ac..4e6bba70 100644 --- a/platform/client_orders_by_project_key_me_orders.go +++ b/platform/client_orders_by_project_key_me_orders.go @@ -24,6 +24,16 @@ func (rb *ByProjectKeyMeOrdersRequestBuilder) OrderQuote() *ByProjectKeyMeOrders client: rb.client, } } + +/** +* Returns all Orders that match a given Query Predicate. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Orders exist for a given Query Predicate. +* - If the Order exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* + */ func (rb *ByProjectKeyMeOrdersRequestBuilder) Get() *ByProjectKeyMeOrdersRequestMethodGet { return &ByProjectKeyMeOrdersRequestMethodGet{ url: fmt.Sprintf("/%s/me/orders", rb.projectKey), @@ -32,7 +42,13 @@ func (rb *ByProjectKeyMeOrdersRequestBuilder) Get() *ByProjectKeyMeOrdersRequest } /** -* Checks if an Order exists for a given Query Predicate. Returns a `200 OK` status if any Orders match the Query Predicate or a `404 Not Found` otherwise. +* Checks if an Order exists for a given Query Predicate. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Order exists that matches the Query Predicate. +* - If one or more Orders exist but don't have either a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* */ func (rb *ByProjectKeyMeOrdersRequestBuilder) Head() *ByProjectKeyMeOrdersRequestMethodHead { return &ByProjectKeyMeOrdersRequestMethodHead{ @@ -42,16 +58,27 @@ func (rb *ByProjectKeyMeOrdersRequestBuilder) Head() *ByProjectKeyMeOrdersReques } /** -* The Cart must have a [shipping address set](ctp:api:type:CartSetShippingAddressAction) for taxes to be calculated. When creating [B2B Orders](/associates-overview#b2b-resources), the Customer must have the `CreateMyOrdersFromMyCarts` [Permission](ctp:api:type:Permission). * +* Creates an Order from a Cart for the Customer or anonymous user. The `customerId` or `anonymousId` field on the Order is automatically set based on the [customer:{id}](/scopes#customer_idid) or [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* +* The Cart must have a [shipping address set](ctp:api:type:CartSetShippingAddressAction) for taxes to be calculated. When creating [B2B Orders](/associates-overview#b2b-resources), the Customer must have the `CreateMyOrdersFromMyCarts` [Permission](ctp:api:type:Permission). * Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. * +* If the Cart's `customerId` does not match the [customer:{id}](/scopes#customer_idid) scope, or the `anonymousId` does not match the [anonymous_id:{id}](/scopes#anonymous_idid) scope, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. +* +* If a server-side problem occurs, indicated by a 500 Internal Server Error HTTP response, the Order creation may still successfully complete after the error is returned. +* If you receive this error, you should verify the status of the Order by querying a unique identifier supplied during the creation request, such as the Order number. +* * Specific Error Codes: * +* - [AssociateMissingPermission](ctp:api:type:AssociateMissingPermissionError) +* - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) +* - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) * - [OutOfStock](ctp:api:type:OutOfStockError) * - [PriceChanged](ctp:api:type:PriceChangedError) -* - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) -* - [AssociateMissingPermission](ctp:api:type:AssociateMissingPermissionError) +* - [ShippingMethodDoesNotMatchCart](ctp:api:type:ShippingMethodDoesNotMatchCartError) +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * */ func (rb *ByProjectKeyMeOrdersRequestBuilder) Post(body MyOrderFromCartDraft) *ByProjectKeyMeOrdersRequestMethodPost { diff --git a/platform/client_orders_by_project_key_me_orders_by_id.go b/platform/client_orders_by_project_key_me_orders_by_id.go index 85372a9f..7b339328 100644 --- a/platform/client_orders_by_project_key_me_orders_by_id.go +++ b/platform/client_orders_by_project_key_me_orders_by_id.go @@ -12,6 +12,15 @@ type ByProjectKeyMeOrdersByIDRequestBuilder struct { client *Client } +/** +* Returns an Order for a given `id`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Order exists for the given `id`. +* - If the Order exists but does not have either a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* + */ func (rb *ByProjectKeyMeOrdersByIDRequestBuilder) Get() *ByProjectKeyMeOrdersByIDRequestMethodGet { return &ByProjectKeyMeOrdersByIDRequestMethodGet{ url: fmt.Sprintf("/%s/me/orders/%s", rb.projectKey, rb.id), @@ -20,7 +29,13 @@ func (rb *ByProjectKeyMeOrdersByIDRequestBuilder) Get() *ByProjectKeyMeOrdersByI } /** -* Checks if an Order exists for a given `id`. Returns a `200 OK` status if the Order exists or a `404 Not Found` otherwise. +* Checks if an Order exists for a given `id`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Order exists for the given `id`. +* - If the Order exists but does not have either a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* */ func (rb *ByProjectKeyMeOrdersByIDRequestBuilder) Head() *ByProjectKeyMeOrdersByIDRequestMethodHead { return &ByProjectKeyMeOrdersByIDRequestMethodHead{ diff --git a/platform/client_orders_by_project_key_me_orders_by_id_get.go b/platform/client_orders_by_project_key_me_orders_by_id_get.go index adfa0818..ba491f8c 100644 --- a/platform/client_orders_by_project_key_me_orders_by_id_get.go +++ b/platform/client_orders_by_project_key_me_orders_by_id_get.go @@ -53,6 +53,16 @@ func (rb *ByProjectKeyMeOrdersByIDRequestMethodGet) WithHeaders(headers http.Hea rb.headers = headers return rb } + +/** +* Returns an Order for a given `id`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Order exists for the given `id`. +* - If the Order exists but does not have either a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* + */ func (rb *ByProjectKeyMeOrdersByIDRequestMethodGet) Execute(ctx context.Context) (result *Order, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_orders_by_project_key_me_orders_by_id_head.go b/platform/client_orders_by_project_key_me_orders_by_id_head.go index e54e5fa0..80f40cda 100644 --- a/platform/client_orders_by_project_key_me_orders_by_id_head.go +++ b/platform/client_orders_by_project_key_me_orders_by_id_head.go @@ -28,7 +28,13 @@ func (rb *ByProjectKeyMeOrdersByIDRequestMethodHead) WithHeaders(headers http.He } /** -* Checks if an Order exists for a given `id`. Returns a `200 OK` status if the Order exists or a `404 Not Found` otherwise. +* Checks if an Order exists for a given `id`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Order exists for the given `id`. +* - If the Order exists but does not have either a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* */ func (rb *ByProjectKeyMeOrdersByIDRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_orders_by_project_key_me_orders_get.go b/platform/client_orders_by_project_key_me_orders_get.go index c7858398..9ec60437 100644 --- a/platform/client_orders_by_project_key_me_orders_get.go +++ b/platform/client_orders_by_project_key_me_orders_get.go @@ -132,6 +132,16 @@ func (rb *ByProjectKeyMeOrdersRequestMethodGet) WithHeaders(headers http.Header) rb.headers = headers return rb } + +/** +* Returns all Orders that match a given Query Predicate. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Orders exist for a given Query Predicate. +* - If the Order exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* + */ func (rb *ByProjectKeyMeOrdersRequestMethodGet) Execute(ctx context.Context) (result *OrderPagedQueryResponse, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_orders_by_project_key_me_orders_head.go b/platform/client_orders_by_project_key_me_orders_head.go index 10f68ed6..725607f8 100644 --- a/platform/client_orders_by_project_key_me_orders_head.go +++ b/platform/client_orders_by_project_key_me_orders_head.go @@ -55,7 +55,13 @@ func (rb *ByProjectKeyMeOrdersRequestMethodHead) WithHeaders(headers http.Header } /** -* Checks if an Order exists for a given Query Predicate. Returns a `200 OK` status if any Orders match the Query Predicate or a `404 Not Found` otherwise. +* Checks if an Order exists for a given Query Predicate. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Order exists that matches the Query Predicate. +* - If one or more Orders exist but don't have either a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* */ func (rb *ByProjectKeyMeOrdersRequestMethodHead) Execute(ctx context.Context) error { var queryParams url.Values diff --git a/platform/client_orders_by_project_key_me_orders_post.go b/platform/client_orders_by_project_key_me_orders_post.go index 59ff6183..6f581a09 100644 --- a/platform/client_orders_by_project_key_me_orders_post.go +++ b/platform/client_orders_by_project_key_me_orders_post.go @@ -56,16 +56,27 @@ func (rb *ByProjectKeyMeOrdersRequestMethodPost) WithHeaders(headers http.Header } /** -* The Cart must have a [shipping address set](ctp:api:type:CartSetShippingAddressAction) for taxes to be calculated. When creating [B2B Orders](/associates-overview#b2b-resources), the Customer must have the `CreateMyOrdersFromMyCarts` [Permission](ctp:api:type:Permission). * +* Creates an Order from a Cart for the Customer or anonymous user. The `customerId` or `anonymousId` field on the Order is automatically set based on the [customer:{id}](/scopes#customer_idid) or [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* +* The Cart must have a [shipping address set](ctp:api:type:CartSetShippingAddressAction) for taxes to be calculated. When creating [B2B Orders](/associates-overview#b2b-resources), the Customer must have the `CreateMyOrdersFromMyCarts` [Permission](ctp:api:type:Permission). * Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. * +* If the Cart's `customerId` does not match the [customer:{id}](/scopes#customer_idid) scope, or the `anonymousId` does not match the [anonymous_id:{id}](/scopes#anonymous_idid) scope, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. +* +* If a server-side problem occurs, indicated by a 500 Internal Server Error HTTP response, the Order creation may still successfully complete after the error is returned. +* If you receive this error, you should verify the status of the Order by querying a unique identifier supplied during the creation request, such as the Order number. +* * Specific Error Codes: * +* - [AssociateMissingPermission](ctp:api:type:AssociateMissingPermissionError) +* - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) +* - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) * - [OutOfStock](ctp:api:type:OutOfStockError) * - [PriceChanged](ctp:api:type:PriceChangedError) -* - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) -* - [AssociateMissingPermission](ctp:api:type:AssociateMissingPermissionError) +* - [ShippingMethodDoesNotMatchCart](ctp:api:type:ShippingMethodDoesNotMatchCartError) +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * */ func (rb *ByProjectKeyMeOrdersRequestMethodPost) Execute(ctx context.Context) (result *Order, err error) { diff --git a/platform/client_orders_by_project_key_orders.go b/platform/client_orders_by_project_key_orders.go index 2791c696..df1e5c9d 100644 --- a/platform/client_orders_by_project_key_orders.go +++ b/platform/client_orders_by_project_key_orders.go @@ -81,6 +81,9 @@ func (rb *ByProjectKeyOrdersRequestBuilder) Head() *ByProjectKeyOrdersRequestMet * * Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. * +* If a server-side problem occurs, indicated by a 500 Internal Server Error HTTP response, the Order creation may still successfully complete after the error is returned. +* If you receive this error, you should verify the status of the Order by querying a unique identifier supplied during the creation request, such as the Order number. +* * Specific Error Codes: * * - [OutOfStock](ctp:api:type:OutOfStockError) @@ -88,6 +91,7 @@ func (rb *ByProjectKeyOrdersRequestBuilder) Head() *ByProjectKeyOrdersRequestMet * - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) * - [ShippingMethodDoesNotMatchCart](ctp:api:type:ShippingMethodDoesNotMatchCartError) * - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +* - [InvalidOperation](ctp:api:type:InvalidOperationError) * - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) * - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * diff --git a/platform/client_orders_by_project_key_orders_post.go b/platform/client_orders_by_project_key_orders_post.go index aaa6d2a4..fa20fed2 100644 --- a/platform/client_orders_by_project_key_orders_post.go +++ b/platform/client_orders_by_project_key_orders_post.go @@ -61,6 +61,9 @@ func (rb *ByProjectKeyOrdersRequestMethodPost) WithHeaders(headers http.Header) * * Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. * +* If a server-side problem occurs, indicated by a 500 Internal Server Error HTTP response, the Order creation may still successfully complete after the error is returned. +* If you receive this error, you should verify the status of the Order by querying a unique identifier supplied during the creation request, such as the Order number. +* * Specific Error Codes: * * - [OutOfStock](ctp:api:type:OutOfStockError) @@ -68,6 +71,7 @@ func (rb *ByProjectKeyOrdersRequestMethodPost) WithHeaders(headers http.Header) * - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) * - [ShippingMethodDoesNotMatchCart](ctp:api:type:ShippingMethodDoesNotMatchCartError) * - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +* - [InvalidOperation](ctp:api:type:InvalidOperationError) * - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) * - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * diff --git a/platform/client_password_by_project_key_in_store_key_by_store_key_me_password.go b/platform/client_password_by_project_key_in_store_key_by_store_key_me_password.go index 6f625ac3..c0e2d1e8 100644 --- a/platform/client_password_by_project_key_in_store_key_by_store_key_me_password.go +++ b/platform/client_password_by_project_key_in_store_key_by_store_key_me_password.go @@ -21,7 +21,12 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMePasswordRequestBuilder) Reset() *ByP } /** -* Changing the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=false`. +* Changing the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=false`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Customer exists with the `id` specified in the [customer:{id}](/scopes#customer_idid) scope. +* - If the Customer exists but is associated with a different Store than what is specified in the `manage_my_profile:{projectKey}:{storeKey}` scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMePasswordRequestBuilder) Post(body MyCustomerChangePassword) *ByProjectKeyInStoreKeyByStoreKeyMePasswordRequestMethodPost { diff --git a/platform/client_password_by_project_key_in_store_key_by_store_key_me_password_post.go b/platform/client_password_by_project_key_in_store_key_by_store_key_me_password_post.go index 27ec1c53..43afb8ca 100644 --- a/platform/client_password_by_project_key_in_store_key_by_store_key_me_password_post.go +++ b/platform/client_password_by_project_key_in_store_key_by_store_key_me_password_post.go @@ -29,7 +29,12 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMePasswordRequestMethodPost) WithHeade } /** -* Changing the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=false`. +* Changing the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=false`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Customer exists with the `id` specified in the [customer:{id}](/scopes#customer_idid) scope. +* - If the Customer exists but is associated with a different Store than what is specified in the `manage_my_profile:{projectKey}:{storeKey}` scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMePasswordRequestMethodPost) Execute(ctx context.Context) (result *Customer, err error) { diff --git a/platform/client_product_projections_by_project_key_in_store_key_by_store_key_product_projections_by_id.go b/platform/client_product_projections_by_project_key_in_store_key_by_store_key_product_projections_by_id.go index df95694b..403b127c 100644 --- a/platform/client_product_projections_by_project_key_in_store_key_by_store_key_product_projections_by_id.go +++ b/platform/client_product_projections_by_project_key_in_store_key_by_store_key_product_projections_by_id.go @@ -16,7 +16,7 @@ type ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDRequestBuilder struct /** * Gets the current or staged representation of a [Product](ctp:api:type:Product) by its ID in the specified [Store](ctp:api:type:Store). * If the Store has defined some languages, countries, distribution, supply Channels, and/or Product Selection, -* they are used for projections based on [locale](ctp:api:type:ProductProjectionLocales), [price](ctp:api:type:ProductProjectionPrices) +* they are used for projections based on [locale](ctp:api:type:ProductProjectionLocales), [price](ctp:api:type:ProductProjectionPrices), * and [inventory](ctp:api:type:ProductProjectionInventoryEntries). * * If [ProductSelection](ctp:api:type:ProductSelection) is used, it affects the [availability of the Product](/projects/stores#products-available-in-store) in the specified Store. diff --git a/platform/client_product_projections_by_project_key_in_store_key_by_store_key_product_projections_by_id_get.go b/platform/client_product_projections_by_project_key_in_store_key_by_store_key_product_projections_by_id_get.go index 20c4ba69..34e7b8ad 100644 --- a/platform/client_product_projections_by_project_key_in_store_key_by_store_key_product_projections_by_id_get.go +++ b/platform/client_product_projections_by_project_key_in_store_key_by_store_key_product_projections_by_id_get.go @@ -133,7 +133,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDRequestMethodGet /** * Gets the current or staged representation of a [Product](ctp:api:type:Product) by its ID in the specified [Store](ctp:api:type:Store). * If the Store has defined some languages, countries, distribution, supply Channels, and/or Product Selection, -* they are used for projections based on [locale](ctp:api:type:ProductProjectionLocales), [price](ctp:api:type:ProductProjectionPrices) +* they are used for projections based on [locale](ctp:api:type:ProductProjectionLocales), [price](ctp:api:type:ProductProjectionPrices), * and [inventory](ctp:api:type:ProductProjectionInventoryEntries). * * If [ProductSelection](ctp:api:type:ProductSelection) is used, it affects the [availability of the Product](/projects/stores#products-available-in-store) in the specified Store. diff --git a/platform/client_product_projections_by_project_key_in_store_key_by_store_key_product_projections_key_by_key.go b/platform/client_product_projections_by_project_key_in_store_key_by_store_key_product_projections_key_by_key.go index 3f563625..8968be17 100644 --- a/platform/client_product_projections_by_project_key_in_store_key_by_store_key_product_projections_key_by_key.go +++ b/platform/client_product_projections_by_project_key_in_store_key_by_store_key_product_projections_key_by_key.go @@ -16,7 +16,7 @@ type ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyRequestBuilder st /** * Gets the current or staged representation of a [Product](ctp:api:type:Product) by its key in the specified [Store](ctp:api:type:Store). * If the Store has defined some languages, countries, distribution, supply Channels, and/or Product Selection, -* they are used for projections based on [locale](ctp:api:type:ProductProjectionLocales), [price](ctp:api:type:ProductProjectionPrices) +* they are used for projections based on [locale](ctp:api:type:ProductProjectionLocales), [price](ctp:api:type:ProductProjectionPrices), * and [inventory](ctp:api:type:ProductProjectionInventoryEntries). * * If [ProductSelection](ctp:api:type:ProductSelection) is used, it affects the [availability of the Product](/projects/stores#products-available-in-store) in the specified Store. diff --git a/platform/client_product_projections_by_project_key_in_store_key_by_store_key_product_projections_key_by_key_get.go b/platform/client_product_projections_by_project_key_in_store_key_by_store_key_product_projections_key_by_key_get.go index de867da8..7e8cd5eb 100644 --- a/platform/client_product_projections_by_project_key_in_store_key_by_store_key_product_projections_key_by_key_get.go +++ b/platform/client_product_projections_by_project_key_in_store_key_by_store_key_product_projections_key_by_key_get.go @@ -133,7 +133,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyRequestMetho /** * Gets the current or staged representation of a [Product](ctp:api:type:Product) by its key in the specified [Store](ctp:api:type:Store). * If the Store has defined some languages, countries, distribution, supply Channels, and/or Product Selection, -* they are used for projections based on [locale](ctp:api:type:ProductProjectionLocales), [price](ctp:api:type:ProductProjectionPrices) +* they are used for projections based on [locale](ctp:api:type:ProductProjectionLocales), [price](ctp:api:type:ProductProjectionPrices), * and [inventory](ctp:api:type:ProductProjectionInventoryEntries). * * If [ProductSelection](ctp:api:type:ProductSelection) is used, it affects the [availability of the Product](/projects/stores#products-available-in-store) in the specified Store. diff --git a/platform/client_product_tailoring_by_project_key_in_store_key_by_store_key_products_by_product_id_product_tailoring.go b/platform/client_product_tailoring_by_project_key_in_store_key_by_store_key_products_by_product_id_product_tailoring.go index b1f678c8..8822fb12 100644 --- a/platform/client_product_tailoring_by_project_key_in_store_key_by_store_key_products_by_product_id_product_tailoring.go +++ b/platform/client_product_tailoring_by_project_key_in_store_key_by_store_key_products_by_product_id_product_tailoring.go @@ -13,6 +13,15 @@ type ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringRequestB client *Client } +func (rb *ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringRequestBuilder) Images() *ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestBuilder { + return &ByProjectKeyInStoreKeyByStoreKeyProductsByProductIDProductTailoringImagesRequestBuilder{ + projectKey: rb.projectKey, + storeKey: rb.storeKey, + productId: rb.productId, + client: rb.client, + } +} + /** * Gets the current or staged representation of a [Product Tailoring](ctp:api:type:ProductTailoring) by its Product ID in the specified [Store](ctp:api:type:Store). * diff --git a/platform/client_product_tailoring_by_project_key_in_store_key_by_store_key_products_key_by_product_key_product_tailoring.go b/platform/client_product_tailoring_by_project_key_in_store_key_by_store_key_products_key_by_product_key_product_tailoring.go index ced10400..32edb2b7 100644 --- a/platform/client_product_tailoring_by_project_key_in_store_key_by_store_key_products_key_by_product_key_product_tailoring.go +++ b/platform/client_product_tailoring_by_project_key_in_store_key_by_store_key_products_key_by_product_key_product_tailoring.go @@ -13,6 +13,15 @@ type ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringRequ client *Client } +func (rb *ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringRequestBuilder) Images() *ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestBuilder { + return &ByProjectKeyInStoreKeyByStoreKeyProductsKeyByProductKeyProductTailoringImagesRequestBuilder{ + projectKey: rb.projectKey, + storeKey: rb.storeKey, + productKey: rb.productKey, + client: rb.client, + } +} + /** * Gets the current or staged representation of a [Product Tailoring](ctp:api:type:ProductTailoring) by its Product key in the specified [Store](ctp:api:type:Store). * diff --git a/platform/client_products_by_project_key_products.go b/platform/client_products_by_project_key_products.go index d8afceff..b3a26a6e 100644 --- a/platform/client_products_by_project_key_products.go +++ b/platform/client_products_by_project_key_products.go @@ -27,7 +27,18 @@ func (rb *ByProjectKeyProductsRequestBuilder) WithId(id string) *ByProjectKeyPro } /** -* If [Price selection](ctp:api:type:ProductPriceSelection) query parameters are provided, the selected Prices are added to the response. +* This endpoint provides high-performance search queries over Products. Product Search allows searching through all products with a current projection in your Project. +* + */ +func (rb *ByProjectKeyProductsRequestBuilder) Search() *ByProjectKeyProductsSearchRequestBuilder { + return &ByProjectKeyProductsSearchRequestBuilder{ + projectKey: rb.projectKey, + client: rb.client, + } +} + +/** +* If [Product price selection query parameters](/../api/pricing-and-discounts-overview#product-price-selection) are provided, the selected Prices are added to the response. */ func (rb *ByProjectKeyProductsRequestBuilder) Get() *ByProjectKeyProductsRequestMethodGet { return &ByProjectKeyProductsRequestMethodGet{ @@ -48,7 +59,7 @@ func (rb *ByProjectKeyProductsRequestBuilder) Head() *ByProjectKeyProductsReques /** * To create a new Product, send a representation that is going to become the initial _staged_ and _current_ representation of the new Product in the catalog. -* If [Price Selection](ctp:api:type:ProductPriceSelection) query parameters are provided, selected Prices will be added to the response. +* If [Product price selection query parameters](/../api/pricing-and-discounts-overview#product-price-selection) are provided, selected Prices will be added to the response. * Produces the [ProductCreated](/projects/messages#product-created) Message. * */ diff --git a/platform/client_products_by_project_key_products_by_id.go b/platform/client_products_by_project_key_products_by_id.go index 83000dcd..add3f7eb 100644 --- a/platform/client_products_by_project_key_products_by_id.go +++ b/platform/client_products_by_project_key_products_by_id.go @@ -28,7 +28,7 @@ func (rb *ByProjectKeyProductsByIDRequestBuilder) ProductSelections() *ByProject } /** -* If [Price selection](ctp:api:type:ProductPriceSelection) query parameters are provided, the selected Prices are added to the response. +* If [Product price selection query parameters](/../api/pricing-and-discounts-overview#product-price-selection) are provided, the selected Prices are added to the response. */ func (rb *ByProjectKeyProductsByIDRequestBuilder) Get() *ByProjectKeyProductsByIDRequestMethodGet { return &ByProjectKeyProductsByIDRequestMethodGet{ @@ -48,7 +48,7 @@ func (rb *ByProjectKeyProductsByIDRequestBuilder) Head() *ByProjectKeyProductsBy } /** -* If [Price selection](ctp:api:type:ProductPriceSelection) query parameters are provided, the selected Prices are added to the response. +* If [Product price selection query parameters](/../api/pricing-and-discounts-overview#product-price-selection) are provided, the selected Prices are added to the response. * * A failed response can return a [DuplicatePriceScope](ctp:api:type:DuplicatePriceScopeError), [DuplicateVariantValues](ctp:api:type:DuplicateVariantValuesError), [DuplicateAttributeValue](ctp:api:type:DuplicateAttributeValueError), or [DuplicateAttributeValues](ctp:api:type:DuplicateAttributeValuesError) error. */ @@ -61,7 +61,7 @@ func (rb *ByProjectKeyProductsByIDRequestBuilder) Post(body ProductUpdate) *ByPr } /** -* If [Price selection](ctp:api:type:ProductPriceSelection) query parameters are provided, the selected Prices are added to the response. +* If [Product price selection query parameters](/../api/pricing-and-discounts-overview#product-price-selection) are provided, the selected Prices are added to the response. * Produces the [ProductDeleted](/projects/messages#product-deleted) Message. */ func (rb *ByProjectKeyProductsByIDRequestBuilder) Delete() *ByProjectKeyProductsByIDRequestMethodDelete { diff --git a/platform/client_products_by_project_key_products_by_id_delete.go b/platform/client_products_by_project_key_products_by_id_delete.go index 7cdb7d72..5cc94ebf 100644 --- a/platform/client_products_by_project_key_products_by_id_delete.go +++ b/platform/client_products_by_project_key_products_by_id_delete.go @@ -31,7 +31,6 @@ type ByProjectKeyProductsByIDRequestMethodDeleteInput struct { PriceCountry *string PriceCustomerGroup *string PriceChannel *string - LocaleProjection []string Version int Expand []string } @@ -50,9 +49,6 @@ func (input *ByProjectKeyProductsByIDRequestMethodDeleteInput) Values() url.Valu if input.PriceChannel != nil { values.Add("priceChannel", fmt.Sprintf("%v", *input.PriceChannel)) } - for _, v := range input.LocaleProjection { - values.Add("localeProjection", fmt.Sprintf("%v", v)) - } values.Add("version", strconv.Itoa(input.Version)) for _, v := range input.Expand { values.Add("expand", fmt.Sprintf("%v", v)) @@ -92,14 +88,6 @@ func (rb *ByProjectKeyProductsByIDRequestMethodDelete) PriceChannel(v string) *B return rb } -func (rb *ByProjectKeyProductsByIDRequestMethodDelete) LocaleProjection(v []string) *ByProjectKeyProductsByIDRequestMethodDelete { - if rb.params == nil { - rb.params = &ByProjectKeyProductsByIDRequestMethodDeleteInput{} - } - rb.params.LocaleProjection = v - return rb -} - func (rb *ByProjectKeyProductsByIDRequestMethodDelete) Version(v int) *ByProjectKeyProductsByIDRequestMethodDelete { if rb.params == nil { rb.params = &ByProjectKeyProductsByIDRequestMethodDeleteInput{} @@ -126,7 +114,7 @@ func (rb *ByProjectKeyProductsByIDRequestMethodDelete) WithHeaders(headers http. } /** -* If [Price selection](ctp:api:type:ProductPriceSelection) query parameters are provided, the selected Prices are added to the response. +* If [Product price selection query parameters](/../api/pricing-and-discounts-overview#product-price-selection) are provided, the selected Prices are added to the response. * Produces the [ProductDeleted](/projects/messages#product-deleted) Message. */ func (rb *ByProjectKeyProductsByIDRequestMethodDelete) Execute(ctx context.Context) (result *Product, err error) { diff --git a/platform/client_products_by_project_key_products_by_id_get.go b/platform/client_products_by_project_key_products_by_id_get.go index 7321f1c9..01eb9802 100644 --- a/platform/client_products_by_project_key_products_by_id_get.go +++ b/platform/client_products_by_project_key_products_by_id_get.go @@ -30,7 +30,6 @@ type ByProjectKeyProductsByIDRequestMethodGetInput struct { PriceCountry *string PriceCustomerGroup *string PriceChannel *string - LocaleProjection []string Expand []string } @@ -48,9 +47,6 @@ func (input *ByProjectKeyProductsByIDRequestMethodGetInput) Values() url.Values if input.PriceChannel != nil { values.Add("priceChannel", fmt.Sprintf("%v", *input.PriceChannel)) } - for _, v := range input.LocaleProjection { - values.Add("localeProjection", fmt.Sprintf("%v", v)) - } for _, v := range input.Expand { values.Add("expand", fmt.Sprintf("%v", v)) } @@ -89,14 +85,6 @@ func (rb *ByProjectKeyProductsByIDRequestMethodGet) PriceChannel(v string) *ByPr return rb } -func (rb *ByProjectKeyProductsByIDRequestMethodGet) LocaleProjection(v []string) *ByProjectKeyProductsByIDRequestMethodGet { - if rb.params == nil { - rb.params = &ByProjectKeyProductsByIDRequestMethodGetInput{} - } - rb.params.LocaleProjection = v - return rb -} - func (rb *ByProjectKeyProductsByIDRequestMethodGet) Expand(v []string) *ByProjectKeyProductsByIDRequestMethodGet { if rb.params == nil { rb.params = &ByProjectKeyProductsByIDRequestMethodGetInput{} @@ -115,7 +103,7 @@ func (rb *ByProjectKeyProductsByIDRequestMethodGet) WithHeaders(headers http.Hea } /** -* If [Price selection](ctp:api:type:ProductPriceSelection) query parameters are provided, the selected Prices are added to the response. +* If [Product price selection query parameters](/../api/pricing-and-discounts-overview#product-price-selection) are provided, the selected Prices are added to the response. */ func (rb *ByProjectKeyProductsByIDRequestMethodGet) Execute(ctx context.Context) (result *Product, err error) { var queryParams url.Values diff --git a/platform/client_products_by_project_key_products_by_id_post.go b/platform/client_products_by_project_key_products_by_id_post.go index e81f79b6..6dab2a01 100644 --- a/platform/client_products_by_project_key_products_by_id_post.go +++ b/platform/client_products_by_project_key_products_by_id_post.go @@ -31,7 +31,6 @@ type ByProjectKeyProductsByIDRequestMethodPostInput struct { PriceCountry *string PriceCustomerGroup *string PriceChannel *string - LocaleProjection []string Expand []string } @@ -49,9 +48,6 @@ func (input *ByProjectKeyProductsByIDRequestMethodPostInput) Values() url.Values if input.PriceChannel != nil { values.Add("priceChannel", fmt.Sprintf("%v", *input.PriceChannel)) } - for _, v := range input.LocaleProjection { - values.Add("localeProjection", fmt.Sprintf("%v", v)) - } for _, v := range input.Expand { values.Add("expand", fmt.Sprintf("%v", v)) } @@ -90,14 +86,6 @@ func (rb *ByProjectKeyProductsByIDRequestMethodPost) PriceChannel(v string) *ByP return rb } -func (rb *ByProjectKeyProductsByIDRequestMethodPost) LocaleProjection(v []string) *ByProjectKeyProductsByIDRequestMethodPost { - if rb.params == nil { - rb.params = &ByProjectKeyProductsByIDRequestMethodPostInput{} - } - rb.params.LocaleProjection = v - return rb -} - func (rb *ByProjectKeyProductsByIDRequestMethodPost) Expand(v []string) *ByProjectKeyProductsByIDRequestMethodPost { if rb.params == nil { rb.params = &ByProjectKeyProductsByIDRequestMethodPostInput{} @@ -116,7 +104,7 @@ func (rb *ByProjectKeyProductsByIDRequestMethodPost) WithHeaders(headers http.He } /** -* If [Price selection](ctp:api:type:ProductPriceSelection) query parameters are provided, the selected Prices are added to the response. +* If [Product price selection query parameters](/../api/pricing-and-discounts-overview#product-price-selection) are provided, the selected Prices are added to the response. * * A failed response can return a [DuplicatePriceScope](ctp:api:type:DuplicatePriceScopeError), [DuplicateVariantValues](ctp:api:type:DuplicateVariantValuesError), [DuplicateAttributeValue](ctp:api:type:DuplicateAttributeValueError), or [DuplicateAttributeValues](ctp:api:type:DuplicateAttributeValuesError) error. */ diff --git a/platform/client_products_by_project_key_products_get.go b/platform/client_products_by_project_key_products_get.go index 69ab3b8a..a48b697c 100644 --- a/platform/client_products_by_project_key_products_get.go +++ b/platform/client_products_by_project_key_products_get.go @@ -32,7 +32,6 @@ type ByProjectKeyProductsRequestMethodGetInput struct { PriceCountry *string PriceCustomerGroup *string PriceChannel *string - LocaleProjection []string Expand []string Sort []string Limit *int @@ -58,9 +57,6 @@ func (input *ByProjectKeyProductsRequestMethodGetInput) Values() url.Values { if input.PriceChannel != nil { values.Add("priceChannel", fmt.Sprintf("%v", *input.PriceChannel)) } - for _, v := range input.LocaleProjection { - values.Add("localeProjection", fmt.Sprintf("%v", v)) - } for _, v := range input.Expand { values.Add("expand", fmt.Sprintf("%v", v)) } @@ -128,14 +124,6 @@ func (rb *ByProjectKeyProductsRequestMethodGet) PriceChannel(v string) *ByProjec return rb } -func (rb *ByProjectKeyProductsRequestMethodGet) LocaleProjection(v []string) *ByProjectKeyProductsRequestMethodGet { - if rb.params == nil { - rb.params = &ByProjectKeyProductsRequestMethodGetInput{} - } - rb.params.LocaleProjection = v - return rb -} - func (rb *ByProjectKeyProductsRequestMethodGet) Expand(v []string) *ByProjectKeyProductsRequestMethodGet { if rb.params == nil { rb.params = &ByProjectKeyProductsRequestMethodGetInput{} @@ -194,7 +182,7 @@ func (rb *ByProjectKeyProductsRequestMethodGet) WithHeaders(headers http.Header) } /** -* If [Price selection](ctp:api:type:ProductPriceSelection) query parameters are provided, the selected Prices are added to the response. +* If [Product price selection query parameters](/../api/pricing-and-discounts-overview#product-price-selection) are provided, the selected Prices are added to the response. */ func (rb *ByProjectKeyProductsRequestMethodGet) Execute(ctx context.Context) (result *ProductPagedQueryResponse, err error) { var queryParams url.Values diff --git a/platform/client_products_by_project_key_products_key_by_key.go b/platform/client_products_by_project_key_products_key_by_key.go index 8ae147c4..c00dc0d9 100644 --- a/platform/client_products_by_project_key_products_key_by_key.go +++ b/platform/client_products_by_project_key_products_key_by_key.go @@ -21,7 +21,7 @@ func (rb *ByProjectKeyProductsKeyByKeyRequestBuilder) ProductSelections() *ByPro } /** -* If [Price selection](ctp:api:type:ProductPriceSelection) query parameters are provided, the selected Prices are added to the response. +* If [Product price selection query parameters](/../api/pricing-and-discounts-overview#product-price-selection) are provided, the selected Prices are added to the response. */ func (rb *ByProjectKeyProductsKeyByKeyRequestBuilder) Get() *ByProjectKeyProductsKeyByKeyRequestMethodGet { return &ByProjectKeyProductsKeyByKeyRequestMethodGet{ @@ -52,7 +52,7 @@ func (rb *ByProjectKeyProductsKeyByKeyRequestBuilder) Post(body ProductUpdate) * } /** -* If [Price selection](ctp:api:type:ProductPriceSelection) query parameters are provided, the selected Prices are added to the response. +* If [Product price selection query parameters](/../api/pricing-and-discounts-overview#product-price-selection) are provided, the selected Prices are added to the response. * Produces the [ProductDeleted](/projects/messages#product-deleted) Message. */ func (rb *ByProjectKeyProductsKeyByKeyRequestBuilder) Delete() *ByProjectKeyProductsKeyByKeyRequestMethodDelete { diff --git a/platform/client_products_by_project_key_products_key_by_key_delete.go b/platform/client_products_by_project_key_products_key_by_key_delete.go index 4e0e2851..e7d946f8 100644 --- a/platform/client_products_by_project_key_products_key_by_key_delete.go +++ b/platform/client_products_by_project_key_products_key_by_key_delete.go @@ -31,7 +31,6 @@ type ByProjectKeyProductsKeyByKeyRequestMethodDeleteInput struct { PriceCountry *string PriceCustomerGroup *string PriceChannel *string - LocaleProjection []string Version int Expand []string } @@ -50,9 +49,6 @@ func (input *ByProjectKeyProductsKeyByKeyRequestMethodDeleteInput) Values() url. if input.PriceChannel != nil { values.Add("priceChannel", fmt.Sprintf("%v", *input.PriceChannel)) } - for _, v := range input.LocaleProjection { - values.Add("localeProjection", fmt.Sprintf("%v", v)) - } values.Add("version", strconv.Itoa(input.Version)) for _, v := range input.Expand { values.Add("expand", fmt.Sprintf("%v", v)) @@ -92,14 +88,6 @@ func (rb *ByProjectKeyProductsKeyByKeyRequestMethodDelete) PriceChannel(v string return rb } -func (rb *ByProjectKeyProductsKeyByKeyRequestMethodDelete) LocaleProjection(v []string) *ByProjectKeyProductsKeyByKeyRequestMethodDelete { - if rb.params == nil { - rb.params = &ByProjectKeyProductsKeyByKeyRequestMethodDeleteInput{} - } - rb.params.LocaleProjection = v - return rb -} - func (rb *ByProjectKeyProductsKeyByKeyRequestMethodDelete) Version(v int) *ByProjectKeyProductsKeyByKeyRequestMethodDelete { if rb.params == nil { rb.params = &ByProjectKeyProductsKeyByKeyRequestMethodDeleteInput{} @@ -126,7 +114,7 @@ func (rb *ByProjectKeyProductsKeyByKeyRequestMethodDelete) WithHeaders(headers h } /** -* If [Price selection](ctp:api:type:ProductPriceSelection) query parameters are provided, the selected Prices are added to the response. +* If [Product price selection query parameters](/../api/pricing-and-discounts-overview#product-price-selection) are provided, the selected Prices are added to the response. * Produces the [ProductDeleted](/projects/messages#product-deleted) Message. */ func (rb *ByProjectKeyProductsKeyByKeyRequestMethodDelete) Execute(ctx context.Context) (result *Product, err error) { diff --git a/platform/client_products_by_project_key_products_key_by_key_get.go b/platform/client_products_by_project_key_products_key_by_key_get.go index f508ede7..cadb81c1 100644 --- a/platform/client_products_by_project_key_products_key_by_key_get.go +++ b/platform/client_products_by_project_key_products_key_by_key_get.go @@ -30,7 +30,6 @@ type ByProjectKeyProductsKeyByKeyRequestMethodGetInput struct { PriceCountry *string PriceCustomerGroup *string PriceChannel *string - LocaleProjection []string Expand []string } @@ -48,9 +47,6 @@ func (input *ByProjectKeyProductsKeyByKeyRequestMethodGetInput) Values() url.Val if input.PriceChannel != nil { values.Add("priceChannel", fmt.Sprintf("%v", *input.PriceChannel)) } - for _, v := range input.LocaleProjection { - values.Add("localeProjection", fmt.Sprintf("%v", v)) - } for _, v := range input.Expand { values.Add("expand", fmt.Sprintf("%v", v)) } @@ -89,14 +85,6 @@ func (rb *ByProjectKeyProductsKeyByKeyRequestMethodGet) PriceChannel(v string) * return rb } -func (rb *ByProjectKeyProductsKeyByKeyRequestMethodGet) LocaleProjection(v []string) *ByProjectKeyProductsKeyByKeyRequestMethodGet { - if rb.params == nil { - rb.params = &ByProjectKeyProductsKeyByKeyRequestMethodGetInput{} - } - rb.params.LocaleProjection = v - return rb -} - func (rb *ByProjectKeyProductsKeyByKeyRequestMethodGet) Expand(v []string) *ByProjectKeyProductsKeyByKeyRequestMethodGet { if rb.params == nil { rb.params = &ByProjectKeyProductsKeyByKeyRequestMethodGetInput{} @@ -115,7 +103,7 @@ func (rb *ByProjectKeyProductsKeyByKeyRequestMethodGet) WithHeaders(headers http } /** -* If [Price selection](ctp:api:type:ProductPriceSelection) query parameters are provided, the selected Prices are added to the response. +* If [Product price selection query parameters](/../api/pricing-and-discounts-overview#product-price-selection) are provided, the selected Prices are added to the response. */ func (rb *ByProjectKeyProductsKeyByKeyRequestMethodGet) Execute(ctx context.Context) (result *Product, err error) { var queryParams url.Values diff --git a/platform/client_products_by_project_key_products_key_by_key_post.go b/platform/client_products_by_project_key_products_key_by_key_post.go index 77696587..e6051e2b 100644 --- a/platform/client_products_by_project_key_products_key_by_key_post.go +++ b/platform/client_products_by_project_key_products_key_by_key_post.go @@ -31,7 +31,6 @@ type ByProjectKeyProductsKeyByKeyRequestMethodPostInput struct { PriceCountry *string PriceCustomerGroup *string PriceChannel *string - LocaleProjection []string Expand []string } @@ -49,9 +48,6 @@ func (input *ByProjectKeyProductsKeyByKeyRequestMethodPostInput) Values() url.Va if input.PriceChannel != nil { values.Add("priceChannel", fmt.Sprintf("%v", *input.PriceChannel)) } - for _, v := range input.LocaleProjection { - values.Add("localeProjection", fmt.Sprintf("%v", v)) - } for _, v := range input.Expand { values.Add("expand", fmt.Sprintf("%v", v)) } @@ -90,14 +86,6 @@ func (rb *ByProjectKeyProductsKeyByKeyRequestMethodPost) PriceChannel(v string) return rb } -func (rb *ByProjectKeyProductsKeyByKeyRequestMethodPost) LocaleProjection(v []string) *ByProjectKeyProductsKeyByKeyRequestMethodPost { - if rb.params == nil { - rb.params = &ByProjectKeyProductsKeyByKeyRequestMethodPostInput{} - } - rb.params.LocaleProjection = v - return rb -} - func (rb *ByProjectKeyProductsKeyByKeyRequestMethodPost) Expand(v []string) *ByProjectKeyProductsKeyByKeyRequestMethodPost { if rb.params == nil { rb.params = &ByProjectKeyProductsKeyByKeyRequestMethodPostInput{} diff --git a/platform/client_products_by_project_key_products_post.go b/platform/client_products_by_project_key_products_post.go index d7f11ecf..32c49455 100644 --- a/platform/client_products_by_project_key_products_post.go +++ b/platform/client_products_by_project_key_products_post.go @@ -31,7 +31,6 @@ type ByProjectKeyProductsRequestMethodPostInput struct { PriceCountry *string PriceCustomerGroup *string PriceChannel *string - LocaleProjection []string Expand []string } @@ -49,9 +48,6 @@ func (input *ByProjectKeyProductsRequestMethodPostInput) Values() url.Values { if input.PriceChannel != nil { values.Add("priceChannel", fmt.Sprintf("%v", *input.PriceChannel)) } - for _, v := range input.LocaleProjection { - values.Add("localeProjection", fmt.Sprintf("%v", v)) - } for _, v := range input.Expand { values.Add("expand", fmt.Sprintf("%v", v)) } @@ -90,14 +86,6 @@ func (rb *ByProjectKeyProductsRequestMethodPost) PriceChannel(v string) *ByProje return rb } -func (rb *ByProjectKeyProductsRequestMethodPost) LocaleProjection(v []string) *ByProjectKeyProductsRequestMethodPost { - if rb.params == nil { - rb.params = &ByProjectKeyProductsRequestMethodPostInput{} - } - rb.params.LocaleProjection = v - return rb -} - func (rb *ByProjectKeyProductsRequestMethodPost) Expand(v []string) *ByProjectKeyProductsRequestMethodPost { if rb.params == nil { rb.params = &ByProjectKeyProductsRequestMethodPostInput{} @@ -117,7 +105,7 @@ func (rb *ByProjectKeyProductsRequestMethodPost) WithHeaders(headers http.Header /** * To create a new Product, send a representation that is going to become the initial _staged_ and _current_ representation of the new Product in the catalog. -* If [Price Selection](ctp:api:type:ProductPriceSelection) query parameters are provided, selected Prices will be added to the response. +* If [Product price selection query parameters](/../api/pricing-and-discounts-overview#product-price-selection) are provided, selected Prices will be added to the response. * Produces the [ProductCreated](/projects/messages#product-created) Message. * */ diff --git a/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests.go b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests.go new file mode 100644 index 00000000..d0c7f05b --- /dev/null +++ b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests.go @@ -0,0 +1,54 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "fmt" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestBuilder struct { + projectKey string + storeKey string + client *Client +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestBuilder) WithKey(key string) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestBuilder { + return &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestBuilder{ + key: key, + projectKey: rb.projectKey, + storeKey: rb.storeKey, + client: rb.client, + } +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestBuilder) WithId(id string) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestBuilder { + return &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestBuilder{ + id: id, + projectKey: rb.projectKey, + storeKey: rb.storeKey, + client: rb.client, + } +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet { + return &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet{ + url: fmt.Sprintf("/%s/in-store/key=%s/quote-requests", rb.projectKey, rb.storeKey), + client: rb.client, + } +} + +/** +* Checks if a QuoteRequest exists for a given Query Predicate. Returns a `200 OK` status if any QuoteRequests match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodHead { + return &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodHead{ + url: fmt.Sprintf("/%s/in-store/key=%s/quote-requests", rb.projectKey, rb.storeKey), + client: rb.client, + } +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestBuilder) Post(body QuoteRequestDraft) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodPost { + return &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodPost{ + body: body, + url: fmt.Sprintf("/%s/in-store/key=%s/quote-requests", rb.projectKey, rb.storeKey), + client: rb.client, + } +} diff --git a/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_by_id.go b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_by_id.go new file mode 100644 index 00000000..28e3e3e1 --- /dev/null +++ b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_by_id.go @@ -0,0 +1,46 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "fmt" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestBuilder struct { + projectKey string + storeKey string + id string + client *Client +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodGet { + return &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodGet{ + url: fmt.Sprintf("/%s/in-store/key=%s/quote-requests/%s", rb.projectKey, rb.storeKey, rb.id), + client: rb.client, + } +} + +/** +* Checks if a QuoteRequest exists for a given `id`. Returns a `200 OK` status if the QuoteRequest exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodHead { + return &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodHead{ + url: fmt.Sprintf("/%s/in-store/key=%s/quote-requests/%s", rb.projectKey, rb.storeKey, rb.id), + client: rb.client, + } +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestBuilder) Post(body QuoteRequestUpdate) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodPost { + return &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodPost{ + body: body, + url: fmt.Sprintf("/%s/in-store/key=%s/quote-requests/%s", rb.projectKey, rb.storeKey, rb.id), + client: rb.client, + } +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestBuilder) Delete() *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodDelete { + return &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodDelete{ + url: fmt.Sprintf("/%s/in-store/key=%s/quote-requests/%s", rb.projectKey, rb.storeKey, rb.id), + client: rb.client, + } +} diff --git a/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_by_id_delete.go b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_by_id_delete.go new file mode 100644 index 00000000..76e1db5c --- /dev/null +++ b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_by_id_delete.go @@ -0,0 +1,173 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" + "strconv" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodDelete struct { + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodDeleteInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodDelete) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodDeleteInput struct { + DataErasure *bool + Version int + Expand []string +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodDeleteInput) Values() url.Values { + values := url.Values{} + if input.DataErasure != nil { + if *input.DataErasure { + values.Add("dataErasure", "true") + } else { + values.Add("dataErasure", "false") + } + } + values.Add("version", strconv.Itoa(input.Version)) + for _, v := range input.Expand { + values.Add("expand", fmt.Sprintf("%v", v)) + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodDelete) DataErasure(v bool) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodDelete { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodDeleteInput{} + } + rb.params.DataErasure = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodDelete) Version(v int) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodDelete { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodDeleteInput{} + } + rb.params.Version = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodDelete) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodDelete { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodDeleteInput{} + } + rb.params.Expand = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodDelete) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodDeleteInput) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodDelete { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodDelete) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodDelete { + rb.headers = headers + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodDelete) Execute(ctx context.Context) (result *QuoteRequest, err error) { + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.delete( + ctx, + rb.url, + queryParams, + rb.headers, + nil, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 409: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 404: + return nil, ErrNotFound + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_by_id_get.go b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_by_id_get.go new file mode 100644 index 00000000..8d9eabb8 --- /dev/null +++ b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_by_id_get.go @@ -0,0 +1,138 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodGet struct { + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodGetInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodGet) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodGetInput struct { + Expand []string +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodGetInput) Values() url.Values { + values := url.Values{} + for _, v := range input.Expand { + values.Add("expand", fmt.Sprintf("%v", v)) + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodGet) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodGetInput{} + } + rb.params.Expand = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodGet) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodGetInput) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodGet { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodGet) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodGet { + rb.headers = headers + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodGet) Execute(ctx context.Context) (result *QuoteRequest, err error) { + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.get( + ctx, + rb.url, + queryParams, + rb.headers, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 404: + return nil, ErrNotFound + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_by_id_head.go b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_by_id_head.go new file mode 100644 index 00000000..f42a566b --- /dev/null +++ b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_by_id_head.go @@ -0,0 +1,106 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodHead struct { + url string + client *Client + headers http.Header +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodHead) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + } +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodHead) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodHead { + rb.headers = headers + return rb +} + +/** +* Checks if a QuoteRequest exists for a given `id`. Returns a `200 OK` status if the QuoteRequest exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodHead) Execute(ctx context.Context) error { + queryParams := url.Values{} + resp, err := rb.client.head( + ctx, + rb.url, + queryParams, + rb.headers, + ) + + if err != nil { + return err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + return nil + case 404: + return ErrNotFound + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return result + } + +} diff --git a/platform/client_business_units_by_project_key_me_business_units_by_id_delete.go b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_by_id_post.go similarity index 60% rename from platform/client_business_units_by_project_key_me_business_units_by_id_delete.go rename to platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_by_id_post.go index c715f390..ce3015ee 100644 --- a/platform/client_business_units_by_project_key_me_business_units_by_id_delete.go +++ b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_by_id_post.go @@ -9,74 +9,68 @@ import ( "io/ioutil" "net/http" "net/url" - "strconv" ) -type ByProjectKeyMeBusinessUnitsByIDRequestMethodDelete struct { +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodPost struct { + body QuoteRequestUpdate url string client *Client headers http.Header - params *ByProjectKeyMeBusinessUnitsByIDRequestMethodDeleteInput + params *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodPostInput } -func (r *ByProjectKeyMeBusinessUnitsByIDRequestMethodDelete) Dump() map[string]interface{} { +func (r *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodPost) Dump() map[string]interface{} { return map[string]interface{}{ "url": r.url, "params": r.params, } } -type ByProjectKeyMeBusinessUnitsByIDRequestMethodDeleteInput struct { - Version int - Expand []string +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodPostInput struct { + Expand []string } -func (input *ByProjectKeyMeBusinessUnitsByIDRequestMethodDeleteInput) Values() url.Values { +func (input *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodPostInput) Values() url.Values { values := url.Values{} - values.Add("version", strconv.Itoa(input.Version)) for _, v := range input.Expand { values.Add("expand", fmt.Sprintf("%v", v)) } return values } -func (rb *ByProjectKeyMeBusinessUnitsByIDRequestMethodDelete) Version(v int) *ByProjectKeyMeBusinessUnitsByIDRequestMethodDelete { +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodPost) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodPost { if rb.params == nil { - rb.params = &ByProjectKeyMeBusinessUnitsByIDRequestMethodDeleteInput{} - } - rb.params.Version = v - return rb -} - -func (rb *ByProjectKeyMeBusinessUnitsByIDRequestMethodDelete) Expand(v []string) *ByProjectKeyMeBusinessUnitsByIDRequestMethodDelete { - if rb.params == nil { - rb.params = &ByProjectKeyMeBusinessUnitsByIDRequestMethodDeleteInput{} + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodPostInput{} } rb.params.Expand = v return rb } -func (rb *ByProjectKeyMeBusinessUnitsByIDRequestMethodDelete) WithQueryParams(input ByProjectKeyMeBusinessUnitsByIDRequestMethodDeleteInput) *ByProjectKeyMeBusinessUnitsByIDRequestMethodDelete { +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodPost) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodPostInput) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodPost { rb.params = &input return rb } -func (rb *ByProjectKeyMeBusinessUnitsByIDRequestMethodDelete) WithHeaders(headers http.Header) *ByProjectKeyMeBusinessUnitsByIDRequestMethodDelete { +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodPost) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodPost { rb.headers = headers return rb } -func (rb *ByProjectKeyMeBusinessUnitsByIDRequestMethodDelete) Execute(ctx context.Context) (result *BusinessUnit, err error) { +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestMethodPost) Execute(ctx context.Context) (result *QuoteRequest, err error) { + data, err := serializeInput(rb.body) + if err != nil { + return nil, err + } var queryParams url.Values if rb.params != nil { queryParams = rb.params.Values() } else { queryParams = url.Values{} } - resp, err := rb.client.delete( + resp, err := rb.client.post( ctx, rb.url, queryParams, rb.headers, - nil, + data, ) if err != nil { diff --git a/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_get.go b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_get.go new file mode 100644 index 00000000..ee0908f4 --- /dev/null +++ b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_get.go @@ -0,0 +1,217 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" + "strconv" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet struct { + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGetInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGetInput struct { + Expand []string + Sort []string + Limit *int + Offset *int + WithTotal *bool + Where []string + PredicateVar map[string][]string +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGetInput) Values() url.Values { + values := url.Values{} + for _, v := range input.Expand { + values.Add("expand", fmt.Sprintf("%v", v)) + } + for _, v := range input.Sort { + values.Add("sort", fmt.Sprintf("%v", v)) + } + if input.Limit != nil { + values.Add("limit", strconv.Itoa(*input.Limit)) + } + if input.Offset != nil { + values.Add("offset", strconv.Itoa(*input.Offset)) + } + if input.WithTotal != nil { + if *input.WithTotal { + values.Add("withTotal", "true") + } else { + values.Add("withTotal", "false") + } + } + for _, v := range input.Where { + values.Add("where", fmt.Sprintf("%v", v)) + } + for k, v := range input.PredicateVar { + for _, x := range v { + values.Add(k, x) + } + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGetInput{} + } + rb.params.Expand = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet) Sort(v []string) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGetInput{} + } + rb.params.Sort = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet) Limit(v int) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGetInput{} + } + rb.params.Limit = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet) Offset(v int) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGetInput{} + } + rb.params.Offset = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet) WithTotal(v bool) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGetInput{} + } + rb.params.WithTotal = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet) Where(v []string) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGetInput{} + } + rb.params.Where = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet) PredicateVar(v map[string][]string) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGetInput{} + } + rb.params.PredicateVar = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGetInput) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet { + rb.headers = headers + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodGet) Execute(ctx context.Context) (result *QuoteRequestPagedQueryResponse, err error) { + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.get( + ctx, + rb.url, + queryParams, + rb.headers, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 404: + return nil, ErrNotFound + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_head.go b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_head.go new file mode 100644 index 00000000..4cd88870 --- /dev/null +++ b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_head.go @@ -0,0 +1,138 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodHead struct { + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodHeadInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodHead) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodHeadInput struct { + Where []string +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodHeadInput) Values() url.Values { + values := url.Values{} + for _, v := range input.Where { + values.Add("where", fmt.Sprintf("%v", v)) + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodHead) Where(v []string) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodHead { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodHeadInput{} + } + rb.params.Where = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodHead) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodHeadInput) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodHead { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodHead) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodHead { + rb.headers = headers + return rb +} + +/** +* Checks if a QuoteRequest exists for a given Query Predicate. Returns a `200 OK` status if any QuoteRequests match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodHead) Execute(ctx context.Context) error { + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.head( + ctx, + rb.url, + queryParams, + rb.headers, + ) + + if err != nil { + return err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + return nil + case 404: + return ErrNotFound + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return result + } + +} diff --git a/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_key_by_key.go b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_key_by_key.go new file mode 100644 index 00000000..7e68962f --- /dev/null +++ b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_key_by_key.go @@ -0,0 +1,46 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "fmt" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestBuilder struct { + projectKey string + storeKey string + key string + client *Client +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodGet { + return &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodGet{ + url: fmt.Sprintf("/%s/in-store/key=%s/quote-requests/key=%s", rb.projectKey, rb.storeKey, rb.key), + client: rb.client, + } +} + +/** +* Checks if a QuoteRequest exists for a given `key`. Returns a `200 OK` status if the QuoteRequest exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodHead { + return &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodHead{ + url: fmt.Sprintf("/%s/in-store/key=%s/quote-requests/key=%s", rb.projectKey, rb.storeKey, rb.key), + client: rb.client, + } +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestBuilder) Post(body QuoteRequestUpdate) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodPost { + return &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodPost{ + body: body, + url: fmt.Sprintf("/%s/in-store/key=%s/quote-requests/key=%s", rb.projectKey, rb.storeKey, rb.key), + client: rb.client, + } +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestBuilder) Delete() *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodDelete { + return &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodDelete{ + url: fmt.Sprintf("/%s/in-store/key=%s/quote-requests/key=%s", rb.projectKey, rb.storeKey, rb.key), + client: rb.client, + } +} diff --git a/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_key_by_key_delete.go b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_key_by_key_delete.go new file mode 100644 index 00000000..bdacfad3 --- /dev/null +++ b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_key_by_key_delete.go @@ -0,0 +1,173 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" + "strconv" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodDelete struct { + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodDeleteInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodDelete) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodDeleteInput struct { + DataErasure *bool + Version int + Expand []string +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodDeleteInput) Values() url.Values { + values := url.Values{} + if input.DataErasure != nil { + if *input.DataErasure { + values.Add("dataErasure", "true") + } else { + values.Add("dataErasure", "false") + } + } + values.Add("version", strconv.Itoa(input.Version)) + for _, v := range input.Expand { + values.Add("expand", fmt.Sprintf("%v", v)) + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodDelete) DataErasure(v bool) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodDelete { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodDeleteInput{} + } + rb.params.DataErasure = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodDelete) Version(v int) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodDelete { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodDeleteInput{} + } + rb.params.Version = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodDelete) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodDelete { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodDeleteInput{} + } + rb.params.Expand = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodDelete) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodDeleteInput) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodDelete { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodDelete) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodDelete { + rb.headers = headers + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodDelete) Execute(ctx context.Context) (result *QuoteRequest, err error) { + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.delete( + ctx, + rb.url, + queryParams, + rb.headers, + nil, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 409: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 404: + return nil, ErrNotFound + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_key_by_key_get.go b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_key_by_key_get.go new file mode 100644 index 00000000..0321ffba --- /dev/null +++ b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_key_by_key_get.go @@ -0,0 +1,138 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodGet struct { + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodGetInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodGet) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodGetInput struct { + Expand []string +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodGetInput) Values() url.Values { + values := url.Values{} + for _, v := range input.Expand { + values.Add("expand", fmt.Sprintf("%v", v)) + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodGet) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodGetInput{} + } + rb.params.Expand = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodGet) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodGetInput) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodGet { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodGet) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodGet { + rb.headers = headers + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodGet) Execute(ctx context.Context) (result *QuoteRequest, err error) { + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.get( + ctx, + rb.url, + queryParams, + rb.headers, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 404: + return nil, ErrNotFound + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_key_by_key_head.go b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_key_by_key_head.go new file mode 100644 index 00000000..8ce56d96 --- /dev/null +++ b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_key_by_key_head.go @@ -0,0 +1,106 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodHead struct { + url string + client *Client + headers http.Header +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodHead) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + } +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodHead) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodHead { + rb.headers = headers + return rb +} + +/** +* Checks if a QuoteRequest exists for a given `key`. Returns a `200 OK` status if the QuoteRequest exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodHead) Execute(ctx context.Context) error { + queryParams := url.Values{} + resp, err := rb.client.head( + ctx, + rb.url, + queryParams, + rb.headers, + ) + + if err != nil { + return err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + return nil + case 404: + return ErrNotFound + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return result + } + +} diff --git a/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_key_by_key_post.go b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_key_by_key_post.go new file mode 100644 index 00000000..8d65cca9 --- /dev/null +++ b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_key_by_key_post.go @@ -0,0 +1,151 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodPost struct { + body QuoteRequestUpdate + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodPostInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodPost) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodPostInput struct { + Expand []string +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodPostInput) Values() url.Values { + values := url.Values{} + for _, v := range input.Expand { + values.Add("expand", fmt.Sprintf("%v", v)) + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodPost) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodPost { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodPostInput{} + } + rb.params.Expand = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodPost) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodPostInput) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodPost { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodPost) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodPost { + rb.headers = headers + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestMethodPost) Execute(ctx context.Context) (result *QuoteRequest, err error) { + data, err := serializeInput(rb.body) + if err != nil { + return nil, err + } + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.post( + ctx, + rb.url, + queryParams, + rb.headers, + data, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 409: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 404: + return nil, ErrNotFound + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_post.go b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_post.go new file mode 100644 index 00000000..7830521f --- /dev/null +++ b/platform/client_quote_requests_by_project_key_in_store_key_by_store_key_quote_requests_post.go @@ -0,0 +1,144 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodPost struct { + body QuoteRequestDraft + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodPostInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodPost) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodPostInput struct { + Expand []string +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodPostInput) Values() url.Values { + values := url.Values{} + for _, v := range input.Expand { + values.Add("expand", fmt.Sprintf("%v", v)) + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodPost) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodPost { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodPostInput{} + } + rb.params.Expand = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodPost) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodPostInput) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodPost { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodPost) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodPost { + rb.headers = headers + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestMethodPost) Execute(ctx context.Context) (result *QuoteRequest, err error) { + data, err := serializeInput(rb.body) + if err != nil { + return nil, err + } + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.post( + ctx, + rb.url, + queryParams, + rb.headers, + data, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 201: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 404: + return nil, ErrNotFound + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_quote_requests_by_project_key_me_quote_requests.go b/platform/client_quote_requests_by_project_key_me_quote_requests.go index 1ace5cbf..ffeef3be 100644 --- a/platform/client_quote_requests_by_project_key_me_quote_requests.go +++ b/platform/client_quote_requests_by_project_key_me_quote_requests.go @@ -25,6 +25,11 @@ func (rb *ByProjectKeyMeQuoteRequestsRequestBuilder) WithKey(key string) *ByProj client: rb.client, } } + +/** +* Returns all Quote Requests that match a given Query Predicate. Returns a `200 OK` status if successful. +* + */ func (rb *ByProjectKeyMeQuoteRequestsRequestBuilder) Get() *ByProjectKeyMeQuoteRequestsRequestMethodGet { return &ByProjectKeyMeQuoteRequestsRequestMethodGet{ url: fmt.Sprintf("/%s/me/quote-requests", rb.projectKey), @@ -33,7 +38,8 @@ func (rb *ByProjectKeyMeQuoteRequestsRequestBuilder) Get() *ByProjectKeyMeQuoteR } /** -* Checks if my QuoteRequest exists for a given Query Predicate. Returns a `200 OK` status if any QuoteRequests match the Query Predicate or a `404 Not Found` otherwise. +* Checks if a QuoteRequest exists for a given Query Predicate. Returns a `200 OK` status if any QuoteRequests match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. +* */ func (rb *ByProjectKeyMeQuoteRequestsRequestBuilder) Head() *ByProjectKeyMeQuoteRequestsRequestMethodHead { return &ByProjectKeyMeQuoteRequestsRequestMethodHead{ diff --git a/platform/client_quote_requests_by_project_key_me_quote_requests_by_id.go b/platform/client_quote_requests_by_project_key_me_quote_requests_by_id.go index 135b7457..d5b54b8c 100644 --- a/platform/client_quote_requests_by_project_key_me_quote_requests_by_id.go +++ b/platform/client_quote_requests_by_project_key_me_quote_requests_by_id.go @@ -20,7 +20,7 @@ func (rb *ByProjectKeyMeQuoteRequestsByIDRequestBuilder) Get() *ByProjectKeyMeQu } /** -* Checks if my QuoteRequest exists for a given `id`. Returns a `200 OK` status if the QuoteRequest exists or a `404 Not Found` otherwise. +* Checks if a QuoteRequest exists for a given `id`. Returns a `200 OK` status if the QuoteRequest exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyMeQuoteRequestsByIDRequestBuilder) Head() *ByProjectKeyMeQuoteRequestsByIDRequestMethodHead { return &ByProjectKeyMeQuoteRequestsByIDRequestMethodHead{ @@ -36,10 +36,3 @@ func (rb *ByProjectKeyMeQuoteRequestsByIDRequestBuilder) Post(body MyQuoteReques client: rb.client, } } - -func (rb *ByProjectKeyMeQuoteRequestsByIDRequestBuilder) Delete() *ByProjectKeyMeQuoteRequestsByIDRequestMethodDelete { - return &ByProjectKeyMeQuoteRequestsByIDRequestMethodDelete{ - url: fmt.Sprintf("/%s/me/quote-requests/%s", rb.projectKey, rb.id), - client: rb.client, - } -} diff --git a/platform/client_quote_requests_by_project_key_me_quote_requests_by_id_head.go b/platform/client_quote_requests_by_project_key_me_quote_requests_by_id_head.go index f49d3d13..12e7c654 100644 --- a/platform/client_quote_requests_by_project_key_me_quote_requests_by_id_head.go +++ b/platform/client_quote_requests_by_project_key_me_quote_requests_by_id_head.go @@ -28,7 +28,7 @@ func (rb *ByProjectKeyMeQuoteRequestsByIDRequestMethodHead) WithHeaders(headers } /** -* Checks if my QuoteRequest exists for a given `id`. Returns a `200 OK` status if the QuoteRequest exists or a `404 Not Found` otherwise. +* Checks if a QuoteRequest exists for a given `id`. Returns a `200 OK` status if the QuoteRequest exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyMeQuoteRequestsByIDRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_quote_requests_by_project_key_me_quote_requests_get.go b/platform/client_quote_requests_by_project_key_me_quote_requests_get.go index b3eeeddc..73b521c4 100644 --- a/platform/client_quote_requests_by_project_key_me_quote_requests_get.go +++ b/platform/client_quote_requests_by_project_key_me_quote_requests_get.go @@ -132,6 +132,11 @@ func (rb *ByProjectKeyMeQuoteRequestsRequestMethodGet) WithHeaders(headers http. rb.headers = headers return rb } + +/** +* Returns all Quote Requests that match a given Query Predicate. Returns a `200 OK` status if successful. +* + */ func (rb *ByProjectKeyMeQuoteRequestsRequestMethodGet) Execute(ctx context.Context) (result *QuoteRequestPagedQueryResponse, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_quote_requests_by_project_key_me_quote_requests_head.go b/platform/client_quote_requests_by_project_key_me_quote_requests_head.go index f1070173..6dc99bd6 100644 --- a/platform/client_quote_requests_by_project_key_me_quote_requests_head.go +++ b/platform/client_quote_requests_by_project_key_me_quote_requests_head.go @@ -55,7 +55,8 @@ func (rb *ByProjectKeyMeQuoteRequestsRequestMethodHead) WithHeaders(headers http } /** -* Checks if my QuoteRequest exists for a given Query Predicate. Returns a `200 OK` status if any QuoteRequests match the Query Predicate or a `404 Not Found` otherwise. +* Checks if a QuoteRequest exists for a given Query Predicate. Returns a `200 OK` status if any QuoteRequests match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. +* */ func (rb *ByProjectKeyMeQuoteRequestsRequestMethodHead) Execute(ctx context.Context) error { var queryParams url.Values diff --git a/platform/client_quote_requests_by_project_key_me_quote_requests_key_by_key.go b/platform/client_quote_requests_by_project_key_me_quote_requests_key_by_key.go index 0b127017..ceabfc01 100644 --- a/platform/client_quote_requests_by_project_key_me_quote_requests_key_by_key.go +++ b/platform/client_quote_requests_by_project_key_me_quote_requests_key_by_key.go @@ -20,7 +20,7 @@ func (rb *ByProjectKeyMeQuoteRequestsKeyByKeyRequestBuilder) Get() *ByProjectKey } /** -* Checks if my QuoteRequest exists for a given `key`. Returns a `200 OK` status if the QuoteRequest exists or a `404 Not Found` otherwise. +* Checks if a QuoteRequest exists for a given `key`. Returns a `200 OK` status if the QuoteRequest exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyMeQuoteRequestsKeyByKeyRequestBuilder) Head() *ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodHead { return &ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodHead{ @@ -36,10 +36,3 @@ func (rb *ByProjectKeyMeQuoteRequestsKeyByKeyRequestBuilder) Post(body MyQuoteRe client: rb.client, } } - -func (rb *ByProjectKeyMeQuoteRequestsKeyByKeyRequestBuilder) Delete() *ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodDelete { - return &ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodDelete{ - url: fmt.Sprintf("/%s/me/quote-requests/key=%s", rb.projectKey, rb.key), - client: rb.client, - } -} diff --git a/platform/client_quote_requests_by_project_key_me_quote_requests_key_by_key_delete.go b/platform/client_quote_requests_by_project_key_me_quote_requests_key_by_key_delete.go deleted file mode 100644 index 940176aa..00000000 --- a/platform/client_quote_requests_by_project_key_me_quote_requests_key_by_key_delete.go +++ /dev/null @@ -1,157 +0,0 @@ -package platform - -// Generated file, please do not change!!! - -import ( - "context" - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "net/url" - "strconv" -) - -type ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodDelete struct { - url string - client *Client - headers http.Header - params *ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodDeleteInput -} - -func (r *ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodDelete) Dump() map[string]interface{} { - return map[string]interface{}{ - "url": r.url, - "params": r.params, - } -} - -type ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodDeleteInput struct { - Version int - Expand []string -} - -func (input *ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodDeleteInput) Values() url.Values { - values := url.Values{} - values.Add("version", strconv.Itoa(input.Version)) - for _, v := range input.Expand { - values.Add("expand", fmt.Sprintf("%v", v)) - } - return values -} - -func (rb *ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodDelete) Version(v int) *ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodDelete { - if rb.params == nil { - rb.params = &ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodDeleteInput{} - } - rb.params.Version = v - return rb -} - -func (rb *ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodDelete) Expand(v []string) *ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodDelete { - if rb.params == nil { - rb.params = &ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodDeleteInput{} - } - rb.params.Expand = v - return rb -} - -func (rb *ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodDelete) WithQueryParams(input ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodDeleteInput) *ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodDelete { - rb.params = &input - return rb -} -func (rb *ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodDelete) WithHeaders(headers http.Header) *ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodDelete { - rb.headers = headers - return rb -} -func (rb *ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodDelete) Execute(ctx context.Context) (result *QuoteRequest, err error) { - var queryParams url.Values - if rb.params != nil { - queryParams = rb.params.Values() - } else { - queryParams = url.Values{} - } - resp, err := rb.client.delete( - ctx, - rb.url, - queryParams, - rb.headers, - nil, - ) - - if err != nil { - return nil, err - } - content, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, err - } - defer resp.Body.Close() - switch resp.StatusCode { - case 200: - err = json.Unmarshal(content, &result) - if err != nil { - return nil, err - } - return result, nil - case 409: - errorObj := ErrorResponse{} - err = json.Unmarshal(content, &errorObj) - if err != nil { - return nil, err - } - return nil, errorObj - case 400: - errorObj := ErrorResponse{} - err = json.Unmarshal(content, &errorObj) - if err != nil { - return nil, err - } - return nil, errorObj - case 401: - errorObj := ErrorResponse{} - err = json.Unmarshal(content, &errorObj) - if err != nil { - return nil, err - } - return nil, errorObj - case 403: - errorObj := ErrorResponse{} - err = json.Unmarshal(content, &errorObj) - if err != nil { - return nil, err - } - return nil, errorObj - case 404: - return nil, ErrNotFound - case 500: - errorObj := ErrorResponse{} - err = json.Unmarshal(content, &errorObj) - if err != nil { - return nil, err - } - return nil, errorObj - case 502: - errorObj := ErrorResponse{} - err = json.Unmarshal(content, &errorObj) - if err != nil { - return nil, err - } - return nil, errorObj - case 503: - errorObj := ErrorResponse{} - err = json.Unmarshal(content, &errorObj) - if err != nil { - return nil, err - } - return nil, errorObj - default: - result := GenericRequestError{ - StatusCode: resp.StatusCode, - Content: content, - Response: resp, - } - return nil, result - } - -} diff --git a/platform/client_quote_requests_by_project_key_me_quote_requests_key_by_key_head.go b/platform/client_quote_requests_by_project_key_me_quote_requests_key_by_key_head.go index 410ed875..17c1275f 100644 --- a/platform/client_quote_requests_by_project_key_me_quote_requests_key_by_key_head.go +++ b/platform/client_quote_requests_by_project_key_me_quote_requests_key_by_key_head.go @@ -28,7 +28,7 @@ func (rb *ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodHead) WithHeaders(head } /** -* Checks if my QuoteRequest exists for a given `key`. Returns a `200 OK` status if the QuoteRequest exists or a `404 Not Found` otherwise. +* Checks if a QuoteRequest exists for a given `key`. Returns a `200 OK` status if the QuoteRequest exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyMeQuoteRequestsKeyByKeyRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_quotes_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_orders_quotes.go b/platform/client_quotes_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_orders_quotes.go index 25f2401e..2cd96cc8 100644 --- a/platform/client_quotes_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_orders_quotes.go +++ b/platform/client_quotes_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_orders_quotes.go @@ -16,6 +16,11 @@ type ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyOrder /** * Creates an Order from a [Quote](ctp:api:type:Cart) in a [BusinessUnit](ctp:api:type:BusinessUnit). * Creating an Order fails with an [InvalidOperation](ctp:api:type:InvalidOperationError) if the Quote does not reference the same BusinessUnit as the `businessUnitKey` path parameter. +* +* Specific Error Codes: +* +* - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +* - [OutOfStock](ctp:api:type:OutOfStockError) * */ func (rb *ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyOrdersQuotesRequestBuilder) Post(body OrderFromQuoteDraft) *ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyOrdersQuotesRequestMethodPost { diff --git a/platform/client_quotes_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_orders_quotes_post.go b/platform/client_quotes_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_orders_quotes_post.go index a46a69c5..98abe4ab 100644 --- a/platform/client_quotes_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_orders_quotes_post.go +++ b/platform/client_quotes_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_orders_quotes_post.go @@ -31,6 +31,11 @@ func (rb *ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKey /** * Creates an Order from a [Quote](ctp:api:type:Cart) in a [BusinessUnit](ctp:api:type:BusinessUnit). * Creating an Order fails with an [InvalidOperation](ctp:api:type:InvalidOperationError) if the Quote does not reference the same BusinessUnit as the `businessUnitKey` path parameter. +* +* Specific Error Codes: +* +* - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +* - [OutOfStock](ctp:api:type:OutOfStockError) * */ func (rb *ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyOrdersQuotesRequestMethodPost) Execute(ctx context.Context) (result *Order, err error) { diff --git a/platform/client_quotes_by_project_key_in_store_key_by_store_key_orders_quotes.go b/platform/client_quotes_by_project_key_in_store_key_by_store_key_orders_quotes.go new file mode 100644 index 00000000..f33cf3e2 --- /dev/null +++ b/platform/client_quotes_by_project_key_in_store_key_by_store_key_orders_quotes.go @@ -0,0 +1,33 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "fmt" +) + +type ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesRequestBuilder struct { + projectKey string + storeKey string + client *Client +} + +/** +* Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. +* +* Specific Error Codes: +* +* - [OutOfStock](ctp:api:type:OutOfStockError) +* - [PriceChanged](ctp:api:type:PriceChangedError) +* - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +* - [InvalidOperation](ctp:api:type:InvalidOperationError) +* - [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) +* + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesRequestBuilder) Post(body OrderFromQuoteDraft) *ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesRequestMethodPost { + return &ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesRequestMethodPost{ + body: body, + url: fmt.Sprintf("/%s/in-store/key=%s/orders/quotes", rb.projectKey, rb.storeKey), + client: rb.client, + } +} diff --git a/platform/client_quotes_by_project_key_in_store_key_by_store_key_orders_quotes_post.go b/platform/client_quotes_by_project_key_in_store_key_by_store_key_orders_quotes_post.go new file mode 100644 index 00000000..af56cca5 --- /dev/null +++ b/platform/client_quotes_by_project_key_in_store_key_by_store_key_orders_quotes_post.go @@ -0,0 +1,125 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesRequestMethodPost struct { + body OrderFromQuoteDraft + url string + client *Client + headers http.Header +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesRequestMethodPost) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + } +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesRequestMethodPost) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesRequestMethodPost { + rb.headers = headers + return rb +} + +/** +* Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. +* +* Specific Error Codes: +* +* - [OutOfStock](ctp:api:type:OutOfStockError) +* - [PriceChanged](ctp:api:type:PriceChangedError) +* - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +* - [InvalidOperation](ctp:api:type:InvalidOperationError) +* - [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) +* + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesRequestMethodPost) Execute(ctx context.Context) (result *Order, err error) { + data, err := serializeInput(rb.body) + if err != nil { + return nil, err + } + queryParams := url.Values{} + resp, err := rb.client.post( + ctx, + rb.url, + queryParams, + rb.headers, + data, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 201: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 404: + return nil, ErrNotFound + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes.go b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes.go new file mode 100644 index 00000000..c0e7c23d --- /dev/null +++ b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes.go @@ -0,0 +1,54 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "fmt" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuotesRequestBuilder struct { + projectKey string + storeKey string + client *Client +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestBuilder) WithKey(key string) *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestBuilder { + return &ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestBuilder{ + key: key, + projectKey: rb.projectKey, + storeKey: rb.storeKey, + client: rb.client, + } +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestBuilder) WithId(id string) *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestBuilder { + return &ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestBuilder{ + id: id, + projectKey: rb.projectKey, + storeKey: rb.storeKey, + client: rb.client, + } +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet { + return &ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet{ + url: fmt.Sprintf("/%s/in-store/key=%s/quotes", rb.projectKey, rb.storeKey), + client: rb.client, + } +} + +/** +* Checks if a Quote exists for a given Query Predicate. Returns a `200 OK` status if any Quotes match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodHead { + return &ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodHead{ + url: fmt.Sprintf("/%s/in-store/key=%s/quotes", rb.projectKey, rb.storeKey), + client: rb.client, + } +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestBuilder) Post(body QuoteDraft) *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodPost { + return &ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodPost{ + body: body, + url: fmt.Sprintf("/%s/in-store/key=%s/quotes", rb.projectKey, rb.storeKey), + client: rb.client, + } +} diff --git a/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_by_id.go b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_by_id.go new file mode 100644 index 00000000..595eb4f4 --- /dev/null +++ b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_by_id.go @@ -0,0 +1,46 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "fmt" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestBuilder struct { + projectKey string + storeKey string + id string + client *Client +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodGet { + return &ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodGet{ + url: fmt.Sprintf("/%s/in-store/key=%s/quotes/%s", rb.projectKey, rb.storeKey, rb.id), + client: rb.client, + } +} + +/** +* Checks if a Quote exists for a given `id`. Returns a `200 OK` status if the Quote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodHead { + return &ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodHead{ + url: fmt.Sprintf("/%s/in-store/key=%s/quotes/%s", rb.projectKey, rb.storeKey, rb.id), + client: rb.client, + } +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestBuilder) Post(body QuoteUpdate) *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodPost { + return &ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodPost{ + body: body, + url: fmt.Sprintf("/%s/in-store/key=%s/quotes/%s", rb.projectKey, rb.storeKey, rb.id), + client: rb.client, + } +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestBuilder) Delete() *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodDelete { + return &ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodDelete{ + url: fmt.Sprintf("/%s/in-store/key=%s/quotes/%s", rb.projectKey, rb.storeKey, rb.id), + client: rb.client, + } +} diff --git a/platform/client_business_units_by_project_key_me_business_units_key_by_key_delete.go b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_by_id_delete.go similarity index 54% rename from platform/client_business_units_by_project_key_me_business_units_key_by_key_delete.go rename to platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_by_id_delete.go index c640ec92..b049f94d 100644 --- a/platform/client_business_units_by_project_key_me_business_units_key_by_key_delete.go +++ b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_by_id_delete.go @@ -12,27 +12,35 @@ import ( "strconv" ) -type ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodDelete struct { +type ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodDelete struct { url string client *Client headers http.Header - params *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodDeleteInput + params *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodDeleteInput } -func (r *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodDelete) Dump() map[string]interface{} { +func (r *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodDelete) Dump() map[string]interface{} { return map[string]interface{}{ "url": r.url, "params": r.params, } } -type ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodDeleteInput struct { - Version int - Expand []string +type ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodDeleteInput struct { + DataErasure *bool + Version int + Expand []string } -func (input *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodDeleteInput) Values() url.Values { +func (input *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodDeleteInput) Values() url.Values { values := url.Values{} + if input.DataErasure != nil { + if *input.DataErasure { + values.Add("dataErasure", "true") + } else { + values.Add("dataErasure", "false") + } + } values.Add("version", strconv.Itoa(input.Version)) for _, v := range input.Expand { values.Add("expand", fmt.Sprintf("%v", v)) @@ -40,31 +48,39 @@ func (input *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodDeleteInput) Values return values } -func (rb *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodDelete) Version(v int) *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodDelete { +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodDelete) DataErasure(v bool) *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodDelete { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodDeleteInput{} + } + rb.params.DataErasure = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodDelete) Version(v int) *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodDelete { if rb.params == nil { - rb.params = &ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodDeleteInput{} + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodDeleteInput{} } rb.params.Version = v return rb } -func (rb *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodDelete) Expand(v []string) *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodDelete { +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodDelete) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodDelete { if rb.params == nil { - rb.params = &ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodDeleteInput{} + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodDeleteInput{} } rb.params.Expand = v return rb } -func (rb *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodDelete) WithQueryParams(input ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodDeleteInput) *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodDelete { +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodDelete) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodDeleteInput) *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodDelete { rb.params = &input return rb } -func (rb *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodDelete) WithHeaders(headers http.Header) *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodDelete { +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodDelete) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodDelete { rb.headers = headers return rb } -func (rb *ByProjectKeyMeBusinessUnitsKeyByKeyRequestMethodDelete) Execute(ctx context.Context) (result *BusinessUnit, err error) { +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodDelete) Execute(ctx context.Context) (result *Quote, err error) { var queryParams url.Values if rb.params != nil { queryParams = rb.params.Values() diff --git a/platform/client_carts_by_project_key_me_carts_key_by_key_get.go b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_by_id_get.go similarity index 64% rename from platform/client_carts_by_project_key_me_carts_key_by_key_get.go rename to platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_by_id_get.go index 5eae8434..8182f211 100644 --- a/platform/client_carts_by_project_key_me_carts_key_by_key_get.go +++ b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_by_id_get.go @@ -11,25 +11,25 @@ import ( "net/url" ) -type ByProjectKeyMeCartsKeyByKeyRequestMethodGet struct { +type ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodGet struct { url string client *Client headers http.Header - params *ByProjectKeyMeCartsKeyByKeyRequestMethodGetInput + params *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodGetInput } -func (r *ByProjectKeyMeCartsKeyByKeyRequestMethodGet) Dump() map[string]interface{} { +func (r *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodGet) Dump() map[string]interface{} { return map[string]interface{}{ "url": r.url, "params": r.params, } } -type ByProjectKeyMeCartsKeyByKeyRequestMethodGetInput struct { +type ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodGetInput struct { Expand []string } -func (input *ByProjectKeyMeCartsKeyByKeyRequestMethodGetInput) Values() url.Values { +func (input *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodGetInput) Values() url.Values { values := url.Values{} for _, v := range input.Expand { values.Add("expand", fmt.Sprintf("%v", v)) @@ -37,23 +37,23 @@ func (input *ByProjectKeyMeCartsKeyByKeyRequestMethodGetInput) Values() url.Valu return values } -func (rb *ByProjectKeyMeCartsKeyByKeyRequestMethodGet) Expand(v []string) *ByProjectKeyMeCartsKeyByKeyRequestMethodGet { +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodGet) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodGet { if rb.params == nil { - rb.params = &ByProjectKeyMeCartsKeyByKeyRequestMethodGetInput{} + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodGetInput{} } rb.params.Expand = v return rb } -func (rb *ByProjectKeyMeCartsKeyByKeyRequestMethodGet) WithQueryParams(input ByProjectKeyMeCartsKeyByKeyRequestMethodGetInput) *ByProjectKeyMeCartsKeyByKeyRequestMethodGet { +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodGet) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodGetInput) *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodGet { rb.params = &input return rb } -func (rb *ByProjectKeyMeCartsKeyByKeyRequestMethodGet) WithHeaders(headers http.Header) *ByProjectKeyMeCartsKeyByKeyRequestMethodGet { +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodGet) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodGet { rb.headers = headers return rb } -func (rb *ByProjectKeyMeCartsKeyByKeyRequestMethodGet) Execute(ctx context.Context) (result *Cart, err error) { +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodGet) Execute(ctx context.Context) (result *Quote, err error) { var queryParams url.Values if rb.params != nil { queryParams = rb.params.Values() diff --git a/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_by_id_head.go b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_by_id_head.go new file mode 100644 index 00000000..fbd87bf5 --- /dev/null +++ b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_by_id_head.go @@ -0,0 +1,106 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodHead struct { + url string + client *Client + headers http.Header +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodHead) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + } +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodHead) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodHead { + rb.headers = headers + return rb +} + +/** +* Checks if a Quote exists for a given `id`. Returns a `200 OK` status if the Quote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodHead) Execute(ctx context.Context) error { + queryParams := url.Values{} + resp, err := rb.client.head( + ctx, + rb.url, + queryParams, + rb.headers, + ) + + if err != nil { + return err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + return nil + case 404: + return ErrNotFound + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return result + } + +} diff --git a/platform/client_carts_by_project_key_me_carts_key_by_key_post.go b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_by_id_post.go similarity index 66% rename from platform/client_carts_by_project_key_me_carts_key_by_key_post.go rename to platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_by_id_post.go index 5957c2d1..8d43a45e 100644 --- a/platform/client_carts_by_project_key_me_carts_key_by_key_post.go +++ b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_by_id_post.go @@ -11,26 +11,26 @@ import ( "net/url" ) -type ByProjectKeyMeCartsKeyByKeyRequestMethodPost struct { - body MyCartUpdate +type ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodPost struct { + body QuoteUpdate url string client *Client headers http.Header - params *ByProjectKeyMeCartsKeyByKeyRequestMethodPostInput + params *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodPostInput } -func (r *ByProjectKeyMeCartsKeyByKeyRequestMethodPost) Dump() map[string]interface{} { +func (r *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodPost) Dump() map[string]interface{} { return map[string]interface{}{ "url": r.url, "params": r.params, } } -type ByProjectKeyMeCartsKeyByKeyRequestMethodPostInput struct { +type ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodPostInput struct { Expand []string } -func (input *ByProjectKeyMeCartsKeyByKeyRequestMethodPostInput) Values() url.Values { +func (input *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodPostInput) Values() url.Values { values := url.Values{} for _, v := range input.Expand { values.Add("expand", fmt.Sprintf("%v", v)) @@ -38,23 +38,23 @@ func (input *ByProjectKeyMeCartsKeyByKeyRequestMethodPostInput) Values() url.Val return values } -func (rb *ByProjectKeyMeCartsKeyByKeyRequestMethodPost) Expand(v []string) *ByProjectKeyMeCartsKeyByKeyRequestMethodPost { +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodPost) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodPost { if rb.params == nil { - rb.params = &ByProjectKeyMeCartsKeyByKeyRequestMethodPostInput{} + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodPostInput{} } rb.params.Expand = v return rb } -func (rb *ByProjectKeyMeCartsKeyByKeyRequestMethodPost) WithQueryParams(input ByProjectKeyMeCartsKeyByKeyRequestMethodPostInput) *ByProjectKeyMeCartsKeyByKeyRequestMethodPost { +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodPost) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodPostInput) *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodPost { rb.params = &input return rb } -func (rb *ByProjectKeyMeCartsKeyByKeyRequestMethodPost) WithHeaders(headers http.Header) *ByProjectKeyMeCartsKeyByKeyRequestMethodPost { +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodPost) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodPost { rb.headers = headers return rb } -func (rb *ByProjectKeyMeCartsKeyByKeyRequestMethodPost) Execute(ctx context.Context) (result *Cart, err error) { +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestMethodPost) Execute(ctx context.Context) (result *Quote, err error) { data, err := serializeInput(rb.body) if err != nil { return nil, err diff --git a/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_get.go b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_get.go new file mode 100644 index 00000000..46132665 --- /dev/null +++ b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_get.go @@ -0,0 +1,217 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" + "strconv" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet struct { + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGetInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGetInput struct { + Expand []string + Sort []string + Limit *int + Offset *int + WithTotal *bool + Where []string + PredicateVar map[string][]string +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGetInput) Values() url.Values { + values := url.Values{} + for _, v := range input.Expand { + values.Add("expand", fmt.Sprintf("%v", v)) + } + for _, v := range input.Sort { + values.Add("sort", fmt.Sprintf("%v", v)) + } + if input.Limit != nil { + values.Add("limit", strconv.Itoa(*input.Limit)) + } + if input.Offset != nil { + values.Add("offset", strconv.Itoa(*input.Offset)) + } + if input.WithTotal != nil { + if *input.WithTotal { + values.Add("withTotal", "true") + } else { + values.Add("withTotal", "false") + } + } + for _, v := range input.Where { + values.Add("where", fmt.Sprintf("%v", v)) + } + for k, v := range input.PredicateVar { + for _, x := range v { + values.Add(k, x) + } + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGetInput{} + } + rb.params.Expand = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet) Sort(v []string) *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGetInput{} + } + rb.params.Sort = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet) Limit(v int) *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGetInput{} + } + rb.params.Limit = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet) Offset(v int) *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGetInput{} + } + rb.params.Offset = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet) WithTotal(v bool) *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGetInput{} + } + rb.params.WithTotal = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet) Where(v []string) *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGetInput{} + } + rb.params.Where = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet) PredicateVar(v map[string][]string) *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGetInput{} + } + rb.params.PredicateVar = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGetInput) *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet { + rb.headers = headers + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodGet) Execute(ctx context.Context) (result *QuotePagedQueryResponse, err error) { + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.get( + ctx, + rb.url, + queryParams, + rb.headers, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 404: + return nil, ErrNotFound + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_head.go b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_head.go new file mode 100644 index 00000000..eeaa2236 --- /dev/null +++ b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_head.go @@ -0,0 +1,138 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodHead struct { + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodHeadInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodHead) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodHeadInput struct { + Where []string +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodHeadInput) Values() url.Values { + values := url.Values{} + for _, v := range input.Where { + values.Add("where", fmt.Sprintf("%v", v)) + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodHead) Where(v []string) *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodHead { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodHeadInput{} + } + rb.params.Where = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodHead) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodHeadInput) *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodHead { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodHead) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodHead { + rb.headers = headers + return rb +} + +/** +* Checks if a Quote exists for a given Query Predicate. Returns a `200 OK` status if any Quotes match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodHead) Execute(ctx context.Context) error { + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.head( + ctx, + rb.url, + queryParams, + rb.headers, + ) + + if err != nil { + return err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + return nil + case 404: + return ErrNotFound + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return result + } + +} diff --git a/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_key_by_key.go b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_key_by_key.go new file mode 100644 index 00000000..58fdcbdb --- /dev/null +++ b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_key_by_key.go @@ -0,0 +1,46 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "fmt" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestBuilder struct { + projectKey string + storeKey string + key string + client *Client +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodGet { + return &ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodGet{ + url: fmt.Sprintf("/%s/in-store/key=%s/quotes/key=%s", rb.projectKey, rb.storeKey, rb.key), + client: rb.client, + } +} + +/** +* Checks if a Quote exists for a given `key`. Returns a `200 OK` status if the Quote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodHead { + return &ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodHead{ + url: fmt.Sprintf("/%s/in-store/key=%s/quotes/key=%s", rb.projectKey, rb.storeKey, rb.key), + client: rb.client, + } +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestBuilder) Post(body QuoteUpdate) *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodPost { + return &ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodPost{ + body: body, + url: fmt.Sprintf("/%s/in-store/key=%s/quotes/key=%s", rb.projectKey, rb.storeKey, rb.key), + client: rb.client, + } +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestBuilder) Delete() *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodDelete { + return &ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodDelete{ + url: fmt.Sprintf("/%s/in-store/key=%s/quotes/key=%s", rb.projectKey, rb.storeKey, rb.key), + client: rb.client, + } +} diff --git a/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_key_by_key_delete.go b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_key_by_key_delete.go new file mode 100644 index 00000000..a828aca5 --- /dev/null +++ b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_key_by_key_delete.go @@ -0,0 +1,173 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" + "strconv" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodDelete struct { + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodDeleteInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodDelete) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodDeleteInput struct { + DataErasure *bool + Version int + Expand []string +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodDeleteInput) Values() url.Values { + values := url.Values{} + if input.DataErasure != nil { + if *input.DataErasure { + values.Add("dataErasure", "true") + } else { + values.Add("dataErasure", "false") + } + } + values.Add("version", strconv.Itoa(input.Version)) + for _, v := range input.Expand { + values.Add("expand", fmt.Sprintf("%v", v)) + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodDelete) DataErasure(v bool) *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodDelete { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodDeleteInput{} + } + rb.params.DataErasure = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodDelete) Version(v int) *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodDelete { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodDeleteInput{} + } + rb.params.Version = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodDelete) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodDelete { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodDeleteInput{} + } + rb.params.Expand = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodDelete) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodDeleteInput) *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodDelete { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodDelete) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodDelete { + rb.headers = headers + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodDelete) Execute(ctx context.Context) (result *Quote, err error) { + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.delete( + ctx, + rb.url, + queryParams, + rb.headers, + nil, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 409: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 404: + return nil, ErrNotFound + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_key_by_key_get.go b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_key_by_key_get.go new file mode 100644 index 00000000..39816a3b --- /dev/null +++ b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_key_by_key_get.go @@ -0,0 +1,138 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodGet struct { + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodGetInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodGet) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodGetInput struct { + Expand []string +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodGetInput) Values() url.Values { + values := url.Values{} + for _, v := range input.Expand { + values.Add("expand", fmt.Sprintf("%v", v)) + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodGet) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodGetInput{} + } + rb.params.Expand = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodGet) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodGetInput) *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodGet { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodGet) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodGet { + rb.headers = headers + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodGet) Execute(ctx context.Context) (result *Quote, err error) { + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.get( + ctx, + rb.url, + queryParams, + rb.headers, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 404: + return nil, ErrNotFound + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_key_by_key_head.go b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_key_by_key_head.go new file mode 100644 index 00000000..512d643d --- /dev/null +++ b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_key_by_key_head.go @@ -0,0 +1,106 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodHead struct { + url string + client *Client + headers http.Header +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodHead) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + } +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodHead) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodHead { + rb.headers = headers + return rb +} + +/** +* Checks if a Quote exists for a given `key`. Returns a `200 OK` status if the Quote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodHead) Execute(ctx context.Context) error { + queryParams := url.Values{} + resp, err := rb.client.head( + ctx, + rb.url, + queryParams, + rb.headers, + ) + + if err != nil { + return err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + return nil + case 404: + return ErrNotFound + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return result + } + +} diff --git a/platform/client_carts_by_project_key_me_carts_key_by_key_delete.go b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_key_by_key_post.go similarity index 61% rename from platform/client_carts_by_project_key_me_carts_key_by_key_delete.go rename to platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_key_by_key_post.go index 05704b75..852e6b94 100644 --- a/platform/client_carts_by_project_key_me_carts_key_by_key_delete.go +++ b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_key_by_key_post.go @@ -9,74 +9,68 @@ import ( "io/ioutil" "net/http" "net/url" - "strconv" ) -type ByProjectKeyMeCartsKeyByKeyRequestMethodDelete struct { +type ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodPost struct { + body QuoteUpdate url string client *Client headers http.Header - params *ByProjectKeyMeCartsKeyByKeyRequestMethodDeleteInput + params *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodPostInput } -func (r *ByProjectKeyMeCartsKeyByKeyRequestMethodDelete) Dump() map[string]interface{} { +func (r *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodPost) Dump() map[string]interface{} { return map[string]interface{}{ "url": r.url, "params": r.params, } } -type ByProjectKeyMeCartsKeyByKeyRequestMethodDeleteInput struct { - Version int - Expand []string +type ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodPostInput struct { + Expand []string } -func (input *ByProjectKeyMeCartsKeyByKeyRequestMethodDeleteInput) Values() url.Values { +func (input *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodPostInput) Values() url.Values { values := url.Values{} - values.Add("version", strconv.Itoa(input.Version)) for _, v := range input.Expand { values.Add("expand", fmt.Sprintf("%v", v)) } return values } -func (rb *ByProjectKeyMeCartsKeyByKeyRequestMethodDelete) Version(v int) *ByProjectKeyMeCartsKeyByKeyRequestMethodDelete { +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodPost) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodPost { if rb.params == nil { - rb.params = &ByProjectKeyMeCartsKeyByKeyRequestMethodDeleteInput{} - } - rb.params.Version = v - return rb -} - -func (rb *ByProjectKeyMeCartsKeyByKeyRequestMethodDelete) Expand(v []string) *ByProjectKeyMeCartsKeyByKeyRequestMethodDelete { - if rb.params == nil { - rb.params = &ByProjectKeyMeCartsKeyByKeyRequestMethodDeleteInput{} + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodPostInput{} } rb.params.Expand = v return rb } -func (rb *ByProjectKeyMeCartsKeyByKeyRequestMethodDelete) WithQueryParams(input ByProjectKeyMeCartsKeyByKeyRequestMethodDeleteInput) *ByProjectKeyMeCartsKeyByKeyRequestMethodDelete { +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodPost) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodPostInput) *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodPost { rb.params = &input return rb } -func (rb *ByProjectKeyMeCartsKeyByKeyRequestMethodDelete) WithHeaders(headers http.Header) *ByProjectKeyMeCartsKeyByKeyRequestMethodDelete { +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodPost) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodPost { rb.headers = headers return rb } -func (rb *ByProjectKeyMeCartsKeyByKeyRequestMethodDelete) Execute(ctx context.Context) (result *Cart, err error) { +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestMethodPost) Execute(ctx context.Context) (result *Quote, err error) { + data, err := serializeInput(rb.body) + if err != nil { + return nil, err + } var queryParams url.Values if rb.params != nil { queryParams = rb.params.Values() } else { queryParams = url.Values{} } - resp, err := rb.client.delete( + resp, err := rb.client.post( ctx, rb.url, queryParams, rb.headers, - nil, + data, ) if err != nil { diff --git a/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_post.go b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_post.go new file mode 100644 index 00000000..5d8125dd --- /dev/null +++ b/platform/client_quotes_by_project_key_in_store_key_by_store_key_quotes_post.go @@ -0,0 +1,144 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodPost struct { + body QuoteDraft + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodPostInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodPost) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodPostInput struct { + Expand []string +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodPostInput) Values() url.Values { + values := url.Values{} + for _, v := range input.Expand { + values.Add("expand", fmt.Sprintf("%v", v)) + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodPost) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodPost { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodPostInput{} + } + rb.params.Expand = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodPost) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodPostInput) *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodPost { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodPost) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodPost { + rb.headers = headers + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyQuotesRequestMethodPost) Execute(ctx context.Context) (result *Quote, err error) { + data, err := serializeInput(rb.body) + if err != nil { + return nil, err + } + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.post( + ctx, + rb.url, + queryParams, + rb.headers, + data, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 201: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 404: + return nil, ErrNotFound + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_quotes_by_project_key_me_quotes.go b/platform/client_quotes_by_project_key_me_quotes.go index 8a5a1eaa..abe05738 100644 --- a/platform/client_quotes_by_project_key_me_quotes.go +++ b/platform/client_quotes_by_project_key_me_quotes.go @@ -33,7 +33,7 @@ func (rb *ByProjectKeyMeQuotesRequestBuilder) Get() *ByProjectKeyMeQuotesRequest } /** -* Checks if a Quote exists for a given Query Predicate. Returns a `200 OK` status if any Quotes match the Query Predicate or a `404 Not Found` otherwise. +* Checks if a Quote exists for a given Query Predicate. Returns a `200 OK` status if any Quotes match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyMeQuotesRequestBuilder) Head() *ByProjectKeyMeQuotesRequestMethodHead { return &ByProjectKeyMeQuotesRequestMethodHead{ diff --git a/platform/client_quotes_by_project_key_me_quotes_by_id.go b/platform/client_quotes_by_project_key_me_quotes_by_id.go index fc517d16..20e42372 100644 --- a/platform/client_quotes_by_project_key_me_quotes_by_id.go +++ b/platform/client_quotes_by_project_key_me_quotes_by_id.go @@ -20,7 +20,7 @@ func (rb *ByProjectKeyMeQuotesByIDRequestBuilder) Get() *ByProjectKeyMeQuotesByI } /** -* Checks if a Quote exists for a given `id`. Returns a `200 OK` status if the Quote exists or a `404 Not Found` otherwise. +* Checks if a Quote exists for a given `id`. Returns a `200 OK` status if the Quote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyMeQuotesByIDRequestBuilder) Head() *ByProjectKeyMeQuotesByIDRequestMethodHead { return &ByProjectKeyMeQuotesByIDRequestMethodHead{ diff --git a/platform/client_quotes_by_project_key_me_quotes_by_id_head.go b/platform/client_quotes_by_project_key_me_quotes_by_id_head.go index 361309d7..29580445 100644 --- a/platform/client_quotes_by_project_key_me_quotes_by_id_head.go +++ b/platform/client_quotes_by_project_key_me_quotes_by_id_head.go @@ -28,7 +28,7 @@ func (rb *ByProjectKeyMeQuotesByIDRequestMethodHead) WithHeaders(headers http.He } /** -* Checks if a Quote exists for a given `id`. Returns a `200 OK` status if the Quote exists or a `404 Not Found` otherwise. +* Checks if a Quote exists for a given `id`. Returns a `200 OK` status if the Quote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyMeQuotesByIDRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_quotes_by_project_key_me_quotes_head.go b/platform/client_quotes_by_project_key_me_quotes_head.go index 59ed0a63..29085ada 100644 --- a/platform/client_quotes_by_project_key_me_quotes_head.go +++ b/platform/client_quotes_by_project_key_me_quotes_head.go @@ -55,7 +55,7 @@ func (rb *ByProjectKeyMeQuotesRequestMethodHead) WithHeaders(headers http.Header } /** -* Checks if a Quote exists for a given Query Predicate. Returns a `200 OK` status if any Quotes match the Query Predicate or a `404 Not Found` otherwise. +* Checks if a Quote exists for a given Query Predicate. Returns a `200 OK` status if any Quotes match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyMeQuotesRequestMethodHead) Execute(ctx context.Context) error { var queryParams url.Values diff --git a/platform/client_quotes_by_project_key_me_quotes_key_by_key.go b/platform/client_quotes_by_project_key_me_quotes_key_by_key.go index 15e5544e..15d9a597 100644 --- a/platform/client_quotes_by_project_key_me_quotes_key_by_key.go +++ b/platform/client_quotes_by_project_key_me_quotes_key_by_key.go @@ -20,7 +20,7 @@ func (rb *ByProjectKeyMeQuotesKeyByKeyRequestBuilder) Get() *ByProjectKeyMeQuote } /** -* Checks if a Quote exists for a given `key`. Returns a `200 OK` status if the Quote exists or a `404 Not Found` otherwise. +* Checks if a Quote exists for a given `key`. Returns a `200 OK` status if the Quote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyMeQuotesKeyByKeyRequestBuilder) Head() *ByProjectKeyMeQuotesKeyByKeyRequestMethodHead { return &ByProjectKeyMeQuotesKeyByKeyRequestMethodHead{ diff --git a/platform/client_quotes_by_project_key_me_quotes_key_by_key_head.go b/platform/client_quotes_by_project_key_me_quotes_key_by_key_head.go index 1561a3eb..7a3d9b45 100644 --- a/platform/client_quotes_by_project_key_me_quotes_key_by_key_head.go +++ b/platform/client_quotes_by_project_key_me_quotes_key_by_key_head.go @@ -28,7 +28,7 @@ func (rb *ByProjectKeyMeQuotesKeyByKeyRequestMethodHead) WithHeaders(headers htt } /** -* Checks if a Quote exists for a given `key`. Returns a `200 OK` status if the Quote exists or a `404 Not Found` otherwise. +* Checks if a Quote exists for a given `key`. Returns a `200 OK` status if the Quote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyMeQuotesKeyByKeyRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_quotes_by_project_key_orders_quotes.go b/platform/client_quotes_by_project_key_orders_quotes.go index 08951242..82102969 100644 --- a/platform/client_quotes_by_project_key_orders_quotes.go +++ b/platform/client_quotes_by_project_key_orders_quotes.go @@ -16,11 +16,11 @@ type ByProjectKeyOrdersQuotesRequestBuilder struct { * * Specific Error Codes: * -* - [OutOfStock](ctp:api:type:OutOfStockError) -* - [PriceChanged](ctp:api:type:PriceChangedError) +* - [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) * - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) * - [InvalidOperation](ctp:api:type:InvalidOperationError) -* - [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) +* - [OutOfStock](ctp:api:type:OutOfStockError) +* - [PriceChanged](ctp:api:type:PriceChangedError) * */ func (rb *ByProjectKeyOrdersQuotesRequestBuilder) Post(body OrderFromQuoteDraft) *ByProjectKeyOrdersQuotesRequestMethodPost { diff --git a/platform/client_quotes_by_project_key_orders_quotes_post.go b/platform/client_quotes_by_project_key_orders_quotes_post.go index d0d5a3d1..d55670e8 100644 --- a/platform/client_quotes_by_project_key_orders_quotes_post.go +++ b/platform/client_quotes_by_project_key_orders_quotes_post.go @@ -33,11 +33,11 @@ func (rb *ByProjectKeyOrdersQuotesRequestMethodPost) WithHeaders(headers http.He * * Specific Error Codes: * -* - [OutOfStock](ctp:api:type:OutOfStockError) -* - [PriceChanged](ctp:api:type:PriceChangedError) +* - [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) * - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) * - [InvalidOperation](ctp:api:type:InvalidOperationError) -* - [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) +* - [OutOfStock](ctp:api:type:OutOfStockError) +* - [PriceChanged](ctp:api:type:PriceChangedError) * */ func (rb *ByProjectKeyOrdersQuotesRequestMethodPost) Execute(ctx context.Context) (result *Order, err error) { diff --git a/platform/client_replicate_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_carts_replicate.go b/platform/client_replicate_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_carts_replicate.go index 6ff65f59..c44411e8 100644 --- a/platform/client_replicate_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_carts_replicate.go +++ b/platform/client_replicate_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_carts_replicate.go @@ -21,6 +21,11 @@ type ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyCarts * The new Cart does not contain Payments or Deliveries. The [State](ctp:api:type:ItemState) of Line Items and Custom Line Items is reset to `initial`. * * If the Cart exists in the [Project](ctp:api:type:Project) but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error. +* +* Specific Error Codes: +* +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * */ func (rb *ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyCartsReplicateRequestBuilder) Post(body ReplicaCartDraft) *ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyCartsReplicateRequestMethodPost { diff --git a/platform/client_replicate_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_carts_replicate_post.go b/platform/client_replicate_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_carts_replicate_post.go index 052fcb3f..950a6264 100644 --- a/platform/client_replicate_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_carts_replicate_post.go +++ b/platform/client_replicate_by_project_key_as_associate_by_associate_id_in_business_unit_key_by_business_unit_key_carts_replicate_post.go @@ -36,6 +36,11 @@ func (rb *ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKey * The new Cart does not contain Payments or Deliveries. The [State](ctp:api:type:ItemState) of Line Items and Custom Line Items is reset to `initial`. * * If the Cart exists in the [Project](ctp:api:type:Project) but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error. +* +* Specific Error Codes: +* +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * */ func (rb *ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyCartsReplicateRequestMethodPost) Execute(ctx context.Context) (result *Cart, err error) { diff --git a/platform/client_replicate_by_project_key_carts_replicate.go b/platform/client_replicate_by_project_key_carts_replicate.go index d2e0bac6..c16a6b2a 100644 --- a/platform/client_replicate_by_project_key_carts_replicate.go +++ b/platform/client_replicate_by_project_key_carts_replicate.go @@ -17,6 +17,11 @@ type ByProjectKeyCartsReplicateRequestBuilder struct { * The replicated Cart preserves Customer information, Line Items and Custom Line Items, Custom Fields, Discount Codes, and other settings of the Cart or Order. If the Line Items become invalid, for example, due to removed Products or Prices, they are removed from the new Cart. If the Customer switches to another Customer Group, the new Cart is updated with the new value. It has up-to-date Tax Rates, Prices, and Line Item product data and is in `Active` [CartState](ctp:api:type:CartState). * * The new Cart does not contain Payments or Deliveries. The [State](ctp:api:type:ItemState) of Line Items and Custom Line Items is reset to `initial`. +* +* Specific Error Codes: +* +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * */ func (rb *ByProjectKeyCartsReplicateRequestBuilder) Post(body ReplicaCartDraft) *ByProjectKeyCartsReplicateRequestMethodPost { diff --git a/platform/client_replicate_by_project_key_carts_replicate_post.go b/platform/client_replicate_by_project_key_carts_replicate_post.go index bdf1f2e0..4c0c9e9e 100644 --- a/platform/client_replicate_by_project_key_carts_replicate_post.go +++ b/platform/client_replicate_by_project_key_carts_replicate_post.go @@ -34,6 +34,11 @@ func (rb *ByProjectKeyCartsReplicateRequestMethodPost) WithHeaders(headers http. * The replicated Cart preserves Customer information, Line Items and Custom Line Items, Custom Fields, Discount Codes, and other settings of the Cart or Order. If the Line Items become invalid, for example, due to removed Products or Prices, they are removed from the new Cart. If the Customer switches to another Customer Group, the new Cart is updated with the new value. It has up-to-date Tax Rates, Prices, and Line Item product data and is in `Active` [CartState](ctp:api:type:CartState). * * The new Cart does not contain Payments or Deliveries. The [State](ctp:api:type:ItemState) of Line Items and Custom Line Items is reset to `initial`. +* +* Specific Error Codes: +* +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * */ func (rb *ByProjectKeyCartsReplicateRequestMethodPost) Execute(ctx context.Context) (result *Cart, err error) { diff --git a/platform/client_replicate_by_project_key_in_store_key_by_store_key_carts_replicate.go b/platform/client_replicate_by_project_key_in_store_key_by_store_key_carts_replicate.go index b3c35a46..7f1fae05 100644 --- a/platform/client_replicate_by_project_key_in_store_key_by_store_key_carts_replicate.go +++ b/platform/client_replicate_by_project_key_in_store_key_by_store_key_carts_replicate.go @@ -18,6 +18,11 @@ type ByProjectKeyInStoreKeyByStoreKeyCartsReplicateRequestBuilder struct { * The replicated Cart preserves Customer information, Line Items and Custom Line Items, Custom Fields, Discount Codes, and other settings of the Cart or Order. If the Line Items become invalid, for example, due to removed Products or Prices, they are removed from the new Cart. If the Customer switches to another Customer Group, the new Cart is updated with the new value. It has up-to-date Tax Rates, Prices, and Line Item product data and is in `Active` [CartState](ctp:api:type:CartState). * * The new Cart does not contain payments or deliveries. The [State](ctp:api:type:ItemState) of Line Items and Custom Line Items is reset to `initial`. +* +* Specific Error Codes: +* +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsReplicateRequestBuilder) Post(body ReplicaCartDraft) *ByProjectKeyInStoreKeyByStoreKeyCartsReplicateRequestMethodPost { diff --git a/platform/client_replicate_by_project_key_in_store_key_by_store_key_carts_replicate_post.go b/platform/client_replicate_by_project_key_in_store_key_by_store_key_carts_replicate_post.go index f86690c6..d1ed8edc 100644 --- a/platform/client_replicate_by_project_key_in_store_key_by_store_key_carts_replicate_post.go +++ b/platform/client_replicate_by_project_key_in_store_key_by_store_key_carts_replicate_post.go @@ -34,6 +34,11 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsReplicateRequestMethodPost) WithH * The replicated Cart preserves Customer information, Line Items and Custom Line Items, Custom Fields, Discount Codes, and other settings of the Cart or Order. If the Line Items become invalid, for example, due to removed Products or Prices, they are removed from the new Cart. If the Customer switches to another Customer Group, the new Cart is updated with the new value. It has up-to-date Tax Rates, Prices, and Line Item product data and is in `Active` [CartState](ctp:api:type:CartState). * * The new Cart does not contain payments or deliveries. The [State](ctp:api:type:ItemState) of Line Items and Custom Line Items is reset to `initial`. +* +* Specific Error Codes: +* +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyCartsReplicateRequestMethodPost) Execute(ctx context.Context) (result *Cart, err error) { diff --git a/platform/client_replicate_by_project_key_me_carts_replicate.go b/platform/client_replicate_by_project_key_me_carts_replicate.go index da09fc53..61f286cc 100644 --- a/platform/client_replicate_by_project_key_me_carts_replicate.go +++ b/platform/client_replicate_by_project_key_me_carts_replicate.go @@ -22,7 +22,12 @@ type ByProjectKeyMeCartsReplicateRequestBuilder struct { * * The new Cart does not contain Payments or Deliveries. The [State](ctp:api:type:ItemState) of Line Items and Custom Line Items is reset to `initial`. * -* In case the Cart or Order to be replicated does not belong to the authenticaed Customer, the API returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error +* If the Cart or Order to be replicated does not belong to the authenticated Customer, the API returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error +* +* Specific Error Codes: +* +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * */ func (rb *ByProjectKeyMeCartsReplicateRequestBuilder) Post(body ReplicaMyCartDraft) *ByProjectKeyMeCartsReplicateRequestMethodPost { diff --git a/platform/client_replicate_by_project_key_me_carts_replicate_post.go b/platform/client_replicate_by_project_key_me_carts_replicate_post.go index bb3b3861..b3144059 100644 --- a/platform/client_replicate_by_project_key_me_carts_replicate_post.go +++ b/platform/client_replicate_by_project_key_me_carts_replicate_post.go @@ -39,7 +39,12 @@ func (rb *ByProjectKeyMeCartsReplicateRequestMethodPost) WithHeaders(headers htt * * The new Cart does not contain Payments or Deliveries. The [State](ctp:api:type:ItemState) of Line Items and Custom Line Items is reset to `initial`. * -* In case the Cart or Order to be replicated does not belong to the authenticaed Customer, the API returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error +* If the Cart or Order to be replicated does not belong to the authenticated Customer, the API returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error +* +* Specific Error Codes: +* +* - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +* - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) * */ func (rb *ByProjectKeyMeCartsReplicateRequestMethodPost) Execute(ctx context.Context) (result *Cart, err error) { diff --git a/platform/client_reset_by_project_key_in_store_key_by_store_key_me_password_reset.go b/platform/client_reset_by_project_key_in_store_key_by_store_key_me_password_reset.go index 8e89866e..47db4612 100644 --- a/platform/client_reset_by_project_key_in_store_key_by_store_key_me_password_reset.go +++ b/platform/client_reset_by_project_key_in_store_key_by_store_key_me_password_reset.go @@ -15,7 +15,12 @@ type ByProjectKeyInStoreKeyByStoreKeyMePasswordResetRequestBuilder struct { /** * This is the last step in the [password reset process of the authenticated Customer](/../api/projects/customers#password-reset-of-customer-in-store). * -* Resetting a password produces the of the Customer [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=true`. +* Resetting a password produces the Customer [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=true`. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Customer exists with the `id` specified in the [customer:{id}](/scopes#customer_idid) scope. +* - If the Customer exists but is associated with a different Store than what is specified in the `manage_my_profile:{projectKey}:{storeKey}` scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMePasswordResetRequestBuilder) Post(body MyCustomerResetPassword) *ByProjectKeyInStoreKeyByStoreKeyMePasswordResetRequestMethodPost { diff --git a/platform/client_reset_by_project_key_in_store_key_by_store_key_me_password_reset_post.go b/platform/client_reset_by_project_key_in_store_key_by_store_key_me_password_reset_post.go index 985fca7c..c06faa14 100644 --- a/platform/client_reset_by_project_key_in_store_key_by_store_key_me_password_reset_post.go +++ b/platform/client_reset_by_project_key_in_store_key_by_store_key_me_password_reset_post.go @@ -31,7 +31,12 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMePasswordResetRequestMethodPost) With /** * This is the last step in the [password reset process of the authenticated Customer](/../api/projects/customers#password-reset-of-customer-in-store). * -* Resetting a password produces the of the Customer [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=true`. +* Resetting a password produces the Customer [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=true`. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no Customer exists with the `id` specified in the [customer:{id}](/scopes#customer_idid) scope. +* - If the Customer exists but is associated with a different Store than what is specified in the `manage_my_profile:{projectKey}:{storeKey}` scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMePasswordResetRequestMethodPost) Execute(ctx context.Context) (result *Customer, err error) { diff --git a/platform/client_search_by_project_key_customers_search.go b/platform/client_search_by_project_key_customers_search.go new file mode 100644 index 00000000..10b8db21 --- /dev/null +++ b/platform/client_search_by_project_key_customers_search.go @@ -0,0 +1,32 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "fmt" +) + +type ByProjectKeyCustomersSearchRequestBuilder struct { + projectKey string + client *Client +} + +func (rb *ByProjectKeyCustomersSearchRequestBuilder) Post(body CustomerSearchRequest) *ByProjectKeyCustomersSearchRequestMethodPost { + return &ByProjectKeyCustomersSearchRequestMethodPost{ + body: body, + url: fmt.Sprintf("/%s/customers/search", rb.projectKey), + client: rb.client, + } +} + +/** +* Checks whether a search index for the Project's Customers exists. +* Returns a `200 OK` status if the index exists or `404 Not Found` otherwise. +* + */ +func (rb *ByProjectKeyCustomersSearchRequestBuilder) Head() *ByProjectKeyCustomersSearchRequestMethodHead { + return &ByProjectKeyCustomersSearchRequestMethodHead{ + url: fmt.Sprintf("/%s/customers/search", rb.projectKey), + client: rb.client, + } +} diff --git a/platform/client_carts_by_project_key_me_carts_key_by_key_head.go b/platform/client_search_by_project_key_customers_search_head.go similarity index 78% rename from platform/client_carts_by_project_key_me_carts_key_by_key_head.go rename to platform/client_search_by_project_key_customers_search_head.go index a06a7493..53dfd1ab 100644 --- a/platform/client_carts_by_project_key_me_carts_key_by_key_head.go +++ b/platform/client_search_by_project_key_customers_search_head.go @@ -10,27 +10,29 @@ import ( "net/url" ) -type ByProjectKeyMeCartsKeyByKeyRequestMethodHead struct { +type ByProjectKeyCustomersSearchRequestMethodHead struct { url string client *Client headers http.Header } -func (r *ByProjectKeyMeCartsKeyByKeyRequestMethodHead) Dump() map[string]interface{} { +func (r *ByProjectKeyCustomersSearchRequestMethodHead) Dump() map[string]interface{} { return map[string]interface{}{ "url": r.url, } } -func (rb *ByProjectKeyMeCartsKeyByKeyRequestMethodHead) WithHeaders(headers http.Header) *ByProjectKeyMeCartsKeyByKeyRequestMethodHead { +func (rb *ByProjectKeyCustomersSearchRequestMethodHead) WithHeaders(headers http.Header) *ByProjectKeyCustomersSearchRequestMethodHead { rb.headers = headers return rb } /** -* Checks if a Cart exists for a given `key`. Returns a `200 OK` status if the Cart exists or a `404 Not Found` otherwise. +* Checks whether a search index for the Project's Customers exists. +* Returns a `200 OK` status if the index exists or `404 Not Found` otherwise. +* */ -func (rb *ByProjectKeyMeCartsKeyByKeyRequestMethodHead) Execute(ctx context.Context) error { +func (rb *ByProjectKeyCustomersSearchRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} resp, err := rb.client.head( ctx, diff --git a/platform/client_search_by_project_key_customers_search_post.go b/platform/client_search_by_project_key_customers_search_post.go new file mode 100644 index 00000000..51aec640 --- /dev/null +++ b/platform/client_search_by_project_key_customers_search_post.go @@ -0,0 +1,112 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyCustomersSearchRequestMethodPost struct { + body CustomerSearchRequest + url string + client *Client + headers http.Header +} + +func (r *ByProjectKeyCustomersSearchRequestMethodPost) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + } +} + +func (rb *ByProjectKeyCustomersSearchRequestMethodPost) WithHeaders(headers http.Header) *ByProjectKeyCustomersSearchRequestMethodPost { + rb.headers = headers + return rb +} +func (rb *ByProjectKeyCustomersSearchRequestMethodPost) Execute(ctx context.Context) (result *CustomerPagedSearchResponse, err error) { + data, err := serializeInput(rb.body) + if err != nil { + return nil, err + } + queryParams := url.Values{} + resp, err := rb.client.post( + ctx, + rb.url, + queryParams, + rb.headers, + data, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 404: + return nil, ErrNotFound + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_search_by_project_key_orders_search.go b/platform/client_search_by_project_key_orders_search.go index 6ecce55b..8a4a3e12 100644 --- a/platform/client_search_by_project_key_orders_search.go +++ b/platform/client_search_by_project_key_orders_search.go @@ -21,6 +21,8 @@ func (rb *ByProjectKeyOrdersSearchRequestBuilder) Post(body OrderSearchRequest) /** * Checks whether a search index for the Project's Orders exists. +* Returns a `200 OK` status if the index exists or a `404 Not Found` error otherwise. +* */ func (rb *ByProjectKeyOrdersSearchRequestBuilder) Head() *ByProjectKeyOrdersSearchRequestMethodHead { return &ByProjectKeyOrdersSearchRequestMethodHead{ diff --git a/platform/client_search_by_project_key_orders_search_head.go b/platform/client_search_by_project_key_orders_search_head.go index 477bb85c..0a93de44 100644 --- a/platform/client_search_by_project_key_orders_search_head.go +++ b/platform/client_search_by_project_key_orders_search_head.go @@ -29,6 +29,8 @@ func (rb *ByProjectKeyOrdersSearchRequestMethodHead) WithHeaders(headers http.He /** * Checks whether a search index for the Project's Orders exists. +* Returns a `200 OK` status if the index exists or a `404 Not Found` error otherwise. +* */ func (rb *ByProjectKeyOrdersSearchRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_search_by_project_key_products_search.go b/platform/client_search_by_project_key_products_search.go new file mode 100644 index 00000000..ac879f55 --- /dev/null +++ b/platform/client_search_by_project_key_products_search.go @@ -0,0 +1,20 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "fmt" +) + +type ByProjectKeyProductsSearchRequestBuilder struct { + projectKey string + client *Client +} + +func (rb *ByProjectKeyProductsSearchRequestBuilder) Post(body ProductSearchRequest) *ByProjectKeyProductsSearchRequestMethodPost { + return &ByProjectKeyProductsSearchRequestMethodPost{ + body: body, + url: fmt.Sprintf("/%s/products/search", rb.projectKey), + client: rb.client, + } +} diff --git a/platform/client_search_by_project_key_products_search_post.go b/platform/client_search_by_project_key_products_search_post.go new file mode 100644 index 00000000..9e64b823 --- /dev/null +++ b/platform/client_search_by_project_key_products_search_post.go @@ -0,0 +1,112 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyProductsSearchRequestMethodPost struct { + body ProductSearchRequest + url string + client *Client + headers http.Header +} + +func (r *ByProjectKeyProductsSearchRequestMethodPost) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + } +} + +func (rb *ByProjectKeyProductsSearchRequestMethodPost) WithHeaders(headers http.Header) *ByProjectKeyProductsSearchRequestMethodPost { + rb.headers = headers + return rb +} +func (rb *ByProjectKeyProductsSearchRequestMethodPost) Execute(ctx context.Context) (result *ProductPagedSearchResponse, err error) { + data, err := serializeInput(rb.body) + if err != nil { + return nil, err + } + queryParams := url.Values{} + resp, err := rb.client.post( + ctx, + rb.url, + queryParams, + rb.headers, + data, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 404: + return nil, ErrNotFound + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists.go b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists.go index 166f6956..d976307b 100644 --- a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists.go +++ b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists.go @@ -28,6 +28,17 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsRequestBuilder) WithId( client: rb.client, } } + +/** +* Returns ShoppingLists that match the given Query Predicate in a Store. Returns `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingLists exist in a Store. +* - If a ShoppingList exists but does not have a `store` specified, or the `store` field references a different Store. +* - If a ShoppingList exists in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* + */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsRequestMethodGet { return &ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsRequestMethodGet{ url: fmt.Sprintf("/%s/in-store/key=%s/me/shopping-lists", rb.projectKey, rb.storeKey), @@ -36,7 +47,14 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsRequestBuilder) Get() * } /** -* Checks if a ShoppingList exists for a given Query Predicate. Returns a `200 OK` status if any ShoppingLists match the Query Predicate or a `404 Not Found` otherwise. +* Checks if a ShoppingList exists for the given Query Predicate in a Store. Returns `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingLists exist for a given Query Predicate in a Store. +* - If a ShoppingList matches the Query Predicate but does not have a `store` specified, or the `store` field references a different Store. +* - If a ShoppingList exists in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsRequestMethodHead { return &ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsRequestMethodHead{ @@ -46,6 +64,9 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsRequestBuilder) Head() } /** +* +* Creates a ShoppingList in a Store for a Customer or anonymous user. The `customer` or `anonymousId` field on the ShoppingList is automatically set based on the given [customer:{id}](/scopes#customer_idid) or [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* * When using this endpoint, the `store` field of a ShoppingList is always set to the [Store](ctp:api:type:Store) specified in the path parameter. * */ diff --git a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_by_id.go b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_by_id.go index db661a5d..e6134898 100644 --- a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_by_id.go +++ b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_by_id.go @@ -14,8 +14,13 @@ type ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDRequestBuilder struct { } /** -* If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), -* the [ResourceNotFound](/errors#404-not-found-1) error is returned. +* Returns a ShoppingList for a given `id` in a Store. Returns `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList matches the given `id` in a Store. +* - If a ShoppingList matches the given `id` but does not have a `store` specified, or the `store` field references a different Store. +* - If a ShoppingList matches the given `id` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDRequestMethodGet { @@ -26,7 +31,14 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDRequestBuilder) Get } /** -* Checks if a ShoppingList exists for a given `id`. Returns a `200 OK` status if the ShoppingList exists or a `404 Not Found` otherwise. +* Checks if a ShoppingList exists for a given `id` in a Store. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList matches the given `id` in a Store. +* - If a ShoppingList matches the given `id` but does not have a `store` specified, or the `store` field references a different Store. +* - If a ShoppingList matches the given `id` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDRequestMethodHead { return &ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDRequestMethodHead{ @@ -36,8 +48,13 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDRequestBuilder) Hea } /** -* If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), -* the [ResourceNotFound](/errors#404-not-found-1) error is returned. +* Updates a ShoppingList for a given `id` in a Store. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList matches the given `id` in a Store. +* - If a ShoppingList matches the given `id` but does not have a `store` specified, or the `store` field references a different Store. +* - If a ShoppingList matches the given `id` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDRequestBuilder) Post(body MyShoppingListUpdate) *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDRequestMethodPost { @@ -49,8 +66,13 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDRequestBuilder) Pos } /** -* If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), -* the [ResourceNotFound](/errors#404-not-found-1) error is returned. +* Deletes the ShoppingList for a given `id` in a Store. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList matches the given `id` in a Store. +* - If a ShoppingList matches the given `id` but does not have a `store` specified, or the `store` field references a different Store. +* - If a ShoppingList matches the given `id` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDRequestBuilder) Delete() *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDRequestMethodDelete { diff --git a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_by_id_delete.go b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_by_id_delete.go index 3a643a41..648ca8fc 100644 --- a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_by_id_delete.go +++ b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_by_id_delete.go @@ -82,8 +82,13 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDRequestMethodDelete } /** -* If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), -* the [ResourceNotFound](/errors#404-not-found-1) error is returned. +* Deletes the ShoppingList for a given `id` in a Store. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList matches the given `id` in a Store. +* - If a ShoppingList matches the given `id` but does not have a `store` specified, or the `store` field references a different Store. +* - If a ShoppingList matches the given `id` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDRequestMethodDelete) Execute(ctx context.Context) (result *ShoppingList, err error) { diff --git a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_by_id_get.go b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_by_id_get.go index 5285a486..b183be19 100644 --- a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_by_id_get.go +++ b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_by_id_get.go @@ -55,8 +55,13 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDRequestMethodGet) W } /** -* If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), -* the [ResourceNotFound](/errors#404-not-found-1) error is returned. +* Returns a ShoppingList for a given `id` in a Store. Returns `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList matches the given `id` in a Store. +* - If a ShoppingList matches the given `id` but does not have a `store` specified, or the `store` field references a different Store. +* - If a ShoppingList matches the given `id` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDRequestMethodGet) Execute(ctx context.Context) (result *ShoppingList, err error) { diff --git a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_by_id_head.go b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_by_id_head.go index 6b92b69c..a9401b3f 100644 --- a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_by_id_head.go +++ b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_by_id_head.go @@ -28,7 +28,14 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDRequestMethodHead) } /** -* Checks if a ShoppingList exists for a given `id`. Returns a `200 OK` status if the ShoppingList exists or a `404 Not Found` otherwise. +* Checks if a ShoppingList exists for a given `id` in a Store. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList matches the given `id` in a Store. +* - If a ShoppingList matches the given `id` but does not have a `store` specified, or the `store` field references a different Store. +* - If a ShoppingList matches the given `id` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_by_id_post.go b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_by_id_post.go index 9fa19df9..4018c53e 100644 --- a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_by_id_post.go +++ b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_by_id_post.go @@ -56,8 +56,13 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDRequestMethodPost) } /** -* If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), -* the [ResourceNotFound](/errors#404-not-found-1) error is returned. +* Updates a ShoppingList for a given `id` in a Store. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList matches the given `id` in a Store. +* - If a ShoppingList matches the given `id` but does not have a `store` specified, or the `store` field references a different Store. +* - If a ShoppingList matches the given `id` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsByIDRequestMethodPost) Execute(ctx context.Context) (result *ShoppingList, err error) { diff --git a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_get.go b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_get.go index 03775ab7..db6c04ec 100644 --- a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_get.go +++ b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_get.go @@ -132,6 +132,17 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsRequestMethodGet) WithH rb.headers = headers return rb } + +/** +* Returns ShoppingLists that match the given Query Predicate in a Store. Returns `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingLists exist in a Store. +* - If a ShoppingList exists but does not have a `store` specified, or the `store` field references a different Store. +* - If a ShoppingList exists in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* + */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsRequestMethodGet) Execute(ctx context.Context) (result *ShoppingListPagedQueryResponse, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_head.go b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_head.go index 75825daa..280b8c84 100644 --- a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_head.go +++ b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_head.go @@ -55,7 +55,14 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsRequestMethodHead) With } /** -* Checks if a ShoppingList exists for a given Query Predicate. Returns a `200 OK` status if any ShoppingLists match the Query Predicate or a `404 Not Found` otherwise. +* Checks if a ShoppingList exists for the given Query Predicate in a Store. Returns `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingLists exist for a given Query Predicate in a Store. +* - If a ShoppingList matches the Query Predicate but does not have a `store` specified, or the `store` field references a different Store. +* - If a ShoppingList exists in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsRequestMethodHead) Execute(ctx context.Context) error { var queryParams url.Values diff --git a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_key_by_key.go b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_key_by_key.go index 8cdb1741..a5f5dbe0 100644 --- a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_key_by_key.go +++ b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_key_by_key.go @@ -14,7 +14,14 @@ type ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyRequestBuilder struc } /** -* If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), the [ResourceNotFound](/errors#404-not-found-1) error is returned. +* Returns a ShoppingList for a given `key` in a Store. Returns `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList matches the given `key` in a Store. +* - If a ShoppingList matches the given `key` but does not have a `store` specified, or the `store` field references a different Store. +* - If a ShoppingList matches the given `key` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, +* or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyRequestMethodGet { @@ -25,7 +32,14 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyRequestBuilder) } /** -* Checks if a ShoppingList exists for a given `key`. Returns a `200 OK` status if the ShoppingList exists or a `404 Not Found` otherwise. +* Checks if a ShoppingList exists for a given `key` in a Store. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList exists that matches the given `key` in a Store. +* - If a ShoppingList matches the given `key` but does not have a `store` specified, or the `store` field references a different Store. +* - If a ShoppingList matches the given `key` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyRequestMethodHead { return &ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyRequestMethodHead{ @@ -35,8 +49,13 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyRequestBuilder) } /** -* If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), -* the [ResourceNotFound](/errors#404-not-found-1) error is returned. +* Updates a ShoppingList for a given `key` in a Store. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList matches the given `key` in a Store. +* - If a ShoppingList matches the given `key` but does not have a `store` specified, or the `store` field references a different Store. +* - If a ShoppingList matches the given `key` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyRequestBuilder) Post(body MyShoppingListUpdate) *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyRequestMethodPost { @@ -48,8 +67,13 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyRequestBuilder) } /** -* If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), -* the [ResourceNotFound](/errors#404-not-found-1) error is returned. +* Deletes the ShoppingList for a given `key` in a Store. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList matches the given `key` in a Store. +* - If a ShoppingList matches the given `key` but does not have a `store` specified, or the `store` field references a different Store. +* - If a ShoppingList matches the given `key` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyRequestBuilder) Delete() *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyRequestMethodDelete { diff --git a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_key_by_key_delete.go b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_key_by_key_delete.go index e25a9dac..c7d165f4 100644 --- a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_key_by_key_delete.go +++ b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_key_by_key_delete.go @@ -82,8 +82,13 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyRequestMethodDe } /** -* If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), -* the [ResourceNotFound](/errors#404-not-found-1) error is returned. +* Deletes the ShoppingList for a given `key` in a Store. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList matches the given `key` in a Store. +* - If a ShoppingList matches the given `key` but does not have a `store` specified, or the `store` field references a different Store. +* - If a ShoppingList matches the given `key` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyRequestMethodDelete) Execute(ctx context.Context) (result *ShoppingList, err error) { diff --git a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_key_by_key_get.go b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_key_by_key_get.go index 86aa1816..a82c8f46 100644 --- a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_key_by_key_get.go +++ b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_key_by_key_get.go @@ -55,7 +55,14 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyRequestMethodGe } /** -* If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), the [ResourceNotFound](/errors#404-not-found-1) error is returned. +* Returns a ShoppingList for a given `key` in a Store. Returns `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList matches the given `key` in a Store. +* - If a ShoppingList matches the given `key` but does not have a `store` specified, or the `store` field references a different Store. +* - If a ShoppingList matches the given `key` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, +* or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyRequestMethodGet) Execute(ctx context.Context) (result *ShoppingList, err error) { diff --git a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_key_by_key_head.go b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_key_by_key_head.go index cdf3ee6a..51687e60 100644 --- a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_key_by_key_head.go +++ b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_key_by_key_head.go @@ -28,7 +28,14 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyRequestMethodHe } /** -* Checks if a ShoppingList exists for a given `key`. Returns a `200 OK` status if the ShoppingList exists or a `404 Not Found` otherwise. +* Checks if a ShoppingList exists for a given `key` in a Store. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList exists that matches the given `key` in a Store. +* - If a ShoppingList matches the given `key` but does not have a `store` specified, or the `store` field references a different Store. +* - If a ShoppingList matches the given `key` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_key_by_key_post.go b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_key_by_key_post.go index 838f20d2..18fb6bc8 100644 --- a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_key_by_key_post.go +++ b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_key_by_key_post.go @@ -56,8 +56,13 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyRequestMethodPo } /** -* If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), -* the [ResourceNotFound](/errors#404-not-found-1) error is returned. +* Updates a ShoppingList for a given `key` in a Store. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList matches the given `key` in a Store. +* - If a ShoppingList matches the given `key` but does not have a `store` specified, or the `store` field references a different Store. +* - If a ShoppingList matches the given `key` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. * */ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsKeyByKeyRequestMethodPost) Execute(ctx context.Context) (result *ShoppingList, err error) { diff --git a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_post.go b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_post.go index f3b5f9a5..1ca11072 100644 --- a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_post.go +++ b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_me_shopping_lists_post.go @@ -56,6 +56,9 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeShoppingListsRequestMethodPost) With } /** +* +* Creates a ShoppingList in a Store for a Customer or anonymous user. The `customer` or `anonymousId` field on the ShoppingList is automatically set based on the given [customer:{id}](/scopes#customer_idid) or [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* * When using this endpoint, the `store` field of a ShoppingList is always set to the [Store](ctp:api:type:Store) specified in the path parameter. * */ diff --git a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists.go b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists.go index 020d1ad2..5f8086f6 100644 --- a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists.go +++ b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists.go @@ -36,7 +36,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyShoppingListsRequestBuilder) Get() *By } /** -* Checks if a ShoppingList exists for a given Query Predicate. Returns a `200 OK` status if any ShoppingLists match the Query Predicate or a `404 Not Found` otherwise. +* Checks if a ShoppingList exists for a given Query Predicate. Returns a `200 OK` status if any ShoppingLists match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyShoppingListsRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyShoppingListsRequestMethodHead { return &ByProjectKeyInStoreKeyByStoreKeyShoppingListsRequestMethodHead{ diff --git a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists_by_id.go b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists_by_id.go index a6739444..773d4fe6 100644 --- a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists_by_id.go +++ b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists_by_id.go @@ -26,7 +26,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyShoppingListsByIDRequestBuilder) Get() } /** -* Checks if a ShoppingList exists for a given `id`. Returns a `200 OK` status if the ShoppingList exists or a `404 Not Found` otherwise. +* Checks if a ShoppingList exists for a given `id`. Returns a `200 OK` status if the ShoppingList exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyShoppingListsByIDRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyShoppingListsByIDRequestMethodHead { return &ByProjectKeyInStoreKeyByStoreKeyShoppingListsByIDRequestMethodHead{ diff --git a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists_by_id_head.go b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists_by_id_head.go index 24cdb297..912fb627 100644 --- a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists_by_id_head.go +++ b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists_by_id_head.go @@ -28,7 +28,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyShoppingListsByIDRequestMethodHead) Wi } /** -* Checks if a ShoppingList exists for a given `id`. Returns a `200 OK` status if the ShoppingList exists or a `404 Not Found` otherwise. +* Checks if a ShoppingList exists for a given `id`. Returns a `200 OK` status if the ShoppingList exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyShoppingListsByIDRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists_head.go b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists_head.go index c1c22000..205d3804 100644 --- a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists_head.go +++ b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists_head.go @@ -55,7 +55,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyShoppingListsRequestMethodHead) WithHe } /** -* Checks if a ShoppingList exists for a given Query Predicate. Returns a `200 OK` status if any ShoppingLists match the Query Predicate or a `404 Not Found` otherwise. +* Checks if a ShoppingList exists for a given Query Predicate. Returns a `200 OK` status if any ShoppingLists match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyShoppingListsRequestMethodHead) Execute(ctx context.Context) error { var queryParams url.Values diff --git a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists_key_by_key.go b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists_key_by_key.go index 955abeb0..bf1b2181 100644 --- a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists_key_by_key.go +++ b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists_key_by_key.go @@ -26,7 +26,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyShoppingListsKeyByKeyRequestBuilder) G } /** -* Checks if a ShoppingList exists for a given `key`. Returns a `200 OK` status if the ShoppingList exists or a `404 Not Found` otherwise. +* Checks if a ShoppingList exists for a given `key`. Returns a `200 OK` status if the ShoppingList exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyShoppingListsKeyByKeyRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyShoppingListsKeyByKeyRequestMethodHead { return &ByProjectKeyInStoreKeyByStoreKeyShoppingListsKeyByKeyRequestMethodHead{ diff --git a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists_key_by_key_head.go b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists_key_by_key_head.go index 29f1886b..d671c1c4 100644 --- a/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists_key_by_key_head.go +++ b/platform/client_shopping_lists_by_project_key_in_store_key_by_store_key_shopping_lists_key_by_key_head.go @@ -28,7 +28,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyShoppingListsKeyByKeyRequestMethodHead } /** -* Checks if a ShoppingList exists for a given `key`. Returns a `200 OK` status if the ShoppingList exists or a `404 Not Found` otherwise. +* Checks if a ShoppingList exists for a given `key`. Returns a `200 OK` status if the ShoppingList exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. */ func (rb *ByProjectKeyInStoreKeyByStoreKeyShoppingListsKeyByKeyRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_shopping_lists_by_project_key_me_shopping_lists.go b/platform/client_shopping_lists_by_project_key_me_shopping_lists.go index ba38e79b..833b6b69 100644 --- a/platform/client_shopping_lists_by_project_key_me_shopping_lists.go +++ b/platform/client_shopping_lists_by_project_key_me_shopping_lists.go @@ -25,6 +25,16 @@ func (rb *ByProjectKeyMeShoppingListsRequestBuilder) WithKey(key string) *ByProj client: rb.client, } } + +/** +* Returns all ShoppingLists that match the given Query Predicate. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList exists for the given Query Predicate. +* - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* + */ func (rb *ByProjectKeyMeShoppingListsRequestBuilder) Get() *ByProjectKeyMeShoppingListsRequestMethodGet { return &ByProjectKeyMeShoppingListsRequestMethodGet{ url: fmt.Sprintf("/%s/me/shopping-lists", rb.projectKey), @@ -33,7 +43,13 @@ func (rb *ByProjectKeyMeShoppingListsRequestBuilder) Get() *ByProjectKeyMeShoppi } /** -* Checks if a ShoppingList exists for a given Query Predicate. Returns a `200 OK` status if any ShoppingLists match the Query Predicate or a `404 Not Found` otherwise. +* Checks if a ShoppingList matches the given Query Predicate. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList exists for the given Query Predicate. +* - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* */ func (rb *ByProjectKeyMeShoppingListsRequestBuilder) Head() *ByProjectKeyMeShoppingListsRequestMethodHead { return &ByProjectKeyMeShoppingListsRequestMethodHead{ @@ -42,6 +58,10 @@ func (rb *ByProjectKeyMeShoppingListsRequestBuilder) Head() *ByProjectKeyMeShopp } } +/** +* Creates a ShoppingList for the Customer or anonymous user. The `customerId` or `anonymousId` on the ShoppingList is automatically set based on the given [customer:{id}](/scopes#customer_idid) or [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* + */ func (rb *ByProjectKeyMeShoppingListsRequestBuilder) Post(body MyShoppingListDraft) *ByProjectKeyMeShoppingListsRequestMethodPost { return &ByProjectKeyMeShoppingListsRequestMethodPost{ body: body, diff --git a/platform/client_shopping_lists_by_project_key_me_shopping_lists_by_id.go b/platform/client_shopping_lists_by_project_key_me_shopping_lists_by_id.go index e1330708..77171e41 100644 --- a/platform/client_shopping_lists_by_project_key_me_shopping_lists_by_id.go +++ b/platform/client_shopping_lists_by_project_key_me_shopping_lists_by_id.go @@ -12,6 +12,15 @@ type ByProjectKeyMeShoppingListsByIDRequestBuilder struct { client *Client } +/** +* Returns a ShoppingList for a given `id`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList exists for the given `id`. +* - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* + */ func (rb *ByProjectKeyMeShoppingListsByIDRequestBuilder) Get() *ByProjectKeyMeShoppingListsByIDRequestMethodGet { return &ByProjectKeyMeShoppingListsByIDRequestMethodGet{ url: fmt.Sprintf("/%s/me/shopping-lists/%s", rb.projectKey, rb.id), @@ -20,7 +29,13 @@ func (rb *ByProjectKeyMeShoppingListsByIDRequestBuilder) Get() *ByProjectKeyMeSh } /** -* Checks if a ShoppingList exists for a given `id`. Returns a `200 OK` status if the ShoppingList exists or a `404 Not Found` otherwise. +* Checks if a ShoppingList exists for a given `id`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList exists for the given `id`. +* - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* */ func (rb *ByProjectKeyMeShoppingListsByIDRequestBuilder) Head() *ByProjectKeyMeShoppingListsByIDRequestMethodHead { return &ByProjectKeyMeShoppingListsByIDRequestMethodHead{ @@ -29,6 +44,15 @@ func (rb *ByProjectKeyMeShoppingListsByIDRequestBuilder) Head() *ByProjectKeyMeS } } +/** +* Updates a ShoppingList for a given `id`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList exists for the given `id`. +* - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* + */ func (rb *ByProjectKeyMeShoppingListsByIDRequestBuilder) Post(body MyShoppingListUpdate) *ByProjectKeyMeShoppingListsByIDRequestMethodPost { return &ByProjectKeyMeShoppingListsByIDRequestMethodPost{ body: body, @@ -37,6 +61,15 @@ func (rb *ByProjectKeyMeShoppingListsByIDRequestBuilder) Post(body MyShoppingLis } } +/** +* Deletes the ShoppingList for a given `id`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList exists for the given `id`. +* - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* + */ func (rb *ByProjectKeyMeShoppingListsByIDRequestBuilder) Delete() *ByProjectKeyMeShoppingListsByIDRequestMethodDelete { return &ByProjectKeyMeShoppingListsByIDRequestMethodDelete{ url: fmt.Sprintf("/%s/me/shopping-lists/%s", rb.projectKey, rb.id), diff --git a/platform/client_shopping_lists_by_project_key_me_shopping_lists_by_id_delete.go b/platform/client_shopping_lists_by_project_key_me_shopping_lists_by_id_delete.go index 7a75dc1b..eb9ed64d 100644 --- a/platform/client_shopping_lists_by_project_key_me_shopping_lists_by_id_delete.go +++ b/platform/client_shopping_lists_by_project_key_me_shopping_lists_by_id_delete.go @@ -64,6 +64,16 @@ func (rb *ByProjectKeyMeShoppingListsByIDRequestMethodDelete) WithHeaders(header rb.headers = headers return rb } + +/** +* Deletes the ShoppingList for a given `id`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList exists for the given `id`. +* - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* + */ func (rb *ByProjectKeyMeShoppingListsByIDRequestMethodDelete) Execute(ctx context.Context) (result *ShoppingList, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_shopping_lists_by_project_key_me_shopping_lists_by_id_get.go b/platform/client_shopping_lists_by_project_key_me_shopping_lists_by_id_get.go index 3ccf98d0..0c16abbd 100644 --- a/platform/client_shopping_lists_by_project_key_me_shopping_lists_by_id_get.go +++ b/platform/client_shopping_lists_by_project_key_me_shopping_lists_by_id_get.go @@ -53,6 +53,16 @@ func (rb *ByProjectKeyMeShoppingListsByIDRequestMethodGet) WithHeaders(headers h rb.headers = headers return rb } + +/** +* Returns a ShoppingList for a given `id`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList exists for the given `id`. +* - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* + */ func (rb *ByProjectKeyMeShoppingListsByIDRequestMethodGet) Execute(ctx context.Context) (result *ShoppingList, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_shopping_lists_by_project_key_me_shopping_lists_by_id_head.go b/platform/client_shopping_lists_by_project_key_me_shopping_lists_by_id_head.go index 28cb493f..82e08479 100644 --- a/platform/client_shopping_lists_by_project_key_me_shopping_lists_by_id_head.go +++ b/platform/client_shopping_lists_by_project_key_me_shopping_lists_by_id_head.go @@ -28,7 +28,13 @@ func (rb *ByProjectKeyMeShoppingListsByIDRequestMethodHead) WithHeaders(headers } /** -* Checks if a ShoppingList exists for a given `id`. Returns a `200 OK` status if the ShoppingList exists or a `404 Not Found` otherwise. +* Checks if a ShoppingList exists for a given `id`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList exists for the given `id`. +* - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* */ func (rb *ByProjectKeyMeShoppingListsByIDRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_shopping_lists_by_project_key_me_shopping_lists_by_id_post.go b/platform/client_shopping_lists_by_project_key_me_shopping_lists_by_id_post.go index 853f105e..d8d576b1 100644 --- a/platform/client_shopping_lists_by_project_key_me_shopping_lists_by_id_post.go +++ b/platform/client_shopping_lists_by_project_key_me_shopping_lists_by_id_post.go @@ -54,6 +54,16 @@ func (rb *ByProjectKeyMeShoppingListsByIDRequestMethodPost) WithHeaders(headers rb.headers = headers return rb } + +/** +* Updates a ShoppingList for a given `id`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList exists for the given `id`. +* - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* + */ func (rb *ByProjectKeyMeShoppingListsByIDRequestMethodPost) Execute(ctx context.Context) (result *ShoppingList, err error) { data, err := serializeInput(rb.body) if err != nil { diff --git a/platform/client_shopping_lists_by_project_key_me_shopping_lists_get.go b/platform/client_shopping_lists_by_project_key_me_shopping_lists_get.go index 95b3e2d3..c6a5f62d 100644 --- a/platform/client_shopping_lists_by_project_key_me_shopping_lists_get.go +++ b/platform/client_shopping_lists_by_project_key_me_shopping_lists_get.go @@ -132,6 +132,16 @@ func (rb *ByProjectKeyMeShoppingListsRequestMethodGet) WithHeaders(headers http. rb.headers = headers return rb } + +/** +* Returns all ShoppingLists that match the given Query Predicate. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList exists for the given Query Predicate. +* - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* + */ func (rb *ByProjectKeyMeShoppingListsRequestMethodGet) Execute(ctx context.Context) (result *ShoppingListPagedQueryResponse, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_shopping_lists_by_project_key_me_shopping_lists_head.go b/platform/client_shopping_lists_by_project_key_me_shopping_lists_head.go index 24b64dc6..e8257f2d 100644 --- a/platform/client_shopping_lists_by_project_key_me_shopping_lists_head.go +++ b/platform/client_shopping_lists_by_project_key_me_shopping_lists_head.go @@ -55,7 +55,13 @@ func (rb *ByProjectKeyMeShoppingListsRequestMethodHead) WithHeaders(headers http } /** -* Checks if a ShoppingList exists for a given Query Predicate. Returns a `200 OK` status if any ShoppingLists match the Query Predicate or a `404 Not Found` otherwise. +* Checks if a ShoppingList matches the given Query Predicate. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList exists for the given Query Predicate. +* - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* */ func (rb *ByProjectKeyMeShoppingListsRequestMethodHead) Execute(ctx context.Context) error { var queryParams url.Values diff --git a/platform/client_shopping_lists_by_project_key_me_shopping_lists_key_by_key.go b/platform/client_shopping_lists_by_project_key_me_shopping_lists_key_by_key.go index 1eee48ec..9da0a786 100644 --- a/platform/client_shopping_lists_by_project_key_me_shopping_lists_key_by_key.go +++ b/platform/client_shopping_lists_by_project_key_me_shopping_lists_key_by_key.go @@ -12,6 +12,15 @@ type ByProjectKeyMeShoppingListsKeyByKeyRequestBuilder struct { client *Client } +/** +* Returns a ShoppingList for a given `key`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList exists for the given `key`. +* - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* + */ func (rb *ByProjectKeyMeShoppingListsKeyByKeyRequestBuilder) Get() *ByProjectKeyMeShoppingListsKeyByKeyRequestMethodGet { return &ByProjectKeyMeShoppingListsKeyByKeyRequestMethodGet{ url: fmt.Sprintf("/%s/me/shopping-lists/key=%s", rb.projectKey, rb.key), @@ -20,7 +29,13 @@ func (rb *ByProjectKeyMeShoppingListsKeyByKeyRequestBuilder) Get() *ByProjectKey } /** -* Checks if a ShoppingList exists for a given `key`. Returns a `200 OK` status if the ShoppingList exists or a `404 Not Found` otherwise. +* Checks if a ShoppingList exists for a given `key`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList exists for the given `key`. +* - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* */ func (rb *ByProjectKeyMeShoppingListsKeyByKeyRequestBuilder) Head() *ByProjectKeyMeShoppingListsKeyByKeyRequestMethodHead { return &ByProjectKeyMeShoppingListsKeyByKeyRequestMethodHead{ @@ -29,6 +44,15 @@ func (rb *ByProjectKeyMeShoppingListsKeyByKeyRequestBuilder) Head() *ByProjectKe } } +/** +* Updates a ShoppingList for a given `key`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList exists for the given `key`. +* - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* + */ func (rb *ByProjectKeyMeShoppingListsKeyByKeyRequestBuilder) Post(body MyShoppingListUpdate) *ByProjectKeyMeShoppingListsKeyByKeyRequestMethodPost { return &ByProjectKeyMeShoppingListsKeyByKeyRequestMethodPost{ body: body, @@ -37,6 +61,15 @@ func (rb *ByProjectKeyMeShoppingListsKeyByKeyRequestBuilder) Post(body MyShoppin } } +/** +* Deletes the ShoppingList for a given `key`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList exists for the given `key`. +* - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* + */ func (rb *ByProjectKeyMeShoppingListsKeyByKeyRequestBuilder) Delete() *ByProjectKeyMeShoppingListsKeyByKeyRequestMethodDelete { return &ByProjectKeyMeShoppingListsKeyByKeyRequestMethodDelete{ url: fmt.Sprintf("/%s/me/shopping-lists/key=%s", rb.projectKey, rb.key), diff --git a/platform/client_shopping_lists_by_project_key_me_shopping_lists_key_by_key_delete.go b/platform/client_shopping_lists_by_project_key_me_shopping_lists_key_by_key_delete.go index 4ef1c72c..507d7f6c 100644 --- a/platform/client_shopping_lists_by_project_key_me_shopping_lists_key_by_key_delete.go +++ b/platform/client_shopping_lists_by_project_key_me_shopping_lists_key_by_key_delete.go @@ -64,6 +64,16 @@ func (rb *ByProjectKeyMeShoppingListsKeyByKeyRequestMethodDelete) WithHeaders(he rb.headers = headers return rb } + +/** +* Deletes the ShoppingList for a given `key`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList exists for the given `key`. +* - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* + */ func (rb *ByProjectKeyMeShoppingListsKeyByKeyRequestMethodDelete) Execute(ctx context.Context) (result *ShoppingList, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_shopping_lists_by_project_key_me_shopping_lists_key_by_key_get.go b/platform/client_shopping_lists_by_project_key_me_shopping_lists_key_by_key_get.go index 88b35186..03a25451 100644 --- a/platform/client_shopping_lists_by_project_key_me_shopping_lists_key_by_key_get.go +++ b/platform/client_shopping_lists_by_project_key_me_shopping_lists_key_by_key_get.go @@ -53,6 +53,16 @@ func (rb *ByProjectKeyMeShoppingListsKeyByKeyRequestMethodGet) WithHeaders(heade rb.headers = headers return rb } + +/** +* Returns a ShoppingList for a given `key`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList exists for the given `key`. +* - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* + */ func (rb *ByProjectKeyMeShoppingListsKeyByKeyRequestMethodGet) Execute(ctx context.Context) (result *ShoppingList, err error) { var queryParams url.Values if rb.params != nil { diff --git a/platform/client_shopping_lists_by_project_key_me_shopping_lists_key_by_key_head.go b/platform/client_shopping_lists_by_project_key_me_shopping_lists_key_by_key_head.go index b9b8c47a..ca247c6f 100644 --- a/platform/client_shopping_lists_by_project_key_me_shopping_lists_key_by_key_head.go +++ b/platform/client_shopping_lists_by_project_key_me_shopping_lists_key_by_key_head.go @@ -28,7 +28,13 @@ func (rb *ByProjectKeyMeShoppingListsKeyByKeyRequestMethodHead) WithHeaders(head } /** -* Checks if a ShoppingList exists for a given `key`. Returns a `200 OK` status if the ShoppingList exists or a `404 Not Found` otherwise. +* Checks if a ShoppingList exists for a given `key`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList exists for the given `key`. +* - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* */ func (rb *ByProjectKeyMeShoppingListsKeyByKeyRequestMethodHead) Execute(ctx context.Context) error { queryParams := url.Values{} diff --git a/platform/client_shopping_lists_by_project_key_me_shopping_lists_key_by_key_post.go b/platform/client_shopping_lists_by_project_key_me_shopping_lists_key_by_key_post.go index 336c714d..0fb427b8 100644 --- a/platform/client_shopping_lists_by_project_key_me_shopping_lists_key_by_key_post.go +++ b/platform/client_shopping_lists_by_project_key_me_shopping_lists_key_by_key_post.go @@ -54,6 +54,16 @@ func (rb *ByProjectKeyMeShoppingListsKeyByKeyRequestMethodPost) WithHeaders(head rb.headers = headers return rb } + +/** +* Updates a ShoppingList for a given `key`. Returns a `200 OK` status if successful. +* +* A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: +* +* - If no ShoppingList exists for the given `key`. +* - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. +* + */ func (rb *ByProjectKeyMeShoppingListsKeyByKeyRequestMethodPost) Execute(ctx context.Context) (result *ShoppingList, err error) { data, err := serializeInput(rb.body) if err != nil { diff --git a/platform/client_shopping_lists_by_project_key_me_shopping_lists_post.go b/platform/client_shopping_lists_by_project_key_me_shopping_lists_post.go index 9512d1f6..e8f6c6dc 100644 --- a/platform/client_shopping_lists_by_project_key_me_shopping_lists_post.go +++ b/platform/client_shopping_lists_by_project_key_me_shopping_lists_post.go @@ -54,6 +54,11 @@ func (rb *ByProjectKeyMeShoppingListsRequestMethodPost) WithHeaders(headers http rb.headers = headers return rb } + +/** +* Creates a ShoppingList for the Customer or anonymous user. The `customerId` or `anonymousId` on the ShoppingList is automatically set based on the given [customer:{id}](/scopes#customer_idid) or [anonymous_id:{id}](/scopes#anonymous_idid) scope. +* + */ func (rb *ByProjectKeyMeShoppingListsRequestMethodPost) Execute(ctx context.Context) (result *ShoppingList, err error) { data, err := serializeInput(rb.body) if err != nil { diff --git a/platform/client_signup_by_project_key_in_store_key_by_store_key_me_signup.go b/platform/client_signup_by_project_key_in_store_key_by_store_key_me_signup.go index 31890502..5f8900e5 100644 --- a/platform/client_signup_by_project_key_in_store_key_by_store_key_me_signup.go +++ b/platform/client_signup_by_project_key_in_store_key_by_store_key_me_signup.go @@ -13,8 +13,13 @@ type ByProjectKeyInStoreKeyByStoreKeyMeSignupRequestBuilder struct { } /** +* +* If used with an optional [access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the `anonymousId` are assigned to the newly created Customer. +* * If omitted in the request body, the [Customer](ctp:api:type:Customer) `stores` field is set to the [Store](ctp:api:type:Store) specified in the path parameter. * +* A Cart returned in the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) has any invalid Line Items removed and is [updated](/api/carts-orders-overview#cart-updates) with the latest prices, taxes, and discounts. During these updates, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError). +* * Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. * */ diff --git a/platform/client_signup_by_project_key_in_store_key_by_store_key_me_signup_post.go b/platform/client_signup_by_project_key_in_store_key_by_store_key_me_signup_post.go index 6cfd31df..dd1a191d 100644 --- a/platform/client_signup_by_project_key_in_store_key_by_store_key_me_signup_post.go +++ b/platform/client_signup_by_project_key_in_store_key_by_store_key_me_signup_post.go @@ -29,8 +29,13 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeSignupRequestMethodPost) WithHeaders } /** +* +* If used with an optional [access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the `anonymousId` are assigned to the newly created Customer. +* * If omitted in the request body, the [Customer](ctp:api:type:Customer) `stores` field is set to the [Store](ctp:api:type:Store) specified in the path parameter. * +* A Cart returned in the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) has any invalid Line Items removed and is [updated](/api/carts-orders-overview#cart-updates) with the latest prices, taxes, and discounts. During these updates, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError). +* * Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. * */ diff --git a/platform/client_signup_by_project_key_me_signup.go b/platform/client_signup_by_project_key_me_signup.go index 553351b6..15e8976b 100644 --- a/platform/client_signup_by_project_key_me_signup.go +++ b/platform/client_signup_by_project_key_me_signup.go @@ -12,7 +12,7 @@ type ByProjectKeyMeSignupRequestBuilder struct { } /** -* If used with an [access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the `anonymousId` are assigned to the newly created Customer. +* If used with an optional [access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the `anonymousId` are assigned to the newly created Customer. * * Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. * diff --git a/platform/client_signup_by_project_key_me_signup_post.go b/platform/client_signup_by_project_key_me_signup_post.go index c8025727..5f3fda5c 100644 --- a/platform/client_signup_by_project_key_me_signup_post.go +++ b/platform/client_signup_by_project_key_me_signup_post.go @@ -29,7 +29,7 @@ func (rb *ByProjectKeyMeSignupRequestMethodPost) WithHeaders(headers http.Header } /** -* If used with an [access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the `anonymousId` are assigned to the newly created Customer. +* If used with an optional [access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the `anonymousId` are assigned to the newly created Customer. * * Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. * diff --git a/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes.go b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes.go new file mode 100644 index 00000000..3d69ddf1 --- /dev/null +++ b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes.go @@ -0,0 +1,54 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "fmt" +) + +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestBuilder struct { + projectKey string + storeKey string + client *Client +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestBuilder) WithKey(key string) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestBuilder { + return &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestBuilder{ + key: key, + projectKey: rb.projectKey, + storeKey: rb.storeKey, + client: rb.client, + } +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestBuilder) WithId(id string) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestBuilder { + return &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestBuilder{ + id: id, + projectKey: rb.projectKey, + storeKey: rb.storeKey, + client: rb.client, + } +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet { + return &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet{ + url: fmt.Sprintf("/%s/in-store/key=%s/staged-quotes", rb.projectKey, rb.storeKey), + client: rb.client, + } +} + +/** +* Checks if a StagedQuote exists for a given Query Predicate. Returns a `200 OK` status if any StagedQuotes match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodHead { + return &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodHead{ + url: fmt.Sprintf("/%s/in-store/key=%s/staged-quotes", rb.projectKey, rb.storeKey), + client: rb.client, + } +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestBuilder) Post(body StagedQuoteDraft) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodPost { + return &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodPost{ + body: body, + url: fmt.Sprintf("/%s/in-store/key=%s/staged-quotes", rb.projectKey, rb.storeKey), + client: rb.client, + } +} diff --git a/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_by_id.go b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_by_id.go new file mode 100644 index 00000000..ade7e38a --- /dev/null +++ b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_by_id.go @@ -0,0 +1,46 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "fmt" +) + +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestBuilder struct { + projectKey string + storeKey string + id string + client *Client +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodGet { + return &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodGet{ + url: fmt.Sprintf("/%s/in-store/key=%s/staged-quotes/%s", rb.projectKey, rb.storeKey, rb.id), + client: rb.client, + } +} + +/** +* Checks if a StagedQuote exists for a given `id`. Returns a `200 OK` status if the StagedQuote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodHead { + return &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodHead{ + url: fmt.Sprintf("/%s/in-store/key=%s/staged-quotes/%s", rb.projectKey, rb.storeKey, rb.id), + client: rb.client, + } +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestBuilder) Post(body StagedQuoteUpdate) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodPost { + return &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodPost{ + body: body, + url: fmt.Sprintf("/%s/in-store/key=%s/staged-quotes/%s", rb.projectKey, rb.storeKey, rb.id), + client: rb.client, + } +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestBuilder) Delete() *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodDelete { + return &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodDelete{ + url: fmt.Sprintf("/%s/in-store/key=%s/staged-quotes/%s", rb.projectKey, rb.storeKey, rb.id), + client: rb.client, + } +} diff --git a/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_by_id_delete.go b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_by_id_delete.go new file mode 100644 index 00000000..641042b3 --- /dev/null +++ b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_by_id_delete.go @@ -0,0 +1,173 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" + "strconv" +) + +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodDelete struct { + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodDeleteInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodDelete) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodDeleteInput struct { + DataErasure *bool + Version int + Expand []string +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodDeleteInput) Values() url.Values { + values := url.Values{} + if input.DataErasure != nil { + if *input.DataErasure { + values.Add("dataErasure", "true") + } else { + values.Add("dataErasure", "false") + } + } + values.Add("version", strconv.Itoa(input.Version)) + for _, v := range input.Expand { + values.Add("expand", fmt.Sprintf("%v", v)) + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodDelete) DataErasure(v bool) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodDelete { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodDeleteInput{} + } + rb.params.DataErasure = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodDelete) Version(v int) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodDelete { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodDeleteInput{} + } + rb.params.Version = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodDelete) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodDelete { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodDeleteInput{} + } + rb.params.Expand = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodDelete) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodDeleteInput) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodDelete { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodDelete) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodDelete { + rb.headers = headers + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodDelete) Execute(ctx context.Context) (result *StagedQuote, err error) { + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.delete( + ctx, + rb.url, + queryParams, + rb.headers, + nil, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 409: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 404: + return nil, ErrNotFound + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_by_id_get.go b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_by_id_get.go new file mode 100644 index 00000000..834f1553 --- /dev/null +++ b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_by_id_get.go @@ -0,0 +1,138 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodGet struct { + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodGetInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodGet) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodGetInput struct { + Expand []string +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodGetInput) Values() url.Values { + values := url.Values{} + for _, v := range input.Expand { + values.Add("expand", fmt.Sprintf("%v", v)) + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodGet) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodGetInput{} + } + rb.params.Expand = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodGet) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodGetInput) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodGet { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodGet) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodGet { + rb.headers = headers + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodGet) Execute(ctx context.Context) (result *StagedQuote, err error) { + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.get( + ctx, + rb.url, + queryParams, + rb.headers, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 404: + return nil, ErrNotFound + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_by_id_head.go b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_by_id_head.go new file mode 100644 index 00000000..ac121ecb --- /dev/null +++ b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_by_id_head.go @@ -0,0 +1,106 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodHead struct { + url string + client *Client + headers http.Header +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodHead) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + } +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodHead) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodHead { + rb.headers = headers + return rb +} + +/** +* Checks if a StagedQuote exists for a given `id`. Returns a `200 OK` status if the StagedQuote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodHead) Execute(ctx context.Context) error { + queryParams := url.Values{} + resp, err := rb.client.head( + ctx, + rb.url, + queryParams, + rb.headers, + ) + + if err != nil { + return err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + return nil + case 404: + return ErrNotFound + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return result + } + +} diff --git a/platform/client_quote_requests_by_project_key_me_quote_requests_by_id_delete.go b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_by_id_post.go similarity index 60% rename from platform/client_quote_requests_by_project_key_me_quote_requests_by_id_delete.go rename to platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_by_id_post.go index 828de275..25c6633b 100644 --- a/platform/client_quote_requests_by_project_key_me_quote_requests_by_id_delete.go +++ b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_by_id_post.go @@ -9,74 +9,68 @@ import ( "io/ioutil" "net/http" "net/url" - "strconv" ) -type ByProjectKeyMeQuoteRequestsByIDRequestMethodDelete struct { +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodPost struct { + body StagedQuoteUpdate url string client *Client headers http.Header - params *ByProjectKeyMeQuoteRequestsByIDRequestMethodDeleteInput + params *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodPostInput } -func (r *ByProjectKeyMeQuoteRequestsByIDRequestMethodDelete) Dump() map[string]interface{} { +func (r *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodPost) Dump() map[string]interface{} { return map[string]interface{}{ "url": r.url, "params": r.params, } } -type ByProjectKeyMeQuoteRequestsByIDRequestMethodDeleteInput struct { - Version int - Expand []string +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodPostInput struct { + Expand []string } -func (input *ByProjectKeyMeQuoteRequestsByIDRequestMethodDeleteInput) Values() url.Values { +func (input *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodPostInput) Values() url.Values { values := url.Values{} - values.Add("version", strconv.Itoa(input.Version)) for _, v := range input.Expand { values.Add("expand", fmt.Sprintf("%v", v)) } return values } -func (rb *ByProjectKeyMeQuoteRequestsByIDRequestMethodDelete) Version(v int) *ByProjectKeyMeQuoteRequestsByIDRequestMethodDelete { +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodPost) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodPost { if rb.params == nil { - rb.params = &ByProjectKeyMeQuoteRequestsByIDRequestMethodDeleteInput{} - } - rb.params.Version = v - return rb -} - -func (rb *ByProjectKeyMeQuoteRequestsByIDRequestMethodDelete) Expand(v []string) *ByProjectKeyMeQuoteRequestsByIDRequestMethodDelete { - if rb.params == nil { - rb.params = &ByProjectKeyMeQuoteRequestsByIDRequestMethodDeleteInput{} + rb.params = &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodPostInput{} } rb.params.Expand = v return rb } -func (rb *ByProjectKeyMeQuoteRequestsByIDRequestMethodDelete) WithQueryParams(input ByProjectKeyMeQuoteRequestsByIDRequestMethodDeleteInput) *ByProjectKeyMeQuoteRequestsByIDRequestMethodDelete { +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodPost) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodPostInput) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodPost { rb.params = &input return rb } -func (rb *ByProjectKeyMeQuoteRequestsByIDRequestMethodDelete) WithHeaders(headers http.Header) *ByProjectKeyMeQuoteRequestsByIDRequestMethodDelete { +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodPost) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodPost { rb.headers = headers return rb } -func (rb *ByProjectKeyMeQuoteRequestsByIDRequestMethodDelete) Execute(ctx context.Context) (result *QuoteRequest, err error) { +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestMethodPost) Execute(ctx context.Context) (result *StagedQuote, err error) { + data, err := serializeInput(rb.body) + if err != nil { + return nil, err + } var queryParams url.Values if rb.params != nil { queryParams = rb.params.Values() } else { queryParams = url.Values{} } - resp, err := rb.client.delete( + resp, err := rb.client.post( ctx, rb.url, queryParams, rb.headers, - nil, + data, ) if err != nil { diff --git a/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_get.go b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_get.go new file mode 100644 index 00000000..29ff9f49 --- /dev/null +++ b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_get.go @@ -0,0 +1,217 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" + "strconv" +) + +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet struct { + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGetInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGetInput struct { + Expand []string + Sort []string + Limit *int + Offset *int + WithTotal *bool + Where []string + PredicateVar map[string][]string +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGetInput) Values() url.Values { + values := url.Values{} + for _, v := range input.Expand { + values.Add("expand", fmt.Sprintf("%v", v)) + } + for _, v := range input.Sort { + values.Add("sort", fmt.Sprintf("%v", v)) + } + if input.Limit != nil { + values.Add("limit", strconv.Itoa(*input.Limit)) + } + if input.Offset != nil { + values.Add("offset", strconv.Itoa(*input.Offset)) + } + if input.WithTotal != nil { + if *input.WithTotal { + values.Add("withTotal", "true") + } else { + values.Add("withTotal", "false") + } + } + for _, v := range input.Where { + values.Add("where", fmt.Sprintf("%v", v)) + } + for k, v := range input.PredicateVar { + for _, x := range v { + values.Add(k, x) + } + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGetInput{} + } + rb.params.Expand = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet) Sort(v []string) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGetInput{} + } + rb.params.Sort = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet) Limit(v int) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGetInput{} + } + rb.params.Limit = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet) Offset(v int) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGetInput{} + } + rb.params.Offset = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet) WithTotal(v bool) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGetInput{} + } + rb.params.WithTotal = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet) Where(v []string) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGetInput{} + } + rb.params.Where = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet) PredicateVar(v map[string][]string) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGetInput{} + } + rb.params.PredicateVar = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGetInput) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet { + rb.headers = headers + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodGet) Execute(ctx context.Context) (result *StagedQuotePagedQueryResponse, err error) { + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.get( + ctx, + rb.url, + queryParams, + rb.headers, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 404: + return nil, ErrNotFound + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_head.go b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_head.go new file mode 100644 index 00000000..09adc1e4 --- /dev/null +++ b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_head.go @@ -0,0 +1,138 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodHead struct { + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodHeadInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodHead) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodHeadInput struct { + Where []string +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodHeadInput) Values() url.Values { + values := url.Values{} + for _, v := range input.Where { + values.Add("where", fmt.Sprintf("%v", v)) + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodHead) Where(v []string) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodHead { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodHeadInput{} + } + rb.params.Where = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodHead) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodHeadInput) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodHead { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodHead) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodHead { + rb.headers = headers + return rb +} + +/** +* Checks if a StagedQuote exists for a given Query Predicate. Returns a `200 OK` status if any StagedQuotes match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodHead) Execute(ctx context.Context) error { + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.head( + ctx, + rb.url, + queryParams, + rb.headers, + ) + + if err != nil { + return err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + return nil + case 404: + return ErrNotFound + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return result + } + +} diff --git a/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_key_by_key.go b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_key_by_key.go new file mode 100644 index 00000000..4e9cc72c --- /dev/null +++ b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_key_by_key.go @@ -0,0 +1,46 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "fmt" +) + +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestBuilder struct { + projectKey string + storeKey string + key string + client *Client +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodGet { + return &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodGet{ + url: fmt.Sprintf("/%s/in-store/key=%s/staged-quotes/key=%s", rb.projectKey, rb.storeKey, rb.key), + client: rb.client, + } +} + +/** +* Checks if a StagedQuote exists for a given `key`. Returns a `200 OK` status if the StagedQuote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodHead { + return &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodHead{ + url: fmt.Sprintf("/%s/in-store/key=%s/staged-quotes/key=%s", rb.projectKey, rb.storeKey, rb.key), + client: rb.client, + } +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestBuilder) Post(body StagedQuoteUpdate) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodPost { + return &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodPost{ + body: body, + url: fmt.Sprintf("/%s/in-store/key=%s/staged-quotes/key=%s", rb.projectKey, rb.storeKey, rb.key), + client: rb.client, + } +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestBuilder) Delete() *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodDelete { + return &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodDelete{ + url: fmt.Sprintf("/%s/in-store/key=%s/staged-quotes/key=%s", rb.projectKey, rb.storeKey, rb.key), + client: rb.client, + } +} diff --git a/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_key_by_key_delete.go b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_key_by_key_delete.go new file mode 100644 index 00000000..85fd4cf9 --- /dev/null +++ b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_key_by_key_delete.go @@ -0,0 +1,173 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" + "strconv" +) + +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodDelete struct { + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodDeleteInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodDelete) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodDeleteInput struct { + DataErasure *bool + Version int + Expand []string +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodDeleteInput) Values() url.Values { + values := url.Values{} + if input.DataErasure != nil { + if *input.DataErasure { + values.Add("dataErasure", "true") + } else { + values.Add("dataErasure", "false") + } + } + values.Add("version", strconv.Itoa(input.Version)) + for _, v := range input.Expand { + values.Add("expand", fmt.Sprintf("%v", v)) + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodDelete) DataErasure(v bool) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodDelete { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodDeleteInput{} + } + rb.params.DataErasure = &v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodDelete) Version(v int) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodDelete { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodDeleteInput{} + } + rb.params.Version = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodDelete) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodDelete { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodDeleteInput{} + } + rb.params.Expand = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodDelete) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodDeleteInput) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodDelete { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodDelete) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodDelete { + rb.headers = headers + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodDelete) Execute(ctx context.Context) (result *StagedQuote, err error) { + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.delete( + ctx, + rb.url, + queryParams, + rb.headers, + nil, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 409: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 404: + return nil, ErrNotFound + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_key_by_key_get.go b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_key_by_key_get.go new file mode 100644 index 00000000..99cb59c4 --- /dev/null +++ b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_key_by_key_get.go @@ -0,0 +1,138 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodGet struct { + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodGetInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodGet) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodGetInput struct { + Expand []string +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodGetInput) Values() url.Values { + values := url.Values{} + for _, v := range input.Expand { + values.Add("expand", fmt.Sprintf("%v", v)) + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodGet) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodGet { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodGetInput{} + } + rb.params.Expand = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodGet) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodGetInput) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodGet { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodGet) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodGet { + rb.headers = headers + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodGet) Execute(ctx context.Context) (result *StagedQuote, err error) { + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.get( + ctx, + rb.url, + queryParams, + rb.headers, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 404: + return nil, ErrNotFound + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_key_by_key_head.go b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_key_by_key_head.go new file mode 100644 index 00000000..7d5484f3 --- /dev/null +++ b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_key_by_key_head.go @@ -0,0 +1,106 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodHead struct { + url string + client *Client + headers http.Header +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodHead) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + } +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodHead) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodHead { + rb.headers = headers + return rb +} + +/** +* Checks if a StagedQuote exists for a given `key`. Returns a `200 OK` status if the StagedQuote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + */ +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodHead) Execute(ctx context.Context) error { + queryParams := url.Values{} + resp, err := rb.client.head( + ctx, + rb.url, + queryParams, + rb.headers, + ) + + if err != nil { + return err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + return nil + case 404: + return ErrNotFound + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return err + } + return errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return result + } + +} diff --git a/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_key_by_key_post.go b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_key_by_key_post.go new file mode 100644 index 00000000..315f491d --- /dev/null +++ b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_key_by_key_post.go @@ -0,0 +1,151 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodPost struct { + body StagedQuoteUpdate + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodPostInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodPost) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodPostInput struct { + Expand []string +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodPostInput) Values() url.Values { + values := url.Values{} + for _, v := range input.Expand { + values.Add("expand", fmt.Sprintf("%v", v)) + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodPost) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodPost { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodPostInput{} + } + rb.params.Expand = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodPost) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodPostInput) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodPost { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodPost) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodPost { + rb.headers = headers + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestMethodPost) Execute(ctx context.Context) (result *StagedQuote, err error) { + data, err := serializeInput(rb.body) + if err != nil { + return nil, err + } + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.post( + ctx, + rb.url, + queryParams, + rb.headers, + data, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 200: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 409: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 404: + return nil, ErrNotFound + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_post.go b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_post.go new file mode 100644 index 00000000..b145b5a3 --- /dev/null +++ b/platform/client_staged_quotes_by_project_key_in_store_key_by_store_key_staged_quotes_post.go @@ -0,0 +1,144 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" +) + +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodPost struct { + body StagedQuoteDraft + url string + client *Client + headers http.Header + params *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodPostInput +} + +func (r *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodPost) Dump() map[string]interface{} { + return map[string]interface{}{ + "url": r.url, + "params": r.params, + } +} + +type ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodPostInput struct { + Expand []string +} + +func (input *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodPostInput) Values() url.Values { + values := url.Values{} + for _, v := range input.Expand { + values.Add("expand", fmt.Sprintf("%v", v)) + } + return values +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodPost) Expand(v []string) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodPost { + if rb.params == nil { + rb.params = &ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodPostInput{} + } + rb.params.Expand = v + return rb +} + +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodPost) WithQueryParams(input ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodPostInput) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodPost { + rb.params = &input + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodPost) WithHeaders(headers http.Header) *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodPost { + rb.headers = headers + return rb +} +func (rb *ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestMethodPost) Execute(ctx context.Context) (result *StagedQuote, err error) { + data, err := serializeInput(rb.body) + if err != nil { + return nil, err + } + var queryParams url.Values + if rb.params != nil { + queryParams = rb.params.Values() + } else { + queryParams = url.Values{} + } + resp, err := rb.client.post( + ctx, + rb.url, + queryParams, + rb.headers, + data, + ) + + if err != nil { + return nil, err + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + defer resp.Body.Close() + switch resp.StatusCode { + case 201: + err = json.Unmarshal(content, &result) + if err != nil { + return nil, err + } + return result, nil + case 400: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 401: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 403: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 404: + return nil, ErrNotFound + case 500: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 502: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + case 503: + errorObj := ErrorResponse{} + err = json.Unmarshal(content, &errorObj) + if err != nil { + return nil, err + } + return nil, errorObj + default: + result := GenericRequestError{ + StatusCode: resp.StatusCode, + Content: content, + Response: resp, + } + return nil, result + } + +} diff --git a/platform/client_standalone_prices_by_project_key_standalone_prices.go b/platform/client_standalone_prices_by_project_key_standalone_prices.go index 7648105f..ff70bdec 100644 --- a/platform/client_standalone_prices_by_project_key_standalone_prices.go +++ b/platform/client_standalone_prices_by_project_key_standalone_prices.go @@ -43,7 +43,10 @@ func (rb *ByProjectKeyStandalonePricesRequestBuilder) Head() *ByProjectKeyStanda } /** -* Produces the [StandalonePriceCreated](ctp:api:type:StandalonePriceCreatedMessage) Message. +* Creating a Standalone Price produces the [StandalonePriceCreated](ctp:api:type:StandalonePriceCreatedMessage) Message. +* +* - If the Standalone Price has the same price scope as an existing Standalone Price, a [DuplicateStandalonePriceScope](ctp:api:type:DuplicateStandalonePriceScopeError) error is returned. +* - If the Standalone Price has overlapping validity periods within the same price scope, a [OverlappingStandalonePriceValidity](ctp:api:type:OverlappingStandalonePriceValidityError) error is returned. A Price without validity period does not conflict with a Price defined for a time period. * */ func (rb *ByProjectKeyStandalonePricesRequestBuilder) Post(body StandalonePriceDraft) *ByProjectKeyStandalonePricesRequestMethodPost { diff --git a/platform/client_standalone_prices_by_project_key_standalone_prices_post.go b/platform/client_standalone_prices_by_project_key_standalone_prices_post.go index dd532c95..3768891f 100644 --- a/platform/client_standalone_prices_by_project_key_standalone_prices_post.go +++ b/platform/client_standalone_prices_by_project_key_standalone_prices_post.go @@ -56,7 +56,10 @@ func (rb *ByProjectKeyStandalonePricesRequestMethodPost) WithHeaders(headers htt } /** -* Produces the [StandalonePriceCreated](ctp:api:type:StandalonePriceCreatedMessage) Message. +* Creating a Standalone Price produces the [StandalonePriceCreated](ctp:api:type:StandalonePriceCreatedMessage) Message. +* +* - If the Standalone Price has the same price scope as an existing Standalone Price, a [DuplicateStandalonePriceScope](ctp:api:type:DuplicateStandalonePriceScopeError) error is returned. +* - If the Standalone Price has overlapping validity periods within the same price scope, a [OverlappingStandalonePriceValidity](ctp:api:type:OverlappingStandalonePriceValidityError) error is returned. A Price without validity period does not conflict with a Price defined for a time period. * */ func (rb *ByProjectKeyStandalonePricesRequestMethodPost) Execute(ctx context.Context) (result *StandalonePrice, err error) { diff --git a/platform/client_subscriptions_by_project_key_subscriptions.go b/platform/client_subscriptions_by_project_key_subscriptions.go index f5b0feef..30edf95a 100644 --- a/platform/client_subscriptions_by_project_key_subscriptions.go +++ b/platform/client_subscriptions_by_project_key_subscriptions.go @@ -43,7 +43,7 @@ func (rb *ByProjectKeySubscriptionsRequestBuilder) Head() *ByProjectKeySubscript } /** -* A test message is sent to ensure the correct configuration of the Destination. If the message cannot be delivered, the Subscription will not be created. The payload of the test message is a notification of type [ResourceCreated](/../api/projects/subscriptions#resourcecreateddeliverypayload) for the `resourceTypeId` `subscription`. +* A test notification is sent to ensure the correct configuration of the Destination. If the notification cannot be delivered, the Subscription will not be created. The payload of the test notification is of type [ResourceCreated](/../api/projects/subscriptions#resourcecreateddeliverypayload) for the `resourceTypeId` `subscription`. * */ func (rb *ByProjectKeySubscriptionsRequestBuilder) Post(body SubscriptionDraft) *ByProjectKeySubscriptionsRequestMethodPost { diff --git a/platform/client_subscriptions_by_project_key_subscriptions_post.go b/platform/client_subscriptions_by_project_key_subscriptions_post.go index f93eb78b..839c7886 100644 --- a/platform/client_subscriptions_by_project_key_subscriptions_post.go +++ b/platform/client_subscriptions_by_project_key_subscriptions_post.go @@ -29,7 +29,7 @@ func (rb *ByProjectKeySubscriptionsRequestMethodPost) WithHeaders(headers http.H } /** -* A test message is sent to ensure the correct configuration of the Destination. If the message cannot be delivered, the Subscription will not be created. The payload of the test message is a notification of type [ResourceCreated](/../api/projects/subscriptions#resourcecreateddeliverypayload) for the `resourceTypeId` `subscription`. +* A test notification is sent to ensure the correct configuration of the Destination. If the notification cannot be delivered, the Subscription will not be created. The payload of the test notification is of type [ResourceCreated](/../api/projects/subscriptions#resourcecreateddeliverypayload) for the `resourceTypeId` `subscription`. * */ func (rb *ByProjectKeySubscriptionsRequestMethodPost) Execute(ctx context.Context) (result *Subscription, err error) { diff --git a/platform/client_suggest_by_project_key_product_projections_suggest_get.go b/platform/client_suggest_by_project_key_product_projections_suggest_get.go index 4a0befa0..dcbfdfdf 100644 --- a/platform/client_suggest_by_project_key_product_projections_suggest_get.go +++ b/platform/client_suggest_by_project_key_product_projections_suggest_get.go @@ -5,7 +5,6 @@ package platform import ( "context" "encoding/json" - "fmt" "io/ioutil" "net/http" "net/url" @@ -27,43 +26,27 @@ func (r *ByProjectKeyProductProjectionsSuggestRequestMethodGet) Dump() map[strin } type ByProjectKeyProductProjectionsSuggestRequestMethodGetInput struct { - Fuzzy *bool SearchKeywords map[string][]string - Sort []string Limit *int - Offset *int - WithTotal *bool + Fuzzy *bool Staged *bool } func (input *ByProjectKeyProductProjectionsSuggestRequestMethodGetInput) Values() url.Values { values := url.Values{} - if input.Fuzzy != nil { - if *input.Fuzzy { - values.Add("fuzzy", "true") - } else { - values.Add("fuzzy", "false") - } - } for k, v := range input.SearchKeywords { for _, x := range v { values.Add(k, x) } } - for _, v := range input.Sort { - values.Add("sort", fmt.Sprintf("%v", v)) - } if input.Limit != nil { values.Add("limit", strconv.Itoa(*input.Limit)) } - if input.Offset != nil { - values.Add("offset", strconv.Itoa(*input.Offset)) - } - if input.WithTotal != nil { - if *input.WithTotal { - values.Add("withTotal", "true") + if input.Fuzzy != nil { + if *input.Fuzzy { + values.Add("fuzzy", "true") } else { - values.Add("withTotal", "false") + values.Add("fuzzy", "false") } } if input.Staged != nil { @@ -76,14 +59,6 @@ func (input *ByProjectKeyProductProjectionsSuggestRequestMethodGetInput) Values( return values } -func (rb *ByProjectKeyProductProjectionsSuggestRequestMethodGet) Fuzzy(v bool) *ByProjectKeyProductProjectionsSuggestRequestMethodGet { - if rb.params == nil { - rb.params = &ByProjectKeyProductProjectionsSuggestRequestMethodGetInput{} - } - rb.params.Fuzzy = &v - return rb -} - func (rb *ByProjectKeyProductProjectionsSuggestRequestMethodGet) SearchKeywords(v map[string][]string) *ByProjectKeyProductProjectionsSuggestRequestMethodGet { if rb.params == nil { rb.params = &ByProjectKeyProductProjectionsSuggestRequestMethodGetInput{} @@ -92,14 +67,6 @@ func (rb *ByProjectKeyProductProjectionsSuggestRequestMethodGet) SearchKeywords( return rb } -func (rb *ByProjectKeyProductProjectionsSuggestRequestMethodGet) Sort(v []string) *ByProjectKeyProductProjectionsSuggestRequestMethodGet { - if rb.params == nil { - rb.params = &ByProjectKeyProductProjectionsSuggestRequestMethodGetInput{} - } - rb.params.Sort = v - return rb -} - func (rb *ByProjectKeyProductProjectionsSuggestRequestMethodGet) Limit(v int) *ByProjectKeyProductProjectionsSuggestRequestMethodGet { if rb.params == nil { rb.params = &ByProjectKeyProductProjectionsSuggestRequestMethodGetInput{} @@ -108,19 +75,11 @@ func (rb *ByProjectKeyProductProjectionsSuggestRequestMethodGet) Limit(v int) *B return rb } -func (rb *ByProjectKeyProductProjectionsSuggestRequestMethodGet) Offset(v int) *ByProjectKeyProductProjectionsSuggestRequestMethodGet { - if rb.params == nil { - rb.params = &ByProjectKeyProductProjectionsSuggestRequestMethodGetInput{} - } - rb.params.Offset = &v - return rb -} - -func (rb *ByProjectKeyProductProjectionsSuggestRequestMethodGet) WithTotal(v bool) *ByProjectKeyProductProjectionsSuggestRequestMethodGet { +func (rb *ByProjectKeyProductProjectionsSuggestRequestMethodGet) Fuzzy(v bool) *ByProjectKeyProductProjectionsSuggestRequestMethodGet { if rb.params == nil { rb.params = &ByProjectKeyProductProjectionsSuggestRequestMethodGetInput{} } - rb.params.WithTotal = &v + rb.params.Fuzzy = &v return rb } diff --git a/platform/types_api_client.go b/platform/types_api_client.go index 734c4840..f451097b 100644 --- a/platform/types_api_client.go +++ b/platform/types_api_client.go @@ -20,7 +20,7 @@ type ApiClient struct { LastUsedAt *Date `json:"lastUsedAt,omitempty"` // If set, the Client will be deleted on (or shortly after) this point in time. DeleteAt *time.Time `json:"deleteAt,omitempty"` - // Date and time (UTC) the APIClient was initially created at. + // Date and time (UTC) the APIClient was initially created. CreatedAt *time.Time `json:"createdAt,omitempty"` // Expiration time in seconds for each access token obtained by the APIClient. Only present when set with the [APIClientDraft](ctp:api:type:ApiClientDraft). If not present the default value applies. AccessTokenValiditySeconds *int `json:"accessTokenValiditySeconds,omitempty"` diff --git a/platform/types_approval_flow.go b/platform/types_approval_flow.go index 2327b2e2..a5001a83 100644 --- a/platform/types_approval_flow.go +++ b/platform/types_approval_flow.go @@ -17,9 +17,9 @@ type ApprovalFlow struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the Approval Flow was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources created after 1 February 2019 except for [events not tracked](/general-concepts#events-tracked). + // IDs and references that created the ApprovalFlow. CreatedBy *CreatedBy `json:"createdBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/general-concepts#events-tracked). + // IDs and references that last modified the ApprovalFlow. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` // [Order](ctp:api:type:Order) that needs to be approved. Order OrderReference `json:"order"` @@ -47,7 +47,7 @@ type ApprovalFlow struct { type ApprovalFlowApproval struct { // Associate who approved the [Approval Flow](ctp:api:type:ApprovalFlow). Approver Associate `json:"approver"` - // Date and time (UTC) when the [Approval Flow](ctp:api:type:ApprovalFlow) was approved at. + // Date and time (UTC) the [Approval Flow](ctp:api:type:ApprovalFlow) was approved. ApprovedAt time.Time `json:"approvedAt"` } @@ -75,7 +75,7 @@ type ApprovalFlowPagedQueryResponse struct { type ApprovalFlowRejection struct { // Associate who rejected the [Approval Flow](ctp:api:type:ApprovalFlow). Rejecter Associate `json:"rejecter"` - // Date and time (UTC) when the [Approval Flow](ctp:api:type:ApprovalFlow) was rejected at. + // Date and time (UTC) the [Approval Flow](ctp:api:type:ApprovalFlow) was rejected. RejectedAt time.Time `json:"rejectedAt"` // The reason for the rejection of the [Approval Flow](ctp:api:type:ApprovalFlow). Reason *string `json:"reason,omitempty"` diff --git a/platform/types_approval_rule.go b/platform/types_approval_rule.go index c96d5ce9..0dbfb84d 100644 --- a/platform/types_approval_rule.go +++ b/platform/types_approval_rule.go @@ -17,9 +17,9 @@ type ApprovalRule struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the Approval Rule was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources created after 1 February 2019 except for [events not tracked](/general-concepts#events-tracked). + // IDs and references that created the ApprovalRule. CreatedBy *CreatedBy `json:"createdBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/general-concepts#events-tracked). + // IDs and references that last modified the ApprovalRule. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` // User-defined unique identifier of the Approval Rule. Must be unique within a [Business Unit](ctp:api:type:BusinessUnit). Key *string `json:"key,omitempty"` diff --git a/platform/types_associate_role.go b/platform/types_associate_role.go index 42b89577..b1113b2f 100644 --- a/platform/types_associate_role.go +++ b/platform/types_associate_role.go @@ -17,11 +17,11 @@ type AssociateRole struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the AssociateRole was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources updated after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the AssociateRole. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the AssociateRole. CreatedBy *CreatedBy `json:"createdBy,omitempty"` - // User-defined unique identifier of the AssociateRole. + // User-defined unique and immutable identifier of the AssociateRole. Key string `json:"key"` // Whether the AssociateRole can be assigned to an Associate by a [buyer](/../api/associates-overview#buyer). If false, the AssociateRole can only be assigned using the [general endpoint](/../api/associates-overview#through-the-general-endpoints). BuyerAssignable bool `json:"buyerAssignable"` @@ -34,7 +34,7 @@ type AssociateRole struct { } type AssociateRoleDraft struct { - // User-defined unique identifier for the AssociateRole. + // User-defined unique and immutable identifier for the AssociateRole. Key string `json:"key"` // Name of the AssociateRole. Name *string `json:"name,omitempty"` @@ -71,7 +71,7 @@ func (obj AssociateRoleDraft) MarshalJSON() ([]byte, error) { } /** -* [Reference](ctp:api:type:Reference) to an [AssociateRole](ctp:api:type:AssociateRole) by its key. +* [KeyReference](ctp:api:type:KeyReference) to an [AssociateRole](ctp:api:type:AssociateRole). * */ type AssociateRoleKeyReference struct { diff --git a/platform/types_attribute_group.go b/platform/types_attribute_group.go index 239c3030..b17c636d 100644 --- a/platform/types_attribute_group.go +++ b/platform/types_attribute_group.go @@ -17,9 +17,9 @@ type AttributeGroup struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the AttributeGroup was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the AttributeGroup. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the AttributeGroup. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Name of the AttributeGroup. Name LocalizedString `json:"name"` diff --git a/platform/types_business_unit.go b/platform/types_business_unit.go index 39b93b1a..a27ca6c2 100644 --- a/platform/types_business_unit.go +++ b/platform/types_business_unit.go @@ -144,6 +144,17 @@ func mapDiscriminatorBusinessUnit(input interface{}) (BusinessUnit, error) { return nil, nil } +/** +* Determines whether a Business Unit can inherit [Approval Rules](/projects/approval-rules) from a parent. Only Business Units of type `Division` can use `ExplicitAndFromParent`. +* + */ +type BusinessUnitApprovalRuleMode string + +const ( + BusinessUnitApprovalRuleModeExplicit BusinessUnitApprovalRuleMode = "Explicit" + BusinessUnitApprovalRuleModeExplicitAndFromParent BusinessUnitApprovalRuleMode = "ExplicitAndFromParent" +) + /** * Determines whether a Business Unit can inherit Associates from a parent. * @@ -190,7 +201,7 @@ func mapDiscriminatorBusinessUnitDraft(input interface{}) (BusinessUnitDraft, er } /** -* [Reference](ctp:api:type:Reference) to a [BusinessUnit](ctp:api:type:BusinessUnit) by its key. +* [KeyReference](ctp:api:type:KeyReference) to a [BusinessUnit](ctp:api:type:BusinessUnit). * */ type BusinessUnitKeyReference struct { @@ -416,6 +427,12 @@ func mapDiscriminatorBusinessUnitUpdateAction(input interface{}) (BusinessUnitUp return nil, err } return obj, nil + case "changeApprovalRuleMode": + obj := BusinessUnitChangeApprovalRuleModeAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil case "changeAssociate": obj := BusinessUnitChangeAssociateAction{} if err := decodeStruct(input, &obj); err != nil { @@ -554,11 +571,11 @@ type Company struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the Business Unit was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources updated after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the BusinessUnit. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the BusinessUnit. CreatedBy *CreatedBy `json:"createdBy,omitempty"` - // User-defined unique identifier of the Business Unit. + // User-defined unique and immutable identifier of the Business Unit. Key string `json:"key"` // Indicates whether the Business Unit can be edited and used in [Orders](/../api/projects/orders). Status BusinessUnitStatus `json:"status"` @@ -568,7 +585,7 @@ type Company struct { // // If the Business Unit has no Stores, then all of its [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [Quotes](ctp:api:type:Quote), or [Quote Requests](ctp:api:type:QuoteRequest) must not belong to any Store. Stores []StoreKeyReference `json:"stores"` - // Is always `Explicit` since a Company cannot have a parent Business Unit that Stores can be inherited from. + // The value of this field is always `Explicit` because a Company cannot have a parent Business Unit that Stores can be inherited from. StoreMode BusinessUnitStoreMode `json:"storeMode"` // Name of the Business Unit. Name string `json:"name"` @@ -586,7 +603,7 @@ type Company struct { BillingAddressIds []string `json:"billingAddressIds"` // Unique identifier of the address used as the default billing address. DefaultBillingAddressId *string `json:"defaultBillingAddressId,omitempty"` - // Is always `Explicit` since a Company cannot have a parent Business Unit that Associates can be inherited from. + // The value of this field is always `Explicit` because a Company cannot have a parent Business Unit that Associates can be inherited from. AssociateMode BusinessUnitAssociateMode `json:"associateMode"` // Associates that are part of the Business Unit in specific [roles](ctp:api:type:AssociateRole). Associates []Associate `json:"associates"` @@ -596,6 +613,8 @@ type Company struct { ParentUnit *BusinessUnitKeyReference `json:"parentUnit,omitempty"` // Top-level unit of the Business Unit. The top-level unit is of `unitType` `Company`. TopLevelUnit BusinessUnitKeyReference `json:"topLevelUnit"` + // The value of this field is always `Explicit` because a Company cannot have a parent Business Unit that Approval Rules can be inherited from. + ApprovalRuleMode BusinessUnitApprovalRuleMode `json:"approvalRuleMode"` } // MarshalJSON override to set the discriminator value or remove @@ -640,7 +659,7 @@ func (obj Company) MarshalJSON() ([]byte, error) { * */ type CompanyDraft struct { - // User-defined unique identifier for the Business Unit. + // User-defined unique and immutable identifier for the Business Unit. Key string `json:"key"` // Indicates whether the Business Unit can be edited and used in [Orders](/../api/projects/orders). Status *BusinessUnitStatus `json:"status,omitempty"` @@ -663,6 +682,10 @@ type CompanyDraft struct { AssociateMode *BusinessUnitAssociateMode `json:"associateMode,omitempty"` // List of members that are part of the Business Unit in specific [roles](ctp:api:type:AssociateRole). Associates []AssociateDraft `json:"associates"` + // Determines whether the Business Unit can inherit Approval Rules from a parent. + // For [Companies](ctp:api:type:BusinessUnitType), the value of this field is always `Explicit`. + // For [Divisions](ctp:api:type:BusinessUnitType), the default value is `ExplicitAndFromParent`. + ApprovalRuleMode *BusinessUnitApprovalRuleMode `json:"approvalRuleMode,omitempty"` // Addresses used by the Business Unit. Addresses []BaseAddress `json:"addresses"` // Indexes of entries in `addresses` to set as shipping addresses. @@ -734,11 +757,11 @@ type Division struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the Business Unit was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources updated after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the BusinessUnit. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the BusinessUnit. CreatedBy *CreatedBy `json:"createdBy,omitempty"` - // User-defined unique identifier of the Business Unit. + // User-defined unique and immutable identifier of the Business Unit. Key string `json:"key"` // Indicates whether the Business Unit can be edited and used in [Orders](/../api/projects/orders). Status BusinessUnitStatus `json:"status"` @@ -776,6 +799,8 @@ type Division struct { ParentUnit BusinessUnitKeyReference `json:"parentUnit"` // Top-level unit of the Business Unit. The top-level unit is of `unitType` `Company`. TopLevelUnit BusinessUnitKeyReference `json:"topLevelUnit"` + // Determines whether a Business Unit can inherit Approval Rules from a parent. + ApprovalRuleMode BusinessUnitApprovalRuleMode `json:"approvalRuleMode"` } // MarshalJSON override to set the discriminator value or remove @@ -821,7 +846,7 @@ func (obj Division) MarshalJSON() ([]byte, error) { * */ type DivisionDraft struct { - // User-defined unique identifier for the Business Unit. + // User-defined unique and immutable identifier for the Business Unit. Key string `json:"key"` // Indicates whether the Business Unit can be edited and used in [Orders](/../api/projects/orders). Status *BusinessUnitStatus `json:"status,omitempty"` @@ -843,6 +868,8 @@ type DivisionDraft struct { AssociateMode *BusinessUnitAssociateMode `json:"associateMode,omitempty"` // List of members that are part of the Business Unit in specific [roles](ctp:api:type:AssociateRole). Associates []AssociateDraft `json:"associates"` + // Determines whether the Division can inherit Approval Rules from a parent. + ApprovalRuleMode *BusinessUnitApprovalRuleMode `json:"approvalRuleMode,omitempty"` // Addresses used by the Business Unit. Addresses []BaseAddress `json:"addresses"` // Indexes of entries in `addresses` to set as shipping addresses. @@ -1039,6 +1066,29 @@ func (obj BusinessUnitChangeAddressAction) MarshalJSON() ([]byte, error) { }{Action: "changeAddress", Alias: (*Alias)(&obj)}) } +/** +* Updates [Approval Rules](/projects/approval-rules) inheritance behavior between Business Units. +* +* Only Business Units of type `Division` can be changed to `ExplicitAndFromParent`. +* +* This update action generates a [BusinessUnitApprovalRuleModeChanged](ctp:api:type:BusinessUnitApprovalRuleModeChangedMessage) Message. +* + */ +type BusinessUnitChangeApprovalRuleModeAction struct { + // The new value for `approvalRuleMode`. + ApprovalRuleMode BusinessUnitApprovalRuleMode `json:"approvalRuleMode"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj BusinessUnitChangeApprovalRuleModeAction) MarshalJSON() ([]byte, error) { + type Alias BusinessUnitChangeApprovalRuleModeAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "changeApprovalRuleMode", Alias: (*Alias)(&obj)}) +} + /** * Updating the [Associate](ctp:api:type:Associate) on a [Business Unit](ctp:api:type:BusinessUnit) generates the [BusinessUnitAssociateChanged](ctp:api:type:BusinessUnitAssociateChangedMessage) Message. * @@ -1470,23 +1520,8 @@ type BusinessUnitSetStoresAction struct { // optional nil slices func (obj BusinessUnitSetStoresAction) MarshalJSON() ([]byte, error) { type Alias BusinessUnitSetStoresAction - data, err := json.Marshal(struct { + return json.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setStores", Alias: (*Alias)(&obj)}) - if err != nil { - return nil, err - } - - raw := make(map[string]interface{}) - if err := json.Unmarshal(data, &raw); err != nil { - return nil, err - } - - if raw["stores"] == nil { - delete(raw, "stores") - } - - return json.Marshal(raw) - } diff --git a/platform/types_cart.go b/platform/types_cart.go index e916db89..c4c9ca7b 100644 --- a/platform/types_cart.go +++ b/platform/types_cart.go @@ -23,7 +23,7 @@ type Cart struct { CustomerId *string `json:"customerId,omitempty"` // Email address of the Customer that the Cart belongs to. CustomerEmail *string `json:"customerEmail,omitempty"` - // [Reference](ctp:api:type:Reference) to the Customer Group of the Customer that the Cart belongs to. Used for [LineItem Price selection](ctp:api:type:LineItemPriceSelection). + // [Reference](ctp:api:type:Reference) to the Customer Group of the Customer that the Cart belongs to. Used for [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). CustomerGroup *CustomerGroupReference `json:"customerGroup,omitempty"` // [Anonymous session](ctp:api:type:AnonymousSession) associated with the Cart. AnonymousId *string `json:"anonymousId,omitempty"` @@ -42,8 +42,8 @@ type Cart struct { // // Taxes are included if [TaxRate](ctp:api:type:TaxRate) `includedInPrice` is `true` for each price. TotalPrice CentPrecisionMoney `json:"totalPrice"` - // - For a Cart with `Platform` [TaxMode](ctp:api:type:TaxMode), it is automatically set when a [shipping address is set](ctp:api:type:CartSetShippingAddressAction). - // - For a Cart with `External` [TaxMode](ctp:api:type:TaxMode), it is automatically set when `shippingAddress` and external Tax Rates for all Line Items, Custom Line Items, and Shipping Methods in the Cart are set. + // - For a Cart with `Platform` [TaxMode](ctp:api:type:TaxMode), it is automatically set when a [shipping address is set](ctp:api:type:CartSetShippingAddressAction). For Carts with `Multiple` [ShippingMode](ctp:api:type:ShippingMode), all Line Items and Custom Line Items must be fully distributed between the Shipping Methods (via `shippingDetails`), otherwise `taxedPrice` is not automatically set. + // - For a Cart with `External` [TaxMode](ctp:api:type:TaxMode), it is automatically set when `shippingAddress` and external Tax Rates for all Line Items, Custom Line Items, and Shipping Methods in the Cart are set. For Carts with `Multiple` [ShippingMode](ctp:api:type:ShippingMode), all allocations must have their respective tax rates present in `perMethodTaxRate`, otherwise `taxedPrice` is not automatically set. // // If a discount applies on `totalPrice`, this field holds the discounted values. TaxedPrice *TaxedPrice `json:"taxedPrice,omitempty"` @@ -94,7 +94,7 @@ type Cart struct { RefusedGifts []CartDiscountReference `json:"refusedGifts"` // Payment information related to the Cart. PaymentInfo *PaymentInfo `json:"paymentInfo,omitempty"` - // Used for [LineItem Price selection](ctp:api:type:LineItemPriceSelection). + // Used for [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). Country *string `json:"country,omitempty"` // Languages of the Cart. Can only contain languages supported by the [Project](ctp:api:type:Project). Locale *string `json:"locale,omitempty"` @@ -104,9 +104,9 @@ type Cart struct { Custom *CustomFields `json:"custom,omitempty"` // Number of days after which an active Cart is deleted since its last modification. Configured in [Project settings](ctp:api:type:CartsConfiguration). DeleteDaysAfterLastModification *int `json:"deleteDaysAfterLastModification,omitempty"` - // Present on resources updated after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the Cart. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Cart. CreatedBy *CreatedBy `json:"createdBy,omitempty"` } @@ -137,7 +137,7 @@ type CartDraft struct { CustomerId *string `json:"customerId,omitempty"` // Email address of the Customer that the Cart belongs to. CustomerEmail *string `json:"customerEmail,omitempty"` - // [ResourceIdentifier](ctp:api:type:ResourceIdentifier) to the Customer Group of the Customer that the Cart belongs to. Used for [LineItem Price selection](ctp:api:type:LineItemPriceSelection). + // [ResourceIdentifier](ctp:api:type:ResourceIdentifier) to the Customer Group of the Customer that the Cart belongs to. Used for [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). // // It is automatically set if the Customer referenced in `customerId` belongs to a Customer Group. // It can also be set explicitly when no `customerId` is present. @@ -190,7 +190,7 @@ type CartDraft struct { ItemShippingAddresses []BaseAddress `json:"itemShippingAddresses"` // `code` of the existing [DiscountCodes](ctp:api:type:DiscountCode) to add to the Cart. DiscountCodes []string `json:"discountCodes"` - // Used for [LineItem Price selection](ctp:api:type:LineItemPriceSelection). + // Used for [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). // If used for [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/carts:POST), the provided country must be one of the [Store's](ctp:api:type:Store) `countries`. Country *string `json:"country,omitempty"` // Languages of the Cart. Can only contain languages supported by the [Project](ctp:api:type:Project). @@ -494,6 +494,12 @@ func mapDiscriminatorCartUpdateAction(input interface{}) (CartUpdateAction, erro return nil, err } return obj, nil + case "changeLineItemsOrder": + obj := CartChangeLineItemsOrderAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil case "changeTaxCalculationMode": obj := CartChangeTaxCalculationModeAction{} if err := decodeStruct(input, &obj); err != nil { @@ -1058,16 +1064,12 @@ func (obj *DirectDiscount) UnmarshalJSON(data []byte) error { /** * Represents a [CartDiscount](ctp:api:type:CartDiscount) that can only be associated with a single Cart or Order. * -* Direct Discounts are always active and valid, and have the default `Stacking` [StackingMode](ctp:api:type:StackingMode). -* They apply in the order in which they are listed in the `directDiscounts` array of [Carts](ctp:api:type:Cart) or [Orders](ctp:api:type:Order), and do not have a sorting order like Cart Discounts. -* -* If a Direct Discount is present, any matching Cart Discounts in the Project are ignored. -* Additionally, a Cart or Order supports either Discount Codes or Direct Discounts at the same time. +* For an introduction to Direct Discounts and to understand how they work in Composable Commerce, see the [Direct Discounts overview](/pricing-and-discounts-overview#direct-discounts). * */ type DirectDiscountDraft struct { // Defines the effect the Discount will have. - Value CartDiscountValue `json:"value"` + Value CartDiscountValueDraft `json:"value"` // Defines what segment of the Cart will be discounted. // // If `value` is set to `giftLineItem`, this must not be set. @@ -1083,7 +1085,7 @@ func (obj *DirectDiscountDraft) UnmarshalJSON(data []byte) error { } if obj.Value != nil { var err error - obj.Value, err = mapDiscriminatorCartDiscountValue(obj.Value) + obj.Value, err = mapDiscriminatorCartDiscountValueDraft(obj.Value) if err != nil { return err } @@ -1350,7 +1352,8 @@ type ExternalTaxRateDraft struct { Country string `json:"country"` // State within the specified country. State *string `json:"state,omitempty"` - // For countries (such as the US) where the total tax is a combination of multiple taxes (such as state and local taxes). The total of all subrates must equal the TaxRate `amount`. + // Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes). The total of all subrates must equal the TaxRate `amount`. + // These subrates are used to calculate the `taxPortions` field of a [Cart](ctp:api:type:Cart) or [Order](ctp:api:type:Order) and the `taxedPrice` field of [LineItems](ctp:api:type:LineItem), [CustomLineItems](ctp:api:type:CustomLineItem), and [ShippingInfos](ctp:api:type:ShippingInfo). SubRates []SubRate `json:"subRates"` } @@ -1487,7 +1490,7 @@ type LineItem struct { PerMethodTaxRate []MethodTaxRate `json:"perMethodTaxRate"` // Identifies [Inventory entries](/../api/projects/inventory) that are reserved. The referenced Channel has the `InventorySupply` [ChannelRoleEnum](ctp:api:type:ChannelRoleEnum). SupplyChannel *ChannelReference `json:"supplyChannel,omitempty"` - // Used to [select](ctp:api:type:LineItemPriceSelection) a Product Price. The referenced Channel has the `ProductDistribution` [ChannelRoleEnum](ctp:api:type:ChannelRoleEnum). + // Used to [select](/../api/pricing-and-discounts-overview#line-item-price-selection) a Product Price. The referenced Channel has the `ProductDistribution` [ChannelRoleEnum](ctp:api:type:ChannelRoleEnum). DistributionChannel *ChannelReference `json:"distributionChannel,omitempty"` // Indicates how the Price for the Line Item is set. PriceMode LineItemPriceMode `json:"priceMode"` @@ -1527,7 +1530,7 @@ type LineItemDraft struct { // // Optional for backwards compatibility reasons. AddedAt *time.Time `json:"addedAt,omitempty"` - // Used to [select](ctp:api:type:LineItemPriceSelection) a Product Price. + // Used to [select](/../api/pricing-and-discounts-overview#line-item-price-selection) a Product Price. // The referenced Channel must have the `ProductDistribution` [ChannelRoleEnum](ctp:api:type:ChannelRoleEnum). // // If the Cart is bound to a [Store](ctp:api:type:Store) with `distributionChannels` set, @@ -1540,7 +1543,7 @@ type LineItemDraft struct { ExternalPrice *Money `json:"externalPrice,omitempty"` // Sets the [LineItem](ctp:api:type:LineItem) `price` and `totalPrice` values, and the `priceMode` to `ExternalTotal` [LineItemPriceMode](ctp:api:type:LineItemPriceMode). ExternalTotalPrice *ExternalLineItemTotalPrice `json:"externalTotalPrice,omitempty"` - // Sets the external Tax Rate for the Line Item, if the Cart has the `External` [TaxMode](ctp:api:type:TaxMode). + // Sets the external Tax Rate for the Line Item, if the Cart has the `External` [TaxMode](ctp:api:type:TaxMode) and `Single` [ShippingMode](ctp:api:type:ShippingMode). If the Cart has `Multiple` [ShippingMode](ctp:api:type:ShippingMode), the Tax Rate is accepted but ignored. ExternalTaxRate *ExternalTaxRateDraft `json:"externalTaxRate,omitempty"` // Sets the external Tax Rates for individual Shipping Methods, if the Cart has the `External` [TaxMode](ctp:api:type:TaxMode) and `Multiple` [ShippingMode](ctp:api:type:ShippingMode). PerMethodExternalTaxRate []MethodExternalTaxRateDraft `json:"perMethodExternalTaxRate"` @@ -1798,7 +1801,7 @@ func (obj ShippingInfo) MarshalJSON() ([]byte, error) { } /** -* Determines whether a [ShippingMethod](ctp:api:type:ShippingMethod) is allowed for a Cart. +* Determines whether the selected [ShippingMethod](ctp:api:type:ShippingMethod) is allowed for the Cart. For more information, see [Predicates](/shipping-delivery-overview#predicates). * */ type ShippingMethodState string @@ -2231,7 +2234,7 @@ func (obj CartAddItemShippingAddressAction) MarshalJSON() ([]byte, error) { * If the Cart contains a [LineItem](ctp:api:type:LineItem) for a Product Variant with the same [LineItemMode](ctp:api:type:LineItemMode), [Custom Fields](/../api/projects/custom-fields), supply and distribution channel, then only the quantity of the existing Line Item is increased. * If [LineItem](ctp:api:type:LineItem) `shippingDetails` is set, it is merged. All addresses will be present afterwards and, for address keys present in both shipping details, the quantity will be summed up. * A new Line Item is added when the `externalPrice` or `externalTotalPrice` is set in this update action. -* The [LineItem](ctp:api:type:LineItem) price is set as described in [LineItem Price selection](ctp:api:type:LineItemPriceSelection). +* The [LineItem](ctp:api:type:LineItem) price is set as described in [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). * * If the Tax Rate is not set, a [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) error is returned. * @@ -2261,7 +2264,7 @@ type CartAddLineItemAction struct { // // Optional for backwards compatibility reasons. AddedAt *time.Time `json:"addedAt,omitempty"` - // Used to [select](ctp:api:type:LineItemPriceSelection) a Product Price. + // Used to [select](/../api/pricing-and-discounts-overview#line-item-price-selection) a Product Price. // The Channel must have the `ProductDistribution` [ChannelRoleEnum](ctp:api:type:ChannelRoleEnum). // If the Cart is bound to a [Store](ctp:api:type:Store) with `distributionChannels` set, the Channel must match one of the Store's distribution channels. DistributionChannel *ChannelResourceIdentifier `json:"distributionChannel,omitempty"` @@ -2272,7 +2275,7 @@ type CartAddLineItemAction struct { ExternalPrice *Money `json:"externalPrice,omitempty"` // Sets the [LineItem](ctp:api:type:LineItem) `price` and `totalPrice` values, and the `priceMode` to `ExternalTotal` [LineItemPriceMode](ctp:api:type:LineItemPriceMode). ExternalTotalPrice *ExternalLineItemTotalPrice `json:"externalTotalPrice,omitempty"` - // External Tax Rate for the Line Item, if the Cart has the `External` [TaxMode](ctp:api:type:TaxMode). + // Sets the external Tax Rate for the Line Item, if the Cart has the `External` [TaxMode](ctp:api:type:TaxMode) and `Single` [ShippingMode](ctp:api:type:ShippingMode). If the Cart has `Multiple` [ShippingMode](ctp:api:type:ShippingMode), the Tax Rate is accepted but ignored. ExternalTaxRate *ExternalTaxRateDraft `json:"externalTaxRate,omitempty"` // Sets the external Tax Rates for individual Shipping Methods, if the Cart has the `External` [TaxMode](ctp:api:type:TaxMode) and `Multiple` [ShippingMode](ctp:api:type:ShippingMode). PerMethodExternalTaxRate []MethodExternalTaxRateDraft `json:"perMethodExternalTaxRate"` @@ -2544,7 +2547,7 @@ func (obj CartChangeCustomLineItemQuantityAction) MarshalJSON() ([]byte, error) * use this update action in combination with the [Set LineItem ShippingDetails](ctp:api:type:CartSetLineItemShippingDetailsAction) update action * in a single Cart update command. * -* The [LineItem](ctp:api:type:LineItem) price is set as described in [LineItem Price selection](ctp:api:type:LineItemPriceSelection). +* The [LineItem](ctp:api:type:LineItem) price is set as described in [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). * */ type CartChangeLineItemQuantityAction struct { @@ -2556,11 +2559,13 @@ type CartChangeLineItemQuantityAction struct { // // If `0`, the Line Item is removed from the Cart. Quantity int `json:"quantity"` - // Sets the [LineItem](ctp:api:type:LineItem) `price` to the given value when changing the quantity of a Line Item with the `ExternalPrice` [LineItemPriceMode](ctp:api:type:LineItemPriceMode). + // Required when the Line Item uses `ExternalPrice` [LineItemPriceMode](ctp:api:type:LineItemPriceMode). + // Sets the [LineItem](ctp:api:type:LineItem) `price` to the given value when changing the quantity of a Line Item. // - // The LineItem price is updated as described in LineItem Price selection. + // The LineItem price is updated as described in Line Item price selection. ExternalPrice *Money `json:"externalPrice,omitempty"` // Sets the [LineItem](ctp:api:type:LineItem) `price` and `totalPrice` to the given value when changing the quantity of a Line Item with the `ExternalTotal` [LineItemPriceMode](ctp:api:type:LineItemPriceMode). + // If `externalTotalPrice` is not given and the `priceMode` is `ExternalTotal`, the external price is unset and the `priceMode` is set to `Platform`. ExternalTotalPrice *ExternalLineItemTotalPrice `json:"externalTotalPrice,omitempty"` } @@ -2574,6 +2579,21 @@ func (obj CartChangeLineItemQuantityAction) MarshalJSON() ([]byte, error) { }{Action: "changeLineItemQuantity", Alias: (*Alias)(&obj)}) } +type CartChangeLineItemsOrderAction struct { + // All existing [LineItem](ctp:api:type:LineItem) `id`s in the desired new order. + LineItemOrder []string `json:"lineItemOrder"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj CartChangeLineItemsOrderAction) MarshalJSON() ([]byte, error) { + type Alias CartChangeLineItemsOrderAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "changeLineItemsOrder", Alias: (*Alias)(&obj)}) +} + /** * Changing the tax calculation mode leads to [recalculation of taxes](/../api/carts-orders-overview#cart-tax-calculation). * @@ -2634,7 +2654,7 @@ func (obj CartChangeTaxRoundingModeAction) MarshalJSON() ([]byte, error) { /** * Changes the [CartState](ctp:api:type:CartState) from `Active` to `Frozen`. Results in a [Frozen Cart](ctp:api:type:FrozenCarts). -* Fails with [InvalidOperation](ctp:api:type:InvalidOperation) error when the Cart is empty. +* Fails with [InvalidOperation](ctp:api:type:InvalidOperationError) error when the Cart is empty. * */ type CartFreezeCartAction struct { @@ -2733,7 +2753,7 @@ func (obj CartRemoveItemShippingAddressAction) MarshalJSON() ([]byte, error) { } /** -* The [LineItem](ctp:api:type:LineItem) price is updated as described in [LineItem Price selection](ctp:api:type:LineItemPriceSelection). +* The [LineItem](ctp:api:type:LineItem) price is updated as described in [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). * */ type CartRemoveLineItemAction struct { @@ -2796,6 +2816,10 @@ func (obj CartRemoveShippingMethodAction) MarshalJSON() ([]byte, error) { }{Action: "removeShippingMethod", Alias: (*Alias)(&obj)}) } +/** +* If the Cart is already associated with a Customer, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned. +* + */ type CartSetAnonymousIdAction struct { // Value to set. // If empty, any existing value is removed. @@ -2885,7 +2909,7 @@ func (obj CartSetBusinessUnitAction) MarshalJSON() ([]byte, error) { } /** -* This update action results in the `taxedPrice` field being added to the Cart when the `ExternalAmount` [TaxMode](ctp:api:type:TaxMode) is used. +* Can be used if the Cart has the `ExternalAmount` [TaxMode](ctp:api:type:TaxMode). This update action adds the `taxedPrice` field to the Cart and must be used after any price-affecting change occurs within the Cart. * */ type CartSetCartTotalTaxAction struct { @@ -3146,10 +3170,10 @@ func (obj CartSetCustomerEmailAction) MarshalJSON() ([]byte, error) { } /** -* This update action can only be used if a Customer is not assigned to a Cart. -* If a Customer is already assigned, the Cart has the same Customer Group as the assigned Customer. +* This update action can only be used if a Customer is not assigned to the Cart. +* If a Customer is already assigned, the Cart uses the Customer Group of the assigned Customer. * -* Setting the Customer Group also updates the [LineItem](ctp:api:type:LineItem) `prices` according to the Customer Group. +* To reflect the new Customer Group, this update action can result in [updates to the Cart](/api/carts-orders-overview#cart-updates). When this occurs, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError). * */ type CartSetCustomerGroupAction struct { @@ -3176,7 +3200,9 @@ func (obj CartSetCustomerGroupAction) MarshalJSON() ([]byte, error) { * */ type CartSetCustomerIdAction struct { - // `id` of an existing [Customer](ctp:api:type:Customer). If empty, any value is removed. + // `id` of an existing [Customer](ctp:api:type:Customer). + // If the Customer is assigned to a [CustomerGroup](ctp:api:type:CustomerGroup), this update action also sets the value for the `customerGroup` field. + // If empty, the update action removes the value for both `customerId` and `customerGroup`. CustomerId *string `json:"customerId,omitempty"` } @@ -3337,7 +3363,7 @@ func (obj CartSetLineItemCustomTypeAction) MarshalJSON() ([]byte, error) { } /** -* Setting a distribution channel for a [LineItem](ctp:api:type:LineItem) can lead to an updated `price` as described in [LineItem Price selection](ctp:api:type:LineItemPriceSelection). +* Setting a distribution channel for a [LineItem](ctp:api:type:LineItem) can lead to an updated `price` as described in [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). * */ type CartSetLineItemDistributionChannelAction struct { @@ -3451,7 +3477,7 @@ func (obj CartSetLineItemSupplyChannelAction) MarshalJSON() ([]byte, error) { } /** -* Can be used if the Cart has the `ExternalAmount` [TaxMode](ctp:api:type:TaxMode). +* Can be used if the Cart has the `ExternalAmount` [TaxMode](ctp:api:type:TaxMode). This update action sets the `taxedPrice` and `taxRate` on a Line Item and must be used after any price-affecting change occurs. * */ type CartSetLineItemTaxAmountAction struct { @@ -3548,7 +3574,7 @@ func (obj CartSetLocaleAction) MarshalJSON() ([]byte, error) { /** * Setting the shipping address also sets the [TaxRate](ctp:api:type:TaxRate) of Line Items and calculates the [TaxedPrice](ctp:api:type:TaxedPrice). * -* If a matching price cannot be found for the given shipping address during [Line Item Price selection](ctp:api:type:LineItemPriceSelection), +* If a matching price cannot be found for the given shipping address during [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection), * a [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) error is returned. * * If you want to allow shipping to states inside a country that are not explicitly covered by a TaxRate, diff --git a/platform/types_cart_discount.go b/platform/types_cart_discount.go index a7d7079d..5ebfed7f 100644 --- a/platform/types_cart_discount.go +++ b/platform/types_cart_discount.go @@ -13,13 +13,13 @@ type CartDiscount struct { ID string `json:"id"` // Current version of the CartDiscount. Version int `json:"version"` - // Date and time (UTC) for the CartDiscount was initially created. + // Date and time (UTC) the CartDiscount was initially created. CreatedAt time.Time `json:"createdAt"` - // Date and time (UTC) for the CartDiscount was last updated. + // Date and time (UTC) the CartDiscount was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources updated after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the CartDiscount. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the CartDiscount. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Name of the CartDiscount. Name LocalizedString `json:"name"` @@ -1213,25 +1213,10 @@ type CartDiscountSetStoresAction struct { // optional nil slices func (obj CartDiscountSetStoresAction) MarshalJSON() ([]byte, error) { type Alias CartDiscountSetStoresAction - data, err := json.Marshal(struct { + return json.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setStores", Alias: (*Alias)(&obj)}) - if err != nil { - return nil, err - } - - raw := make(map[string]interface{}) - if err := json.Unmarshal(data, &raw); err != nil { - return nil, err - } - - if raw["stores"] == nil { - delete(raw, "stores") - } - - return json.Marshal(raw) - } type CartDiscountSetValidFromAction struct { diff --git a/platform/types_category.go b/platform/types_category.go index 2c1cdcd6..da82f534 100644 --- a/platform/types_category.go +++ b/platform/types_category.go @@ -17,9 +17,9 @@ type Category struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the Category was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources updated after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the Category. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Category. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Name of the Category. Name LocalizedString `json:"name"` diff --git a/platform/types_channel.go b/platform/types_channel.go index 8f0043e9..249a55e3 100644 --- a/platform/types_channel.go +++ b/platform/types_channel.go @@ -17,9 +17,9 @@ type Channel struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the Channel was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources updated after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the Channel. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Channel. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // User-defined unique identifier of the Channel. Key string `json:"key"` diff --git a/platform/types_common.go b/platform/types_common.go index c4687641..11d86902 100644 --- a/platform/types_common.go +++ b/platform/types_common.go @@ -138,6 +138,23 @@ type AssetSource struct { ContentType *string `json:"contentType,omitempty"` } +/** +* Indicates the source and method that indirectly created or modified the resource. This is present on resources created or updated after 1 April 2024. + */ +type Attribution struct { + // `id` of the [API Client](ctp:api:type:ApiClient) that created or modified the resource. + ClientId *string `json:"clientId,omitempty"` + // Method used to initiate the creation or modification of the resource. + Source AttributionSource `json:"source"` +} + +type AttributionSource string + +const ( + AttributionSourceImport AttributionSource = "Import" + AttributionSourceExport AttributionSource = "Export" +) + /** * Polymorphic base type that represents a postal address and contact details. * Depending on the read or write action, it can be either [Address](ctp:api:type:Address) or [AddressDraft](ctp:api:type:AddressDraft) that @@ -351,7 +368,7 @@ type ClientLogging struct { } /** -* Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). +* IDs and references that created the resource. This is present on resources created after 1 February 2019 except for [events not tracked](/general-concepts#events-tracked). */ type CreatedBy struct { // `id` of the [API Client](ctp:api:type:ApiClient) which created the resource. @@ -364,6 +381,8 @@ type CreatedBy struct { AnonymousId *string `json:"anonymousId,omitempty"` // Indicates the [Customer](ctp:api:type:Customer) who created the resource in the context of a [Business Unit](ctp:api:type:BusinessUnit). Only present when an Associate acts on behalf of a company using the [associate endpoints](/associates-overview#on-the-associate-endpoints). Associate *CustomerReference `json:"associate,omitempty"` + // Indicates if the resource was created indirectly. + AttributedTo *Attribution `json:"attributedTo,omitempty"` } type DiscountedPrice struct { @@ -498,7 +517,7 @@ func mapDiscriminatorKeyReference(input interface{}) (KeyReference, error) { } /** -* Present on resources modified after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). +* IDs and references that last modified the resource. This is present on resources created or updated after 1 February 2019 except for [events not tracked](/general-concepts#events-tracked). */ type LastModifiedBy struct { // `id` of the [API Client](ctp:api:type:ApiClient) which modified the resource. @@ -511,6 +530,8 @@ type LastModifiedBy struct { AnonymousId *string `json:"anonymousId,omitempty"` // Indicates the [Customer](ctp:api:type:Customer) who modified the resource in the context of a [Business Unit](ctp:api:type:BusinessUnit). Only present when an Associate acts on behalf of a company using the [associate endpoints](/associates-overview#on-the-associate-endpoints). Associate *CustomerReference `json:"associate,omitempty"` + // Indicates if the resource was modified indirectly. + AttributedTo *Attribution `json:"attributedTo,omitempty"` } /** @@ -520,8 +541,7 @@ type LastModifiedBy struct { type LocalizedString map[string]string /** -* Draft type that stores amounts only in cent precision for the specified currency. -* +* Draft object to store money in cent amounts for a specific currency. */ type Money struct { // Amount in the smallest indivisible unit of a currency, such as: @@ -565,7 +585,7 @@ type Price struct { // Date and time until this Price is valid. Prices that are no longer valid are not automatically removed, but they can be [removed](ctp:api:type:ProductRemovePriceAction) if necessary. ValidUntil *time.Time `json:"validUntil,omitempty"` // Is set if a [ProductDiscount](ctp:api:type:ProductDiscount) has been applied. - // If set, the API uses the DiscountedPrice value for the [Line Item Price selection](ctp:api:type:LineItemPriceSelection). + // If set, the API uses the DiscountedPrice value for the [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). // When a [relative discount](ctp:api:type:ProductDiscountValueRelative) has been applied and the fraction part of the DiscountedPrice `value` is 0.5, the `value` is rounded in favor of the customer with [half-down rounding](https://en.wikipedia.org/wiki/Rounding#Round_half_down). Discounted *DiscountedPrice `json:"discounted,omitempty"` // Present if different Prices for certain [LineItem](ctp:api:type:LineItem) quantities have been specified. @@ -1275,7 +1295,7 @@ func mapDiscriminatorResourceIdentifier(input interface{}) (ResourceIdentifier, /** * Scoped Price is contained in a [ProductVariant](ctp:api:type:ProductVariant) which is returned in response to a -* [Product Projection Search](ctp:api:type:ProductProjectionSearchFilterScopedPrice) request when [Scoped Price Search](ctp:api:type:ScopedPriceSearch) is used. +* [Product Projection Search](ctp:api:type:ProductProjectionSearchFilterScopedPrice) request when [Scoped Price Search](/../api/pricing-and-discounts-overview#scoped-price-search) is used. * */ type ScopedPrice struct { @@ -1363,8 +1383,7 @@ func mapDiscriminatorTypedMoney(input interface{}) (TypedMoney, error) { } /** -* Object that stores cent amounts in a specific currency. -* +* Object that stores money in cent amounts of a specific currency. */ type CentPrecisionMoney struct { // Amount in the smallest indivisible unit of a currency, such as: @@ -1389,7 +1408,7 @@ func (obj CentPrecisionMoney) MarshalJSON() ([]byte, error) { } /** -* Money object that stores an amount of a fraction of the smallest indivisible unit of the specified currency. +* Object that stores money as a fraction of the smallest indivisible unit of a specific currency. */ type HighPrecisionMoney struct { // Amount in the smallest indivisible unit of a currency, such as: @@ -1476,7 +1495,7 @@ func (obj CentPrecisionMoneyDraft) MarshalJSON() ([]byte, error) { } /** -* Money draft object to store an amount of a fraction of the smallest indivisible unit of the specified currency. +* Draft object to store money as a fraction of the smallest indivisible unit for a specific currency. */ type HighPrecisionMoneyDraft struct { // Amount in the smallest indivisible unit of a currency. This field is optional for high precision. If provided, it is checked for validity. Example: diff --git a/platform/types_custom_object.go b/platform/types_custom_object.go index 51bebbbc..9c9673f0 100644 --- a/platform/types_custom_object.go +++ b/platform/types_custom_object.go @@ -16,9 +16,9 @@ type CustomObject struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the CustomObject was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the CustomObject. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the CustomObject. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Namespace to group CustomObjects. Container string `json:"container"` diff --git a/platform/types_customer.go b/platform/types_customer.go index 5324469c..84f7c27a 100644 --- a/platform/types_customer.go +++ b/platform/types_customer.go @@ -43,9 +43,9 @@ type Customer struct { CustomerNumber *string `json:"customerNumber,omitempty"` // Optional identifier for use in external systems like customer relationship management (CRM) or enterprise resource planning (ERP). ExternalId *string `json:"externalId,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the Customer. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Customer. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Email address of the Customer that is [unique](/../api/customers-overview#customer-uniqueness) for an entire Project or to a Store the Customer is assigned to. // It is the mandatory unique identifier of a Customer. @@ -88,7 +88,7 @@ type Customer struct { Salutation *string `json:"salutation,omitempty"` // [Stores](ctp:api:type:Store) to which the Customer is assigned to. // - // - If no Stores are specified, the Customer is a global customer, and can log in using the [Password Flow for global Customers](/../api/authorization#password-flow-for-global-customers). + // - If `stores` is empty, the Customer is a global customer, and can log in using the [Password Flow for global Customers](/../api/authorization#password-flow-for-global-customers). // - If any Stores are specified, the Customer can only log in using the [Password Flow for Customers in a Store](/../api/authorization#password-flow-for-customers-in-a-store) for those specific Stores. Stores []StoreKeyReference `json:"stores"` // Indicates whether the `password` is required for the Customer. @@ -119,10 +119,6 @@ func (obj Customer) MarshalJSON() ([]byte, error) { delete(raw, "billingAddressIds") } - if raw["stores"] == nil { - delete(raw, "stores") - } - return json.Marshal(raw) } @@ -1037,6 +1033,8 @@ func (obj CustomerSetCustomTypeAction) MarshalJSON() ([]byte, error) { /** * Setting the Customer Group of the Customer produces the [CustomerGroupSet](ctp:api:type:CustomerGroupSetMessage) Message. +* +* To reflect the new Customer Group, this update action can result in [updates](/api/carts-orders-overview#cart-updates) to the most recently modified active Cart. When this occurs, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError). * */ type CustomerSetCustomerGroupAction struct { @@ -1120,8 +1118,6 @@ func (obj CustomerSetDefaultBillingAddressAction) MarshalJSON() ([]byte, error) /** * Sets the default shipping address from `addresses`. * The action adds the `id` of the specified address to the `shippingAddressIds` if not contained already. Either `addressId` or `addressKey` is required. -* -* If the Tax Category of the Cart [ShippingInfo](ctp:api:type:ShippingInfo) is missing the TaxRate matching country and state given in the `shippingAddress` of that Cart, a [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) error is returned. * */ type CustomerSetDefaultShippingAddressAction struct { @@ -1270,25 +1266,10 @@ type CustomerSetStoresAction struct { // optional nil slices func (obj CustomerSetStoresAction) MarshalJSON() ([]byte, error) { type Alias CustomerSetStoresAction - data, err := json.Marshal(struct { + return json.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setStores", Alias: (*Alias)(&obj)}) - if err != nil { - return nil, err - } - - raw := make(map[string]interface{}) - if err := json.Unmarshal(data, &raw); err != nil { - return nil, err - } - - if raw["stores"] == nil { - delete(raw, "stores") - } - - return json.Marshal(raw) - } /** diff --git a/platform/types_customer_group.go b/platform/types_customer_group.go index 4d6ef8b4..d00320da 100644 --- a/platform/types_customer_group.go +++ b/platform/types_customer_group.go @@ -17,9 +17,9 @@ type CustomerGroup struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the CustomerGroup was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources updated after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the CustomerGroup. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the CustomerGroup. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // User-defined unique identifier for the CustomerGroup. Key *string `json:"key,omitempty"` diff --git a/platform/types_customer_search.go b/platform/types_customer_search.go new file mode 100644 index 00000000..90bf26b5 --- /dev/null +++ b/platform/types_customer_search.go @@ -0,0 +1,83 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "encoding/json" + "time" +) + +type CustomerIndexingProgress struct { + // The number of Customers successfully indexed. + Indexed int `json:"indexed"` + // The number of Customers that failed to be indexed. + Failed int `json:"failed"` + // The estimated total number of Customers to be indexed. + EstimatedTotal int `json:"estimatedTotal"` +} + +type CustomerPagedSearchResponse struct { + // Total number of results matching the query. + Total int `json:"total"` + // Number of [results requested](/../api/general-concepts#limit). + Limit int `json:"limit"` + // Number of [elements skipped](/../api/general-concepts#offset). + Offset int `json:"offset"` + // Search result containing the Customers matching the search query. + Results []CustomerSearchResult `json:"results"` +} + +type CustomerSearchIndexingStatusResponse struct { + // Current status of indexing the Customer Search. + Status CustomerIndexingStatus `json:"status"` + // Progress of indexing. Only available when indexing is in progress. + States *CustomerIndexingProgress `json:"states,omitempty"` + // Date and time (UTC) when the last indexing started. + StartedAt *time.Time `json:"startedAt,omitempty"` + // Time when the status was last modified. + LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + // Indicates how many times the system tried to start indexing after failed attempts. The counter is set to null after an indexing finished successfully. + RetryCount *int `json:"retryCount,omitempty"` +} + +type CustomerSearchRequest struct { + // The Customer search query. + Query *SearchQuery `json:"query,omitempty"` + // Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order. + Sort []SearchSorting `json:"sort"` + // The maximum number of search results to be returned. + Limit *int `json:"limit,omitempty"` + // The number of search results to be skipped in the response for pagination. + Offset *int `json:"offset,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj CustomerSearchRequest) MarshalJSON() ([]byte, error) { + type Alias CustomerSearchRequest + data, err := json.Marshal(struct { + *Alias + }{Alias: (*Alias)(&obj)}) + if err != nil { + return nil, err + } + + raw := make(map[string]interface{}) + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + if raw["sort"] == nil { + delete(raw, "sort") + } + + return json.Marshal(raw) + +} + +type CustomerSearchResult struct { + // `id` of the [Customer](ctp:api:type:Customer) matching the search query. + ID string `json:"id"` + // How closely this customer matches the search query. + Relevance float64 `json:"relevance"` +} diff --git a/platform/types_discount_code.go b/platform/types_discount_code.go index 4d419000..f17914fa 100644 --- a/platform/types_discount_code.go +++ b/platform/types_discount_code.go @@ -19,9 +19,9 @@ type DiscountCode struct { LastModifiedAt time.Time `json:"lastModifiedAt"` // User-defined unique identifier of the DiscountCode. Key *string `json:"key,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the DiscountCode. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the DiscountCode. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Name of the DiscountCode. Name *LocalizedString `json:"name,omitempty"` @@ -92,8 +92,12 @@ type DiscountCodeDraft struct { // Only active DiscountCodes can be applied to the Cart. IsActive *bool `json:"isActive,omitempty"` // Number of times the DiscountCode can be applied. + // + // If not set, the DiscountCode can be applied any number of times. MaxApplications *int `json:"maxApplications,omitempty"` // Number of times the DiscountCode can be applied per Customer. + // + // If not set, the DiscountCode can be applied any number of times. MaxApplicationsPerCustomer *int `json:"maxApplicationsPerCustomer,omitempty"` // Custom Fields for the DiscountCode. Custom *CustomFieldsDraft `json:"custom,omitempty"` @@ -453,7 +457,9 @@ func (obj DiscountCodeSetKeyAction) MarshalJSON() ([]byte, error) { } type DiscountCodeSetMaxApplicationsAction struct { - // Value to set. If empty, any existing value will be removed. + // Value to set. + // + // If empty, any existing value will be removed and the DiscountCode can be applied any number of times. MaxApplications *int `json:"maxApplications,omitempty"` } @@ -468,7 +474,9 @@ func (obj DiscountCodeSetMaxApplicationsAction) MarshalJSON() ([]byte, error) { } type DiscountCodeSetMaxApplicationsPerCustomerAction struct { - // Value to set. If empty, any existing value will be removed. + // Value to set. + // + // If empty, any existing value will be removed and the DiscountCode can be applied any number of times. MaxApplicationsPerCustomer *int `json:"maxApplicationsPerCustomer,omitempty"` } diff --git a/platform/types_error.go b/platform/types_error.go index 60eeb060..05e350d7 100644 --- a/platform/types_error.go +++ b/platform/types_error.go @@ -297,6 +297,12 @@ func mapDiscriminatorErrorObject(input interface{}) (ErrorObject, error) { return nil, err } return obj, nil + case "LockedField": + obj := LockedFieldError{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil case "MatchingPriceNotFound": obj := MatchingPriceNotFoundError{} if err := decodeStruct(input, &obj); err != nil { @@ -1140,12 +1146,10 @@ func (obj ContentTooLargeError) Error() string { * * - [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/carts:POST) request and [Set Country](ctp:api:type:CartSetCountryAction) update action on Carts. * - [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/me/carts:POST) request and [Set Country](ctp:api:type:MyCartSetCountryAction) update action on My Carts. -* - [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) requests on Orders. -* - [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST) requests on My Orders. -* - [Create Order from Quote](ctp:api:endpoint:/{projectKey}/orders/quotes:POST) requests on Orders. -* - [Create Order from Quote](ctp:api:endpoint:/{projectKey}/me/orders/quotes:POST) requests on My Orders. +* - [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) and [Create Order from Quote](ctp:api:endpoint:/{projectKey}/orders/quotes:POST) requests on Orders. +* - [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST) and [Create Order from Quote](ctp:api:endpoint:/{projectKey}/me/orders/quotes:POST) requests on My Orders. * - [Create Order by Import](ctp:api:endpoint:/{projectKey}/orders/import:POST) request on Order Import. -* - [Set Country](ctp:api:type:StagedOrderSetCountryAction) on Order Edits. +* - [Set Country](ctp:api:type:StagedOrderSetCountryAction) update action on Order Edits. * */ type CountryNotConfiguredInStoreError struct { @@ -1228,8 +1232,13 @@ func (obj CountryNotConfiguredInStoreError) Error() string { * * The error is returned as a failed response to: * +* - [Create Cart](ctp:api:endpoint:/{projectKey}/carts:POST) and [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/carts:POST) requests and [Add DiscountCode](ctp:api:type:CartAddDiscountCodeAction) update action on Carts. +* - [Create Cart](ctp:api:endpoint:/{projectKey}/me/carts:POST) and [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/me/carts:POST) requests and [Add DiscountCode](ctp:api:type:MyCartAddDiscountCodeAction) update action on My Carts. +* - [Create Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts:POST) request on Associate Carts. * - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) requests on Orders. * - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/me/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST) requests on My Orders. +* - [Add DiscountCode](ctp:api:type:StagedOrderAddDiscountCodeAction) update action on Order Edits. +* - [Create Order from Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders:POST) request on Associate Orders. * */ type DiscountCodeNonApplicableError struct { @@ -3085,7 +3094,7 @@ func (obj FeatureRemovedError) Error() string { /** * Returned when a server-side problem occurs before or after data persistence. In some cases, the requested action may successfully complete after the error is returned. Therefore, it is recommended to verify the status of the requested resource after receiving a 500 error. * -* If you encounter this error, report it using the [Support Portal](https://support.commercetools.com). +* If you encounter this error, report it to the [Composable Commerce support team](https://support.commercetools.com). * */ type GeneralError struct { @@ -3304,8 +3313,8 @@ func (obj InternalConstraintViolatedError) Error() string { * * The error is returned as a failed response to: * -* - [Authenticate a global Customer (Sign-in)](ctp:api:endpoint:/{projectKey}/login:POST) and [Authenticate Customer (Sign-in) in a Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/login:POST) requests on Customers. -* - [Authenticating Customer (Sign-in)](ctp:api:endpoint:/{projectKey}/me/login:POST) and [Authenticate Customer (Sign-in) in a Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/me/login:POST) requests on My Customer Profile. +* - [Authenticate (sign in) Customer](ctp:api:endpoint:/{projectKey}/login:POST) and [Authenticate (sign in) Customer in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/login:POST) requests on Customers. +* - [Authenticate (sign in) Customer](ctp:api:endpoint:/{projectKey}/me/login:POST) and [Authenticate (sign in) Customer in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/me/login:POST) requests on My Customer Profile. * */ type InvalidCredentialsError struct { @@ -3617,7 +3626,17 @@ func (obj InvalidInputError) Error() string { /** * Returned when Line Item or Custom Line Item quantities set under [ItemShippingDetails](ctp:api:type:ItemShippingDetails) do not match the sum of the quantities in their respective shipping details. * -* The error is returned as a failed response to the [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) requests. +* When a Cart is frozen, the error can be returned as a failed response to all update actions on [Carts](ctp:api:type:CartUpdateAction) and [My Carts](ctp:api:type:MyCartUpdateAction). +* +* The error is also returned as a failed response to: +* +* - [Create Cart](ctp:api:endpoint:/{projectKey}/carts:POST) and [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/carts:POST) requests and [Add LineItem](ctp:api:type:CartAddLineItemAction), [Add CustomLineItem](ctp:api:type:CartAddCustomLineItemAction), [Set LineItem ShippingDetails](ctp:api:type:CartSetLineItemShippingDetailsAction), [Set CustomLineItem ShippingDetails](ctp:api:type:CartSetCustomLineItemShippingDetailsAction), [Add Shopping List](ctp:api:type:CartAddShoppingListAction), and [Remove LineItem](ctp:api:type:CartRemoveLineItemAction) update actions on Carts. +* - [Create Cart](ctp:api:endpoint:/{projectKey}/me/carts:POST) and [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/me/carts:POST) requests, and [Add LineItem](ctp:api:type:MyCartAddLineItemAction), [Set LineItem ShippingDetails](ctp:api:type:MyCartSetLineItemShippingDetailsAction), and [Remove LineItem](ctp:api:type:MyCartRemoveLineItemAction) update actions on My Carts. +* - [Create Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts:POST) request on Associate Carts. +* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST), [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST), [Create Order from Quote](ctp:api:endpoint:/{projectKey}/orders/quotes:POST), and [Create Order by Import](ctp:api:endpoint:/{projectKey}/orders/import:POST) requests on Orders. +* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/me/orders:POST), [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST), and [Create Order from Quote](ctp:api:endpoint:/{projectKey}/me/orders/quotes:POST) requests on My Orders. +* - [Add LineItem](ctp:api:type:StagedOrderAddLineItemAction), [Add CustomLineItem](ctp:api:type:StagedOrderAddCustomLineItemAction), [Set LineItem ShippingDetails](ctp:api:type:StagedOrderSetLineItemShippingDetailsAction), [Set CustomLineItem ShippingDetails](ctp:api:type:StagedOrderSetCustomLineItemShippingDetailsAction), [Add Shopping List](ctp:api:type:StagedOrderAddShoppingListAction), and [Remove LineItem](ctp:api:type:StagedOrderRemoveLineItemAction) update actions on Order Edits. +* - [Create Order from Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders:POST) and [Create Order from Quote in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders/quotes:POST) requests on Associate Orders. * */ type InvalidItemShippingDetailsError struct { @@ -4062,15 +4081,99 @@ func (obj LanguageUsedInStoresError) Error() string { return "unknown LanguageUsedInStoresError: failed to parse error response" } +/** +* Returned when two [Customers](ctp:api:type:Customer) are simultaneously created or updated with the same email address. +* +* To confirm if the operation was successful, repeat the request. +* + */ +type LockedFieldError struct { + // `"'$field' is locked by another request. Please try again later."` + Message string `json:"message"` + // Error-specific additional fields. + ExtraValues map[string]interface{} `json:"-"` + // Field that is currently locked. + Field string `json:"field"` +} + +// UnmarshalJSON override to deserialize correct attribute types based +// on the discriminator value +func (obj *LockedFieldError) UnmarshalJSON(data []byte) error { + type Alias LockedFieldError + if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + return err + } + + if err := json.Unmarshal(data, &obj.ExtraValues); err != nil { + return err + } + delete(obj.ExtraValues, "code") + delete(obj.ExtraValues, "message") + delete(obj.ExtraValues, "field") + + return nil +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj LockedFieldError) MarshalJSON() ([]byte, error) { + type Alias LockedFieldError + data, err := json.Marshal(struct { + Action string `json:"code"` + *Alias + }{Action: "LockedField", Alias: (*Alias)(&obj)}) + if err != nil { + return nil, err + } + + raw := make(map[string]interface{}) + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + for key, value := range obj.ExtraValues { + raw[key] = value + } + + return json.Marshal(raw) + +} + +func (obj *LockedFieldError) DecodeStruct(src map[string]interface{}) error { + { + obj.ExtraValues = make(map[string]interface{}) + for key, value := range src { + // + if key != "code" { + obj.ExtraValues[key] = value + } + } + } + return nil +} + +func (obj LockedFieldError) Error() string { + if obj.Message != "" { + return obj.Message + } + return "unknown LockedFieldError: failed to parse error response" +} + /** * Returned when the Product Variant does not have a Price according to the [Product](ctp:api:type:Product) `priceMode` value for a selected currency, country, Customer Group, or Channel. * -* The error is returned as a failed response to: +* The error can be returned as a failed response to all update actions on [Carts](ctp:api:type:CartUpdateAction) and [Staged Orders](ctp:api:type:StagedOrderUpdateAction). +* +* The error is also returned as a failed response to: * -* - [Add LineItem](ctp:api:type:CartAddLineItemAction), [Add CustomLineItem](ctp:api:type:CartAddCustomLineItemAction), and [Add DiscountCode](ctp:api:type:CartAddDiscountCodeAction) update actions on Carts. -* - [Add LineItem](ctp:api:type:StagedOrderAddLineItemAction), [Add CustomLineItem](ctp:api:type:StagedOrderAddCustomLineItemAction), and [Add DiscountCode](ctp:api:type:StagedOrderAddDiscountCodeAction) update actions on Order Edits. +* - [Authenticate (sign in) Customer](ctp:api:endpoint:/{projectKey}/login:POST) and [Authenticate (sign in) Customer in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/login:POST) requests and [Set CustomerGroup](ctp:api:type:CustomerSetCustomerGroupAction) update action on Customers. +* - [Authenticate (sign in) Customer](ctp:api:endpoint:/{projectKey}/me/login:POST) and [Authenticate (sign in) Customer in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/me/login:POST) requests on My Customer Profile. +* - [Create Cart](ctp:api:endpoint:/{projectKey}/carts:POST), [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/carts:POST), [Replicate Cart](ctp:api:endpoint:/{projectKey}/carts/replicate:POST), and [Replicate Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/carts/replicate:POST) requests on Carts. +* - [Create Cart](ctp:api:endpoint:/{projectKey}/me/carts:POST) and [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/me/carts:POST) and [Replicate My Cart](ctp:api:endpoint:/{projectKey}/me/carts/replicate:POST) requests on My Carts. +* - [Create Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts:POST) and [Replicate Cart in Business Unit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts/replicate:POST) requests on Associate Carts. * - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) requests on Orders. * - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/me/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST) requests on My Orders. +* - [Create Order from Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders:POST) request on Associate Orders. * */ type MatchingPriceNotFoundError struct { @@ -4485,10 +4588,18 @@ func (obj MissingRoleOnChannelError) Error() string { /** * Returned when the Tax Category of at least one of the `lineItems`, `customLineItems`, or `shippingInfo` in the [Cart](ctp:api:type:Cart) is missing the [TaxRate](ctp:api:type:TaxRate) matching `country` and `state` given in the `shippingAddress` of that Cart. * -* The error is returned as a failed response to: +* The error can be returned as a failed response to all update actions on [Carts](ctp:api:type:CartUpdateAction) and [Staged Orders](ctp:api:type:StagedOrderUpdateAction). * -* - [Set Default Shipping Address](ctp:api:type:CustomerSetDefaultShippingAddressAction), [Add LineItem](ctp:api:type:CartAddLineItemAction), [Add CustomLineItem](ctp:api:type:CartAddCustomLineItemAction), [Set Shipping Address](ctp:api:type:CartSetShippingAddressAction), [Add LineItem](ctp:api:type:MyCartAddLineItemAction), [Add LineItem](ctp:api:type:StagedOrderAddLineItemAction), and [Add CustomLineItem](ctp:api:type:StagedOrderAddCustomLineItemAction) update actions -* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) requests. +* The error is also returned as a failed response to: +* +* - [Authenticate (sign in) Customer](ctp:api:endpoint:/{projectKey}/login:POST) and [Authenticate (sign in) Customer in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/login:POST) requests and [Set CustomerGroup](ctp:api:type:CustomerSetCustomerGroupAction) update action on Customers. +* - [Authenticate (sign in) Customer](ctp:api:endpoint:/{projectKey}/me/login:POST) and [Authenticate (sign in) Customer in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/me/login:POST) on My Customer Profile. +* - [Create Cart](ctp:api:endpoint:/{projectKey}/carts:POST), [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/carts:POST), [Replicate Cart](ctp:api:endpoint:/{projectKey}/carts/replicate:POST), and [Replicate Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/carts/replicate:POST) requests on Carts. +* - [Create Cart](ctp:api:endpoint:/{projectKey}/me/carts:POST) and [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/me/carts:POST) and [Replicate My Cart](ctp:api:endpoint:/{projectKey}/me/carts/replicate:POST) requests on My Carts. +* - [Create Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts:POST) and [Replicate Cart in Business Unit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts/replicate:POST) requests on Associate Carts. +* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) requests on Orders. +* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/me/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST) requests on My Orders. +* - [Create Order from Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders:POST) requests on Associate Orders. * */ type MissingTaxRateForCountryError struct { @@ -4796,8 +4907,9 @@ func (obj ObjectNotFoundError) Error() string { * * The error is returned as a failed response to: * -* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST), [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST), and [Create Order by Import](ctp:api:endpoint:/{projectKey}/orders/import:POST) requests on Orders. -* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/me/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST) requests on My Orders. +* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST), [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST), [Create Order from Quote](ctp:api:endpoint:/{projectKey}/orders/quotes:POST), and [Create Order by Import](ctp:api:endpoint:/{projectKey}/orders/import:POST) requests on Orders. +* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/me/orders:POST), [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST), and [Create Order from Quote](ctp:api:endpoint:/{projectKey}/me/orders/quotes:POST) requests on My Orders. +* - [Create Order from Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders:POST) and [Create Order from Quote in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders/quotes:POST) requests on Associate Orders. * */ type OutOfStockError struct { @@ -5060,7 +5172,7 @@ func (obj OverlappingStandalonePriceValidityError) Error() string { * Returned when a previous conflicting operation is still pending and needs to finish before the request can succeed. * * The client application should retry the request with exponential backoff up to a point where further delay is unacceptable. -* If the error persists, report it using the [Support Portal](https://support.commercetools.com). +* If the error persists, report it to the [Composable Commerce support team](https://support.commercetools.com). * */ type PendingOperationError struct { @@ -5133,12 +5245,15 @@ func (obj PendingOperationError) Error() string { } /** -* Returned when the Price, Tax Rate, or Shipping Rate of some Line Items changed since they were last added to the Cart. +* Returned when the Price or Tax Rate of some Line Items or Shipping Rate of some Shipping Methods changed since they were last added to the Cart. * -* The error is returned as a failed response to: +* When a Cart is frozen, the error can be returned as a failed response to all update actions on [Carts](ctp:api:type:CartUpdateAction) and [My Carts](ctp:api:type:MyCartUpdateAction). * -* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) requests on Orders. -* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/me/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST) requests on My Orders. +* The error is also returned as a failed response to: +* +* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST), [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST), and [Create Order from Quote](ctp:api:endpoint:/{projectKey}/orders/quotes:POST) requests on Orders. +* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/me/orders:POST), [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST), and [Create Order from Quote](ctp:api:endpoint:/{projectKey}/me/orders/quotes:POST) requests on My Orders. +* - [Create Order from Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders:POST) request on Associate Orders. * */ type PriceChangedError struct { @@ -6359,7 +6474,13 @@ func (obj SemanticErrorError) Error() string { /** * Returned when the Cart contains a [ShippingMethod](ctp:api:type:ShippingMethod) that is not allowed for the [Cart](ctp:api:type:Cart). In this case, the [ShippingMethodState](ctp:api:type:ShippingMethodState) value is `DoesNotMatchCart`. * -* The error is returned as a failed response to the [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST) or [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) requests. +* When a Cart is frozen, the error can be returned as a failed response to all update actions on [Carts](ctp:api:type:CartUpdateAction) and [My Carts](ctp:api:type:MyCartUpdateAction). +* +* The error is also returned as a failed response to: +* +* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) requests on Orders. +* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/me/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST) requests on My Orders. +* - [Create Order from Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders:POST) request on Associate Orders. * */ type ShippingMethodDoesNotMatchCartError struct { @@ -6876,6 +6997,12 @@ func mapDiscriminatorGraphQLErrorObject(input interface{}) (GraphQLErrorObject, return nil, err } return obj, nil + case "LockedField": + obj := GraphQLLockedFieldError{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil case "MatchingPriceNotFound": obj := GraphQLMatchingPriceNotFoundError{} if err := decodeStruct(input, &obj); err != nil { @@ -7637,12 +7764,10 @@ func (obj *GraphQLContentTooLargeError) DecodeStruct(src map[string]interface{}) * * - [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/carts:POST) request and [Set Country](ctp:api:type:CartSetCountryAction) update action on Carts. * - [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/me/carts:POST) request and [Set Country](ctp:api:type:MyCartSetCountryAction) update action on My Carts. -* - [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) requests on Orders. -* - [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST) requests on My Orders. -* - [Create Order from Quote](ctp:api:endpoint:/{projectKey}/orders/quotes:POST) requests on Orders. -* - [Create Order from Quote](ctp:api:endpoint:/{projectKey}/me/orders/quotes:POST) requests on My Orders. +* - [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) and [Create Order from Quote](ctp:api:endpoint:/{projectKey}/orders/quotes:POST) requests on Orders. +* - [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST) and [Create Order from Quote](ctp:api:endpoint:/{projectKey}/me/orders/quotes:POST) requests on My Orders. * - [Create Order by Import](ctp:api:endpoint:/{projectKey}/orders/import:POST) request on Order Import. -* - [Set Country](ctp:api:type:StagedOrderSetCountryAction) on Order Edits. +* - [Set Country](ctp:api:type:StagedOrderSetCountryAction) update action on Order Edits. * */ type GraphQLCountryNotConfiguredInStoreError struct { @@ -7715,8 +7840,13 @@ func (obj *GraphQLCountryNotConfiguredInStoreError) DecodeStruct(src map[string] * * The error is returned as a failed response to: * +* - [Create Cart](ctp:api:endpoint:/{projectKey}/carts:POST) and [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/carts:POST) requests and [Add DiscountCode](ctp:api:type:CartAddDiscountCodeAction) update action on Carts. +* - [Create Cart](ctp:api:endpoint:/{projectKey}/me/carts:POST) and [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/me/carts:POST) requests and [Add DiscountCode](ctp:api:type:MyCartAddDiscountCodeAction) update action on My Carts. +* - [Create Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts:POST) request on Associate Carts. * - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) requests on Orders. * - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/me/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST) requests on My Orders. +* - [Add DiscountCode](ctp:api:type:StagedOrderAddDiscountCodeAction) update action on Order Edits. +* - [Create Order from Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders:POST) request on Associate Orders. * */ type GraphQLDiscountCodeNonApplicableError struct { @@ -9193,7 +9323,7 @@ func (obj *GraphQLFeatureRemovedError) DecodeStruct(src map[string]interface{}) /** * Returned when a server-side problem occurs before or after data persistence. In some cases, the requested action may successfully complete after the error is returned. Therefore, it is recommended to verify the status of the requested resource after receiving a 500 error. * -* If you encounter this error, report it using the [Support Portal](https://support.commercetools.com). +* If you encounter this error, report it to the [Composable Commerce support team](https://support.commercetools.com). * */ type GraphQLGeneralError struct { @@ -9382,8 +9512,8 @@ func (obj *GraphQLInternalConstraintViolatedError) DecodeStruct(src map[string]i * * The error is returned as a failed response to: * -* - [Authenticate a global Customer (Sign-in)](ctp:api:endpoint:/{projectKey}/login:POST) and [Authenticate Customer (Sign-in) in a Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/login:POST) requests on Customers. -* - [Authenticating Customer (Sign-in)](ctp:api:endpoint:/{projectKey}/me/login:POST) and [Authenticate Customer (Sign-in) in a Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/me/login:POST) requests on My Customer Profile. +* - [Authenticate (sign in) Customer](ctp:api:endpoint:/{projectKey}/login:POST) and [Authenticate (sign in) Customer in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/login:POST) requests on Customers. +* - [Authenticate (sign in) Customer](ctp:api:endpoint:/{projectKey}/me/login:POST) and [Authenticate (sign in) Customer in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/me/login:POST) requests on My Customer Profile. * */ type GraphQLInvalidCredentialsError struct { @@ -9655,7 +9785,17 @@ func (obj *GraphQLInvalidInputError) DecodeStruct(src map[string]interface{}) er /** * Returned when Line Item or Custom Line Item quantities set under [ItemShippingDetails](ctp:api:type:ItemShippingDetails) do not match the sum of the quantities in their respective shipping details. * -* The error is returned as a failed response to the [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) requests. +* When a Cart is frozen, the error can be returned as a failed response to all update actions on [Carts](ctp:api:type:CartUpdateAction) and [My Carts](ctp:api:type:MyCartUpdateAction). +* +* The error is also returned as a failed response to: +* +* - [Create Cart](ctp:api:endpoint:/{projectKey}/carts:POST) and [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/carts:POST) requests and [Add LineItem](ctp:api:type:CartAddLineItemAction), [Add CustomLineItem](ctp:api:type:CartAddCustomLineItemAction), [Set LineItem ShippingDetails](ctp:api:type:CartSetLineItemShippingDetailsAction), [Set CustomLineItem ShippingDetails](ctp:api:type:CartSetCustomLineItemShippingDetailsAction), [Add Shopping List](ctp:api:type:CartAddShoppingListAction), and [Remove LineItem](ctp:api:type:CartRemoveLineItemAction) update actions on Carts. +* - [Create Cart](ctp:api:endpoint:/{projectKey}/me/carts:POST) and [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/me/carts:POST) requests, and [Add LineItem](ctp:api:type:MyCartAddLineItemAction), [Set LineItem ShippingDetails](ctp:api:type:MyCartSetLineItemShippingDetailsAction), and [Remove LineItem](ctp:api:type:MyCartRemoveLineItemAction) update actions on My Carts. +* - [Create Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts:POST) request on Associate Carts. +* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST), [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST), [Create Order from Quote](ctp:api:endpoint:/{projectKey}/orders/quotes:POST), and [Create Order by Import](ctp:api:endpoint:/{projectKey}/orders/import:POST) requests on Orders. +* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/me/orders:POST), [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST), and [Create Order from Quote](ctp:api:endpoint:/{projectKey}/me/orders/quotes:POST) requests on My Orders. +* - [Add LineItem](ctp:api:type:StagedOrderAddLineItemAction), [Add CustomLineItem](ctp:api:type:StagedOrderAddCustomLineItemAction), [Set LineItem ShippingDetails](ctp:api:type:StagedOrderSetLineItemShippingDetailsAction), [Set CustomLineItem ShippingDetails](ctp:api:type:StagedOrderSetCustomLineItemShippingDetailsAction), [Add Shopping List](ctp:api:type:StagedOrderAddShoppingListAction), and [Remove LineItem](ctp:api:type:StagedOrderRemoveLineItemAction) update actions on Order Edits. +* - [Create Order from Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders:POST) and [Create Order from Quote in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders/quotes:POST) requests on Associate Orders. * */ type GraphQLInvalidItemShippingDetailsError struct { @@ -10040,15 +10180,89 @@ func (obj *GraphQLLanguageUsedInStoresError) DecodeStruct(src map[string]interfa return nil } +/** +* Returned when two [Customers](ctp:api:type:Customer) are simultaneously created or updated with the same email address. +* +* To confirm if the operation was successful, repeat the request. +* + */ +type GraphQLLockedFieldError struct { + // Error-specific additional fields. + ExtraValues map[string]interface{} `json:"-"` + // Field that is currently locked. + Field string `json:"field"` +} + +// UnmarshalJSON override to deserialize correct attribute types based +// on the discriminator value +func (obj *GraphQLLockedFieldError) UnmarshalJSON(data []byte) error { + type Alias GraphQLLockedFieldError + if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + return err + } + + if err := json.Unmarshal(data, &obj.ExtraValues); err != nil { + return err + } + delete(obj.ExtraValues, "code") + delete(obj.ExtraValues, "field") + + return nil +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj GraphQLLockedFieldError) MarshalJSON() ([]byte, error) { + type Alias GraphQLLockedFieldError + data, err := json.Marshal(struct { + Action string `json:"code"` + *Alias + }{Action: "LockedField", Alias: (*Alias)(&obj)}) + if err != nil { + return nil, err + } + + raw := make(map[string]interface{}) + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + for key, value := range obj.ExtraValues { + raw[key] = value + } + + return json.Marshal(raw) + +} + +func (obj *GraphQLLockedFieldError) DecodeStruct(src map[string]interface{}) error { + { + obj.ExtraValues = make(map[string]interface{}) + for key, value := range src { + // + if key != "code" { + obj.ExtraValues[key] = value + } + } + } + return nil +} + /** * Returned when the Product Variant does not have a Price according to the [Product](ctp:api:type:Product) `priceMode` value for a selected currency, country, Customer Group, or Channel. * -* The error is returned as a failed response to: +* The error can be returned as a failed response to all update actions on [Carts](ctp:api:type:CartUpdateAction) and [Staged Orders](ctp:api:type:StagedOrderUpdateAction). +* +* The error is also returned as a failed response to: * -* - [Add LineItem](ctp:api:type:CartAddLineItemAction), [Add CustomLineItem](ctp:api:type:CartAddCustomLineItemAction), and [Add DiscountCode](ctp:api:type:CartAddDiscountCodeAction) update actions on Carts. -* - [Add LineItem](ctp:api:type:StagedOrderAddLineItemAction), [Add CustomLineItem](ctp:api:type:StagedOrderAddCustomLineItemAction), and [Add DiscountCode](ctp:api:type:StagedOrderAddDiscountCodeAction) update actions on Order Edits. +* - [Authenticate (sign in) Customer](ctp:api:endpoint:/{projectKey}/login:POST) and [Authenticate (sign in) Customer in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/login:POST) requests and [Set CustomerGroup](ctp:api:type:CustomerSetCustomerGroupAction) update action on Customers. +* - [Authenticate (sign in) Customer](ctp:api:endpoint:/{projectKey}/me/login:POST) and [Authenticate (sign in) Customer in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/me/login:POST) requests on My Customer Profile. +* - [Create Cart](ctp:api:endpoint:/{projectKey}/carts:POST), [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/carts:POST), [Replicate Cart](ctp:api:endpoint:/{projectKey}/carts/replicate:POST), and [Replicate Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/carts/replicate:POST) requests on Carts. +* - [Create Cart](ctp:api:endpoint:/{projectKey}/me/carts:POST) and [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/me/carts:POST) and [Replicate My Cart](ctp:api:endpoint:/{projectKey}/me/carts/replicate:POST) requests on My Carts. +* - [Create Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts:POST) and [Replicate Cart in Business Unit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts/replicate:POST) requests on Associate Carts. * - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) requests on Orders. * - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/me/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST) requests on My Orders. +* - [Create Order from Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders:POST) request on Associate Orders. * */ type GraphQLMatchingPriceNotFoundError struct { @@ -10413,10 +10627,18 @@ func (obj *GraphQLMissingRoleOnChannelError) DecodeStruct(src map[string]interfa /** * Returned when the Tax Category of at least one of the `lineItems`, `customLineItems`, or `shippingInfo` in the [Cart](ctp:api:type:Cart) is missing the [TaxRate](ctp:api:type:TaxRate) matching `country` and `state` given in the `shippingAddress` of that Cart. * -* The error is returned as a failed response to: +* The error can be returned as a failed response to all update actions on [Carts](ctp:api:type:CartUpdateAction) and [Staged Orders](ctp:api:type:StagedOrderUpdateAction). * -* - [Set Default Shipping Address](ctp:api:type:CustomerSetDefaultShippingAddressAction), [Add LineItem](ctp:api:type:CartAddLineItemAction), [Add CustomLineItem](ctp:api:type:CartAddCustomLineItemAction), [Set Shipping Address](ctp:api:type:CartSetShippingAddressAction), [Add LineItem](ctp:api:type:MyCartAddLineItemAction), [Add LineItem](ctp:api:type:StagedOrderAddLineItemAction), and [Add CustomLineItem](ctp:api:type:StagedOrderAddCustomLineItemAction) update actions -* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) requests. +* The error is also returned as a failed response to: +* +* - [Authenticate (sign in) Customer](ctp:api:endpoint:/{projectKey}/login:POST) and [Authenticate (sign in) Customer in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/login:POST) requests and [Set CustomerGroup](ctp:api:type:CustomerSetCustomerGroupAction) update action on Customers. +* - [Authenticate (sign in) Customer](ctp:api:endpoint:/{projectKey}/me/login:POST) and [Authenticate (sign in) Customer in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/me/login:POST) on My Customer Profile. +* - [Create Cart](ctp:api:endpoint:/{projectKey}/carts:POST), [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/carts:POST), [Replicate Cart](ctp:api:endpoint:/{projectKey}/carts/replicate:POST), and [Replicate Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/carts/replicate:POST) requests on Carts. +* - [Create Cart](ctp:api:endpoint:/{projectKey}/me/carts:POST) and [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/me/carts:POST) and [Replicate My Cart](ctp:api:endpoint:/{projectKey}/me/carts/replicate:POST) requests on My Carts. +* - [Create Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts:POST) and [Replicate Cart in Business Unit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts/replicate:POST) requests on Associate Carts. +* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) requests on Orders. +* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/me/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST) requests on My Orders. +* - [Create Order from Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders:POST) requests on Associate Orders. * */ type GraphQLMissingTaxRateForCountryError struct { @@ -10684,8 +10906,9 @@ func (obj *GraphQLObjectNotFoundError) DecodeStruct(src map[string]interface{}) * * The error is returned as a failed response to: * -* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST), [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST), and [Create Order by Import](ctp:api:endpoint:/{projectKey}/orders/import:POST) requests on Orders. -* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/me/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST) requests on My Orders. +* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST), [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST), [Create Order from Quote](ctp:api:endpoint:/{projectKey}/orders/quotes:POST), and [Create Order by Import](ctp:api:endpoint:/{projectKey}/orders/import:POST) requests on Orders. +* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/me/orders:POST), [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST), and [Create Order from Quote](ctp:api:endpoint:/{projectKey}/me/orders/quotes:POST) requests on My Orders. +* - [Create Order from Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders:POST) and [Create Order from Quote in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders/quotes:POST) requests on Associate Orders. * */ type GraphQLOutOfStockError struct { @@ -10918,7 +11141,7 @@ func (obj *GraphQLOverlappingStandalonePriceValidityError) DecodeStruct(src map[ * Returned when a previous conflicting operation is still pending and needs to finish before the request can succeed. * * The client application should retry the request with exponential backoff up to a point where further delay is unacceptable. -* If the error persists, report it using the [Support Portal](https://support.commercetools.com). +* If the error persists, report it to the [Composable Commerce support team](https://support.commercetools.com). * */ type GraphQLPendingOperationError struct { @@ -10981,12 +11204,15 @@ func (obj *GraphQLPendingOperationError) DecodeStruct(src map[string]interface{} } /** -* Returned when the Price, Tax Rate, or Shipping Rate of some Line Items changed since they were last added to the Cart. +* Returned when the Price or Tax Rate of some Line Items or Shipping Rate of some Shipping Methods changed since they were last added to the Cart. * -* The error is returned as a failed response to: +* When a Cart is frozen, the error can be returned as a failed response to all update actions on [Carts](ctp:api:type:CartUpdateAction) and [My Carts](ctp:api:type:MyCartUpdateAction). * -* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) requests on Orders. -* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/me/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST) requests on My Orders. +* The error is also returned as a failed response to: +* +* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST), [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST), and [Create Order from Quote](ctp:api:endpoint:/{projectKey}/orders/quotes:POST) requests on Orders. +* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/me/orders:POST), [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST), and [Create Order from Quote](ctp:api:endpoint:/{projectKey}/me/orders/quotes:POST) requests on My Orders. +* - [Create Order from Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders:POST) request on Associate Orders. * */ type GraphQLPriceChangedError struct { @@ -12045,7 +12271,13 @@ func (obj *GraphQLSemanticErrorError) DecodeStruct(src map[string]interface{}) e /** * Returned when the Cart contains a [ShippingMethod](ctp:api:type:ShippingMethod) that is not allowed for the [Cart](ctp:api:type:Cart). In this case, the [ShippingMethodState](ctp:api:type:ShippingMethodState) value is `DoesNotMatchCart`. * -* The error is returned as a failed response to the [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST) or [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) requests. +* When a Cart is frozen, the error can be returned as a failed response to all update actions on [Carts](ctp:api:type:CartUpdateAction) and [My Carts](ctp:api:type:MyCartUpdateAction). +* +* The error is also returned as a failed response to: +* +* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) requests on Orders. +* - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/me/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST) requests on My Orders. +* - [Create Order from Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders:POST) request on Associate Orders. * */ type GraphQLShippingMethodDoesNotMatchCartError struct { diff --git a/platform/types_extension.go b/platform/types_extension.go index f4630a04..2c48e333 100644 --- a/platform/types_extension.go +++ b/platform/types_extension.go @@ -17,9 +17,9 @@ type Extension struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the Extension was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the Extension. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Extension. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // User-defined unique identifier of the Extension. Key *string `json:"key,omitempty"` @@ -143,7 +143,7 @@ type ExtensionDraft struct { // The maximum value is 10000 ms (10 seconds) for `payment` Extensions and 2000 ms (2 seconds) for all other Extensions. // // This limit can be increased per Project after we review the performance impact. - // Please contact our support via the [Support Portal](https://support.commercetools.com) and provide the Region, Project key, and use case. + // Please contact the [Composable Commerce support team](https://support.commercetools.com) and provide the Region, Project key, and use case. TimeoutInMs *int `json:"timeoutInMs,omitempty"` } @@ -226,6 +226,7 @@ const ( ExtensionResourceTypeIdStagedQuote ExtensionResourceTypeId = "staged-quote" ExtensionResourceTypeIdQuote ExtensionResourceTypeId = "quote" ExtensionResourceTypeIdBusinessUnit ExtensionResourceTypeId = "business-unit" + ExtensionResourceTypeIdShoppingList ExtensionResourceTypeId = "shopping-list" ) type ExtensionTrigger struct { @@ -512,7 +513,7 @@ type ExtensionSetTimeoutInMsAction struct { // The maximum value is 10000 ms (10 seconds) for `payment` Extensions and 2000 ms (2 seconds) for all other Extensions. // // This limit can be increased per Project after we review the performance impact. - // Please contact our support via the [Support Portal](https://support.commercetools.com/) and provide the Region, Project key, and use case. + // Please contact the [Composable Commerce support team](https://support.commercetools.com/) and provide the Region, Project key, and use case. TimeoutInMs *int `json:"timeoutInMs,omitempty"` } diff --git a/platform/types_inventory.go b/platform/types_inventory.go index 8e953dcf..2fd77984 100644 --- a/platform/types_inventory.go +++ b/platform/types_inventory.go @@ -17,9 +17,9 @@ type InventoryEntry struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the InventoryEntry was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the InventoryEntry. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the InventoryEntry. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // User-defined unique identifier of the InventoryEntry. Key *string `json:"key,omitempty"` diff --git a/platform/types_me.go b/platform/types_me.go index 855a3dc7..39c5954f 100644 --- a/platform/types_me.go +++ b/platform/types_me.go @@ -238,7 +238,7 @@ type MyCartDraft struct { ShippingMode *ShippingMode `json:"shippingMode,omitempty"` // `code` of the existing [DiscountCodes](ctp:api:type:DiscountCode) to add to the Cart. DiscountCodes []string `json:"discountCodes"` - // Used for [LineItem Price selection](ctp:api:type:LineItemPriceSelection). + // Used for [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). // If used for [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/me/carts:POST), the provided country must be one of the [Store's](ctp:api:type:Store) `countries`. Country *string `json:"country,omitempty"` // Languages of the Cart. @@ -361,6 +361,12 @@ func mapDiscriminatorMyCartUpdateAction(input interface{}) (MyCartUpdateAction, return nil, err } return obj, nil + case "changeLineItemsOrder": + obj := MyCartChangeLineItemsOrderAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil case "changeTaxMode": obj := MyCartChangeTaxModeAction{} if err := decodeStruct(input, &obj); err != nil { @@ -510,7 +516,7 @@ type MyCompanyDraft struct { // Email address of the Business Unit. ContactEmail *string `json:"contactEmail,omitempty"` // Custom Fields for the Business Unit. - Custom *CustomFields `json:"custom,omitempty"` + Custom *CustomFieldsDraft `json:"custom,omitempty"` // Addresses used by the Business Unit. Addresses []BaseAddress `json:"addresses"` // Indexes of entries in `addresses` to set as shipping addresses. @@ -807,7 +813,7 @@ type MyDivisionDraft struct { // Email address of the Business Unit. ContactEmail *string `json:"contactEmail,omitempty"` // Custom Fields for the Business Unit. - Custom *CustomFields `json:"custom,omitempty"` + Custom *CustomFieldsDraft `json:"custom,omitempty"` // Addresses used by the Business Unit. Addresses []BaseAddress `json:"addresses"` // Indexes of entries in `addresses` to set as shipping addresses. @@ -881,7 +887,7 @@ type MyLineItemDraft struct { // Used to identify [Inventory entries](/../api/projects/inventory) that must be reserved. // The Channel must have the `InventorySupply` [ChannelRoleEnum](ctp:api:type:ChannelRoleEnum). SupplyChannel *ChannelResourceIdentifier `json:"supplyChannel,omitempty"` - // Used to [select](ctp:api:type:LineItemPriceSelection) a Product Price. + // Used to [select](/../api/pricing-and-discounts-overview#line-item-price-selection) a Product Price. // The Channel must have the `ProductDistribution` [ChannelRoleEnum](ctp:api:type:ChannelRoleEnum). // // If the Cart is bound to a [Store](ctp:api:type:Store) with `distributionChannels` set, @@ -1049,7 +1055,8 @@ func mapDiscriminatorMyPaymentUpdateAction(input interface{}) (MyPaymentUpdateAc } type MyQuoteRequestDraft struct { - // `id` of the Cart from which the Quote Request is created. + // `id` of the Cart from which the Quote Request is created. Carts with [Discount Codes](ctp:api:type:DiscountCode) and Carts with `Multiple` [ShippingMode](ctp:api:type:ShippingMode) are not supported. + // The Cart must have a `shippingAddress` defined, otherwise an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned when [creating a Quote Request](ctp:api:endpoint:/{projectKey}/me/quote-requests:POST). CartId string `json:"cartId"` // Current version of the Cart. CartVersion int `json:"cartVersion"` @@ -1824,7 +1831,7 @@ func (obj MyCartAddItemShippingAddressAction) MarshalJSON() ([]byte, error) { /** * If the Cart contains a [LineItem](ctp:api:type:LineItem) for a Product Variant with the same [LineItemMode](ctp:api:type:LineItemMode), [Custom Fields](/../api/projects/custom-fields), supply and distribution channel, then only the quantity of the existing Line Item is increased. * If [LineItem](ctp:api:type:LineItem) `shippingDetails` is set, it is merged. All addresses will be present afterwards and, for address keys present in both shipping details, the quantity will be summed up. -* The [LineItem](ctp:api:type:LineItem) price is set as described in [LineItem Price selection](ctp:api:type:LineItemPriceSelection). +* The [LineItem](ctp:api:type:LineItem) price is set as described in [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). * * If the Tax Rate is not set, a [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) error is returned. * @@ -1855,7 +1862,7 @@ type MyCartAddLineItemAction struct { // // Optional for backwards compatibility reasons. AddedAt *time.Time `json:"addedAt,omitempty"` - // Used to [select](ctp:api:type:LineItemPriceSelection) a Product Price. + // Used to [select](/../api/pricing-and-discounts-overview#line-item-price-selection) a Product Price. // The Channel must have the `ProductDistribution` [ChannelRoleEnum](ctp:api:type:ChannelRoleEnum). // If the Cart is bound to a [Store](ctp:api:type:Store) with `distributionChannels` set, the Channel must match one of the Store's distribution channels. DistributionChannel *ChannelResourceIdentifier `json:"distributionChannel,omitempty"` @@ -1958,6 +1965,21 @@ func (obj MyCartChangeLineItemQuantityAction) MarshalJSON() ([]byte, error) { }{Action: "changeLineItemQuantity", Alias: (*Alias)(&obj)}) } +type MyCartChangeLineItemsOrderAction struct { + // All existing [LineItem](ctp:api:type:LineItem) `id`s of the [Cart](ctp:api:type:Cart) in the desired new order. + LineItemOrder []string `json:"lineItemOrder"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj MyCartChangeLineItemsOrderAction) MarshalJSON() ([]byte, error) { + type Alias MyCartChangeLineItemsOrderAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "changeLineItemsOrder", Alias: (*Alias)(&obj)}) +} + /** * - When `External` [TaxMode](ctp:api:type:TaxMode) is changed to `Platform` or `Disabled`, all previously set external Tax Rates are removed. * - When set to `Platform`, Line Items, Custom Line Items, and Shipping Method require a Tax Category with a Tax Rate for the Cart's `shippingAddress`. @@ -2038,7 +2060,7 @@ func (obj MyCartRemoveItemShippingAddressAction) MarshalJSON() ([]byte, error) { } /** -* The [LineItem](ctp:api:type:LineItem) price is updated as described in [LineItem Price selection](ctp:api:type:LineItemPriceSelection). +* The [LineItem](ctp:api:type:LineItem) price is updated as described in [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). * */ type MyCartRemoveLineItemAction struct { @@ -2262,7 +2284,7 @@ func (obj MyCartSetLineItemCustomTypeAction) MarshalJSON() ([]byte, error) { } /** -* Setting a distribution channel for a [LineItem](ctp:api:type:LineItem) can lead to an updated `price` as described in [LineItem Price selection](ctp:api:type:LineItemPriceSelection). +* Setting a distribution channel for a [LineItem](ctp:api:type:LineItem) can lead to an updated `price` as described in [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). * */ type MyCartSetLineItemDistributionChannelAction struct { @@ -2351,7 +2373,7 @@ func (obj MyCartSetLocaleAction) MarshalJSON() ([]byte, error) { /** * Setting the shipping address also sets the [TaxRate](ctp:api:type:TaxRate) of Line Items and calculates the [TaxedPrice](ctp:api:type:TaxedPrice). * -* If a matching price cannot be found for the given shipping address during [Line Item Price selection](ctp:api:type:LineItemPriceSelection), +* If a matching price cannot be found for the given shipping address during [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection), * a [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) error is returned. * * If you want to allow shipping to states inside a country that are not explicitly covered by a TaxRate, diff --git a/platform/types_message.go b/platform/types_message.go index 834eed59..d267ad94 100644 --- a/platform/types_message.go +++ b/platform/types_message.go @@ -388,6 +388,19 @@ func mapDiscriminatorMessage(input interface{}) (Message, error) { } } return obj, nil + case "BusinessUnitApprovalRuleModeChanged": + obj := BusinessUnitApprovalRuleModeChangedMessage{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return nil, err + } + } + return obj, nil case "BusinessUnitAssociateAdded": obj := BusinessUnitAssociateAddedMessage{} if err := decodeStruct(input, &obj); err != nil { @@ -1474,6 +1487,71 @@ func mapDiscriminatorMessage(input interface{}) (Message, error) { } } return obj, nil + case "ProductPriceCustomFieldAdded": + obj := ProductPriceCustomFieldAddedMessage{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return nil, err + } + } + return obj, nil + case "ProductPriceCustomFieldChanged": + obj := ProductPriceCustomFieldChangedMessage{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return nil, err + } + } + return obj, nil + case "ProductPriceCustomFieldRemoved": + obj := ProductPriceCustomFieldRemovedMessage{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return nil, err + } + } + return obj, nil + case "ProductPriceCustomFieldsRemoved": + obj := ProductPriceCustomFieldsRemovedMessage{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return nil, err + } + } + return obj, nil + case "ProductPriceCustomFieldsSet": + obj := ProductPriceCustomFieldsSetMessage{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return nil, err + } + } + return obj, nil case "ProductPriceDiscountsSet": obj := ProductPriceDiscountsSetMessage{} if err := decodeStruct(input, &obj); err != nil { @@ -1768,6 +1846,32 @@ func mapDiscriminatorMessage(input interface{}) (Message, error) { } } return obj, nil + case "ProductTailoringImageAdded": + obj := ProductTailoringImageAddedMessage{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return nil, err + } + } + return obj, nil + case "ProductTailoringImagesSet": + obj := ProductTailoringImagesSetMessage{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return nil, err + } + } + return obj, nil case "ProductTailoringNameSet": obj := ProductTailoringNameSetMessage{} if err := decodeStruct(input, &obj); err != nil { @@ -1859,6 +1963,32 @@ func mapDiscriminatorMessage(input interface{}) (Message, error) { } } return obj, nil + case "ProductVariantTailoringAdded": + obj := ProductVariantTailoringAddedMessage{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return nil, err + } + } + return obj, nil + case "ProductVariantTailoringRemoved": + obj := ProductVariantTailoringRemovedMessage{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return nil, err + } + } + return obj, nil case "QuoteCreated": obj := QuoteCreatedMessage{} if err := decodeStruct(input, &obj); err != nil { @@ -2327,6 +2457,20 @@ func mapDiscriminatorMessage(input interface{}) (Message, error) { return nil, err } } + if obj.Value != nil { + var err error + obj.Value, err = mapDiscriminatorTypedMoney(obj.Value) + if err != nil { + return nil, err + } + } + if obj.OldValue != nil { + var err error + obj.OldValue, err = mapDiscriminatorTypedMoney(obj.OldValue) + if err != nil { + return nil, err + } + } return obj, nil case "StoreCountriesChanged": obj := StoreCountriesChangedMessage{} @@ -2449,9 +2593,9 @@ type ApprovalFlowApprovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -2509,9 +2653,9 @@ type ApprovalFlowCompletedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -2569,9 +2713,9 @@ type ApprovalFlowCreatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -2627,9 +2771,9 @@ type ApprovalFlowRejectedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -2689,9 +2833,9 @@ type ApprovalRuleApproversSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -2749,9 +2893,9 @@ type ApprovalRuleCreatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -2807,9 +2951,9 @@ type ApprovalRuleDescriptionSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -2867,9 +3011,9 @@ type ApprovalRuleKeySetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -2927,9 +3071,9 @@ type ApprovalRuleNameSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -2987,9 +3131,9 @@ type ApprovalRulePredicateSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -3047,9 +3191,9 @@ type ApprovalRuleRequestersSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -3107,9 +3251,9 @@ type ApprovalRuleStatusSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -3167,9 +3311,9 @@ type AssociateRoleBuyerAssignableChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -3225,9 +3369,9 @@ type AssociateRoleCreatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -3283,9 +3427,9 @@ type AssociateRoleDeletedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -3339,9 +3483,9 @@ type AssociateRoleNameChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -3397,9 +3541,9 @@ type AssociateRolePermissionAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -3455,9 +3599,9 @@ type AssociateRolePermissionRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -3513,9 +3657,9 @@ type AssociateRolePermissionsSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -3571,9 +3715,9 @@ type BusinessUnitAddressAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -3629,9 +3773,9 @@ type BusinessUnitAddressChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -3687,9 +3831,9 @@ type BusinessUnitAddressCustomFieldAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -3704,6 +3848,8 @@ type BusinessUnitAddressCustomFieldAddedMessage struct { Name string `json:"name"` // The added [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType). Value interface{} `json:"value"` + // `id` of the [Address](ctp:api:type:Address) to which the Custom Field was added. + AddressId *string `json:"addressId,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based @@ -3747,9 +3893,9 @@ type BusinessUnitAddressCustomFieldChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -3766,6 +3912,8 @@ type BusinessUnitAddressCustomFieldChangedMessage struct { Value interface{} `json:"value"` // [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType) before the [Set CustomField](ctp:api:type:BusinessUnitSetAddressCustomFieldAction) update action. OldValue interface{} `json:"oldValue,omitempty"` + // `id` of the [Address](ctp:api:type:Address) of which the Custom Field was changed. + AddressId *string `json:"addressId,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based @@ -3809,9 +3957,9 @@ type BusinessUnitAddressCustomFieldRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -3824,6 +3972,8 @@ type BusinessUnitAddressCustomFieldRemovedMessage struct { ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` // Name of the Custom Field that was removed. Name string `json:"name"` + // `id` of the [Address](ctp:api:type:Address) from which the Custom Field was removed. + AddressId *string `json:"addressId,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based @@ -3867,9 +4017,9 @@ type BusinessUnitAddressCustomTypeRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -3882,6 +4032,8 @@ type BusinessUnitAddressCustomTypeRemovedMessage struct { ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` // `id` of the [Custom Type](ctp:api:type:Type) that was removed. Absent if there was no previous Custom Type present. OldTypeId *string `json:"oldTypeId,omitempty"` + // `id` of the [Address](ctp:api:type:Address) from which the Custom Type was removed. + AddressId *string `json:"addressId,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based @@ -3925,9 +4077,9 @@ type BusinessUnitAddressCustomTypeSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -3942,6 +4094,8 @@ type BusinessUnitAddressCustomTypeSetMessage struct { CustomFields CustomFields `json:"customFields"` // `id` of the previous [Custom Type](ctp:api:type:Type). Absent if there was no previous Custom Type present. OldTypeId *string `json:"oldTypeId,omitempty"` + // `id` of the [Address](ctp:api:type:Address) on which the Custom Field was set. + AddressId *string `json:"addressId,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based @@ -3985,9 +4139,9 @@ type BusinessUnitAddressRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -4030,6 +4184,66 @@ func (obj BusinessUnitAddressRemovedMessage) MarshalJSON() ([]byte, error) { }{Action: "BusinessUnitAddressRemoved", Alias: (*Alias)(&obj)}) } +/** +* Generated after a successful [Change Approval Rule Mode](ctp:api:type:BusinessUnitChangeApprovalRuleModeAction) update action. +* + */ +type BusinessUnitApprovalRuleModeChangedMessage struct { + // Unique identifier of the Message. Can be used to track which Messages have been processed. + ID string `json:"id"` + // Version of a resource. In case of Messages, this is always `1`. + Version int `json:"version"` + // Date and time (UTC) the Message was generated. + CreatedAt time.Time `json:"createdAt"` + // Value of `createdAt`. + LastModifiedAt time.Time `json:"lastModifiedAt"` + // IDs and references that last modified the Message. + LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` + // IDs and references that created the Message. + CreatedBy *CreatedBy `json:"createdBy,omitempty"` + // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. + // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. + SequenceNumber int `json:"sequenceNumber"` + // [Reference](ctp:api:type:Reference) to the resource on which the change or action was performed. + Resource Reference `json:"resource"` + // Version of the resource on which the change or action was performed. + ResourceVersion int `json:"resourceVersion"` + // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. + ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` + // [BusinessUnitApprovalRuleMode](ctp:api:type:BusinessUnitApprovalRuleMode) of the Business Unit after the [Change Approval Rule Mode](ctp:api:type:BusinessUnitChangeApprovalRuleModeAction) update action. + ApprovalRuleMode BusinessUnitApprovalRuleMode `json:"approvalRuleMode"` + // [BusinessUnitApprovalRuleMode](ctp:api:type:BusinessUnitApprovalRuleMode) of the Business Unit before the [Change Approval Rule Mode](ctp:api:type:BusinessUnitChangeApprovalRuleModeAction) update action. + OldApprovalRuleMode *BusinessUnitApprovalRuleMode `json:"oldApprovalRuleMode,omitempty"` +} + +// UnmarshalJSON override to deserialize correct attribute types based +// on the discriminator value +func (obj *BusinessUnitApprovalRuleModeChangedMessage) UnmarshalJSON(data []byte) error { + type Alias BusinessUnitApprovalRuleModeChangedMessage + if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + return err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return err + } + } + + return nil +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj BusinessUnitApprovalRuleModeChangedMessage) MarshalJSON() ([]byte, error) { + type Alias BusinessUnitApprovalRuleModeChangedMessage + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "BusinessUnitApprovalRuleModeChanged", Alias: (*Alias)(&obj)}) +} + /** * Generated after a successful [Add Associate](ctp:api:type:BusinessUnitAddAssociateAction) update action. * @@ -4043,9 +4257,9 @@ type BusinessUnitAssociateAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -4101,9 +4315,9 @@ type BusinessUnitAssociateChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -4159,9 +4373,9 @@ type BusinessUnitAssociateModeChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -4219,9 +4433,9 @@ type BusinessUnitAssociateRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -4277,9 +4491,9 @@ type BusinessUnitAssociatesSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -4335,9 +4549,9 @@ type BusinessUnitBillingAddressAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -4393,9 +4607,9 @@ type BusinessUnitBillingAddressRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -4451,9 +4665,9 @@ type BusinessUnitContactEmailSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -4509,9 +4723,9 @@ type BusinessUnitCreatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -4574,9 +4788,9 @@ type BusinessUnitCustomFieldAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -4634,9 +4848,9 @@ type BusinessUnitCustomFieldChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -4696,9 +4910,9 @@ type BusinessUnitCustomFieldRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -4754,9 +4968,9 @@ type BusinessUnitCustomTypeRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -4812,9 +5026,9 @@ type BusinessUnitCustomTypeSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -4872,9 +5086,9 @@ type BusinessUnitDefaultBillingAddressSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -4930,9 +5144,9 @@ type BusinessUnitDefaultShippingAddressSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -4988,9 +5202,9 @@ type BusinessUnitDeletedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -5044,9 +5258,9 @@ type BusinessUnitNameChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -5102,9 +5316,9 @@ type BusinessUnitParentChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -5162,9 +5376,9 @@ type BusinessUnitShippingAddressAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -5220,9 +5434,9 @@ type BusinessUnitShippingAddressRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -5278,9 +5492,9 @@ type BusinessUnitStatusChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -5336,9 +5550,9 @@ type BusinessUnitStoreAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -5394,9 +5608,9 @@ type BusinessUnitStoreModeChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -5458,9 +5672,9 @@ type BusinessUnitStoreRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -5516,9 +5730,9 @@ type BusinessUnitStoresSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -5574,9 +5788,9 @@ type CartDiscountCreatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -5632,9 +5846,9 @@ type CartDiscountDeletedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -5688,9 +5902,9 @@ type CartDiscountStoreAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -5746,9 +5960,9 @@ type CartDiscountStoreRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -5804,9 +6018,9 @@ type CartDiscountStoresSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -5862,9 +6076,9 @@ type CategoryCreatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -5920,9 +6134,9 @@ type CategorySlugChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -5980,9 +6194,9 @@ type CustomerAddressAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -6038,9 +6252,9 @@ type CustomerAddressChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -6097,9 +6311,9 @@ type CustomerAddressCustomFieldAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -6114,6 +6328,8 @@ type CustomerAddressCustomFieldAddedMessage struct { Name string `json:"name"` // The added [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType). Value interface{} `json:"value"` + // `id` of the [Address](ctp:api:type:Address) to which the Custom Field was added. + AddressId *string `json:"addressId,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based @@ -6157,9 +6373,9 @@ type CustomerAddressCustomFieldChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -6177,6 +6393,8 @@ type CustomerAddressCustomFieldChangedMessage struct { // [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType) before the [Set CustomField](ctp:api:type:CustomerSetAddressCustomFieldAction) update action. // When there has not been a Custom Field with the `name` on the Customer Address before, a [Customer Address Custom Field Added](ctp:api:type:CustomerAddressCustomFieldAddedMessage) Message is generated instead. PreviousValue interface{} `json:"previousValue,omitempty"` + // `id` of the [Address](ctp:api:type:Address) of which the Custom Field was changed. + AddressId *string `json:"addressId,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based @@ -6220,9 +6438,9 @@ type CustomerAddressCustomFieldRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -6235,6 +6453,8 @@ type CustomerAddressCustomFieldRemovedMessage struct { ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` // Name of the Custom Field that was removed. Name string `json:"name"` + // `id` of the [Address](ctp:api:type:Address) from which the Custom Field was removed. + AddressId *string `json:"addressId,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based @@ -6278,9 +6498,9 @@ type CustomerAddressCustomTypeRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -6293,6 +6513,8 @@ type CustomerAddressCustomTypeRemovedMessage struct { ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` // `id` of the [Custom Type](ctp:api:type:Type) that was removed. Absent if there was no previous Custom Type present. PreviousTypeId *string `json:"previousTypeId,omitempty"` + // `id` of the [Address](ctp:api:type:Address) from which the Custom Type was removed. + AddressId *string `json:"addressId,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based @@ -6336,9 +6558,9 @@ type CustomerAddressCustomTypeSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -6353,6 +6575,8 @@ type CustomerAddressCustomTypeSetMessage struct { CustomFields CustomFields `json:"customFields"` // `id` of the previous [Custom Type](ctp:api:type:Type). Absent if there was no previous Custom Type present. PreviousTypeId *string `json:"previousTypeId,omitempty"` + // `id` of the [Address](ctp:api:type:Address) on which the Custom Field was set. + AddressId *string `json:"addressId,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based @@ -6396,9 +6620,9 @@ type CustomerAddressRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -6454,9 +6678,9 @@ type CustomerCompanyNameSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -6512,9 +6736,9 @@ type CustomerCreatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -6571,9 +6795,9 @@ type CustomerCustomFieldAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -6631,9 +6855,9 @@ type CustomerCustomFieldChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -6694,9 +6918,9 @@ type CustomerCustomFieldRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -6752,9 +6976,9 @@ type CustomerCustomTypeRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -6810,9 +7034,9 @@ type CustomerCustomTypeSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -6870,9 +7094,9 @@ type CustomerDateOfBirthSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -6928,9 +7152,9 @@ type CustomerDeletedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -6984,9 +7208,9 @@ type CustomerEmailChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -7042,9 +7266,9 @@ type CustomerEmailTokenCreatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -7102,9 +7326,9 @@ type CustomerEmailVerifiedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -7158,9 +7382,9 @@ type CustomerFirstNameSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -7217,9 +7441,9 @@ type CustomerGroupCustomFieldAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -7277,9 +7501,9 @@ type CustomerGroupCustomFieldChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -7339,9 +7563,9 @@ type CustomerGroupCustomFieldRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -7397,9 +7621,9 @@ type CustomerGroupCustomTypeRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -7455,9 +7679,9 @@ type CustomerGroupCustomTypeSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -7515,9 +7739,9 @@ type CustomerGroupSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -7573,9 +7797,9 @@ type CustomerLastNameSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -7631,9 +7855,9 @@ type CustomerPasswordTokenCreatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -7691,9 +7915,9 @@ type CustomerPasswordUpdatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -7749,9 +7973,9 @@ type CustomerTitleSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -7807,9 +8031,9 @@ type DiscountCodeCreatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -7865,9 +8089,9 @@ type DiscountCodeDeletedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -7921,9 +8145,9 @@ type DiscountCodeKeySetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -7981,9 +8205,9 @@ type InventoryEntryCreatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -8039,9 +8263,9 @@ type InventoryEntryDeletedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -8100,9 +8324,9 @@ type InventoryEntryQuantitySetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -8267,6 +8491,71 @@ func mapDiscriminatorOrderMessage(input interface{}) (OrderMessage, error) { } } return obj, nil + case "DeliveryCustomFieldAdded": + obj := DeliveryCustomFieldAddedMessage{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return nil, err + } + } + return obj, nil + case "DeliveryCustomFieldChanged": + obj := DeliveryCustomFieldChangedMessage{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return nil, err + } + } + return obj, nil + case "DeliveryCustomFieldRemoved": + obj := DeliveryCustomFieldRemovedMessage{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return nil, err + } + } + return obj, nil + case "DeliveryCustomTypeRemoved": + obj := DeliveryCustomTypeRemovedMessage{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return nil, err + } + } + return obj, nil + case "DeliveryCustomTypeSet": + obj := DeliveryCustomTypeSetMessage{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return nil, err + } + } + return obj, nil case "DeliveryItemsUpdated": obj := DeliveryItemsUpdatedMessage{} if err := decodeStruct(input, &obj); err != nil { @@ -8870,9 +9159,9 @@ type CustomLineItemStateTransitionMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -8887,7 +9176,7 @@ type CustomLineItemStateTransitionMessage struct { CustomLineItemId string `json:"customLineItemId"` // User-defined unique identifier of the [Custom Line Item](ctp:api:type:CustomLineItem). CustomLineItemKey *string `json:"customLineItemKey,omitempty"` - // Date and time (UTC) when the transition of the [Custom Line Item](ctp:api:type:CustomLineItem) [State](ctp:api:type:State) was performed. + // Date and time (UTC) the transition of the [Custom Line Item](ctp:api:type:CustomLineItem) [State](ctp:api:type:State) was performed. TransitionDate time.Time `json:"transitionDate"` // Number of [Custom Line Items](ctp:api:type:CustomLineItem) for which the [State](ctp:api:type:State) was transitioned. Quantity int `json:"quantity"` @@ -8938,9 +9227,9 @@ type DeliveryAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -8998,9 +9287,9 @@ type DeliveryAddressSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -9011,7 +9300,7 @@ type DeliveryAddressSetMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Unique identifier of the [Parcel](ctp:api:type:Delivery). + // Unique identifier of the [Delivery](ctp:api:type:Delivery). DeliveryId string `json:"deliveryId"` // [Address](ctp:api:type:Address) after the [Set Delivery Address](ctp:api:type:OrderSetDeliveryAddressAction) update action. Address *Address `json:"address,omitempty"` @@ -9050,10 +9339,10 @@ func (obj DeliveryAddressSetMessage) MarshalJSON() ([]byte, error) { } /** -* Generated after a successful [Set Delivery Items](ctp:api:type:OrderSetDeliveryItemsAction) update action. +* Generated after adding a Custom Field to a Delivery using the [Set CustomField](ctp:api:type:OrderSetDeliveryCustomFieldAction) update action. * */ -type DeliveryItemsUpdatedMessage struct { +type DeliveryCustomFieldAddedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -9062,9 +9351,9 @@ type DeliveryItemsUpdatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -9075,20 +9364,18 @@ type DeliveryItemsUpdatedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` + // Name of the Custom Field that was added. + Name string `json:"name"` + // The added [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType). + Value interface{} `json:"value"` // Unique identifier of the [Delivery](ctp:api:type:Delivery). DeliveryId string `json:"deliveryId"` - // [Delivery Items](ctp:api:type:DeliveryItem) after the [Set Delivery Items](ctp:api:type:OrderSetDeliveryItemsAction) update action. - Items []DeliveryItem `json:"items"` - // [Delivery Items](ctp:api:type:DeliveryItem) before the [Set Delivery Items](ctp:api:type:OrderSetDeliveryItemsAction) update action. - OldItems []DeliveryItem `json:"oldItems"` - // User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). - ShippingKey *string `json:"shippingKey,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *DeliveryItemsUpdatedMessage) UnmarshalJSON(data []byte) error { - type Alias DeliveryItemsUpdatedMessage +func (obj *DeliveryCustomFieldAddedMessage) UnmarshalJSON(data []byte) error { + type Alias DeliveryCustomFieldAddedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -9105,19 +9392,19 @@ func (obj *DeliveryItemsUpdatedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj DeliveryItemsUpdatedMessage) MarshalJSON() ([]byte, error) { - type Alias DeliveryItemsUpdatedMessage +func (obj DeliveryCustomFieldAddedMessage) MarshalJSON() ([]byte, error) { + type Alias DeliveryCustomFieldAddedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "DeliveryItemsUpdated", Alias: (*Alias)(&obj)}) + }{Action: "DeliveryCustomFieldAdded", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Remove Delivery](ctp:api:type:OrderRemoveDeliveryAction) update action. +* Generated when an existing Custom Field on a Delivery has been changed using the [Set CustomField](ctp:api:type:OrderSetDeliveryCustomFieldAction) update action. * */ -type DeliveryRemovedMessage struct { +type DeliveryCustomFieldChangedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -9126,9 +9413,9 @@ type DeliveryRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -9139,16 +9426,21 @@ type DeliveryRemovedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // The [Delivery](ctp:api:type:Delivery) that was removed from the [Order](ctp:api:type:Order). - Delivery Delivery `json:"delivery"` - // User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). - ShippingKey *string `json:"shippingKey,omitempty"` + // Name of the Custom Field that changed. + Name string `json:"name"` + // [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType) after the [Set CustomField](ctp:api:type:OrderSetDeliveryCustomFieldAction) update action. + Value interface{} `json:"value"` + // [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType) before the [Set CustomField](ctp:api:type:OrderSetDeliveryCustomFieldAction) update action. + // When there has not been a Custom Field with the `name` on the Delivery before, a [Delivery Custom Field Added](ctp:api:type:DeliveryCustomFieldAddedMessage) Message is generated instead. + PreviousValue interface{} `json:"previousValue,omitempty"` + // Unique identifier of the [Delivery](ctp:api:type:Delivery). + DeliveryId string `json:"deliveryId"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *DeliveryRemovedMessage) UnmarshalJSON(data []byte) error { - type Alias DeliveryRemovedMessage +func (obj *DeliveryCustomFieldChangedMessage) UnmarshalJSON(data []byte) error { + type Alias DeliveryCustomFieldChangedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -9165,19 +9457,19 @@ func (obj *DeliveryRemovedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj DeliveryRemovedMessage) MarshalJSON() ([]byte, error) { - type Alias DeliveryRemovedMessage +func (obj DeliveryCustomFieldChangedMessage) MarshalJSON() ([]byte, error) { + type Alias DeliveryCustomFieldChangedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "DeliveryRemoved", Alias: (*Alias)(&obj)}) + }{Action: "DeliveryCustomFieldChanged", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Transition LineItem State](ctp:api:type:OrderTransitionLineItemStateAction) update action. +* Generated when a Custom Field has been removed from the Delivery using the [Set CustomField](ctp:api:type:OrderSetDeliveryCustomFieldAction) update action. * */ -type LineItemStateTransitionMessage struct { +type DeliveryCustomFieldRemovedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -9186,9 +9478,9 @@ type LineItemStateTransitionMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -9199,24 +9491,16 @@ type LineItemStateTransitionMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Unique identifier of the [Line Item](ctp:api:type:LineItem). - LineItemId string `json:"lineItemId"` - // User-defined unique identifier of the LineItem. - LineItemKey *string `json:"lineItemKey,omitempty"` - // Date and time (UTC) when the transition of the [Line Item](ctp:api:type:LineItem) [State](ctp:api:type:State) was performed. - TransitionDate time.Time `json:"transitionDate"` - // Number of [Line Items](ctp:api:type:LineItem) for which the [State](ctp:api:type:State) was transitioned. - Quantity int `json:"quantity"` - // [State](ctp:api:type:State) the [Line Item](ctp:api:type:LineItem) was transitioned from. - FromState StateReference `json:"fromState"` - // [State](ctp:api:type:State) the [Line Item](ctp:api:type:LineItem) was transitioned to. - ToState StateReference `json:"toState"` + // Name of the Custom Field that was removed. + Name string `json:"name"` + // Unique identifier of the [Delivery](ctp:api:type:Delivery). + DeliveryId string `json:"deliveryId"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *LineItemStateTransitionMessage) UnmarshalJSON(data []byte) error { - type Alias LineItemStateTransitionMessage +func (obj *DeliveryCustomFieldRemovedMessage) UnmarshalJSON(data []byte) error { + type Alias DeliveryCustomFieldRemovedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -9233,19 +9517,19 @@ func (obj *LineItemStateTransitionMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj LineItemStateTransitionMessage) MarshalJSON() ([]byte, error) { - type Alias LineItemStateTransitionMessage +func (obj DeliveryCustomFieldRemovedMessage) MarshalJSON() ([]byte, error) { + type Alias DeliveryCustomFieldRemovedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "LineItemStateTransition", Alias: (*Alias)(&obj)}) + }{Action: "DeliveryCustomFieldRemoved", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Set Billing Address](ctp:api:type:OrderSetBillingAddressAction) update action. +* Generated after removing a Custom Type from a Delivery using the [Set Custom Type](ctp:api:type:OrderSetDeliveryCustomTypeAction) update action with empty parameters. * */ -type OrderBillingAddressSetMessage struct { +type DeliveryCustomTypeRemovedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -9254,9 +9538,9 @@ type OrderBillingAddressSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -9267,16 +9551,16 @@ type OrderBillingAddressSetMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Billing address on the Order after the [Set Billing Address](ctp:api:type:OrderSetBillingAddressAction) update action. - Address *Address `json:"address,omitempty"` - // Billing address on the Order before the [Set Billing Address](ctp:api:type:OrderSetBillingAddressAction) update action. - OldAddress *Address `json:"oldAddress,omitempty"` + // `id` of the [Custom Type](ctp:api:type:Type) that was removed. Absent if there was no previous Custom Type present. + PreviousTypeId *string `json:"previousTypeId,omitempty"` + // Unique identifier of the [Delivery](ctp:api:type:Delivery). + DeliveryId string `json:"deliveryId"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderBillingAddressSetMessage) UnmarshalJSON(data []byte) error { - type Alias OrderBillingAddressSetMessage +func (obj *DeliveryCustomTypeRemovedMessage) UnmarshalJSON(data []byte) error { + type Alias DeliveryCustomTypeRemovedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -9293,19 +9577,19 @@ func (obj *OrderBillingAddressSetMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderBillingAddressSetMessage) MarshalJSON() ([]byte, error) { - type Alias OrderBillingAddressSetMessage +func (obj DeliveryCustomTypeRemovedMessage) MarshalJSON() ([]byte, error) { + type Alias DeliveryCustomTypeRemovedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderBillingAddressSet", Alias: (*Alias)(&obj)}) + }{Action: "DeliveryCustomTypeRemoved", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Create Order](ctp:api:endpoint:/{projectKey}/orders:POST) request. +* Generated after adding a Custom Type to a Delivery using the [Set Custom Type](ctp:api:type:OrderSetDeliveryCustomTypeAction) update action. * */ -type OrderCreatedMessage struct { +type DeliveryCustomTypeSetMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -9314,9 +9598,9 @@ type OrderCreatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -9327,14 +9611,18 @@ type OrderCreatedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [Order](ctp:api:type:Order) that was created. - Order Order `json:"order"` + // The Custom Fields that have been set. + CustomFields CustomFields `json:"customFields"` + // `id` of the previous [Custom Type](ctp:api:type:Type). Absent if there was no previous Custom Type present. + PreviousTypeId *string `json:"previousTypeId,omitempty"` + // Unique identifier of the [Delivery](ctp:api:type:Delivery). + DeliveryId string `json:"deliveryId"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderCreatedMessage) UnmarshalJSON(data []byte) error { - type Alias OrderCreatedMessage +func (obj *DeliveryCustomTypeSetMessage) UnmarshalJSON(data []byte) error { + type Alias DeliveryCustomTypeSetMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -9351,19 +9639,19 @@ func (obj *OrderCreatedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderCreatedMessage) MarshalJSON() ([]byte, error) { - type Alias OrderCreatedMessage +func (obj DeliveryCustomTypeSetMessage) MarshalJSON() ([]byte, error) { + type Alias DeliveryCustomTypeSetMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderCreated", Alias: (*Alias)(&obj)}) + }{Action: "DeliveryCustomTypeSet", Alias: (*Alias)(&obj)}) } /** -* Generated after adding a Custom Field using the [Set CustomField](ctp:api:type:OrderSetCustomFieldAction). +* Generated after a successful [Set Delivery Items](ctp:api:type:OrderSetDeliveryItemsAction) update action. * */ -type OrderCustomFieldAddedMessage struct { +type DeliveryItemsUpdatedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -9372,9 +9660,9 @@ type OrderCustomFieldAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -9385,16 +9673,20 @@ type OrderCustomFieldAddedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Name of the Custom Field that was added. - Name string `json:"name"` - // The added [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType). - Value interface{} `json:"value"` + // Unique identifier of the [Delivery](ctp:api:type:Delivery). + DeliveryId string `json:"deliveryId"` + // [Delivery Items](ctp:api:type:DeliveryItem) after the [Set Delivery Items](ctp:api:type:OrderSetDeliveryItemsAction) update action. + Items []DeliveryItem `json:"items"` + // [Delivery Items](ctp:api:type:DeliveryItem) before the [Set Delivery Items](ctp:api:type:OrderSetDeliveryItemsAction) update action. + OldItems []DeliveryItem `json:"oldItems"` + // User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). + ShippingKey *string `json:"shippingKey,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderCustomFieldAddedMessage) UnmarshalJSON(data []byte) error { - type Alias OrderCustomFieldAddedMessage +func (obj *DeliveryItemsUpdatedMessage) UnmarshalJSON(data []byte) error { + type Alias DeliveryItemsUpdatedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -9411,19 +9703,19 @@ func (obj *OrderCustomFieldAddedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderCustomFieldAddedMessage) MarshalJSON() ([]byte, error) { - type Alias OrderCustomFieldAddedMessage +func (obj DeliveryItemsUpdatedMessage) MarshalJSON() ([]byte, error) { + type Alias DeliveryItemsUpdatedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderCustomFieldAdded", Alias: (*Alias)(&obj)}) + }{Action: "DeliveryItemsUpdated", Alias: (*Alias)(&obj)}) } /** -* Generated when an existing Custom Field has been changed using the [Set CustomField](ctp:api:type:OrderSetCustomFieldAction) action. +* Generated after a successful [Remove Delivery](ctp:api:type:OrderRemoveDeliveryAction) update action. * */ -type OrderCustomFieldChangedMessage struct { +type DeliveryRemovedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -9432,9 +9724,9 @@ type OrderCustomFieldChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -9445,19 +9737,16 @@ type OrderCustomFieldChangedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Name of the Custom Field that changed. - Name string `json:"name"` - // [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType) after the [Set CustomField](ctp:api:type:OrderSetCustomFieldAction) update action. - Value interface{} `json:"value"` - // [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType) before the [Set CustomField](ctp:api:type:OrderSetCustomFieldAction) update action. - // When there has not been a Custom Field with the `name` on the Order before, an [Order Custom Field Added](ctp:api:type:OrderCustomFieldAddedMessage) Message is generated instead. - PreviousValue interface{} `json:"previousValue,omitempty"` + // The [Delivery](ctp:api:type:Delivery) that was removed from the [Order](ctp:api:type:Order). + Delivery Delivery `json:"delivery"` + // User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). + ShippingKey *string `json:"shippingKey,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderCustomFieldChangedMessage) UnmarshalJSON(data []byte) error { - type Alias OrderCustomFieldChangedMessage +func (obj *DeliveryRemovedMessage) UnmarshalJSON(data []byte) error { + type Alias DeliveryRemovedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -9474,19 +9763,19 @@ func (obj *OrderCustomFieldChangedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderCustomFieldChangedMessage) MarshalJSON() ([]byte, error) { - type Alias OrderCustomFieldChangedMessage +func (obj DeliveryRemovedMessage) MarshalJSON() ([]byte, error) { + type Alias DeliveryRemovedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderCustomFieldChanged", Alias: (*Alias)(&obj)}) + }{Action: "DeliveryRemoved", Alias: (*Alias)(&obj)}) } /** -* Generated when a Custom Field has been removed from the Order using the [Set CustomField](ctp:api:type:OrderSetCustomFieldAction) action. +* Generated after a successful [Transition LineItem State](ctp:api:type:OrderTransitionLineItemStateAction) update action. * */ -type OrderCustomFieldRemovedMessage struct { +type LineItemStateTransitionMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -9495,9 +9784,9 @@ type OrderCustomFieldRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -9508,14 +9797,24 @@ type OrderCustomFieldRemovedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Name of the Custom Field that was removed. - Name string `json:"name"` + // Unique identifier of the [Line Item](ctp:api:type:LineItem). + LineItemId string `json:"lineItemId"` + // User-defined unique identifier of the LineItem. + LineItemKey *string `json:"lineItemKey,omitempty"` + // Date and time (UTC) the transition of the [Line Item](ctp:api:type:LineItem) [State](ctp:api:type:State) was performed. + TransitionDate time.Time `json:"transitionDate"` + // Number of [Line Items](ctp:api:type:LineItem) for which the [State](ctp:api:type:State) was transitioned. + Quantity int `json:"quantity"` + // [State](ctp:api:type:State) the [Line Item](ctp:api:type:LineItem) was transitioned from. + FromState StateReference `json:"fromState"` + // [State](ctp:api:type:State) the [Line Item](ctp:api:type:LineItem) was transitioned to. + ToState StateReference `json:"toState"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderCustomFieldRemovedMessage) UnmarshalJSON(data []byte) error { - type Alias OrderCustomFieldRemovedMessage +func (obj *LineItemStateTransitionMessage) UnmarshalJSON(data []byte) error { + type Alias LineItemStateTransitionMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -9532,19 +9831,19 @@ func (obj *OrderCustomFieldRemovedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderCustomFieldRemovedMessage) MarshalJSON() ([]byte, error) { - type Alias OrderCustomFieldRemovedMessage +func (obj LineItemStateTransitionMessage) MarshalJSON() ([]byte, error) { + type Alias LineItemStateTransitionMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderCustomFieldRemoved", Alias: (*Alias)(&obj)}) + }{Action: "LineItemStateTransition", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Add CustomLineItem](ctp:api:type:StagedOrderAddCustomLineItemAction) update action. +* Generated after a successful [Set Billing Address](ctp:api:type:OrderSetBillingAddressAction) update action. * */ -type OrderCustomLineItemAddedMessage struct { +type OrderBillingAddressSetMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -9553,9 +9852,9 @@ type OrderCustomLineItemAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -9566,14 +9865,16 @@ type OrderCustomLineItemAddedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [Custom Line Item](ctp:api:type:CustomLineItem) that was added to the [Order](ctp:api:type:Order). - CustomLineItem CustomLineItem `json:"customLineItem"` + // Billing address on the Order after the [Set Billing Address](ctp:api:type:OrderSetBillingAddressAction) update action. + Address *Address `json:"address,omitempty"` + // Billing address on the Order before the [Set Billing Address](ctp:api:type:OrderSetBillingAddressAction) update action. + OldAddress *Address `json:"oldAddress,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderCustomLineItemAddedMessage) UnmarshalJSON(data []byte) error { - type Alias OrderCustomLineItemAddedMessage +func (obj *OrderBillingAddressSetMessage) UnmarshalJSON(data []byte) error { + type Alias OrderBillingAddressSetMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -9590,19 +9891,19 @@ func (obj *OrderCustomLineItemAddedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderCustomLineItemAddedMessage) MarshalJSON() ([]byte, error) { - type Alias OrderCustomLineItemAddedMessage +func (obj OrderBillingAddressSetMessage) MarshalJSON() ([]byte, error) { + type Alias OrderBillingAddressSetMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderCustomLineItemAdded", Alias: (*Alias)(&obj)}) + }{Action: "OrderBillingAddressSet", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful recalculation of a Discount on a [Custom Line Item](ctp:api:type:CustomLineItem). +* Generated after a successful [Create Order](ctp:api:endpoint:/{projectKey}/orders:POST) request. * */ -type OrderCustomLineItemDiscountSetMessage struct { +type OrderCreatedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -9611,9 +9912,9 @@ type OrderCustomLineItemDiscountSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -9624,20 +9925,14 @@ type OrderCustomLineItemDiscountSetMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Unique identifier for the [Custom Line Item](ctp:api:type:CustomLineItem). - CustomLineItemId string `json:"customLineItemId"` - // User-defined unique identifier of the [Custom Line Item](ctp:api:type:CustomLineItem). - CustomLineItemKey *string `json:"customLineItemKey,omitempty"` - // Array of [DiscountedLineItemPriceForQuantity](ctp:api:type:DiscountedLineItemPriceForQuantity) after the Discount recalculation. - DiscountedPricePerQuantity []DiscountedLineItemPriceForQuantity `json:"discountedPricePerQuantity"` - // [TaxedItemPrice](ctp:api:type:TaxedItemPrice) of the [Custom Line Item](ctp:api:type:CustomLineItem) after the Discount recalculation. - TaxedPrice *TaxedItemPrice `json:"taxedPrice,omitempty"` + // [Order](ctp:api:type:Order) that was created. + Order Order `json:"order"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderCustomLineItemDiscountSetMessage) UnmarshalJSON(data []byte) error { - type Alias OrderCustomLineItemDiscountSetMessage +func (obj *OrderCreatedMessage) UnmarshalJSON(data []byte) error { + type Alias OrderCreatedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -9654,19 +9949,19 @@ func (obj *OrderCustomLineItemDiscountSetMessage) UnmarshalJSON(data []byte) err // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderCustomLineItemDiscountSetMessage) MarshalJSON() ([]byte, error) { - type Alias OrderCustomLineItemDiscountSetMessage +func (obj OrderCreatedMessage) MarshalJSON() ([]byte, error) { + type Alias OrderCreatedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderCustomLineItemDiscountSet", Alias: (*Alias)(&obj)}) + }{Action: "OrderCreated", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Change CustomLineItem Quantity](ctp:api:type:StagedOrderChangeCustomLineItemQuantityAction) update action. +* Generated after adding a Custom Field using the [Set CustomField](ctp:api:type:OrderSetCustomFieldAction). * */ -type OrderCustomLineItemQuantityChangedMessage struct { +type OrderCustomFieldAddedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -9675,9 +9970,9 @@ type OrderCustomLineItemQuantityChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -9688,20 +9983,16 @@ type OrderCustomLineItemQuantityChangedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Unique identifier of the [Custom Line Item](ctp:api:type:CustomLineItem). - CustomLineItemId string `json:"customLineItemId"` - // User-defined unique identifier of the [Custom Line Item](ctp:api:type:CustomLineItem). - CustomLineItemKey *string `json:"customLineItemKey,omitempty"` - // [Custom Line Item](ctp:api:type:CustomLineItem) quantity after the [Change Custom Line Item Quantity](ctp:api:type:StagedOrderChangeCustomLineItemQuantityAction) update action. - Quantity int `json:"quantity"` - // [Custom Line Item](ctp:api:type:CustomLineItem) quantity before the [Change Custom Line Item Quantity](ctp:api:type:StagedOrderChangeCustomLineItemQuantityAction) update action. - OldQuantity int `json:"oldQuantity"` + // Name of the Custom Field that was added. + Name string `json:"name"` + // The added [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType). + Value interface{} `json:"value"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderCustomLineItemQuantityChangedMessage) UnmarshalJSON(data []byte) error { - type Alias OrderCustomLineItemQuantityChangedMessage +func (obj *OrderCustomFieldAddedMessage) UnmarshalJSON(data []byte) error { + type Alias OrderCustomFieldAddedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -9718,19 +10009,19 @@ func (obj *OrderCustomLineItemQuantityChangedMessage) UnmarshalJSON(data []byte) // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderCustomLineItemQuantityChangedMessage) MarshalJSON() ([]byte, error) { - type Alias OrderCustomLineItemQuantityChangedMessage +func (obj OrderCustomFieldAddedMessage) MarshalJSON() ([]byte, error) { + type Alias OrderCustomFieldAddedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderCustomLineItemQuantityChanged", Alias: (*Alias)(&obj)}) + }{Action: "OrderCustomFieldAdded", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Remove CustomLineItem](ctp:api:type:StagedOrderRemoveCustomLineItemAction) update action. +* Generated when an existing Custom Field has been changed using the [Set CustomField](ctp:api:type:OrderSetCustomFieldAction) action. * */ -type OrderCustomLineItemRemovedMessage struct { +type OrderCustomFieldChangedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -9739,9 +10030,9 @@ type OrderCustomLineItemRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -9752,18 +10043,19 @@ type OrderCustomLineItemRemovedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Unique identifier of the [Custom Line Item](ctp:api:type:CustomLineItem). - CustomLineItemId string `json:"customLineItemId"` - // User-defined unique identifier of the [Custom Line Item](ctp:api:type:CustomLineItem). - CustomLineItemKey *string `json:"customLineItemKey,omitempty"` - // [Custom Line Item](ctp:api:type:CustomLineItem) that was removed from the [Order](ctp:api:type:Order). - CustomLineItem CustomLineItem `json:"customLineItem"` + // Name of the Custom Field that changed. + Name string `json:"name"` + // [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType) after the [Set CustomField](ctp:api:type:OrderSetCustomFieldAction) update action. + Value interface{} `json:"value"` + // [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType) before the [Set CustomField](ctp:api:type:OrderSetCustomFieldAction) update action. + // When there has not been a Custom Field with the `name` on the Order before, an [Order Custom Field Added](ctp:api:type:OrderCustomFieldAddedMessage) Message is generated instead. + PreviousValue interface{} `json:"previousValue,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderCustomLineItemRemovedMessage) UnmarshalJSON(data []byte) error { - type Alias OrderCustomLineItemRemovedMessage +func (obj *OrderCustomFieldChangedMessage) UnmarshalJSON(data []byte) error { + type Alias OrderCustomFieldChangedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -9780,19 +10072,19 @@ func (obj *OrderCustomLineItemRemovedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderCustomLineItemRemovedMessage) MarshalJSON() ([]byte, error) { - type Alias OrderCustomLineItemRemovedMessage +func (obj OrderCustomFieldChangedMessage) MarshalJSON() ([]byte, error) { + type Alias OrderCustomFieldChangedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderCustomLineItemRemoved", Alias: (*Alias)(&obj)}) + }{Action: "OrderCustomFieldChanged", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Set Custom Type](ctp:api:type:OrderSetCustomTypeAction) with empty parameters. +* Generated when a Custom Field has been removed from the Order using the [Set CustomField](ctp:api:type:OrderSetCustomFieldAction) action. * */ -type OrderCustomTypeRemovedMessage struct { +type OrderCustomFieldRemovedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -9801,9 +10093,9 @@ type OrderCustomTypeRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -9814,14 +10106,14 @@ type OrderCustomTypeRemovedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // `id` of the [Custom Type](ctp:api:type:Type) that was removed. Absent if there was no previous Custom Type present. - PreviousTypeId *string `json:"previousTypeId,omitempty"` + // Name of the Custom Field that was removed. + Name string `json:"name"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderCustomTypeRemovedMessage) UnmarshalJSON(data []byte) error { - type Alias OrderCustomTypeRemovedMessage +func (obj *OrderCustomFieldRemovedMessage) UnmarshalJSON(data []byte) error { + type Alias OrderCustomFieldRemovedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -9838,19 +10130,19 @@ func (obj *OrderCustomTypeRemovedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderCustomTypeRemovedMessage) MarshalJSON() ([]byte, error) { - type Alias OrderCustomTypeRemovedMessage +func (obj OrderCustomFieldRemovedMessage) MarshalJSON() ([]byte, error) { + type Alias OrderCustomFieldRemovedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderCustomTypeRemoved", Alias: (*Alias)(&obj)}) + }{Action: "OrderCustomFieldRemoved", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Set Custom Type](ctp:api:type:OrderSetCustomTypeAction). +* Generated after a successful [Add CustomLineItem](ctp:api:type:StagedOrderAddCustomLineItemAction) update action. * */ -type OrderCustomTypeSetMessage struct { +type OrderCustomLineItemAddedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -9859,9 +10151,9 @@ type OrderCustomTypeSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -9872,16 +10164,14 @@ type OrderCustomTypeSetMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // The Custom Fields that have been set. - CustomFields CustomFields `json:"customFields"` - // `id` of the previous [Custom Type](ctp:api:type:Type). Absent if there was no previous Custom Type present. - PreviousTypeId *string `json:"previousTypeId,omitempty"` + // [Custom Line Item](ctp:api:type:CustomLineItem) that was added to the [Order](ctp:api:type:Order). + CustomLineItem CustomLineItem `json:"customLineItem"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderCustomTypeSetMessage) UnmarshalJSON(data []byte) error { - type Alias OrderCustomTypeSetMessage +func (obj *OrderCustomLineItemAddedMessage) UnmarshalJSON(data []byte) error { + type Alias OrderCustomLineItemAddedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -9898,19 +10188,19 @@ func (obj *OrderCustomTypeSetMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderCustomTypeSetMessage) MarshalJSON() ([]byte, error) { - type Alias OrderCustomTypeSetMessage +func (obj OrderCustomLineItemAddedMessage) MarshalJSON() ([]byte, error) { + type Alias OrderCustomLineItemAddedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderCustomTypeSet", Alias: (*Alias)(&obj)}) + }{Action: "OrderCustomLineItemAdded", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Set Customer Email](ctp:api:type:OrderSetCustomerEmailAction) update action. +* Generated after a successful recalculation of a Discount on a [Custom Line Item](ctp:api:type:CustomLineItem). * */ -type OrderCustomerEmailSetMessage struct { +type OrderCustomLineItemDiscountSetMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -9919,9 +10209,9 @@ type OrderCustomerEmailSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -9932,16 +10222,20 @@ type OrderCustomerEmailSetMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Email address on the [Order](ctp:api:type:Order) after the [Set Customer Email](ctp:api:type:OrderSetCustomerEmailAction) update action. - Email *string `json:"email,omitempty"` - // Email address on the [Order](ctp:api:type:Order) before the [Set Customer Email](ctp:api:type:OrderSetCustomerEmailAction) update action. - OldEmail *string `json:"oldEmail,omitempty"` + // Unique identifier for the [Custom Line Item](ctp:api:type:CustomLineItem). + CustomLineItemId string `json:"customLineItemId"` + // User-defined unique identifier of the [Custom Line Item](ctp:api:type:CustomLineItem). + CustomLineItemKey *string `json:"customLineItemKey,omitempty"` + // Array of [DiscountedLineItemPriceForQuantity](ctp:api:type:DiscountedLineItemPriceForQuantity) after the Discount recalculation. + DiscountedPricePerQuantity []DiscountedLineItemPriceForQuantity `json:"discountedPricePerQuantity"` + // [TaxedItemPrice](ctp:api:type:TaxedItemPrice) of the [Custom Line Item](ctp:api:type:CustomLineItem) after the Discount recalculation. + TaxedPrice *TaxedItemPrice `json:"taxedPrice,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderCustomerEmailSetMessage) UnmarshalJSON(data []byte) error { - type Alias OrderCustomerEmailSetMessage +func (obj *OrderCustomLineItemDiscountSetMessage) UnmarshalJSON(data []byte) error { + type Alias OrderCustomLineItemDiscountSetMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -9958,19 +10252,19 @@ func (obj *OrderCustomerEmailSetMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderCustomerEmailSetMessage) MarshalJSON() ([]byte, error) { - type Alias OrderCustomerEmailSetMessage +func (obj OrderCustomLineItemDiscountSetMessage) MarshalJSON() ([]byte, error) { + type Alias OrderCustomLineItemDiscountSetMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderCustomerEmailSet", Alias: (*Alias)(&obj)}) + }{Action: "OrderCustomLineItemDiscountSet", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Set Customer Group](ctp:api:type:StagedOrderSetCustomerGroupAction) update action. +* Generated after a successful [Change CustomLineItem Quantity](ctp:api:type:StagedOrderChangeCustomLineItemQuantityAction) update action. * */ -type OrderCustomerGroupSetMessage struct { +type OrderCustomLineItemQuantityChangedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -9979,9 +10273,9 @@ type OrderCustomerGroupSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -9992,16 +10286,20 @@ type OrderCustomerGroupSetMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [CustomerGroup](ctp:api:type:CustomerGroup) on the [Order](ctp:api:type:Order) after the [Set Customer Group](ctp:api:type:StagedOrderSetCustomerGroupAction) update action. - CustomerGroup *CustomerGroupReference `json:"customerGroup,omitempty"` - // [CustomerGroup](ctp:api:type:CustomerGroup) on the [Order](ctp:api:type:Order) before the [Set Customer Group](ctp:api:type:StagedOrderSetCustomerGroupAction) update action. - OldCustomerGroup *CustomerGroupReference `json:"oldCustomerGroup,omitempty"` + // Unique identifier of the [Custom Line Item](ctp:api:type:CustomLineItem). + CustomLineItemId string `json:"customLineItemId"` + // User-defined unique identifier of the [Custom Line Item](ctp:api:type:CustomLineItem). + CustomLineItemKey *string `json:"customLineItemKey,omitempty"` + // [Custom Line Item](ctp:api:type:CustomLineItem) quantity after the [Change Custom Line Item Quantity](ctp:api:type:StagedOrderChangeCustomLineItemQuantityAction) update action. + Quantity int `json:"quantity"` + // [Custom Line Item](ctp:api:type:CustomLineItem) quantity before the [Change Custom Line Item Quantity](ctp:api:type:StagedOrderChangeCustomLineItemQuantityAction) update action. + OldQuantity int `json:"oldQuantity"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderCustomerGroupSetMessage) UnmarshalJSON(data []byte) error { - type Alias OrderCustomerGroupSetMessage +func (obj *OrderCustomLineItemQuantityChangedMessage) UnmarshalJSON(data []byte) error { + type Alias OrderCustomLineItemQuantityChangedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -10018,19 +10316,19 @@ func (obj *OrderCustomerGroupSetMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderCustomerGroupSetMessage) MarshalJSON() ([]byte, error) { - type Alias OrderCustomerGroupSetMessage +func (obj OrderCustomLineItemQuantityChangedMessage) MarshalJSON() ([]byte, error) { + type Alias OrderCustomLineItemQuantityChangedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderCustomerGroupSet", Alias: (*Alias)(&obj)}) + }{Action: "OrderCustomLineItemQuantityChanged", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Set Customer ID](ctp:api:type:OrderSetCustomerIdAction) update action. +* Generated after a successful [Remove CustomLineItem](ctp:api:type:StagedOrderRemoveCustomLineItemAction) update action. * */ -type OrderCustomerSetMessage struct { +type OrderCustomLineItemRemovedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -10039,9 +10337,9 @@ type OrderCustomerSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -10052,20 +10350,18 @@ type OrderCustomerSetMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [Customer](ctp:api:type:Customer) on the [Order](ctp:api:type:Order) after the [Set Customer ID](ctp:api:type:OrderSetCustomerIdAction) update action. - Customer *CustomerReference `json:"customer,omitempty"` - // [CustomerGroup](ctp:api:type:CustomerGroup) on the [Order](ctp:api:type:Order) after the [Set Customer ID](ctp:api:type:OrderSetCustomerIdAction) update action. - CustomerGroup *CustomerGroupReference `json:"customerGroup,omitempty"` - // [Customer](ctp:api:type:Customer) on the [Order](ctp:api:type:Order) before the [Set Customer ID](ctp:api:type:OrderSetCustomerIdAction) update action. - OldCustomer *CustomerReference `json:"oldCustomer,omitempty"` - // [CustomerGroup](ctp:api:type:CustomerGroup) on the [Order](ctp:api:type:Order) before the [Set Customer ID](ctp:api:type:OrderSetCustomerIdAction) update action. - OldCustomerGroup *CustomerGroupReference `json:"oldCustomerGroup,omitempty"` + // Unique identifier of the [Custom Line Item](ctp:api:type:CustomLineItem). + CustomLineItemId string `json:"customLineItemId"` + // User-defined unique identifier of the [Custom Line Item](ctp:api:type:CustomLineItem). + CustomLineItemKey *string `json:"customLineItemKey,omitempty"` + // [Custom Line Item](ctp:api:type:CustomLineItem) that was removed from the [Order](ctp:api:type:Order). + CustomLineItem CustomLineItem `json:"customLineItem"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderCustomerSetMessage) UnmarshalJSON(data []byte) error { - type Alias OrderCustomerSetMessage +func (obj *OrderCustomLineItemRemovedMessage) UnmarshalJSON(data []byte) error { + type Alias OrderCustomLineItemRemovedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -10082,19 +10378,19 @@ func (obj *OrderCustomerSetMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderCustomerSetMessage) MarshalJSON() ([]byte, error) { - type Alias OrderCustomerSetMessage +func (obj OrderCustomLineItemRemovedMessage) MarshalJSON() ([]byte, error) { + type Alias OrderCustomLineItemRemovedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderCustomerSet", Alias: (*Alias)(&obj)}) + }{Action: "OrderCustomLineItemRemoved", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Delete Order](/../api/projects/orders#delete-order) request. +* Generated after a successful [Set Custom Type](ctp:api:type:OrderSetCustomTypeAction) with empty parameters. * */ -type OrderDeletedMessage struct { +type OrderCustomTypeRemovedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -10103,9 +10399,9 @@ type OrderDeletedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -10116,14 +10412,14 @@ type OrderDeletedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [Order](ctp:api:type:Order) that has been deleted. - Order Order `json:"order"` + // `id` of the [Custom Type](ctp:api:type:Type) that was removed. Absent if there was no previous Custom Type present. + PreviousTypeId *string `json:"previousTypeId,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderDeletedMessage) UnmarshalJSON(data []byte) error { - type Alias OrderDeletedMessage +func (obj *OrderCustomTypeRemovedMessage) UnmarshalJSON(data []byte) error { + type Alias OrderCustomTypeRemovedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -10140,19 +10436,19 @@ func (obj *OrderDeletedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderDeletedMessage) MarshalJSON() ([]byte, error) { - type Alias OrderDeletedMessage +func (obj OrderCustomTypeRemovedMessage) MarshalJSON() ([]byte, error) { + type Alias OrderCustomTypeRemovedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderDeleted", Alias: (*Alias)(&obj)}) + }{Action: "OrderCustomTypeRemoved", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Add DiscountCode](ctp:api:type:StagedOrderAddDiscountCodeAction) update action. +* Generated after a successful [Set Custom Type](ctp:api:type:OrderSetCustomTypeAction). * */ -type OrderDiscountCodeAddedMessage struct { +type OrderCustomTypeSetMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -10161,9 +10457,9 @@ type OrderDiscountCodeAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -10174,14 +10470,16 @@ type OrderDiscountCodeAddedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [DiscountCode](ctp:api:type:DiscountCode) that was added. - DiscountCode DiscountCodeReference `json:"discountCode"` + // The Custom Fields that have been set. + CustomFields CustomFields `json:"customFields"` + // `id` of the previous [Custom Type](ctp:api:type:Type). Absent if there was no previous Custom Type present. + PreviousTypeId *string `json:"previousTypeId,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderDiscountCodeAddedMessage) UnmarshalJSON(data []byte) error { - type Alias OrderDiscountCodeAddedMessage +func (obj *OrderCustomTypeSetMessage) UnmarshalJSON(data []byte) error { + type Alias OrderCustomTypeSetMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -10198,19 +10496,19 @@ func (obj *OrderDiscountCodeAddedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderDiscountCodeAddedMessage) MarshalJSON() ([]byte, error) { - type Alias OrderDiscountCodeAddedMessage +func (obj OrderCustomTypeSetMessage) MarshalJSON() ([]byte, error) { + type Alias OrderCustomTypeSetMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderDiscountCodeAdded", Alias: (*Alias)(&obj)}) + }{Action: "OrderCustomTypeSet", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Remove DiscountCode](ctp:api:type:StagedOrderRemoveDiscountCodeAction) update action. +* Generated after a successful [Set Customer Email](ctp:api:type:OrderSetCustomerEmailAction) update action. * */ -type OrderDiscountCodeRemovedMessage struct { +type OrderCustomerEmailSetMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -10219,9 +10517,9 @@ type OrderDiscountCodeRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -10232,14 +10530,16 @@ type OrderDiscountCodeRemovedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [DiscountCode](ctp:api:type:DiscountCode) that was removed. - DiscountCode DiscountCodeReference `json:"discountCode"` + // Email address on the [Order](ctp:api:type:Order) after the [Set Customer Email](ctp:api:type:OrderSetCustomerEmailAction) update action. + Email *string `json:"email,omitempty"` + // Email address on the [Order](ctp:api:type:Order) before the [Set Customer Email](ctp:api:type:OrderSetCustomerEmailAction) update action. + OldEmail *string `json:"oldEmail,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderDiscountCodeRemovedMessage) UnmarshalJSON(data []byte) error { - type Alias OrderDiscountCodeRemovedMessage +func (obj *OrderCustomerEmailSetMessage) UnmarshalJSON(data []byte) error { + type Alias OrderCustomerEmailSetMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -10256,19 +10556,19 @@ func (obj *OrderDiscountCodeRemovedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderDiscountCodeRemovedMessage) MarshalJSON() ([]byte, error) { - type Alias OrderDiscountCodeRemovedMessage +func (obj OrderCustomerEmailSetMessage) MarshalJSON() ([]byte, error) { + type Alias OrderCustomerEmailSetMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderDiscountCodeRemoved", Alias: (*Alias)(&obj)}) + }{Action: "OrderCustomerEmailSet", Alias: (*Alias)(&obj)}) } /** -* Generated after the [DiscountCodeState](ctp:api:type:DiscountCodeState) changes due to a [recalculation](/../api/projects/carts#recalculate). +* Generated after a successful [Set Customer Group](ctp:api:type:StagedOrderSetCustomerGroupAction) update action. * */ -type OrderDiscountCodeStateSetMessage struct { +type OrderCustomerGroupSetMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -10277,9 +10577,9 @@ type OrderDiscountCodeStateSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -10290,18 +10590,16 @@ type OrderDiscountCodeStateSetMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [DiscountCode](ctp:api:type:DiscountCode) that changed due to the recalculation. - DiscountCode DiscountCodeReference `json:"discountCode"` - // [DiscountCodeState](ctp:api:type:DiscountCodeState) after the recalculation. - State DiscountCodeState `json:"state"` - // [DiscountCodeState](ctp:api:type:DiscountCodeState) before the recalculation. - OldState *DiscountCodeState `json:"oldState,omitempty"` + // [CustomerGroup](ctp:api:type:CustomerGroup) on the [Order](ctp:api:type:Order) after the [Set Customer Group](ctp:api:type:StagedOrderSetCustomerGroupAction) update action. + CustomerGroup *CustomerGroupReference `json:"customerGroup,omitempty"` + // [CustomerGroup](ctp:api:type:CustomerGroup) on the [Order](ctp:api:type:Order) before the [Set Customer Group](ctp:api:type:StagedOrderSetCustomerGroupAction) update action. + OldCustomerGroup *CustomerGroupReference `json:"oldCustomerGroup,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderDiscountCodeStateSetMessage) UnmarshalJSON(data []byte) error { - type Alias OrderDiscountCodeStateSetMessage +func (obj *OrderCustomerGroupSetMessage) UnmarshalJSON(data []byte) error { + type Alias OrderCustomerGroupSetMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -10318,19 +10616,19 @@ func (obj *OrderDiscountCodeStateSetMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderDiscountCodeStateSetMessage) MarshalJSON() ([]byte, error) { - type Alias OrderDiscountCodeStateSetMessage +func (obj OrderCustomerGroupSetMessage) MarshalJSON() ([]byte, error) { + type Alias OrderCustomerGroupSetMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderDiscountCodeStateSet", Alias: (*Alias)(&obj)}) + }{Action: "OrderCustomerGroupSet", Alias: (*Alias)(&obj)}) } /** -* Generated after successfully [applying an OrderEdit](ctp:api:endpoint:/{projectKey}/orders/edits/{id}/apply:POST). +* Generated after a successful [Set Customer ID](ctp:api:type:OrderSetCustomerIdAction) update action. * */ -type OrderEditAppliedMessage struct { +type OrderCustomerSetMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -10339,9 +10637,9 @@ type OrderEditAppliedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -10352,16 +10650,20 @@ type OrderEditAppliedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [OrderEdit](ctp:api:type:OrderEdit) that was applied. - Edit OrderEdit `json:"edit"` - // Information about a successfully applied [OrderEdit](ctp:api:type:OrderEdit). - Result OrderEditApplied `json:"result"` + // [Customer](ctp:api:type:Customer) on the [Order](ctp:api:type:Order) after the [Set Customer ID](ctp:api:type:OrderSetCustomerIdAction) update action. + Customer *CustomerReference `json:"customer,omitempty"` + // [CustomerGroup](ctp:api:type:CustomerGroup) on the [Order](ctp:api:type:Order) after the [Set Customer ID](ctp:api:type:OrderSetCustomerIdAction) update action. + CustomerGroup *CustomerGroupReference `json:"customerGroup,omitempty"` + // [Customer](ctp:api:type:Customer) on the [Order](ctp:api:type:Order) before the [Set Customer ID](ctp:api:type:OrderSetCustomerIdAction) update action. + OldCustomer *CustomerReference `json:"oldCustomer,omitempty"` + // [CustomerGroup](ctp:api:type:CustomerGroup) on the [Order](ctp:api:type:Order) before the [Set Customer ID](ctp:api:type:OrderSetCustomerIdAction) update action. + OldCustomerGroup *CustomerGroupReference `json:"oldCustomerGroup,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderEditAppliedMessage) UnmarshalJSON(data []byte) error { - type Alias OrderEditAppliedMessage +func (obj *OrderCustomerSetMessage) UnmarshalJSON(data []byte) error { + type Alias OrderCustomerSetMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -10378,19 +10680,19 @@ func (obj *OrderEditAppliedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderEditAppliedMessage) MarshalJSON() ([]byte, error) { - type Alias OrderEditAppliedMessage +func (obj OrderCustomerSetMessage) MarshalJSON() ([]byte, error) { + type Alias OrderCustomerSetMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderEditApplied", Alias: (*Alias)(&obj)}) + }{Action: "OrderCustomerSet", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Order Import](ctp:api:endpoint:/{projectKey}/orders/import:POST). +* Generated after a successful [Delete Order](/../api/projects/orders#delete-order) request. * */ -type OrderImportedMessage struct { +type OrderDeletedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -10399,9 +10701,9 @@ type OrderImportedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -10412,14 +10714,14 @@ type OrderImportedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [Order](ctp:api:type:Order) that was imported. + // [Order](ctp:api:type:Order) that has been deleted. Order Order `json:"order"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderImportedMessage) UnmarshalJSON(data []byte) error { - type Alias OrderImportedMessage +func (obj *OrderDeletedMessage) UnmarshalJSON(data []byte) error { + type Alias OrderDeletedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -10436,19 +10738,19 @@ func (obj *OrderImportedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderImportedMessage) MarshalJSON() ([]byte, error) { - type Alias OrderImportedMessage +func (obj OrderDeletedMessage) MarshalJSON() ([]byte, error) { + type Alias OrderDeletedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderImported", Alias: (*Alias)(&obj)}) + }{Action: "OrderDeleted", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Add LineItem](ctp:api:type:StagedOrderAddLineItemAction) update action. +* Generated after a successful [Add DiscountCode](ctp:api:type:StagedOrderAddDiscountCodeAction) update action. * */ -type OrderLineItemAddedMessage struct { +type OrderDiscountCodeAddedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -10457,9 +10759,9 @@ type OrderLineItemAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -10470,16 +10772,14 @@ type OrderLineItemAddedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [Line Item](ctp:api:type:LineItem) that was added to the [Order](ctp:api:type:Order). - LineItem LineItem `json:"lineItem"` - // Quantity of [Line Items](ctp:api:type:LineItem) that were added to the [Order](ctp:api:type:Order). - AddedQuantity int `json:"addedQuantity"` + // [DiscountCode](ctp:api:type:DiscountCode) that was added. + DiscountCode DiscountCodeReference `json:"discountCode"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderLineItemAddedMessage) UnmarshalJSON(data []byte) error { - type Alias OrderLineItemAddedMessage +func (obj *OrderDiscountCodeAddedMessage) UnmarshalJSON(data []byte) error { + type Alias OrderDiscountCodeAddedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -10496,19 +10796,19 @@ func (obj *OrderLineItemAddedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderLineItemAddedMessage) MarshalJSON() ([]byte, error) { - type Alias OrderLineItemAddedMessage +func (obj OrderDiscountCodeAddedMessage) MarshalJSON() ([]byte, error) { + type Alias OrderDiscountCodeAddedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderLineItemAdded", Alias: (*Alias)(&obj)}) + }{Action: "OrderDiscountCodeAdded", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful recalculation of a Discount on a [Line Item](ctp:api:type:LineItem). +* Generated after a successful [Remove DiscountCode](ctp:api:type:StagedOrderRemoveDiscountCodeAction) update action. * */ -type OrderLineItemDiscountSetMessage struct { +type OrderDiscountCodeRemovedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -10517,9 +10817,9 @@ type OrderLineItemDiscountSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -10530,25 +10830,14 @@ type OrderLineItemDiscountSetMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Unique identifier for the [Line Item](ctp:api:type:LineItem). - LineItemId string `json:"lineItemId"` - // User-defined unique identifier of the LineItem. - LineItemKey *string `json:"lineItemKey,omitempty"` - // Array of [DiscountedLineItemPriceForQuantity](ctp:api:type:DiscountedLineItemPriceForQuantity) after the Discount recalculation. - DiscountedPricePerQuantity []DiscountedLineItemPriceForQuantity `json:"discountedPricePerQuantity"` - // Total Price of the [Line Item](ctp:api:type:LineItem) after the Discount recalculation. - TotalPrice Money `json:"totalPrice"` - // [TaxedItemPrice](ctp:api:type:TaxedItemPrice) of the [Line Item](ctp:api:type:LineItem) after the Discount recalculation. - TaxedPrice *TaxedItemPrice `json:"taxedPrice,omitempty"` - // Total taxed prices based on the quantity of Line Item assigned to each [Shipping Method](ctp:api:type:ShippingMethod). Only applicable for Carts with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). - // Automatically set after `perMethodTaxRate` is set. - TaxedPricePortions []MethodTaxedPrice `json:"taxedPricePortions"` + // [DiscountCode](ctp:api:type:DiscountCode) that was removed. + DiscountCode DiscountCodeReference `json:"discountCode"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderLineItemDiscountSetMessage) UnmarshalJSON(data []byte) error { - type Alias OrderLineItemDiscountSetMessage +func (obj *OrderDiscountCodeRemovedMessage) UnmarshalJSON(data []byte) error { + type Alias OrderDiscountCodeRemovedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -10565,19 +10854,19 @@ func (obj *OrderLineItemDiscountSetMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderLineItemDiscountSetMessage) MarshalJSON() ([]byte, error) { - type Alias OrderLineItemDiscountSetMessage +func (obj OrderDiscountCodeRemovedMessage) MarshalJSON() ([]byte, error) { + type Alias OrderDiscountCodeRemovedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderLineItemDiscountSet", Alias: (*Alias)(&obj)}) + }{Action: "OrderDiscountCodeRemoved", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Set LineItem DistributionChannel](/../api/projects/order-edits#set-lineitem-distributionchannel) update action. +* Generated after the [DiscountCodeState](ctp:api:type:DiscountCodeState) changes due to a [recalculation](/../api/projects/carts#recalculate). * */ -type OrderLineItemDistributionChannelSetMessage struct { +type OrderDiscountCodeStateSetMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -10586,9 +10875,9 @@ type OrderLineItemDistributionChannelSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -10599,18 +10888,18 @@ type OrderLineItemDistributionChannelSetMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Unique identifier of the [Line Item](ctp:api:type:LineItem). - LineItemId string `json:"lineItemId"` - // User-defined unique identifier of the LineItem. - LineItemKey *string `json:"lineItemKey,omitempty"` - // [Distribution Channel](ctp:api:type:Channel) that was set. - DistributionChannel *ChannelReference `json:"distributionChannel,omitempty"` + // [DiscountCode](ctp:api:type:DiscountCode) that changed due to the recalculation. + DiscountCode DiscountCodeReference `json:"discountCode"` + // [DiscountCodeState](ctp:api:type:DiscountCodeState) after the recalculation. + State DiscountCodeState `json:"state"` + // [DiscountCodeState](ctp:api:type:DiscountCodeState) before the recalculation. + OldState *DiscountCodeState `json:"oldState,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderLineItemDistributionChannelSetMessage) UnmarshalJSON(data []byte) error { - type Alias OrderLineItemDistributionChannelSetMessage +func (obj *OrderDiscountCodeStateSetMessage) UnmarshalJSON(data []byte) error { + type Alias OrderDiscountCodeStateSetMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -10627,19 +10916,19 @@ func (obj *OrderLineItemDistributionChannelSetMessage) UnmarshalJSON(data []byte // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderLineItemDistributionChannelSetMessage) MarshalJSON() ([]byte, error) { - type Alias OrderLineItemDistributionChannelSetMessage +func (obj OrderDiscountCodeStateSetMessage) MarshalJSON() ([]byte, error) { + type Alias OrderDiscountCodeStateSetMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderLineItemDistributionChannelSet", Alias: (*Alias)(&obj)}) + }{Action: "OrderDiscountCodeStateSet", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Remove LineItem](ctp:api:type:StagedOrderRemoveLineItemAction) update action. +* Generated after successfully [applying an OrderEdit](ctp:api:endpoint:/{projectKey}/orders/edits/{id}/apply:POST). * */ -type OrderLineItemRemovedMessage struct { +type OrderEditAppliedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -10648,9 +10937,9 @@ type OrderLineItemRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -10661,30 +10950,16 @@ type OrderLineItemRemovedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Unique identifier of the [Line Item](ctp:api:type:LineItem). - LineItemId string `json:"lineItemId"` - // User-defined unique identifier of the LineItem. - LineItemKey *string `json:"lineItemKey,omitempty"` - // Quantity of [Line Items](ctp:api:type:LineItem) that were removed during the [Remove Line Item](ctp:api:type:StagedOrderRemoveLineItemAction) update action. - RemovedQuantity int `json:"removedQuantity"` - // [Line Item](ctp:api:type:LineItem) quantity after the [Remove Line Item](ctp:api:type:StagedOrderRemoveLineItemAction) update action. - NewQuantity int `json:"newQuantity"` - // [ItemStates](ctp:api:type:ItemState) after the [Remove Line Item](ctp:api:type:StagedOrderRemoveLineItemAction) update action. - NewState []ItemState `json:"newState"` - // `totalPrice` of the [Order](ctp:api:type:Order) after the [Remove Line Item](ctp:api:type:StagedOrderRemoveLineItemAction) update action. - NewTotalPrice CentPrecisionMoney `json:"newTotalPrice"` - // [TaxedItemPrice](ctp:api:type:TaxedItemPrice) of the [Order](ctp:api:type:Order) after the [Remove Line Item](ctp:api:type:StagedOrderRemoveLineItemAction) update action. - NewTaxedPrice *TaxedItemPrice `json:"newTaxedPrice,omitempty"` - // [Price](ctp:api:type:Price) of the [Order](ctp:api:type:Order) after the [Remove Line Item](ctp:api:type:StagedOrderRemoveLineItemAction) update action. - NewPrice *Price `json:"newPrice,omitempty"` - // [Shipping Details](ctp:api:type:ItemShippingDetails) of the [Order](ctp:api:type:Order) after the [Remove Line Item](ctp:api:type:StagedOrderRemoveLineItemAction) update action. - NewShippingDetail *ItemShippingDetails `json:"newShippingDetail,omitempty"` + // [OrderEdit](ctp:api:type:OrderEdit) that was applied. + Edit OrderEdit `json:"edit"` + // Information about a successfully applied [OrderEdit](ctp:api:type:OrderEdit). + Result OrderEditApplied `json:"result"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderLineItemRemovedMessage) UnmarshalJSON(data []byte) error { - type Alias OrderLineItemRemovedMessage +func (obj *OrderEditAppliedMessage) UnmarshalJSON(data []byte) error { + type Alias OrderEditAppliedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -10701,19 +10976,19 @@ func (obj *OrderLineItemRemovedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderLineItemRemovedMessage) MarshalJSON() ([]byte, error) { - type Alias OrderLineItemRemovedMessage +func (obj OrderEditAppliedMessage) MarshalJSON() ([]byte, error) { + type Alias OrderEditAppliedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderLineItemRemoved", Alias: (*Alias)(&obj)}) + }{Action: "OrderEditApplied", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Add Payment](ctp:api:type:OrderAddPaymentAction) update action or when a [Payment](ctp:api:type:Payment) is added via [Order Edits](ctp:api:type:StagedOrderAddPaymentAction). +* Generated after a successful [Order Import](ctp:api:endpoint:/{projectKey}/orders/import:POST). * */ -type OrderPaymentAddedMessage struct { +type OrderImportedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -10722,9 +10997,9 @@ type OrderPaymentAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -10735,14 +11010,14 @@ type OrderPaymentAddedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [Payment](ctp:api:type:Payment) that was added to the [Order](ctp:api:type:Order). - Payment PaymentReference `json:"payment"` + // [Order](ctp:api:type:Order) that was imported. + Order Order `json:"order"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderPaymentAddedMessage) UnmarshalJSON(data []byte) error { - type Alias OrderPaymentAddedMessage +func (obj *OrderImportedMessage) UnmarshalJSON(data []byte) error { + type Alias OrderImportedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -10759,19 +11034,19 @@ func (obj *OrderPaymentAddedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderPaymentAddedMessage) MarshalJSON() ([]byte, error) { - type Alias OrderPaymentAddedMessage +func (obj OrderImportedMessage) MarshalJSON() ([]byte, error) { + type Alias OrderImportedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderPaymentAdded", Alias: (*Alias)(&obj)}) + }{Action: "OrderImported", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Change PaymentState](ctp:api:type:OrderChangePaymentStateAction) update action. +* Generated after a successful [Add LineItem](ctp:api:type:StagedOrderAddLineItemAction) update action. * */ -type OrderPaymentStateChangedMessage struct { +type OrderLineItemAddedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -10780,9 +11055,9 @@ type OrderPaymentStateChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -10793,16 +11068,16 @@ type OrderPaymentStateChangedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [PaymentState](ctp:api:type:PaymentState) after the [Change Payment State](ctp:api:type:OrderChangePaymentStateAction) update action. - PaymentState PaymentState `json:"paymentState"` - // [PaymentState](ctp:api:type:PaymentState) before the [Change Payment State](ctp:api:type:OrderChangePaymentStateAction) update action. - OldPaymentState *PaymentState `json:"oldPaymentState,omitempty"` + // [Line Item](ctp:api:type:LineItem) that was added to the [Order](ctp:api:type:Order). + LineItem LineItem `json:"lineItem"` + // Quantity of [Line Items](ctp:api:type:LineItem) that were added to the [Order](ctp:api:type:Order). + AddedQuantity int `json:"addedQuantity"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderPaymentStateChangedMessage) UnmarshalJSON(data []byte) error { - type Alias OrderPaymentStateChangedMessage +func (obj *OrderLineItemAddedMessage) UnmarshalJSON(data []byte) error { + type Alias OrderLineItemAddedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -10819,19 +11094,19 @@ func (obj *OrderPaymentStateChangedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderPaymentStateChangedMessage) MarshalJSON() ([]byte, error) { - type Alias OrderPaymentStateChangedMessage +func (obj OrderLineItemAddedMessage) MarshalJSON() ([]byte, error) { + type Alias OrderLineItemAddedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderPaymentStateChanged", Alias: (*Alias)(&obj)}) + }{Action: "OrderLineItemAdded", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Set Purchase Order Number](ctp:api:type:OrderSetPurchaseOrderNumberAction) update action. +* Generated after a successful recalculation of a Discount on a [Line Item](ctp:api:type:LineItem). * */ -type OrderPurchaseOrderNumberSetMessage struct { +type OrderLineItemDiscountSetMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -10840,9 +11115,9 @@ type OrderPurchaseOrderNumberSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -10853,16 +11128,25 @@ type OrderPurchaseOrderNumberSetMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Purchase order number on the [Order](ctp:api:type:Order) after the [Set Purchase Order Number](ctp:api:type:OrderSetPurchaseOrderNumberAction) update action. - PurchaseOrderNumber *string `json:"purchaseOrderNumber,omitempty"` - // Purchase order number on the [Order](ctp:api:type:Order) before the [Set Purchase Order Number](ctp:api:type:OrderSetPurchaseOrderNumberAction) update action. - OldPurchaseOrderNumber *string `json:"oldPurchaseOrderNumber,omitempty"` + // Unique identifier for the [Line Item](ctp:api:type:LineItem). + LineItemId string `json:"lineItemId"` + // User-defined unique identifier of the LineItem. + LineItemKey *string `json:"lineItemKey,omitempty"` + // Array of [DiscountedLineItemPriceForQuantity](ctp:api:type:DiscountedLineItemPriceForQuantity) after the Discount recalculation. + DiscountedPricePerQuantity []DiscountedLineItemPriceForQuantity `json:"discountedPricePerQuantity"` + // Total Price of the [Line Item](ctp:api:type:LineItem) after the Discount recalculation. + TotalPrice CentPrecisionMoney `json:"totalPrice"` + // [TaxedItemPrice](ctp:api:type:TaxedItemPrice) of the [Line Item](ctp:api:type:LineItem) after the Discount recalculation. + TaxedPrice *TaxedItemPrice `json:"taxedPrice,omitempty"` + // Total taxed prices based on the quantity of Line Item assigned to each [Shipping Method](ctp:api:type:ShippingMethod). Only applicable for Carts with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). + // Automatically set after `perMethodTaxRate` is set. + TaxedPricePortions []MethodTaxedPrice `json:"taxedPricePortions"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderPurchaseOrderNumberSetMessage) UnmarshalJSON(data []byte) error { - type Alias OrderPurchaseOrderNumberSetMessage +func (obj *OrderLineItemDiscountSetMessage) UnmarshalJSON(data []byte) error { + type Alias OrderLineItemDiscountSetMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -10879,19 +11163,19 @@ func (obj *OrderPurchaseOrderNumberSetMessage) UnmarshalJSON(data []byte) error // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderPurchaseOrderNumberSetMessage) MarshalJSON() ([]byte, error) { - type Alias OrderPurchaseOrderNumberSetMessage +func (obj OrderLineItemDiscountSetMessage) MarshalJSON() ([]byte, error) { + type Alias OrderLineItemDiscountSetMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderPurchaseOrderNumberSet", Alias: (*Alias)(&obj)}) + }{Action: "OrderLineItemDiscountSet", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Set ReturnShipmentState](ctp:api:type:OrderSetReturnShipmentStateAction) update action on [Orders](ctp:api:type:Order) and [Order Edits](ctp:api:type:OrderEdit). +* Generated after a successful [Set LineItem DistributionChannel](/../api/projects/order-edits#set-lineitem-distributionchannel) update action. * */ -type OrderReturnShipmentStateChangedMessage struct { +type OrderLineItemDistributionChannelSetMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -10900,9 +11184,9 @@ type OrderReturnShipmentStateChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -10913,16 +11197,18 @@ type OrderReturnShipmentStateChangedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Unique identifier of the [ReturnItem](ctp:api:type:ReturnItem). - ReturnItemId string `json:"returnItemId"` - // State of the [ReturnItem](ctp:api:type:ReturnItem) after the [Set Return Shipment State](ctp:api:type:OrderSetReturnShipmentStateAction) update action. - ReturnShipmentState ReturnShipmentState `json:"returnShipmentState"` + // Unique identifier of the [Line Item](ctp:api:type:LineItem). + LineItemId string `json:"lineItemId"` + // User-defined unique identifier of the LineItem. + LineItemKey *string `json:"lineItemKey,omitempty"` + // [Distribution Channel](ctp:api:type:Channel) that was set. + DistributionChannel *ChannelReference `json:"distributionChannel,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderReturnShipmentStateChangedMessage) UnmarshalJSON(data []byte) error { - type Alias OrderReturnShipmentStateChangedMessage +func (obj *OrderLineItemDistributionChannelSetMessage) UnmarshalJSON(data []byte) error { + type Alias OrderLineItemDistributionChannelSetMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -10939,19 +11225,19 @@ func (obj *OrderReturnShipmentStateChangedMessage) UnmarshalJSON(data []byte) er // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderReturnShipmentStateChangedMessage) MarshalJSON() ([]byte, error) { - type Alias OrderReturnShipmentStateChangedMessage +func (obj OrderLineItemDistributionChannelSetMessage) MarshalJSON() ([]byte, error) { + type Alias OrderLineItemDistributionChannelSetMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderReturnShipmentStateChanged", Alias: (*Alias)(&obj)}) + }{Action: "OrderLineItemDistributionChannelSet", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Change ShipmentState](ctp:api:type:OrderChangeShipmentStateAction) update action. +* Generated after a successful [Remove LineItem](ctp:api:type:StagedOrderRemoveLineItemAction) update action. * */ -type OrderShipmentStateChangedMessage struct { +type OrderLineItemRemovedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -10960,9 +11246,9 @@ type OrderShipmentStateChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -10973,16 +11259,30 @@ type OrderShipmentStateChangedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [ShipmentState](ctp:api:type:ShipmentState) after the [Change Shipment State](ctp:api:type:OrderChangeShipmentStateAction) update action. - ShipmentState ShipmentState `json:"shipmentState"` - // [ShipmentState](ctp:api:type:ShipmentState) before the [Change Shipment State](ctp:api:type:OrderChangeShipmentStateAction) update action. - OldShipmentState *ShipmentState `json:"oldShipmentState,omitempty"` + // Unique identifier of the [Line Item](ctp:api:type:LineItem). + LineItemId string `json:"lineItemId"` + // User-defined unique identifier of the LineItem. + LineItemKey *string `json:"lineItemKey,omitempty"` + // Quantity of [Line Items](ctp:api:type:LineItem) that were removed during the [Remove LineItem](ctp:api:type:StagedOrderRemoveLineItemAction) update action. + RemovedQuantity int `json:"removedQuantity"` + // [Line Item](ctp:api:type:LineItem) quantity after the [Remove LineItem](ctp:api:type:StagedOrderRemoveLineItemAction) update action. + NewQuantity int `json:"newQuantity"` + // [ItemStates](ctp:api:type:ItemState) after the [Remove LineItem](ctp:api:type:StagedOrderRemoveLineItemAction) update action. + NewState []ItemState `json:"newState"` + // `totalPrice` of the [Order](ctp:api:type:Order) after the [Remove LineItem](ctp:api:type:StagedOrderRemoveLineItemAction) update action. + NewTotalPrice CentPrecisionMoney `json:"newTotalPrice"` + // [TaxedItemPrice](ctp:api:type:TaxedItemPrice) of the [Order](ctp:api:type:Order) after the [Remove LineItem](ctp:api:type:StagedOrderRemoveLineItemAction) update action. + NewTaxedPrice *TaxedItemPrice `json:"newTaxedPrice,omitempty"` + // [Price](ctp:api:type:Price) of the [Order](ctp:api:type:Order) after the [Remove LineItem](ctp:api:type:StagedOrderRemoveLineItemAction) update action. + NewPrice *Price `json:"newPrice,omitempty"` + // [Shipping Details](ctp:api:type:ItemShippingDetails) of the [Order](ctp:api:type:Order) after the [Remove LineItem](ctp:api:type:StagedOrderRemoveLineItemAction) update action. + NewShippingDetail *ItemShippingDetails `json:"newShippingDetail,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderShipmentStateChangedMessage) UnmarshalJSON(data []byte) error { - type Alias OrderShipmentStateChangedMessage +func (obj *OrderLineItemRemovedMessage) UnmarshalJSON(data []byte) error { + type Alias OrderLineItemRemovedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -10999,19 +11299,19 @@ func (obj *OrderShipmentStateChangedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderShipmentStateChangedMessage) MarshalJSON() ([]byte, error) { - type Alias OrderShipmentStateChangedMessage +func (obj OrderLineItemRemovedMessage) MarshalJSON() ([]byte, error) { + type Alias OrderLineItemRemovedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderShipmentStateChanged", Alias: (*Alias)(&obj)}) + }{Action: "OrderLineItemRemoved", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Set Shipping Address](ctp:api:type:OrderSetShippingAddressAction) update action. +* Generated after a successful [Add Payment](ctp:api:type:OrderAddPaymentAction) update action or when a [Payment](ctp:api:type:Payment) is added via [Order Edits](ctp:api:type:StagedOrderAddPaymentAction). * */ -type OrderShippingAddressSetMessage struct { +type OrderPaymentAddedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -11020,9 +11320,9 @@ type OrderShippingAddressSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -11033,16 +11333,14 @@ type OrderShippingAddressSetMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Shipping address on the Order after the [Set Shipping Address](ctp:api:type:OrderSetShippingAddressAction) update action. - Address *Address `json:"address,omitempty"` - // Shipping address on the Order before the [Set Shipping Address](ctp:api:type:OrderSetShippingAddressAction) update action. - OldAddress *Address `json:"oldAddress,omitempty"` + // [Payment](ctp:api:type:Payment) that was added to the [Order](ctp:api:type:Order). + Payment PaymentReference `json:"payment"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderShippingAddressSetMessage) UnmarshalJSON(data []byte) error { - type Alias OrderShippingAddressSetMessage +func (obj *OrderPaymentAddedMessage) UnmarshalJSON(data []byte) error { + type Alias OrderPaymentAddedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -11059,19 +11357,19 @@ func (obj *OrderShippingAddressSetMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderShippingAddressSetMessage) MarshalJSON() ([]byte, error) { - type Alias OrderShippingAddressSetMessage +func (obj OrderPaymentAddedMessage) MarshalJSON() ([]byte, error) { + type Alias OrderPaymentAddedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderShippingAddressSet", Alias: (*Alias)(&obj)}) + }{Action: "OrderPaymentAdded", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Set ShippingMethod](ctp:api:type:StagedOrderSetShippingMethodAction) and [Set Custom ShippingMethod](ctp:api:type:StagedOrderSetCustomShippingMethodAction) update actions. +* Generated after a successful [Change PaymentState](ctp:api:type:OrderChangePaymentStateAction) update action. * */ -type OrderShippingInfoSetMessage struct { +type OrderPaymentStateChangedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -11080,9 +11378,9 @@ type OrderShippingInfoSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -11093,16 +11391,16 @@ type OrderShippingInfoSetMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [ShippingInfo](ctp:api:type:ShippingInfo) after the [Set Shipping Method](ctp:api:type:StagedOrderSetShippingMethodAction) or [Set Custom Shipping Method](ctp:api:type:StagedOrderSetCustomShippingMethodAction) update action. - ShippingInfo *ShippingInfo `json:"shippingInfo,omitempty"` - // [ShippingInfo](ctp:api:type:ShippingInfo) before the [Set Shipping Method](ctp:api:type:StagedOrderSetShippingMethodAction) or [Set Custom Shipping Method](ctp:api:type:StagedOrderSetCustomShippingMethodAction) update action. - OldShippingInfo *ShippingInfo `json:"oldShippingInfo,omitempty"` + // [PaymentState](ctp:api:type:PaymentState) after the [Change Payment State](ctp:api:type:OrderChangePaymentStateAction) update action. + PaymentState PaymentState `json:"paymentState"` + // [PaymentState](ctp:api:type:PaymentState) before the [Change Payment State](ctp:api:type:OrderChangePaymentStateAction) update action. + OldPaymentState *PaymentState `json:"oldPaymentState,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderShippingInfoSetMessage) UnmarshalJSON(data []byte) error { - type Alias OrderShippingInfoSetMessage +func (obj *OrderPaymentStateChangedMessage) UnmarshalJSON(data []byte) error { + type Alias OrderPaymentStateChangedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -11119,19 +11417,19 @@ func (obj *OrderShippingInfoSetMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderShippingInfoSetMessage) MarshalJSON() ([]byte, error) { - type Alias OrderShippingInfoSetMessage +func (obj OrderPaymentStateChangedMessage) MarshalJSON() ([]byte, error) { + type Alias OrderPaymentStateChangedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderShippingInfoSet", Alias: (*Alias)(&obj)}) + }{Action: "OrderPaymentStateChanged", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Set ShippingRateInput](ctp:api:type:StagedOrderSetShippingRateInputAction) update action. +* Generated after a successful [Set Purchase Order Number](ctp:api:type:OrderSetPurchaseOrderNumberAction) update action. * */ -type OrderShippingRateInputSetMessage struct { +type OrderPurchaseOrderNumberSetMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -11140,9 +11438,9 @@ type OrderShippingRateInputSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -11153,16 +11451,16 @@ type OrderShippingRateInputSetMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [ShippingRateInput](ctp:api:type:ShippingRateInput) after the [Set ShippingRateInput](ctp:api:type:StagedOrderSetShippingRateInputAction) update action. - ShippingRateInput ShippingRateInput `json:"shippingRateInput,omitempty"` - // [ShippingRateInput](ctp:api:type:ShippingRateInput) before the [Set ShippingRateInput](ctp:api:type:StagedOrderSetShippingRateInputAction) update action. - OldShippingRateInput ShippingRateInput `json:"oldShippingRateInput,omitempty"` + // Purchase order number on the [Order](ctp:api:type:Order) after the [Set Purchase Order Number](ctp:api:type:OrderSetPurchaseOrderNumberAction) update action. + PurchaseOrderNumber *string `json:"purchaseOrderNumber,omitempty"` + // Purchase order number on the [Order](ctp:api:type:Order) before the [Set Purchase Order Number](ctp:api:type:OrderSetPurchaseOrderNumberAction) update action. + OldPurchaseOrderNumber *string `json:"oldPurchaseOrderNumber,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderShippingRateInputSetMessage) UnmarshalJSON(data []byte) error { - type Alias OrderShippingRateInputSetMessage +func (obj *OrderPurchaseOrderNumberSetMessage) UnmarshalJSON(data []byte) error { + type Alias OrderPurchaseOrderNumberSetMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -11173,20 +11471,320 @@ func (obj *OrderShippingRateInputSetMessage) UnmarshalJSON(data []byte) error { return err } } - if obj.ShippingRateInput != nil { - var err error - obj.ShippingRateInput, err = mapDiscriminatorShippingRateInput(obj.ShippingRateInput) - if err != nil { - return err - } - } - if obj.OldShippingRateInput != nil { - var err error - obj.OldShippingRateInput, err = mapDiscriminatorShippingRateInput(obj.OldShippingRateInput) - if err != nil { - return err - } - } + + return nil +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj OrderPurchaseOrderNumberSetMessage) MarshalJSON() ([]byte, error) { + type Alias OrderPurchaseOrderNumberSetMessage + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "OrderPurchaseOrderNumberSet", Alias: (*Alias)(&obj)}) +} + +/** +* Generated after a successful [Set ReturnShipmentState](ctp:api:type:OrderSetReturnShipmentStateAction) update action on [Orders](ctp:api:type:Order) and [Order Edits](ctp:api:type:OrderEdit). +* + */ +type OrderReturnShipmentStateChangedMessage struct { + // Unique identifier of the Message. Can be used to track which Messages have been processed. + ID string `json:"id"` + // Version of a resource. In case of Messages, this is always `1`. + Version int `json:"version"` + // Date and time (UTC) the Message was generated. + CreatedAt time.Time `json:"createdAt"` + // Value of `createdAt`. + LastModifiedAt time.Time `json:"lastModifiedAt"` + // IDs and references that last modified the Message. + LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` + // IDs and references that created the Message. + CreatedBy *CreatedBy `json:"createdBy,omitempty"` + // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. + // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. + SequenceNumber int `json:"sequenceNumber"` + // [Reference](ctp:api:type:Reference) to the resource on which the change or action was performed. + Resource Reference `json:"resource"` + // Version of the resource on which the change or action was performed. + ResourceVersion int `json:"resourceVersion"` + // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. + ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` + // Unique identifier of the [ReturnItem](ctp:api:type:ReturnItem). + ReturnItemId string `json:"returnItemId"` + // State of the [ReturnItem](ctp:api:type:ReturnItem) after the [Set Return Shipment State](ctp:api:type:OrderSetReturnShipmentStateAction) update action. + ReturnShipmentState ReturnShipmentState `json:"returnShipmentState"` +} + +// UnmarshalJSON override to deserialize correct attribute types based +// on the discriminator value +func (obj *OrderReturnShipmentStateChangedMessage) UnmarshalJSON(data []byte) error { + type Alias OrderReturnShipmentStateChangedMessage + if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + return err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return err + } + } + + return nil +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj OrderReturnShipmentStateChangedMessage) MarshalJSON() ([]byte, error) { + type Alias OrderReturnShipmentStateChangedMessage + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "OrderReturnShipmentStateChanged", Alias: (*Alias)(&obj)}) +} + +/** +* Generated after a successful [Change ShipmentState](ctp:api:type:OrderChangeShipmentStateAction) update action. +* + */ +type OrderShipmentStateChangedMessage struct { + // Unique identifier of the Message. Can be used to track which Messages have been processed. + ID string `json:"id"` + // Version of a resource. In case of Messages, this is always `1`. + Version int `json:"version"` + // Date and time (UTC) the Message was generated. + CreatedAt time.Time `json:"createdAt"` + // Value of `createdAt`. + LastModifiedAt time.Time `json:"lastModifiedAt"` + // IDs and references that last modified the Message. + LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` + // IDs and references that created the Message. + CreatedBy *CreatedBy `json:"createdBy,omitempty"` + // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. + // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. + SequenceNumber int `json:"sequenceNumber"` + // [Reference](ctp:api:type:Reference) to the resource on which the change or action was performed. + Resource Reference `json:"resource"` + // Version of the resource on which the change or action was performed. + ResourceVersion int `json:"resourceVersion"` + // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. + ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` + // [ShipmentState](ctp:api:type:ShipmentState) after the [Change Shipment State](ctp:api:type:OrderChangeShipmentStateAction) update action. + ShipmentState ShipmentState `json:"shipmentState"` + // [ShipmentState](ctp:api:type:ShipmentState) before the [Change Shipment State](ctp:api:type:OrderChangeShipmentStateAction) update action. + OldShipmentState *ShipmentState `json:"oldShipmentState,omitempty"` +} + +// UnmarshalJSON override to deserialize correct attribute types based +// on the discriminator value +func (obj *OrderShipmentStateChangedMessage) UnmarshalJSON(data []byte) error { + type Alias OrderShipmentStateChangedMessage + if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + return err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return err + } + } + + return nil +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj OrderShipmentStateChangedMessage) MarshalJSON() ([]byte, error) { + type Alias OrderShipmentStateChangedMessage + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "OrderShipmentStateChanged", Alias: (*Alias)(&obj)}) +} + +/** +* Generated after a successful [Set Shipping Address](ctp:api:type:OrderSetShippingAddressAction) update action. +* + */ +type OrderShippingAddressSetMessage struct { + // Unique identifier of the Message. Can be used to track which Messages have been processed. + ID string `json:"id"` + // Version of a resource. In case of Messages, this is always `1`. + Version int `json:"version"` + // Date and time (UTC) the Message was generated. + CreatedAt time.Time `json:"createdAt"` + // Value of `createdAt`. + LastModifiedAt time.Time `json:"lastModifiedAt"` + // IDs and references that last modified the Message. + LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` + // IDs and references that created the Message. + CreatedBy *CreatedBy `json:"createdBy,omitempty"` + // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. + // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. + SequenceNumber int `json:"sequenceNumber"` + // [Reference](ctp:api:type:Reference) to the resource on which the change or action was performed. + Resource Reference `json:"resource"` + // Version of the resource on which the change or action was performed. + ResourceVersion int `json:"resourceVersion"` + // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. + ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` + // Shipping address on the Order after the [Set Shipping Address](ctp:api:type:OrderSetShippingAddressAction) update action. + Address *Address `json:"address,omitempty"` + // Shipping address on the Order before the [Set Shipping Address](ctp:api:type:OrderSetShippingAddressAction) update action. + OldAddress *Address `json:"oldAddress,omitempty"` +} + +// UnmarshalJSON override to deserialize correct attribute types based +// on the discriminator value +func (obj *OrderShippingAddressSetMessage) UnmarshalJSON(data []byte) error { + type Alias OrderShippingAddressSetMessage + if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + return err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return err + } + } + + return nil +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj OrderShippingAddressSetMessage) MarshalJSON() ([]byte, error) { + type Alias OrderShippingAddressSetMessage + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "OrderShippingAddressSet", Alias: (*Alias)(&obj)}) +} + +/** +* Generated after a successful [Set ShippingMethod](ctp:api:type:StagedOrderSetShippingMethodAction) and [Set Custom ShippingMethod](ctp:api:type:StagedOrderSetCustomShippingMethodAction) update actions. +* + */ +type OrderShippingInfoSetMessage struct { + // Unique identifier of the Message. Can be used to track which Messages have been processed. + ID string `json:"id"` + // Version of a resource. In case of Messages, this is always `1`. + Version int `json:"version"` + // Date and time (UTC) the Message was generated. + CreatedAt time.Time `json:"createdAt"` + // Value of `createdAt`. + LastModifiedAt time.Time `json:"lastModifiedAt"` + // IDs and references that last modified the Message. + LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` + // IDs and references that created the Message. + CreatedBy *CreatedBy `json:"createdBy,omitempty"` + // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. + // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. + SequenceNumber int `json:"sequenceNumber"` + // [Reference](ctp:api:type:Reference) to the resource on which the change or action was performed. + Resource Reference `json:"resource"` + // Version of the resource on which the change or action was performed. + ResourceVersion int `json:"resourceVersion"` + // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. + ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` + // [ShippingInfo](ctp:api:type:ShippingInfo) after the [Set Shipping Method](ctp:api:type:StagedOrderSetShippingMethodAction) or [Set Custom Shipping Method](ctp:api:type:StagedOrderSetCustomShippingMethodAction) update action. + ShippingInfo *ShippingInfo `json:"shippingInfo,omitempty"` + // [ShippingInfo](ctp:api:type:ShippingInfo) before the [Set Shipping Method](ctp:api:type:StagedOrderSetShippingMethodAction) or [Set Custom Shipping Method](ctp:api:type:StagedOrderSetCustomShippingMethodAction) update action. + OldShippingInfo *ShippingInfo `json:"oldShippingInfo,omitempty"` +} + +// UnmarshalJSON override to deserialize correct attribute types based +// on the discriminator value +func (obj *OrderShippingInfoSetMessage) UnmarshalJSON(data []byte) error { + type Alias OrderShippingInfoSetMessage + if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + return err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return err + } + } + + return nil +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj OrderShippingInfoSetMessage) MarshalJSON() ([]byte, error) { + type Alias OrderShippingInfoSetMessage + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "OrderShippingInfoSet", Alias: (*Alias)(&obj)}) +} + +/** +* Generated after a successful [Set ShippingRateInput](ctp:api:type:StagedOrderSetShippingRateInputAction) update action. +* + */ +type OrderShippingRateInputSetMessage struct { + // Unique identifier of the Message. Can be used to track which Messages have been processed. + ID string `json:"id"` + // Version of a resource. In case of Messages, this is always `1`. + Version int `json:"version"` + // Date and time (UTC) the Message was generated. + CreatedAt time.Time `json:"createdAt"` + // Value of `createdAt`. + LastModifiedAt time.Time `json:"lastModifiedAt"` + // IDs and references that last modified the Message. + LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` + // IDs and references that created the Message. + CreatedBy *CreatedBy `json:"createdBy,omitempty"` + // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. + // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. + SequenceNumber int `json:"sequenceNumber"` + // [Reference](ctp:api:type:Reference) to the resource on which the change or action was performed. + Resource Reference `json:"resource"` + // Version of the resource on which the change or action was performed. + ResourceVersion int `json:"resourceVersion"` + // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. + ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` + // [ShippingRateInput](ctp:api:type:ShippingRateInput) after the [Set ShippingRateInput](ctp:api:type:StagedOrderSetShippingRateInputAction) update action. + ShippingRateInput ShippingRateInput `json:"shippingRateInput,omitempty"` + // [ShippingRateInput](ctp:api:type:ShippingRateInput) before the [Set ShippingRateInput](ctp:api:type:StagedOrderSetShippingRateInputAction) update action. + OldShippingRateInput ShippingRateInput `json:"oldShippingRateInput,omitempty"` +} + +// UnmarshalJSON override to deserialize correct attribute types based +// on the discriminator value +func (obj *OrderShippingRateInputSetMessage) UnmarshalJSON(data []byte) error { + type Alias OrderShippingRateInputSetMessage + if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + return err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return err + } + } + if obj.ShippingRateInput != nil { + var err error + obj.ShippingRateInput, err = mapDiscriminatorShippingRateInput(obj.ShippingRateInput) + if err != nil { + return err + } + } + if obj.OldShippingRateInput != nil { + var err error + obj.OldShippingRateInput, err = mapDiscriminatorShippingRateInput(obj.OldShippingRateInput) + if err != nil { + return err + } + } return nil } @@ -11198,14 +11796,256 @@ func (obj OrderShippingRateInputSetMessage) MarshalJSON() ([]byte, error) { return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderShippingRateInputSet", Alias: (*Alias)(&obj)}) + }{Action: "OrderShippingRateInputSet", Alias: (*Alias)(&obj)}) +} + +/** +* Generated after a successful [Change OrderState](ctp:api:type:OrderChangeOrderStateAction) update action. +* + */ +type OrderStateChangedMessage struct { + // Unique identifier of the Message. Can be used to track which Messages have been processed. + ID string `json:"id"` + // Version of a resource. In case of Messages, this is always `1`. + Version int `json:"version"` + // Date and time (UTC) the Message was generated. + CreatedAt time.Time `json:"createdAt"` + // Value of `createdAt`. + LastModifiedAt time.Time `json:"lastModifiedAt"` + // IDs and references that last modified the Message. + LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` + // IDs and references that created the Message. + CreatedBy *CreatedBy `json:"createdBy,omitempty"` + // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. + // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. + SequenceNumber int `json:"sequenceNumber"` + // [Reference](ctp:api:type:Reference) to the resource on which the change or action was performed. + Resource Reference `json:"resource"` + // Version of the resource on which the change or action was performed. + ResourceVersion int `json:"resourceVersion"` + // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. + ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` + // [OrderState](ctp:api:type:OrderState) after the [Change Order State](ctp:api:type:OrderChangeOrderStateAction) update action. + OrderState OrderState `json:"orderState"` + // [OrderState](ctp:api:type:OrderState) before the [Change Order State](ctp:api:type:OrderChangeOrderStateAction) update action. + OldOrderState *OrderState `json:"oldOrderState,omitempty"` +} + +// UnmarshalJSON override to deserialize correct attribute types based +// on the discriminator value +func (obj *OrderStateChangedMessage) UnmarshalJSON(data []byte) error { + type Alias OrderStateChangedMessage + if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + return err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return err + } + } + + return nil +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj OrderStateChangedMessage) MarshalJSON() ([]byte, error) { + type Alias OrderStateChangedMessage + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "OrderStateChanged", Alias: (*Alias)(&obj)}) +} + +/** +* Generated after a successful [Transition State](ctp:api:type:OrderTransitionStateAction) update action. +* + */ +type OrderStateTransitionMessage struct { + // Unique identifier of the Message. Can be used to track which Messages have been processed. + ID string `json:"id"` + // Version of a resource. In case of Messages, this is always `1`. + Version int `json:"version"` + // Date and time (UTC) the Message was generated. + CreatedAt time.Time `json:"createdAt"` + // Value of `createdAt`. + LastModifiedAt time.Time `json:"lastModifiedAt"` + // IDs and references that last modified the Message. + LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` + // IDs and references that created the Message. + CreatedBy *CreatedBy `json:"createdBy,omitempty"` + // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. + // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. + SequenceNumber int `json:"sequenceNumber"` + // [Reference](ctp:api:type:Reference) to the resource on which the change or action was performed. + Resource Reference `json:"resource"` + // Version of the resource on which the change or action was performed. + ResourceVersion int `json:"resourceVersion"` + // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. + ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` + // [OrderState](ctp:api:type:OrderState) after the [Transition State](ctp:api:type:OrderTransitionStateAction) update action. + State StateReference `json:"state"` + // [OrderState](ctp:api:type:OrderState) before the [Transition State](ctp:api:type:OrderTransitionStateAction) update action. + OldState *StateReference `json:"oldState,omitempty"` + // Whether [State](ctp:api:type:State) transition validations were turned off during the [Transition State](ctp:api:type:OrderTransitionStateAction) update action. + Force bool `json:"force"` +} + +// UnmarshalJSON override to deserialize correct attribute types based +// on the discriminator value +func (obj *OrderStateTransitionMessage) UnmarshalJSON(data []byte) error { + type Alias OrderStateTransitionMessage + if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + return err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return err + } + } + + return nil +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj OrderStateTransitionMessage) MarshalJSON() ([]byte, error) { + type Alias OrderStateTransitionMessage + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "OrderStateTransition", Alias: (*Alias)(&obj)}) +} + +/** +* Generated after a successful [Set Store](ctp:api:type:OrderSetStoreAction) update action. +* + */ +type OrderStoreSetMessage struct { + // Unique identifier of the Message. Can be used to track which Messages have been processed. + ID string `json:"id"` + // Version of a resource. In case of Messages, this is always `1`. + Version int `json:"version"` + // Date and time (UTC) the Message was generated. + CreatedAt time.Time `json:"createdAt"` + // Value of `createdAt`. + LastModifiedAt time.Time `json:"lastModifiedAt"` + // IDs and references that last modified the Message. + LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` + // IDs and references that created the Message. + CreatedBy *CreatedBy `json:"createdBy,omitempty"` + // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. + // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. + SequenceNumber int `json:"sequenceNumber"` + // [Reference](ctp:api:type:Reference) to the resource on which the change or action was performed. + Resource Reference `json:"resource"` + // Version of the resource on which the change or action was performed. + ResourceVersion int `json:"resourceVersion"` + // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. + ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` + // [Store](ctp:api:type:Store) that was set. + Store *StoreKeyReference `json:"store,omitempty"` +} + +// UnmarshalJSON override to deserialize correct attribute types based +// on the discriminator value +func (obj *OrderStoreSetMessage) UnmarshalJSON(data []byte) error { + type Alias OrderStoreSetMessage + if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + return err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return err + } + } + + return nil +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj OrderStoreSetMessage) MarshalJSON() ([]byte, error) { + type Alias OrderStoreSetMessage + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "OrderStoreSet", Alias: (*Alias)(&obj)}) +} + +/** +* Generated after a successful [Add Parcel to Delivery](ctp:api:type:OrderAddParcelToDeliveryAction) update action. +* + */ +type ParcelAddedToDeliveryMessage struct { + // Unique identifier of the Message. Can be used to track which Messages have been processed. + ID string `json:"id"` + // Version of a resource. In case of Messages, this is always `1`. + Version int `json:"version"` + // Date and time (UTC) the Message was generated. + CreatedAt time.Time `json:"createdAt"` + // Value of `createdAt`. + LastModifiedAt time.Time `json:"lastModifiedAt"` + // IDs and references that last modified the Message. + LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` + // IDs and references that created the Message. + CreatedBy *CreatedBy `json:"createdBy,omitempty"` + // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. + // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. + SequenceNumber int `json:"sequenceNumber"` + // [Reference](ctp:api:type:Reference) to the resource on which the change or action was performed. + Resource Reference `json:"resource"` + // Version of the resource on which the change or action was performed. + ResourceVersion int `json:"resourceVersion"` + // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. + ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` + // Unique identifier of the [Delivery](ctp:api:type:Delivery). + Delivery Delivery `json:"delivery"` + // [Parcel](ctp:api:type:Parcel) that was added to the [Delivery](ctp:api:type:Delivery). + Parcel Parcel `json:"parcel"` + // User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). + ShippingKey *string `json:"shippingKey,omitempty"` +} + +// UnmarshalJSON override to deserialize correct attribute types based +// on the discriminator value +func (obj *ParcelAddedToDeliveryMessage) UnmarshalJSON(data []byte) error { + type Alias ParcelAddedToDeliveryMessage + if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + return err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return err + } + } + + return nil +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ParcelAddedToDeliveryMessage) MarshalJSON() ([]byte, error) { + type Alias ParcelAddedToDeliveryMessage + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "ParcelAddedToDelivery", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Change OrderState](ctp:api:type:OrderChangeOrderStateAction) update action. +* Generated after a successful [Set Parcel Items](ctp:api:type:OrderSetParcelItemsAction) update action. * */ -type OrderStateChangedMessage struct { +type ParcelItemsUpdatedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -11214,9 +12054,9 @@ type OrderStateChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -11227,16 +12067,22 @@ type OrderStateChangedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [OrderState](ctp:api:type:OrderState) after the [Change Order State](ctp:api:type:OrderChangeOrderStateAction) update action. - OrderState OrderState `json:"orderState"` - // [OrderState](ctp:api:type:OrderState) before the [Change Order State](ctp:api:type:OrderChangeOrderStateAction) update action. - OldOrderState *OrderState `json:"oldOrderState,omitempty"` + // Unique identifier of the [Parcel](ctp:api:type:Parcel). + ParcelId string `json:"parcelId"` + // Unique identifier of the [Delivery](ctp:api:type:Delivery). + DeliveryId string `json:"deliveryId"` + // [Delivery Items](ctp:api:type:DeliveryItem) after the [Set Parcel Items](ctp:api:type:OrderSetParcelItemsAction) update action. + Items []DeliveryItem `json:"items"` + // [Delivery Items](ctp:api:type:DeliveryItem) before the [Set Parcel Items](ctp:api:type:OrderSetParcelItemsAction) update action. + OldItems []DeliveryItem `json:"oldItems"` + // User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). + ShippingKey *string `json:"shippingKey,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderStateChangedMessage) UnmarshalJSON(data []byte) error { - type Alias OrderStateChangedMessage +func (obj *ParcelItemsUpdatedMessage) UnmarshalJSON(data []byte) error { + type Alias ParcelItemsUpdatedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -11253,19 +12099,19 @@ func (obj *OrderStateChangedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderStateChangedMessage) MarshalJSON() ([]byte, error) { - type Alias OrderStateChangedMessage +func (obj ParcelItemsUpdatedMessage) MarshalJSON() ([]byte, error) { + type Alias ParcelItemsUpdatedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderStateChanged", Alias: (*Alias)(&obj)}) + }{Action: "ParcelItemsUpdated", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Transition State](ctp:api:type:OrderTransitionStateAction) update action. +* Generated after a successful [Set Parcel Measurements](ctp:api:type:OrderSetParcelMeasurementsAction) update action. * */ -type OrderStateTransitionMessage struct { +type ParcelMeasurementsUpdatedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -11274,9 +12120,9 @@ type OrderStateTransitionMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -11287,18 +12133,20 @@ type OrderStateTransitionMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [OrderState](ctp:api:type:OrderState) after the [Transition State](ctp:api:type:OrderTransitionStateAction) update action. - State StateReference `json:"state"` - // [OrderState](ctp:api:type:OrderState) before the [Transition State](ctp:api:type:OrderTransitionStateAction) update action. - OldState *StateReference `json:"oldState,omitempty"` - // Whether [State](ctp:api:type:State) transition validations were turned off during the [Transition State](ctp:api:type:OrderTransitionStateAction) update action. - Force bool `json:"force"` + // Unique identifier of the [Delivery](ctp:api:type:Delivery). + DeliveryId string `json:"deliveryId"` + // Unique identifier of the [Parcel](ctp:api:type:Parcel). + ParcelId string `json:"parcelId"` + // The [Parcel Measurements](ctp:api:type:ParcelMeasurements) that were set on the [Parcel](ctp:api:type:Parcel). + Measurements *ParcelMeasurements `json:"measurements,omitempty"` + // User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). + ShippingKey *string `json:"shippingKey,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderStateTransitionMessage) UnmarshalJSON(data []byte) error { - type Alias OrderStateTransitionMessage +func (obj *ParcelMeasurementsUpdatedMessage) UnmarshalJSON(data []byte) error { + type Alias ParcelMeasurementsUpdatedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -11315,19 +12163,19 @@ func (obj *OrderStateTransitionMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderStateTransitionMessage) MarshalJSON() ([]byte, error) { - type Alias OrderStateTransitionMessage +func (obj ParcelMeasurementsUpdatedMessage) MarshalJSON() ([]byte, error) { + type Alias ParcelMeasurementsUpdatedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderStateTransition", Alias: (*Alias)(&obj)}) + }{Action: "ParcelMeasurementsUpdated", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Set Store](ctp:api:type:OrderSetStoreAction) update action. +* Generated after a successful [Remove Parcel from Delivery](ctp:api:type:OrderRemoveParcelFromDeliveryAction) update action. * */ -type OrderStoreSetMessage struct { +type ParcelRemovedFromDeliveryMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -11336,9 +12184,9 @@ type OrderStoreSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -11349,14 +12197,18 @@ type OrderStoreSetMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [Store](ctp:api:type:Store) that was set. - Store *StoreKeyReference `json:"store,omitempty"` + // Unique identifier of the [Delivery](ctp:api:type:Delivery). + DeliveryId string `json:"deliveryId"` + // [Parcel](ctp:api:type:Parcel) that was removed from the [Delivery](ctp:api:type:Delivery). + Parcel Parcel `json:"parcel"` + // User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). + ShippingKey *string `json:"shippingKey,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *OrderStoreSetMessage) UnmarshalJSON(data []byte) error { - type Alias OrderStoreSetMessage +func (obj *ParcelRemovedFromDeliveryMessage) UnmarshalJSON(data []byte) error { + type Alias ParcelRemovedFromDeliveryMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -11373,19 +12225,19 @@ func (obj *OrderStoreSetMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj OrderStoreSetMessage) MarshalJSON() ([]byte, error) { - type Alias OrderStoreSetMessage +func (obj ParcelRemovedFromDeliveryMessage) MarshalJSON() ([]byte, error) { + type Alias ParcelRemovedFromDeliveryMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "OrderStoreSet", Alias: (*Alias)(&obj)}) + }{Action: "ParcelRemovedFromDelivery", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Add Parcel to Delivery](ctp:api:type:OrderAddParcelToDeliveryAction) update action. +* Generated after a successful [Set Parcel Tracking Data](ctp:api:type:OrderSetParcelTrackingDataAction) update action. * */ -type ParcelAddedToDeliveryMessage struct { +type ParcelTrackingDataUpdatedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -11394,9 +12246,9 @@ type ParcelAddedToDeliveryMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -11408,17 +12260,19 @@ type ParcelAddedToDeliveryMessage struct { // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` // Unique identifier of the [Delivery](ctp:api:type:Delivery). - Delivery Delivery `json:"delivery"` - // [Parcel](ctp:api:type:Parcel) that was added to the [Delivery](ctp:api:type:Delivery). - Parcel Parcel `json:"parcel"` + DeliveryId string `json:"deliveryId"` + // Unique identifier of the [Parcel](ctp:api:type:Parcel). + ParcelId string `json:"parcelId"` + // The [Tracking Data](ctp:api:type:TrackingData) that was added to the [Parcel](ctp:api:type:Parcel). + TrackingData *TrackingData `json:"trackingData,omitempty"` // User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). ShippingKey *string `json:"shippingKey,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *ParcelAddedToDeliveryMessage) UnmarshalJSON(data []byte) error { - type Alias ParcelAddedToDeliveryMessage +func (obj *ParcelTrackingDataUpdatedMessage) UnmarshalJSON(data []byte) error { + type Alias ParcelTrackingDataUpdatedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -11435,19 +12289,19 @@ func (obj *ParcelAddedToDeliveryMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj ParcelAddedToDeliveryMessage) MarshalJSON() ([]byte, error) { - type Alias ParcelAddedToDeliveryMessage +func (obj ParcelTrackingDataUpdatedMessage) MarshalJSON() ([]byte, error) { + type Alias ParcelTrackingDataUpdatedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "ParcelAddedToDelivery", Alias: (*Alias)(&obj)}) + }{Action: "ParcelTrackingDataUpdated", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Set Parcel Items](ctp:api:type:OrderSetParcelItemsAction) update action. +* Generated after a successful [Create Payment](ctp:api:endpoint:/{projectKey}/payments:POST) request. * */ -type ParcelItemsUpdatedMessage struct { +type PaymentCreatedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -11456,9 +12310,9 @@ type ParcelItemsUpdatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -11469,22 +12323,14 @@ type ParcelItemsUpdatedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Unique identifier of the [Parcel](ctp:api:type:Parcel). - ParcelId string `json:"parcelId"` - // Unique identifier of the [Delivery](ctp:api:type:Delivery). - DeliveryId string `json:"deliveryId"` - // [Delivery Items](ctp:api:type:DeliveryItem) after the [Set Parcel Items](ctp:api:type:OrderSetParcelItemsAction) update action. - Items []DeliveryItem `json:"items"` - // [Delivery Items](ctp:api:type:DeliveryItem) before the [Set Parcel Items](ctp:api:type:OrderSetParcelItemsAction) update action. - OldItems []DeliveryItem `json:"oldItems"` - // User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). - ShippingKey *string `json:"shippingKey,omitempty"` + // [Payment](ctp:api:type:Payment) that was created. + Payment Payment `json:"payment"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *ParcelItemsUpdatedMessage) UnmarshalJSON(data []byte) error { - type Alias ParcelItemsUpdatedMessage +func (obj *PaymentCreatedMessage) UnmarshalJSON(data []byte) error { + type Alias PaymentCreatedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -11501,19 +12347,19 @@ func (obj *ParcelItemsUpdatedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj ParcelItemsUpdatedMessage) MarshalJSON() ([]byte, error) { - type Alias ParcelItemsUpdatedMessage +func (obj PaymentCreatedMessage) MarshalJSON() ([]byte, error) { + type Alias PaymentCreatedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "ParcelItemsUpdated", Alias: (*Alias)(&obj)}) + }{Action: "PaymentCreated", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Set Parcel Measurements](ctp:api:type:OrderSetParcelMeasurementsAction) update action. +* Generated after a successful [Add InterfaceInteraction](ctp:api:type:PaymentAddInterfaceInteractionAction) update action. * */ -type ParcelMeasurementsUpdatedMessage struct { +type PaymentInteractionAddedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -11522,9 +12368,9 @@ type ParcelMeasurementsUpdatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -11535,20 +12381,14 @@ type ParcelMeasurementsUpdatedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Unique identifier of the [Delivery](ctp:api:type:Delivery). - DeliveryId string `json:"deliveryId"` - // Unique identifier of the [Parcel](ctp:api:type:Parcel). - ParcelId string `json:"parcelId"` - // The [Parcel Measurements](ctp:api:type:ParcelMeasurements) that were set on the [Parcel](ctp:api:type:Parcel). - Measurements *ParcelMeasurements `json:"measurements,omitempty"` - // User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). - ShippingKey *string `json:"shippingKey,omitempty"` + // The interface interaction that was added to the [Payment](ctp:api:type:Payment). + Interaction CustomFields `json:"interaction"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *ParcelMeasurementsUpdatedMessage) UnmarshalJSON(data []byte) error { - type Alias ParcelMeasurementsUpdatedMessage +func (obj *PaymentInteractionAddedMessage) UnmarshalJSON(data []byte) error { + type Alias PaymentInteractionAddedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -11565,19 +12405,19 @@ func (obj *ParcelMeasurementsUpdatedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj ParcelMeasurementsUpdatedMessage) MarshalJSON() ([]byte, error) { - type Alias ParcelMeasurementsUpdatedMessage +func (obj PaymentInteractionAddedMessage) MarshalJSON() ([]byte, error) { + type Alias PaymentInteractionAddedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "ParcelMeasurementsUpdated", Alias: (*Alias)(&obj)}) + }{Action: "PaymentInteractionAdded", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Remove Parcel from Delivery](ctp:api:type:OrderRemoveParcelFromDeliveryAction) update action. +* Generated after a successful [Set StatusInterfaceCode](ctp:api:type:PaymentSetStatusInterfaceCodeAction) update action. * */ -type ParcelRemovedFromDeliveryMessage struct { +type PaymentStatusInterfaceCodeSetMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -11586,9 +12426,9 @@ type ParcelRemovedFromDeliveryMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -11599,18 +12439,76 @@ type ParcelRemovedFromDeliveryMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Unique identifier of the [Delivery](ctp:api:type:Delivery). - DeliveryId string `json:"deliveryId"` - // [Parcel](ctp:api:type:Parcel) that was removed from the [Delivery](ctp:api:type:Delivery). - Parcel Parcel `json:"parcel"` - // User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). - ShippingKey *string `json:"shippingKey,omitempty"` + // Unique identifier for the [Payment](ctp:api:type:Payment) for which the [Set StatusInterfaceCode](ctp:api:type:PaymentSetStatusInterfaceCodeAction) update action was applied. + PaymentId string `json:"paymentId"` + // The `interfaceCode` that was set during the [Set StatusInterfaceCode](ctp:api:type:PaymentSetStatusInterfaceCodeAction) update action. + InterfaceCode *string `json:"interfaceCode,omitempty"` +} + +// UnmarshalJSON override to deserialize correct attribute types based +// on the discriminator value +func (obj *PaymentStatusInterfaceCodeSetMessage) UnmarshalJSON(data []byte) error { + type Alias PaymentStatusInterfaceCodeSetMessage + if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + return err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return err + } + } + + return nil +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj PaymentStatusInterfaceCodeSetMessage) MarshalJSON() ([]byte, error) { + type Alias PaymentStatusInterfaceCodeSetMessage + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "PaymentStatusInterfaceCodeSet", Alias: (*Alias)(&obj)}) +} + +/** +* Generated after a successful [Transition State](ctp:api:type:PaymentTransitionStateAction) update action. +* + */ +type PaymentStatusStateTransitionMessage struct { + // Unique identifier of the Message. Can be used to track which Messages have been processed. + ID string `json:"id"` + // Version of a resource. In case of Messages, this is always `1`. + Version int `json:"version"` + // Date and time (UTC) the Message was generated. + CreatedAt time.Time `json:"createdAt"` + // Value of `createdAt`. + LastModifiedAt time.Time `json:"lastModifiedAt"` + // IDs and references that last modified the Message. + LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` + // IDs and references that created the Message. + CreatedBy *CreatedBy `json:"createdBy,omitempty"` + // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. + // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. + SequenceNumber int `json:"sequenceNumber"` + // [Reference](ctp:api:type:Reference) to the resource on which the change or action was performed. + Resource Reference `json:"resource"` + // Version of the resource on which the change or action was performed. + ResourceVersion int `json:"resourceVersion"` + // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. + ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` + // [State](ctp:api:type:State) of the [Payment](ctp:api:type:Payment) after the [Transition State](ctp:api:type:PaymentTransitionStateAction) update action. + State StateReference `json:"state"` + // Whether [State](ctp:api:type:State) transition validations were turned off during the [Change Transaction State](ctp:api:type:PaymentChangeTransactionStateAction) update action. + Force bool `json:"force"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *ParcelRemovedFromDeliveryMessage) UnmarshalJSON(data []byte) error { - type Alias ParcelRemovedFromDeliveryMessage +func (obj *PaymentStatusStateTransitionMessage) UnmarshalJSON(data []byte) error { + type Alias PaymentStatusStateTransitionMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -11627,19 +12525,19 @@ func (obj *ParcelRemovedFromDeliveryMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj ParcelRemovedFromDeliveryMessage) MarshalJSON() ([]byte, error) { - type Alias ParcelRemovedFromDeliveryMessage +func (obj PaymentStatusStateTransitionMessage) MarshalJSON() ([]byte, error) { + type Alias PaymentStatusStateTransitionMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "ParcelRemovedFromDelivery", Alias: (*Alias)(&obj)}) + }{Action: "PaymentStatusStateTransition", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Set Parcel Tracking Data](ctp:api:type:OrderSetParcelTrackingDataAction) update action. +* Generated after a successful [Add Transaction](ctp:api:type:PaymentAddTransactionAction) update action. * */ -type ParcelTrackingDataUpdatedMessage struct { +type PaymentTransactionAddedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -11648,9 +12546,9 @@ type ParcelTrackingDataUpdatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -11661,20 +12559,14 @@ type ParcelTrackingDataUpdatedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Unique identifier of the [Delivery](ctp:api:type:Delivery). - DeliveryId string `json:"deliveryId"` - // Unique identifier of the [Parcel](ctp:api:type:Parcel). - ParcelId string `json:"parcelId"` - // The [Tracking Data](ctp:api:type:TrackingData) that was added to the [Parcel](ctp:api:type:Parcel). - TrackingData *TrackingData `json:"trackingData,omitempty"` - // User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). - ShippingKey *string `json:"shippingKey,omitempty"` + // [Transaction](ctp:api:type:Transaction) that was added to the [Payment](ctp:api:type:Payment). + Transaction Transaction `json:"transaction"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *ParcelTrackingDataUpdatedMessage) UnmarshalJSON(data []byte) error { - type Alias ParcelTrackingDataUpdatedMessage +func (obj *PaymentTransactionAddedMessage) UnmarshalJSON(data []byte) error { + type Alias PaymentTransactionAddedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -11691,19 +12583,19 @@ func (obj *ParcelTrackingDataUpdatedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj ParcelTrackingDataUpdatedMessage) MarshalJSON() ([]byte, error) { - type Alias ParcelTrackingDataUpdatedMessage +func (obj PaymentTransactionAddedMessage) MarshalJSON() ([]byte, error) { + type Alias PaymentTransactionAddedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "ParcelTrackingDataUpdated", Alias: (*Alias)(&obj)}) + }{Action: "PaymentTransactionAdded", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Create Payment](ctp:api:endpoint:/{projectKey}/payments:POST) request. +* Generated after a successful [Change TransactionState](ctp:api:type:PaymentChangeTransactionStateAction) update action. * */ -type PaymentCreatedMessage struct { +type PaymentTransactionStateChangedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -11712,9 +12604,9 @@ type PaymentCreatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -11725,14 +12617,16 @@ type PaymentCreatedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [Payment](ctp:api:type:Payment) that was created. - Payment Payment `json:"payment"` + // Unique identifier for the [Transaction](ctp:api:type:Transaction) for which the [Transaction State](ctp:api:type:TransactionState) changed. + TransactionId string `json:"transactionId"` + // [Transaction State](ctp:api:type:TransactionState) after the [Change Transaction State](ctp:api:type:PaymentChangeTransactionStateAction) update action. + State TransactionState `json:"state"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *PaymentCreatedMessage) UnmarshalJSON(data []byte) error { - type Alias PaymentCreatedMessage +func (obj *PaymentTransactionStateChangedMessage) UnmarshalJSON(data []byte) error { + type Alias PaymentTransactionStateChangedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -11749,19 +12643,19 @@ func (obj *PaymentCreatedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj PaymentCreatedMessage) MarshalJSON() ([]byte, error) { - type Alias PaymentCreatedMessage +func (obj PaymentTransactionStateChangedMessage) MarshalJSON() ([]byte, error) { + type Alias PaymentTransactionStateChangedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "PaymentCreated", Alias: (*Alias)(&obj)}) + }{Action: "PaymentTransactionStateChanged", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Add InterfaceInteraction](ctp:api:type:PaymentAddInterfaceInteractionAction) update action. +* Generated after a successful [Add to Category](ctp:api:type:ProductAddToCategoryAction) update action. * */ -type PaymentInteractionAddedMessage struct { +type ProductAddedToCategoryMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -11770,9 +12664,9 @@ type PaymentInteractionAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -11783,14 +12677,16 @@ type PaymentInteractionAddedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // The interface interaction that was added to the [Payment](ctp:api:type:Payment). - Interaction CustomFields `json:"interaction"` + // [Category](ctp:api:type:Category) the [Product](ctp:api:type:Product) was added to. + Category CategoryReference `json:"category"` + // Whether the update was only applied to the staged [Product Projection](ctp:api:type:ProductProjection). + Staged bool `json:"staged"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *PaymentInteractionAddedMessage) UnmarshalJSON(data []byte) error { - type Alias PaymentInteractionAddedMessage +func (obj *ProductAddedToCategoryMessage) UnmarshalJSON(data []byte) error { + type Alias ProductAddedToCategoryMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -11807,19 +12703,19 @@ func (obj *PaymentInteractionAddedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj PaymentInteractionAddedMessage) MarshalJSON() ([]byte, error) { - type Alias PaymentInteractionAddedMessage +func (obj ProductAddedToCategoryMessage) MarshalJSON() ([]byte, error) { + type Alias ProductAddedToCategoryMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "PaymentInteractionAdded", Alias: (*Alias)(&obj)}) + }{Action: "ProductAddedToCategory", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Set StatusInterfaceCode](ctp:api:type:PaymentSetStatusInterfaceCodeAction) update action. +* Generated after a successful [Create Product](ctp:api:endpoint:/{projectKey}/products:POST) request. * */ -type PaymentStatusInterfaceCodeSetMessage struct { +type ProductCreatedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -11828,9 +12724,9 @@ type PaymentStatusInterfaceCodeSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -11841,16 +12737,14 @@ type PaymentStatusInterfaceCodeSetMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Unique identifier for the [Payment](ctp:api:type:Payment) for which the [Set StatusInterfaceCode](ctp:api:type:PaymentSetStatusInterfaceCodeAction) update action was applied. - PaymentId string `json:"paymentId"` - // The `interfaceCode` that was set during the [Set StatusInterfaceCode](ctp:api:type:PaymentSetStatusInterfaceCodeAction) update action. - InterfaceCode *string `json:"interfaceCode,omitempty"` + // The staged [Product Projection](ctp:api:type:ProductProjection) of the [Product](ctp:api:type:Product) at the time of creation. + ProductProjection ProductProjection `json:"productProjection"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *PaymentStatusInterfaceCodeSetMessage) UnmarshalJSON(data []byte) error { - type Alias PaymentStatusInterfaceCodeSetMessage +func (obj *ProductCreatedMessage) UnmarshalJSON(data []byte) error { + type Alias ProductCreatedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -11867,19 +12761,19 @@ func (obj *PaymentStatusInterfaceCodeSetMessage) UnmarshalJSON(data []byte) erro // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj PaymentStatusInterfaceCodeSetMessage) MarshalJSON() ([]byte, error) { - type Alias PaymentStatusInterfaceCodeSetMessage +func (obj ProductCreatedMessage) MarshalJSON() ([]byte, error) { + type Alias ProductCreatedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "PaymentStatusInterfaceCodeSet", Alias: (*Alias)(&obj)}) + }{Action: "ProductCreated", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Transition State](ctp:api:type:PaymentTransitionStateAction) update action. +* Generated after a successful [Delete Product](/../api/projects/products#delete-product) request. * */ -type PaymentStatusStateTransitionMessage struct { +type ProductDeletedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -11888,9 +12782,9 @@ type PaymentStatusStateTransitionMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -11901,16 +12795,16 @@ type PaymentStatusStateTransitionMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [State](ctp:api:type:State) of the [Payment](ctp:api:type:Payment) after the [Transition State](ctp:api:type:PaymentTransitionStateAction) update action. - State StateReference `json:"state"` - // Whether [State](ctp:api:type:State) transition validations were turned off during the [Change Transaction State](ctp:api:type:PaymentChangeTransactionStateAction) update action. - Force bool `json:"force"` + // List of image URLs that were removed during the [Delete Product](ctp:api:type:Product) request. + RemovedImageUrls []string `json:"removedImageUrls"` + // Current [Product Projection](ctp:api:type:ProductProjection) of the deleted [Product](ctp:api:type:Product). + CurrentProjection *ProductProjection `json:"currentProjection,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *PaymentStatusStateTransitionMessage) UnmarshalJSON(data []byte) error { - type Alias PaymentStatusStateTransitionMessage +func (obj *ProductDeletedMessage) UnmarshalJSON(data []byte) error { + type Alias ProductDeletedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -11927,19 +12821,19 @@ func (obj *PaymentStatusStateTransitionMessage) UnmarshalJSON(data []byte) error // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj PaymentStatusStateTransitionMessage) MarshalJSON() ([]byte, error) { - type Alias PaymentStatusStateTransitionMessage +func (obj ProductDeletedMessage) MarshalJSON() ([]byte, error) { + type Alias ProductDeletedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "PaymentStatusStateTransition", Alias: (*Alias)(&obj)}) + }{Action: "ProductDeleted", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Add Transaction](ctp:api:type:PaymentAddTransactionAction) update action. +* Generated after a successful [Add External Image](ctp:api:type:ProductAddExternalImageAction) update action or after the successful [upload of an image](/../api/projects/products#upload-product-image). * */ -type PaymentTransactionAddedMessage struct { +type ProductImageAddedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -11948,9 +12842,9 @@ type PaymentTransactionAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -11961,14 +12855,18 @@ type PaymentTransactionAddedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [Transaction](ctp:api:type:Transaction) that was added to the [Payment](ctp:api:type:Payment). - Transaction Transaction `json:"transaction"` + // Unique identifier of the [Product Variant](ctp:api:type:ProductVariant) to which the [Image](ctp:api:type:Image) was added. + VariantId int `json:"variantId"` + // [Image](ctp:api:type:Image) that was added. + Image Image `json:"image"` + // Whether the update was only applied to the staged [Product Projection](ctp:api:type:ProductProjection). + Staged bool `json:"staged"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *PaymentTransactionAddedMessage) UnmarshalJSON(data []byte) error { - type Alias PaymentTransactionAddedMessage +func (obj *ProductImageAddedMessage) UnmarshalJSON(data []byte) error { + type Alias ProductImageAddedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -11985,19 +12883,19 @@ func (obj *PaymentTransactionAddedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj PaymentTransactionAddedMessage) MarshalJSON() ([]byte, error) { - type Alias PaymentTransactionAddedMessage +func (obj ProductImageAddedMessage) MarshalJSON() ([]byte, error) { + type Alias ProductImageAddedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "PaymentTransactionAdded", Alias: (*Alias)(&obj)}) + }{Action: "ProductImageAdded", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Change TransactionState](ctp:api:type:PaymentChangeTransactionStateAction) update action. +* Generated after a successful [Add Price](ctp:api:type:ProductAddPriceAction) update action. * */ -type PaymentTransactionStateChangedMessage struct { +type ProductPriceAddedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -12006,9 +12904,9 @@ type PaymentTransactionStateChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -12019,16 +12917,18 @@ type PaymentTransactionStateChangedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Unique identifier for the [Transaction](ctp:api:type:Transaction) for which the [Transaction State](ctp:api:type:TransactionState) changed. - TransactionId string `json:"transactionId"` - // [Transaction State](ctp:api:type:TransactionState) after the [Change Transaction State](ctp:api:type:PaymentChangeTransactionStateAction) update action. - State TransactionState `json:"state"` + // Unique identifier of the [ProductVariant](ctp:api:type:ProductVariant) for which the Price was added. + VariantId int `json:"variantId"` + // The Embedded Price that was added to the [ProductVariant](ctp:api:type:ProductVariant). + Price Price `json:"price"` + // Whether the update was only applied to the staged [Product Projection](ctp:api:type:ProductProjection). + Staged bool `json:"staged"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *PaymentTransactionStateChangedMessage) UnmarshalJSON(data []byte) error { - type Alias PaymentTransactionStateChangedMessage +func (obj *ProductPriceAddedMessage) UnmarshalJSON(data []byte) error { + type Alias ProductPriceAddedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -12045,19 +12945,19 @@ func (obj *PaymentTransactionStateChangedMessage) UnmarshalJSON(data []byte) err // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj PaymentTransactionStateChangedMessage) MarshalJSON() ([]byte, error) { - type Alias PaymentTransactionStateChangedMessage +func (obj ProductPriceAddedMessage) MarshalJSON() ([]byte, error) { + type Alias ProductPriceAddedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "PaymentTransactionStateChanged", Alias: (*Alias)(&obj)}) + }{Action: "ProductPriceAdded", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Add to Category](ctp:api:type:ProductAddToCategoryAction) update action. +* Generated after a successful [Change Price](ctp:api:type:ProductChangePriceAction) update action. * */ -type ProductAddedToCategoryMessage struct { +type ProductPriceChangedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -12066,9 +12966,9 @@ type ProductAddedToCategoryMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -12079,16 +12979,22 @@ type ProductAddedToCategoryMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // [Category](ctp:api:type:Category) the [Product](ctp:api:type:Product) was added to. - Category CategoryReference `json:"category"` + // Unique identifier of the [ProductVariant](ctp:api:type:ProductVariant) for which the Price was changed. + VariantId int `json:"variantId"` + // The current Embedded Price before the [Change Embedded Price](ctp:api:type:ProductChangePriceAction) update action. + OldPrice Price `json:"oldPrice"` + // The Embedded Price after the [Change Embedded Price](ctp:api:type:ProductChangePriceAction) update action. + NewPrice Price `json:"newPrice"` // Whether the update was only applied to the staged [Product Projection](ctp:api:type:ProductProjection). Staged bool `json:"staged"` + // The staged Embedded Price before the [Change Embedded Price](ctp:api:type:ProductChangePriceAction) update action. + OldStagedPrice *Price `json:"oldStagedPrice,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *ProductAddedToCategoryMessage) UnmarshalJSON(data []byte) error { - type Alias ProductAddedToCategoryMessage +func (obj *ProductPriceChangedMessage) UnmarshalJSON(data []byte) error { + type Alias ProductPriceChangedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -12105,19 +13011,19 @@ func (obj *ProductAddedToCategoryMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj ProductAddedToCategoryMessage) MarshalJSON() ([]byte, error) { - type Alias ProductAddedToCategoryMessage +func (obj ProductPriceChangedMessage) MarshalJSON() ([]byte, error) { + type Alias ProductPriceChangedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "ProductAddedToCategory", Alias: (*Alias)(&obj)}) + }{Action: "ProductPriceChanged", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Create Product](ctp:api:endpoint:/{projectKey}/products:POST) request. +* Generated after adding a Custom Field to a Price using the [Set Price CustomField](ctp:api:type:ProductSetProductPriceCustomFieldAction) update action. * */ -type ProductCreatedMessage struct { +type ProductPriceCustomFieldAddedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -12126,9 +13032,9 @@ type ProductCreatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -12139,14 +13045,22 @@ type ProductCreatedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // The staged [Product Projection](ctp:api:type:ProductProjection) of the [Product](ctp:api:type:Product) at the time of creation. - ProductProjection ProductProjection `json:"productProjection"` + // Unique identifier of the [Price](ctp:api:type:Price) to which the Custom Field was added. + PriceId string `json:"priceId"` + // Unique identifier of the [ProductVariant](ctp:api:type:ProductVariant) to which the Price belongs. + VariantId int `json:"variantId"` + // Whether the update was only applied to the staged [Product Projection](ctp:api:type:ProductProjection). + Staged bool `json:"staged"` + // Name of the Custom Field that was added. + Name string `json:"name"` + // The added [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType). + Value interface{} `json:"value"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *ProductCreatedMessage) UnmarshalJSON(data []byte) error { - type Alias ProductCreatedMessage +func (obj *ProductPriceCustomFieldAddedMessage) UnmarshalJSON(data []byte) error { + type Alias ProductPriceCustomFieldAddedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -12163,19 +13077,19 @@ func (obj *ProductCreatedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj ProductCreatedMessage) MarshalJSON() ([]byte, error) { - type Alias ProductCreatedMessage +func (obj ProductPriceCustomFieldAddedMessage) MarshalJSON() ([]byte, error) { + type Alias ProductPriceCustomFieldAddedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "ProductCreated", Alias: (*Alias)(&obj)}) + }{Action: "ProductPriceCustomFieldAdded", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Delete Product](/../api/projects/products#delete-product) request. +* Generated after changing an existing Custom Field on a Price using the [Set Price CustomField](ctp:api:type:ProductSetProductPriceCustomFieldAction) update action. * */ -type ProductDeletedMessage struct { +type ProductPriceCustomFieldChangedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -12184,9 +13098,9 @@ type ProductDeletedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -12197,16 +13111,22 @@ type ProductDeletedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // List of image URLs that were removed during the [Delete Product](ctp:api:type:Product) request. - RemovedImageUrls []string `json:"removedImageUrls"` - // Current [Product Projection](ctp:api:type:ProductProjection) of the deleted [Product](ctp:api:type:Product). - CurrentProjection *ProductProjection `json:"currentProjection,omitempty"` + // Unique identifier of the [Price](ctp:api:type:Price) of which the Custom Field was changed. + PriceId string `json:"priceId"` + // Unique identifier of the [ProductVariant](ctp:api:type:ProductVariant) to which the Price belongs. + VariantId int `json:"variantId"` + // Whether the update was only applied to the staged [Product Projection](ctp:api:type:ProductProjection). + Staged bool `json:"staged"` + // Name of the Custom Field that was changed. + Name string `json:"name"` + // [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType) after the [Set Price CustomField](ctp:api:type:ProductSetProductPriceCustomFieldAction) update action. + Value interface{} `json:"value"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *ProductDeletedMessage) UnmarshalJSON(data []byte) error { - type Alias ProductDeletedMessage +func (obj *ProductPriceCustomFieldChangedMessage) UnmarshalJSON(data []byte) error { + type Alias ProductPriceCustomFieldChangedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -12223,19 +13143,19 @@ func (obj *ProductDeletedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj ProductDeletedMessage) MarshalJSON() ([]byte, error) { - type Alias ProductDeletedMessage +func (obj ProductPriceCustomFieldChangedMessage) MarshalJSON() ([]byte, error) { + type Alias ProductPriceCustomFieldChangedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "ProductDeleted", Alias: (*Alias)(&obj)}) + }{Action: "ProductPriceCustomFieldChanged", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Add External Image](ctp:api:type:ProductAddExternalImageAction) update action or after the successful [upload of an image](/../api/projects/products#upload-product-image). +* Generated after removing a Custom Field from a Price using the [Set Price CustomField](ctp:api:type:ProductSetProductPriceCustomFieldAction) update action. * */ -type ProductImageAddedMessage struct { +type ProductPriceCustomFieldRemovedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -12244,9 +13164,9 @@ type ProductImageAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -12257,18 +13177,20 @@ type ProductImageAddedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Unique identifier of the [Product Variant](ctp:api:type:ProductVariant) to which the [Image](ctp:api:type:Image) was added. + // Unique identifier of the [Price](ctp:api:type:Price) from which the Custom Field was removed. + PriceId string `json:"priceId"` + // Unique identifier of the [ProductVariant](ctp:api:type:ProductVariant) to which the Price belongs. VariantId int `json:"variantId"` - // [Image](ctp:api:type:Image) that was added. - Image Image `json:"image"` // Whether the update was only applied to the staged [Product Projection](ctp:api:type:ProductProjection). Staged bool `json:"staged"` + // Name of the Custom Field that was removed. + Name string `json:"name"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *ProductImageAddedMessage) UnmarshalJSON(data []byte) error { - type Alias ProductImageAddedMessage +func (obj *ProductPriceCustomFieldRemovedMessage) UnmarshalJSON(data []byte) error { + type Alias ProductPriceCustomFieldRemovedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -12285,19 +13207,19 @@ func (obj *ProductImageAddedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj ProductImageAddedMessage) MarshalJSON() ([]byte, error) { - type Alias ProductImageAddedMessage +func (obj ProductPriceCustomFieldRemovedMessage) MarshalJSON() ([]byte, error) { + type Alias ProductPriceCustomFieldRemovedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "ProductImageAdded", Alias: (*Alias)(&obj)}) + }{Action: "ProductPriceCustomFieldRemoved", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Add Price](ctp:api:type:ProductAddPriceAction) update action. +* Generated after removing a Custom Type from a Price using the [Set Price Custom Type](ctp:api:type:ProductSetProductPriceCustomTypeAction) update action. * */ -type ProductPriceAddedMessage struct { +type ProductPriceCustomFieldsRemovedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -12306,9 +13228,9 @@ type ProductPriceAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -12319,18 +13241,18 @@ type ProductPriceAddedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Unique identifier of the [ProductVariant](ctp:api:type:ProductVariant) for which the Price was added. + // Unique identifier of the [Price](ctp:api:type:Price) from which the Custom Type was removed. + PriceId string `json:"priceId"` + // Unique identifier of the [ProductVariant](ctp:api:type:ProductVariant) to which the Price belongs. VariantId int `json:"variantId"` - // The [Embedded Price](/projects/products#embedded-price) that was added to the [ProductVariant](ctp:api:type:ProductVariant). - Price Price `json:"price"` // Whether the update was only applied to the staged [Product Projection](ctp:api:type:ProductProjection). Staged bool `json:"staged"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *ProductPriceAddedMessage) UnmarshalJSON(data []byte) error { - type Alias ProductPriceAddedMessage +func (obj *ProductPriceCustomFieldsRemovedMessage) UnmarshalJSON(data []byte) error { + type Alias ProductPriceCustomFieldsRemovedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -12347,19 +13269,19 @@ func (obj *ProductPriceAddedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj ProductPriceAddedMessage) MarshalJSON() ([]byte, error) { - type Alias ProductPriceAddedMessage +func (obj ProductPriceCustomFieldsRemovedMessage) MarshalJSON() ([]byte, error) { + type Alias ProductPriceCustomFieldsRemovedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "ProductPriceAdded", Alias: (*Alias)(&obj)}) + }{Action: "ProductPriceCustomFieldsRemoved", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Change Price](ctp:api:type:ProductChangePriceAction) update action. +* Generated after a successful [Set Price Custom Type](ctp:api:type:ProductSetProductPriceCustomTypeAction) update action. * */ -type ProductPriceChangedMessage struct { +type ProductPriceCustomFieldsSetMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -12368,9 +13290,9 @@ type ProductPriceChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -12381,22 +13303,22 @@ type ProductPriceChangedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Unique identifier of the [ProductVariant](ctp:api:type:ProductVariant) for which the Price was changed. + // Unique identifier of the [Price](ctp:api:type:Price) on which the Custom Type was set. + PriceId string `json:"priceId"` + // Unique identifier of the [ProductVariant](ctp:api:type:ProductVariant) to which the Price belongs. VariantId int `json:"variantId"` - // The current [Embedded Price](/projects/products#embedded-price) before the [Change Embedded Price](ctp:api:type:ProductChangePriceAction) update action. - OldPrice Price `json:"oldPrice"` - // The [Embedded Price](/projects/products#embedded-price) after the [Change Embedded Price](ctp:api:type:ProductChangePriceAction) update action. - NewPrice Price `json:"newPrice"` // Whether the update was only applied to the staged [Product Projection](ctp:api:type:ProductProjection). Staged bool `json:"staged"` - // The staged [Embedded Price](/projects/products#embedded-price) before the [Change Embedded Price](ctp:api:type:ProductChangePriceAction) update action. - OldStagedPrice *Price `json:"oldStagedPrice,omitempty"` + // Custom Fields that were set. + CustomField CustomFields `json:"customField"` + // `id` of the previous [Custom Type](ctp:api:type:Type). Absent if there was no previous Custom Type present. + OldTypeId *string `json:"oldTypeId,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *ProductPriceChangedMessage) UnmarshalJSON(data []byte) error { - type Alias ProductPriceChangedMessage +func (obj *ProductPriceCustomFieldsSetMessage) UnmarshalJSON(data []byte) error { + type Alias ProductPriceCustomFieldsSetMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -12413,12 +13335,12 @@ func (obj *ProductPriceChangedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj ProductPriceChangedMessage) MarshalJSON() ([]byte, error) { - type Alias ProductPriceChangedMessage +func (obj ProductPriceCustomFieldsSetMessage) MarshalJSON() ([]byte, error) { + type Alias ProductPriceCustomFieldsSetMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "ProductPriceChanged", Alias: (*Alias)(&obj)}) + }{Action: "ProductPriceCustomFieldsSet", Alias: (*Alias)(&obj)}) } /** @@ -12434,9 +13356,9 @@ type ProductPriceDiscountsSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -12480,7 +13402,7 @@ func (obj ProductPriceDiscountsSetMessage) MarshalJSON() ([]byte, error) { } /** -* Details about a [Embedded Price](/projects/products#embedded-price) that was updated due to a Discount. Specific to [Product Price Discounts Set](ctp:api:type:ProductPriceDiscountsSetMessage) Message. +* Details about an [Embedded Price](ctp:api:type:Price) that was updated due to a Discount. Specific to [Product Price Discounts Set](ctp:api:type:ProductPriceDiscountsSetMessage) Message. * */ type ProductPriceDiscountsSetUpdatedPrice struct { @@ -12511,9 +13433,9 @@ type ProductPriceExternalDiscountSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -12579,9 +13501,9 @@ type ProductPriceKeySetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -12644,9 +13566,9 @@ type ProductPriceModeSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -12702,9 +13624,9 @@ type ProductPriceRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -12717,7 +13639,7 @@ type ProductPriceRemovedMessage struct { ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` // Unique identifier of the [ProductVariant](ctp:api:type:ProductVariant) for which the Price was removed. VariantId int `json:"variantId"` - // The [Embedded Price](/projects/products#embedded-price) that was removed from the [ProductVariant](ctp:api:type:ProductVariant). + // The Embedded Price that was removed from the [ProductVariant](ctp:api:type:ProductVariant). Price Price `json:"price"` // Whether the update was only applied to the staged [Product Projection](ctp:api:type:ProductProjection). Staged bool `json:"staged"` @@ -12764,9 +13686,9 @@ type ProductPricesSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -12826,9 +13748,9 @@ type ProductPublishedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -12888,9 +13810,9 @@ type ProductRemovedFromCategoryMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -12948,9 +13870,9 @@ type ProductRevertedStagedChangesMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -13006,9 +13928,9 @@ type ProductSelectionCreatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -13064,9 +13986,9 @@ type ProductSelectionDeletedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -13120,9 +14042,9 @@ type ProductSelectionProductAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -13187,9 +14109,9 @@ type ProductSelectionProductExcludedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -13247,9 +14169,9 @@ type ProductSelectionProductRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -13305,9 +14227,9 @@ type ProductSelectionVariantExclusionChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -13367,9 +14289,9 @@ type ProductSelectionVariantSelectionChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -13443,9 +14365,9 @@ type ProductSlugChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -13503,9 +14425,9 @@ type ProductStateTransitionMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -13564,9 +14486,9 @@ type ProductTailoringCreatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -13591,6 +14513,14 @@ type ProductTailoringCreatedMessage struct { Name *LocalizedString `json:"name,omitempty"` // The slug of the [Product Tailoring](ctp:api:type:ProductTailoring) at the time of creation. Slug *LocalizedString `json:"slug,omitempty"` + // The metaTitle of the [Product Tailoring](ctp:api:type:ProductTailoring) at the time of creation. + MetaTitle *LocalizedString `json:"metaTitle,omitempty"` + // The metaDescription of the [Product Tailoring](ctp:api:type:ProductTailoring) at the time of creation. + MetaDescription *LocalizedString `json:"metaDescription,omitempty"` + // The metaKeywords of the [Product Tailoring](ctp:api:type:ProductTailoring) at the time of creation. + MetaKeywords *LocalizedString `json:"metaKeywords,omitempty"` + // The variants of the [Product Tailoring](ctp:api:type:ProductTailoring) at the time of creation. + Variants []ProductVariantTailoring `json:"variants"` // `true` if the ProductTailoring is published. Published bool `json:"published"` } @@ -13617,10 +14547,25 @@ func (obj *ProductTailoringCreatedMessage) UnmarshalJSON(data []byte) error { // optional nil slices func (obj ProductTailoringCreatedMessage) MarshalJSON() ([]byte, error) { type Alias ProductTailoringCreatedMessage - return json.Marshal(struct { + data, err := json.Marshal(struct { Action string `json:"type"` *Alias }{Action: "ProductTailoringCreated", Alias: (*Alias)(&obj)}) + if err != nil { + return nil, err + } + + raw := make(map[string]interface{}) + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + if raw["variants"] == nil { + delete(raw, "variants") + } + + return json.Marshal(raw) + } /** @@ -13637,9 +14582,9 @@ type ProductTailoringDeletedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -13699,9 +14644,9 @@ type ProductTailoringDescriptionSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -13752,6 +14697,160 @@ func (obj ProductTailoringDescriptionSetMessage) MarshalJSON() ([]byte, error) { }{Action: "ProductTailoringDescriptionSet", Alias: (*Alias)(&obj)}) } +/** +* Generated after a successful [Add External Image](ctp:api:type:ProductTailoringAddExternalImageAction) update action +* or after a successful [Upload Product Tailoring image](/projects/product-tailoring#upload-product-tailoring-image) request. +* + */ +type ProductTailoringImageAddedMessage struct { + // Unique identifier of the Message. Can be used to track which Messages have been processed. + ID string `json:"id"` + // Version of a resource. In case of Messages, this is always `1`. + Version int `json:"version"` + // Date and time (UTC) the Message was generated. + CreatedAt time.Time `json:"createdAt"` + // Value of `createdAt`. + LastModifiedAt time.Time `json:"lastModifiedAt"` + // IDs and references that last modified the Message. + LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` + // IDs and references that created the Message. + CreatedBy *CreatedBy `json:"createdBy,omitempty"` + // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. + // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. + SequenceNumber int `json:"sequenceNumber"` + // [Reference](ctp:api:type:Reference) to the resource on which the change or action was performed. + Resource Reference `json:"resource"` + // Version of the resource on which the change or action was performed. + ResourceVersion int `json:"resourceVersion"` + // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. + ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` + // The Store to which the Product Tailoring belongs. + Store StoreKeyReference `json:"store"` + // `key` of the tailored Product. + ProductKey *string `json:"productKey,omitempty"` + // Reference to the tailored Product. + Product ProductReference `json:"product"` + // `id` of the tailored [ProductVariant](ctp:api:type:ProductVariant). + VariantId int `json:"variantId"` + // [Image](ctp:api:type:Image) that was added. + Image Image `json:"image"` +} + +// UnmarshalJSON override to deserialize correct attribute types based +// on the discriminator value +func (obj *ProductTailoringImageAddedMessage) UnmarshalJSON(data []byte) error { + type Alias ProductTailoringImageAddedMessage + if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + return err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return err + } + } + + return nil +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringImageAddedMessage) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringImageAddedMessage + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "ProductTailoringImageAdded", Alias: (*Alias)(&obj)}) +} + +/** +* Generated after a successful [Set Images](ctp:api:type:ProductTailoringSetExternalImagesAction) update action. +* + */ +type ProductTailoringImagesSetMessage struct { + // Unique identifier of the Message. Can be used to track which Messages have been processed. + ID string `json:"id"` + // Version of a resource. In case of Messages, this is always `1`. + Version int `json:"version"` + // Date and time (UTC) the Message was generated. + CreatedAt time.Time `json:"createdAt"` + // Value of `createdAt`. + LastModifiedAt time.Time `json:"lastModifiedAt"` + // IDs and references that last modified the Message. + LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` + // IDs and references that created the Message. + CreatedBy *CreatedBy `json:"createdBy,omitempty"` + // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. + // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. + SequenceNumber int `json:"sequenceNumber"` + // [Reference](ctp:api:type:Reference) to the resource on which the change or action was performed. + Resource Reference `json:"resource"` + // Version of the resource on which the change or action was performed. + ResourceVersion int `json:"resourceVersion"` + // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. + ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` + // The Store to which the Product Tailoring belongs. + Store StoreKeyReference `json:"store"` + // `key` of the tailored Product. + ProductKey *string `json:"productKey,omitempty"` + // Reference to the Product the Product Tailoring belongs to. + Product ProductReference `json:"product"` + // `id` of the tailored Product Variant. + VariantId int `json:"variantId"` + // [Images](ctp:api:type:Image) on the tailored [Product Variant](ctp:api:type:ProductVariantTailoring) before the [Set Images](ctp:api:type:ProductTailoringSetExternalImagesAction) update action. + OldImages []Image `json:"oldImages"` + // [Images](ctp:api:type:Image) on the tailored [Product Variant](ctp:api:type:ProductVariantTailoring) after the [Set Images](ctp:api:type:ProductTailoringSetExternalImagesAction) update action. + Images []Image `json:"images"` +} + +// UnmarshalJSON override to deserialize correct attribute types based +// on the discriminator value +func (obj *ProductTailoringImagesSetMessage) UnmarshalJSON(data []byte) error { + type Alias ProductTailoringImagesSetMessage + if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + return err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return err + } + } + + return nil +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringImagesSetMessage) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringImagesSetMessage + data, err := json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "ProductTailoringImagesSet", Alias: (*Alias)(&obj)}) + if err != nil { + return nil, err + } + + raw := make(map[string]interface{}) + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + if raw["oldImages"] == nil { + delete(raw, "oldImages") + } + + if raw["images"] == nil { + delete(raw, "images") + } + + return json.Marshal(raw) + +} + /** * Generated after a successful Product Tailoring [Set Name](ctp:api:type:ProductTailoringSetNameAction) update action. * @@ -13765,9 +14864,9 @@ type ProductTailoringNameSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -13831,9 +14930,9 @@ type ProductTailoringPublishedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -13893,9 +14992,9 @@ type ProductTailoringSlugSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -13947,10 +15046,128 @@ func (obj ProductTailoringSlugSetMessage) MarshalJSON() ([]byte, error) { } /** -* Generated after a successful [Product Tailoring Unpublish](ctp:api:type:ProductTailoringUnpublishAction) update action. +* Generated after a successful [Product Tailoring Unpublish](ctp:api:type:ProductTailoringUnpublishAction) update action. +* + */ +type ProductTailoringUnpublishedMessage struct { + // Unique identifier of the Message. Can be used to track which Messages have been processed. + ID string `json:"id"` + // Version of a resource. In case of Messages, this is always `1`. + Version int `json:"version"` + // Date and time (UTC) the Message was generated. + CreatedAt time.Time `json:"createdAt"` + // Value of `createdAt`. + LastModifiedAt time.Time `json:"lastModifiedAt"` + // IDs and references that last modified the Message. + LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` + // IDs and references that created the Message. + CreatedBy *CreatedBy `json:"createdBy,omitempty"` + // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. + // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. + SequenceNumber int `json:"sequenceNumber"` + // [Reference](ctp:api:type:Reference) to the resource on which the change or action was performed. + Resource Reference `json:"resource"` + // Version of the resource on which the change or action was performed. + ResourceVersion int `json:"resourceVersion"` + // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. + ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` + // The Store to which the Product Tailoring belongs. + Store StoreKeyReference `json:"store"` + // User-defined unique identifier of the Product this Product Tailoring belongs to. + ProductKey *string `json:"productKey,omitempty"` + // Reference to the Product the Product Tailoring belongs to. + Product ProductReference `json:"product"` +} + +// UnmarshalJSON override to deserialize correct attribute types based +// on the discriminator value +func (obj *ProductTailoringUnpublishedMessage) UnmarshalJSON(data []byte) error { + type Alias ProductTailoringUnpublishedMessage + if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + return err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return err + } + } + + return nil +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringUnpublishedMessage) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringUnpublishedMessage + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "ProductTailoringUnpublished", Alias: (*Alias)(&obj)}) +} + +/** +* Generated after a successful [Unpublish Product](ctp:api:type:ProductUnpublishAction) update action. +* + */ +type ProductUnpublishedMessage struct { + // Unique identifier of the Message. Can be used to track which Messages have been processed. + ID string `json:"id"` + // Version of a resource. In case of Messages, this is always `1`. + Version int `json:"version"` + // Date and time (UTC) the Message was generated. + CreatedAt time.Time `json:"createdAt"` + // Value of `createdAt`. + LastModifiedAt time.Time `json:"lastModifiedAt"` + // IDs and references that last modified the Message. + LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` + // IDs and references that created the Message. + CreatedBy *CreatedBy `json:"createdBy,omitempty"` + // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. + // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. + SequenceNumber int `json:"sequenceNumber"` + // [Reference](ctp:api:type:Reference) to the resource on which the change or action was performed. + Resource Reference `json:"resource"` + // Version of the resource on which the change or action was performed. + ResourceVersion int `json:"resourceVersion"` + // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. + ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` +} + +// UnmarshalJSON override to deserialize correct attribute types based +// on the discriminator value +func (obj *ProductUnpublishedMessage) UnmarshalJSON(data []byte) error { + type Alias ProductUnpublishedMessage + if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + return err + } + if obj.Resource != nil { + var err error + obj.Resource, err = mapDiscriminatorReference(obj.Resource) + if err != nil { + return err + } + } + + return nil +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductUnpublishedMessage) MarshalJSON() ([]byte, error) { + type Alias ProductUnpublishedMessage + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "ProductUnpublished", Alias: (*Alias)(&obj)}) +} + +/** +* Generated after a successful [Add ProductVariant](ctp:api:type:ProductAddVariantAction) update action. * */ -type ProductTailoringUnpublishedMessage struct { +type ProductVariantAddedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -13959,9 +15176,9 @@ type ProductTailoringUnpublishedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -13972,18 +15189,16 @@ type ProductTailoringUnpublishedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // The Store to which the Product Tailoring belongs. - Store StoreKeyReference `json:"store"` - // User-defined unique identifier of the Product this Product Tailoring belongs to. - ProductKey *string `json:"productKey,omitempty"` - // Reference to the Product the Product Tailoring belongs to. - Product ProductReference `json:"product"` + // Unique identifier of the [Product Variant](ctp:api:type:ProductVariant) that was added. + Variant ProductVariant `json:"variant"` + // Whether the update was only applied to the staged [Product Projection](ctp:api:type:ProductProjection). + Staged bool `json:"staged"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *ProductTailoringUnpublishedMessage) UnmarshalJSON(data []byte) error { - type Alias ProductTailoringUnpublishedMessage +func (obj *ProductVariantAddedMessage) UnmarshalJSON(data []byte) error { + type Alias ProductVariantAddedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -14000,19 +15215,19 @@ func (obj *ProductTailoringUnpublishedMessage) UnmarshalJSON(data []byte) error // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj ProductTailoringUnpublishedMessage) MarshalJSON() ([]byte, error) { - type Alias ProductTailoringUnpublishedMessage +func (obj ProductVariantAddedMessage) MarshalJSON() ([]byte, error) { + type Alias ProductVariantAddedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "ProductTailoringUnpublished", Alias: (*Alias)(&obj)}) + }{Action: "ProductVariantAdded", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Unpublish Product](ctp:api:type:ProductUnpublishAction) update action. +* Generated after a successful [Remove ProductVariant](ctp:api:type:ProductRemoveVariantAction) update action. * */ -type ProductUnpublishedMessage struct { +type ProductVariantDeletedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -14021,9 +15236,9 @@ type ProductUnpublishedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -14034,12 +15249,16 @@ type ProductUnpublishedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` + // Unique identifier of the [Product Variant](ctp:api:type:ProductVariant) that was added. + Variant *ProductVariant `json:"variant,omitempty"` + // List of image URLs that were removed with the [Remove Product Variant](ctp:api:type:ProductRemoveVariantAction) update action. + RemovedImageUrls []string `json:"removedImageUrls"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *ProductUnpublishedMessage) UnmarshalJSON(data []byte) error { - type Alias ProductUnpublishedMessage +func (obj *ProductVariantDeletedMessage) UnmarshalJSON(data []byte) error { + type Alias ProductVariantDeletedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -14056,19 +15275,19 @@ func (obj *ProductUnpublishedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj ProductUnpublishedMessage) MarshalJSON() ([]byte, error) { - type Alias ProductUnpublishedMessage +func (obj ProductVariantDeletedMessage) MarshalJSON() ([]byte, error) { + type Alias ProductVariantDeletedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "ProductUnpublished", Alias: (*Alias)(&obj)}) + }{Action: "ProductVariantDeleted", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Add ProductVariant](ctp:api:type:ProductAddVariantAction) update action. +* Generated after a successful [Add ProductVariant Tailoring](ctp:api:type:ProductTailoringAddVariantAction) update action. * */ -type ProductVariantAddedMessage struct { +type ProductVariantTailoringAddedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -14077,9 +15296,9 @@ type ProductVariantAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -14090,16 +15309,22 @@ type ProductVariantAddedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Unique identifier of the [Product Variant](ctp:api:type:ProductVariant) that was added. - Variant ProductVariant `json:"variant"` - // Whether the update was only applied to the staged [Product Projection](ctp:api:type:ProductProjection). - Staged bool `json:"staged"` + // The Store to which the Product Tailoring belongs. + Store StoreKeyReference `json:"store"` + // `key` of the tailored Product. + ProductKey *string `json:"productKey,omitempty"` + // Reference to the tailored Product. + Product ProductReference `json:"product"` + // `id` of the [ProductVariant](ctp:api:type:ProductVariant) added to the Tailoring. + VariantId int `json:"variantId"` + // The [ProductVariantTailoring](ctp:api:type:ProductVariantTailoring) that was added to the ProductTailoring. + Variant ProductVariantTailoring `json:"variant"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *ProductVariantAddedMessage) UnmarshalJSON(data []byte) error { - type Alias ProductVariantAddedMessage +func (obj *ProductVariantTailoringAddedMessage) UnmarshalJSON(data []byte) error { + type Alias ProductVariantTailoringAddedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -14116,19 +15341,19 @@ func (obj *ProductVariantAddedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj ProductVariantAddedMessage) MarshalJSON() ([]byte, error) { - type Alias ProductVariantAddedMessage +func (obj ProductVariantTailoringAddedMessage) MarshalJSON() ([]byte, error) { + type Alias ProductVariantTailoringAddedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "ProductVariantAdded", Alias: (*Alias)(&obj)}) + }{Action: "ProductVariantTailoringAdded", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Remove ProductVariant](ctp:api:type:ProductRemoveVariantAction) update action. +* Generated after a successful [Remove ProductVariant Tailoring](ctp:api:type:ProductTailoringRemoveVariantAction) update action. * */ -type ProductVariantDeletedMessage struct { +type ProductVariantTailoringRemovedMessage struct { // Unique identifier of the Message. Can be used to track which Messages have been processed. ID string `json:"id"` // Version of a resource. In case of Messages, this is always `1`. @@ -14137,9 +15362,9 @@ type ProductVariantDeletedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -14150,16 +15375,22 @@ type ProductVariantDeletedMessage struct { ResourceVersion int `json:"resourceVersion"` // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` - // Unique identifier of the [Product Variant](ctp:api:type:ProductVariant) that was added. - Variant *ProductVariant `json:"variant,omitempty"` - // List of image URLs that were removed with the [Remove Product Variant](ctp:api:type:ProductRemoveVariantAction) update action. - RemovedImageUrls []string `json:"removedImageUrls"` + // The Store to which the Product Tailoring belongs. + Store StoreKeyReference `json:"store"` + // `key` of the tailored Product. + ProductKey *string `json:"productKey,omitempty"` + // Reference to the Product the Product Tailoring belongs to. + Product ProductReference `json:"product"` + // `id` of the [ProductVariant](ctp:api:type:ProductVariant) removed from the Tailoring. + VariantId int `json:"variantId"` + // The [ProductVariantTailoring](ctp:api:type:ProductVariantTailoring) that was removed from the ProductTailoring. + Variant ProductVariantTailoring `json:"variant"` } // UnmarshalJSON override to deserialize correct attribute types based // on the discriminator value -func (obj *ProductVariantDeletedMessage) UnmarshalJSON(data []byte) error { - type Alias ProductVariantDeletedMessage +func (obj *ProductVariantTailoringRemovedMessage) UnmarshalJSON(data []byte) error { + type Alias ProductVariantTailoringRemovedMessage if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } @@ -14176,12 +15407,12 @@ func (obj *ProductVariantDeletedMessage) UnmarshalJSON(data []byte) error { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj ProductVariantDeletedMessage) MarshalJSON() ([]byte, error) { - type Alias ProductVariantDeletedMessage +func (obj ProductVariantTailoringRemovedMessage) MarshalJSON() ([]byte, error) { + type Alias ProductVariantTailoringRemovedMessage return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "ProductVariantDeleted", Alias: (*Alias)(&obj)}) + }{Action: "ProductVariantTailoringRemoved", Alias: (*Alias)(&obj)}) } /** @@ -14197,9 +15428,9 @@ type QuoteCreatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -14255,9 +15486,9 @@ type QuoteCustomerChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -14315,9 +15546,9 @@ type QuoteDeletedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -14371,9 +15602,9 @@ type QuoteRenegotiationRequestedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -14429,9 +15660,9 @@ type QuoteRequestCreatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -14487,9 +15718,9 @@ type QuoteRequestCustomerChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -14547,9 +15778,9 @@ type QuoteRequestDeletedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -14603,9 +15834,9 @@ type QuoteRequestStateChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -14663,9 +15894,9 @@ type QuoteRequestStateTransitionMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -14725,9 +15956,9 @@ type QuoteStateChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -14785,9 +16016,9 @@ type QuoteStateTransitionMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -14847,9 +16078,9 @@ type ReturnInfoAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -14905,9 +16136,9 @@ type ReturnInfoSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -14978,9 +16209,9 @@ type ReviewCreatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -15036,9 +16267,9 @@ type ReviewRatingSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -15107,9 +16338,9 @@ type ReviewStateTransitionMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -15182,9 +16413,9 @@ type StagedQuoteCreatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -15240,9 +16471,9 @@ type StagedQuoteDeletedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -15296,9 +16527,9 @@ type StagedQuoteSellerCommentSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -15354,9 +16585,9 @@ type StagedQuoteStateChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -15414,9 +16645,9 @@ type StagedQuoteStateTransitionMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -15476,9 +16707,9 @@ type StagedQuoteValidToSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -15534,9 +16765,9 @@ type StandalonePriceActiveChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -15594,9 +16825,9 @@ type StandalonePriceCreatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -15652,9 +16883,9 @@ type StandalonePriceDeletedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -15710,9 +16941,9 @@ type StandalonePriceDiscountSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -15768,9 +16999,9 @@ type StandalonePriceExternalDiscountSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -15826,9 +17057,9 @@ type StandalonePriceKeySetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -15886,9 +17117,9 @@ type StandalonePriceStagedChangesAppliedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -15944,9 +17175,9 @@ type StandalonePriceStagedChangesRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -16002,9 +17233,9 @@ type StandalonePriceTierAddedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -16060,9 +17291,9 @@ type StandalonePriceTierRemovedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -16118,9 +17349,9 @@ type StandalonePriceTiersSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -16178,9 +17409,9 @@ type StandalonePriceValidFromAndUntilSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -16242,9 +17473,9 @@ type StandalonePriceValidFromSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -16302,9 +17533,9 @@ type StandalonePriceValidUntilSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -16362,9 +17593,9 @@ type StandalonePriceValueChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -16376,12 +17607,12 @@ type StandalonePriceValueChangedMessage struct { // User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` // The new value of the updated [StandalonePrice](ctp:api:type:StandalonePrice). - Value Money `json:"value"` + Value TypedMoney `json:"value"` // Whether the new value was applied to the current or the staged representation of the StandalonePrice. Staged changes are stored on the [StagedStandalonePrice](ctp:api:type:StagedStandalonePrice). Staged bool `json:"staged"` // The old value of the updated [StandalonePrice](ctp:api:type:StandalonePrice). // Present on Messages created after 3 February 2023. Optional for backwards compatibility. - OldValue *Money `json:"oldValue,omitempty"` + OldValue TypedMoney `json:"oldValue,omitempty"` } // UnmarshalJSON override to deserialize correct attribute types based @@ -16398,6 +17629,20 @@ func (obj *StandalonePriceValueChangedMessage) UnmarshalJSON(data []byte) error return err } } + if obj.Value != nil { + var err error + obj.Value, err = mapDiscriminatorTypedMoney(obj.Value) + if err != nil { + return err + } + } + if obj.OldValue != nil { + var err error + obj.OldValue, err = mapDiscriminatorTypedMoney(obj.OldValue) + if err != nil { + return err + } + } return nil } @@ -16427,9 +17672,9 @@ type StoreCountriesChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -16506,9 +17751,9 @@ type StoreCreatedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -16595,9 +17840,9 @@ type StoreDeletedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -16653,9 +17898,9 @@ type StoreDistributionChannelsChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -16732,9 +17977,9 @@ type StoreLanguagesChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -16811,9 +18056,9 @@ type StoreNameSetMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -16889,9 +18134,9 @@ type StoreProductSelectionsChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -16976,9 +18221,9 @@ type StoreSupplyChannelsChangedMessage struct { CreatedAt time.Time `json:"createdAt"` // Value of `createdAt`. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Value of `createdBy`. + // IDs and references that last modified the Message. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Message. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. // `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. @@ -17239,6 +18484,12 @@ func mapDiscriminatorMessagePayload(input interface{}) (MessagePayload, error) { return nil, err } return obj, nil + case "BusinessUnitApprovalRuleModeChanged": + obj := BusinessUnitApprovalRuleModeChangedMessagePayload{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil case "BusinessUnitAssociateAdded": obj := BusinessUnitAssociateAddedMessagePayload{} if err := decodeStruct(input, &obj); err != nil { @@ -17744,6 +18995,36 @@ func mapDiscriminatorMessagePayload(input interface{}) (MessagePayload, error) { return nil, err } return obj, nil + case "ProductPriceCustomFieldAdded": + obj := ProductPriceCustomFieldAddedMessagePayload{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "ProductPriceCustomFieldChanged": + obj := ProductPriceCustomFieldChangedMessagePayload{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "ProductPriceCustomFieldRemoved": + obj := ProductPriceCustomFieldRemovedMessagePayload{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "ProductPriceCustomFieldsRemoved": + obj := ProductPriceCustomFieldsRemovedMessagePayload{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "ProductPriceCustomFieldsSet": + obj := ProductPriceCustomFieldsSetMessagePayload{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil case "ProductPriceDiscountsSet": obj := ProductPriceDiscountsSetMessagePayload{} if err := decodeStruct(input, &obj); err != nil { @@ -17891,6 +19172,18 @@ func mapDiscriminatorMessagePayload(input interface{}) (MessagePayload, error) { return nil, err } return obj, nil + case "ProductTailoringImageAdded": + obj := ProductTailoringImageAddedMessagePayload{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "ProductTailoringImagesSet": + obj := ProductTailoringImagesSetMessagePayload{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil case "ProductTailoringNameSet": obj := ProductTailoringNameSetMessagePayload{} if err := decodeStruct(input, &obj); err != nil { @@ -17933,6 +19226,18 @@ func mapDiscriminatorMessagePayload(input interface{}) (MessagePayload, error) { return nil, err } return obj, nil + case "ProductVariantTailoringAdded": + obj := ProductVariantTailoringAddedMessagePayload{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "ProductVariantTailoringRemoved": + obj := ProductVariantTailoringRemovedMessagePayload{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil case "QuoteCreated": obj := QuoteCreatedMessagePayload{} if err := decodeStruct(input, &obj); err != nil { @@ -18162,6 +19467,20 @@ func mapDiscriminatorMessagePayload(input interface{}) (MessagePayload, error) { if err := decodeStruct(input, &obj); err != nil { return nil, err } + if obj.Value != nil { + var err error + obj.Value, err = mapDiscriminatorTypedMoney(obj.Value) + if err != nil { + return nil, err + } + } + if obj.OldValue != nil { + var err error + obj.OldValue, err = mapDiscriminatorTypedMoney(obj.OldValue) + if err != nil { + return nil, err + } + } return obj, nil case "StoreCountriesChanged": obj := StoreCountriesChangedMessagePayload{} @@ -18643,6 +19962,8 @@ type BusinessUnitAddressCustomFieldAddedMessagePayload struct { Name string `json:"name"` // The added [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType). Value interface{} `json:"value"` + // `id` of the [Address](ctp:api:type:Address) to which the Custom Field was added. + AddressId *string `json:"addressId,omitempty"` } // MarshalJSON override to set the discriminator value or remove @@ -18666,6 +19987,8 @@ type BusinessUnitAddressCustomFieldChangedMessagePayload struct { Value interface{} `json:"value"` // [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType) before the [Set CustomField](ctp:api:type:BusinessUnitSetAddressCustomFieldAction) update action. OldValue interface{} `json:"oldValue,omitempty"` + // `id` of the [Address](ctp:api:type:Address) of which the Custom Field was changed. + AddressId *string `json:"addressId,omitempty"` } // MarshalJSON override to set the discriminator value or remove @@ -18685,6 +20008,8 @@ func (obj BusinessUnitAddressCustomFieldChangedMessagePayload) MarshalJSON() ([] type BusinessUnitAddressCustomFieldRemovedMessagePayload struct { // Name of the Custom Field that was removed. Name string `json:"name"` + // `id` of the [Address](ctp:api:type:Address) from which the Custom Field was removed. + AddressId *string `json:"addressId,omitempty"` } // MarshalJSON override to set the discriminator value or remove @@ -18704,6 +20029,8 @@ func (obj BusinessUnitAddressCustomFieldRemovedMessagePayload) MarshalJSON() ([] type BusinessUnitAddressCustomTypeRemovedMessagePayload struct { // `id` of the [Custom Type](ctp:api:type:Type) that was removed. Absent if there was no previous Custom Type present. OldTypeId *string `json:"oldTypeId,omitempty"` + // `id` of the [Address](ctp:api:type:Address) from which the Custom Type was removed. + AddressId *string `json:"addressId,omitempty"` } // MarshalJSON override to set the discriminator value or remove @@ -18725,6 +20052,8 @@ type BusinessUnitAddressCustomTypeSetMessagePayload struct { CustomFields CustomFields `json:"customFields"` // `id` of the previous [Custom Type](ctp:api:type:Type). Absent if there was no previous Custom Type present. OldTypeId *string `json:"oldTypeId,omitempty"` + // `id` of the [Address](ctp:api:type:Address) on which the Custom Field was set. + AddressId *string `json:"addressId,omitempty"` } // MarshalJSON override to set the discriminator value or remove @@ -18756,6 +20085,27 @@ func (obj BusinessUnitAddressRemovedMessagePayload) MarshalJSON() ([]byte, error }{Action: "BusinessUnitAddressRemoved", Alias: (*Alias)(&obj)}) } +/** +* Generated after a successful [Change Approval Rule Mode](ctp:api:type:BusinessUnitChangeApprovalRuleModeAction) update action. +* + */ +type BusinessUnitApprovalRuleModeChangedMessagePayload struct { + // [BusinessUnitApprovalRuleMode](ctp:api:type:BusinessUnitApprovalRuleMode) of the Business Unit after the [Change Approval Rule Mode](ctp:api:type:BusinessUnitChangeApprovalRuleModeAction) update action. + ApprovalRuleMode BusinessUnitApprovalRuleMode `json:"approvalRuleMode"` + // [BusinessUnitApprovalRuleMode](ctp:api:type:BusinessUnitApprovalRuleMode) of the Business Unit before the [Change Approval Rule Mode](ctp:api:type:BusinessUnitChangeApprovalRuleModeAction) update action. + OldApprovalRuleMode *BusinessUnitApprovalRuleMode `json:"oldApprovalRuleMode,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj BusinessUnitApprovalRuleModeChangedMessagePayload) MarshalJSON() ([]byte, error) { + type Alias BusinessUnitApprovalRuleModeChangedMessagePayload + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "BusinessUnitApprovalRuleModeChanged", Alias: (*Alias)(&obj)}) +} + /** * Generated after a successful [Add Associate](ctp:api:type:BusinessUnitAddAssociateAction) update action. * @@ -19465,6 +20815,8 @@ type CustomerAddressCustomFieldAddedMessagePayload struct { Name string `json:"name"` // The added [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType). Value interface{} `json:"value"` + // `id` of the [Address](ctp:api:type:Address) to which the Custom Field was added. + AddressId *string `json:"addressId,omitempty"` } // MarshalJSON override to set the discriminator value or remove @@ -19489,6 +20841,8 @@ type CustomerAddressCustomFieldChangedMessagePayload struct { // [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType) before the [Set CustomField](ctp:api:type:CustomerSetAddressCustomFieldAction) update action. // When there has not been a Custom Field with the `name` on the Customer Address before, a [Customer Address Custom Field Added](ctp:api:type:CustomerAddressCustomFieldAddedMessage) Message is generated instead. PreviousValue interface{} `json:"previousValue,omitempty"` + // `id` of the [Address](ctp:api:type:Address) of which the Custom Field was changed. + AddressId *string `json:"addressId,omitempty"` } // MarshalJSON override to set the discriminator value or remove @@ -19508,6 +20862,8 @@ func (obj CustomerAddressCustomFieldChangedMessagePayload) MarshalJSON() ([]byte type CustomerAddressCustomFieldRemovedMessagePayload struct { // Name of the Custom Field that was removed. Name string `json:"name"` + // `id` of the [Address](ctp:api:type:Address) from which the Custom Field was removed. + AddressId *string `json:"addressId,omitempty"` } // MarshalJSON override to set the discriminator value or remove @@ -19527,6 +20883,8 @@ func (obj CustomerAddressCustomFieldRemovedMessagePayload) MarshalJSON() ([]byte type CustomerAddressCustomTypeRemovedMessagePayload struct { // `id` of the [Custom Type](ctp:api:type:Type) that was removed. Absent if there was no previous Custom Type present. PreviousTypeId *string `json:"previousTypeId,omitempty"` + // `id` of the [Address](ctp:api:type:Address) from which the Custom Type was removed. + AddressId *string `json:"addressId,omitempty"` } // MarshalJSON override to set the discriminator value or remove @@ -19548,6 +20906,8 @@ type CustomerAddressCustomTypeSetMessagePayload struct { CustomFields CustomFields `json:"customFields"` // `id` of the previous [Custom Type](ctp:api:type:Type). Absent if there was no previous Custom Type present. PreviousTypeId *string `json:"previousTypeId,omitempty"` + // `id` of the [Address](ctp:api:type:Address) on which the Custom Field was set. + AddressId *string `json:"addressId,omitempty"` } // MarshalJSON override to set the discriminator value or remove @@ -20192,6 +21552,36 @@ func mapDiscriminatorOrderMessagePayload(input interface{}) (OrderMessagePayload return nil, err } return obj, nil + case "DeliveryCustomFieldAdded": + obj := DeliveryCustomFieldAddedMessagePayload{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "DeliveryCustomFieldChanged": + obj := DeliveryCustomFieldChangedMessagePayload{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "DeliveryCustomFieldRemoved": + obj := DeliveryCustomFieldRemovedMessagePayload{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "DeliveryCustomTypeRemoved": + obj := DeliveryCustomTypeRemovedMessagePayload{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "DeliveryCustomTypeSet": + obj := DeliveryCustomTypeSetMessagePayload{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil case "DeliveryItemsUpdated": obj := DeliveryItemsUpdatedMessagePayload{} if err := decodeStruct(input, &obj); err != nil { @@ -20483,7 +21873,7 @@ type CustomLineItemStateTransitionMessagePayload struct { CustomLineItemId string `json:"customLineItemId"` // User-defined unique identifier of the [Custom Line Item](ctp:api:type:CustomLineItem). CustomLineItemKey *string `json:"customLineItemKey,omitempty"` - // Date and time (UTC) when the transition of the [Custom Line Item](ctp:api:type:CustomLineItem) [State](ctp:api:type:State) was performed. + // Date and time (UTC) the transition of the [Custom Line Item](ctp:api:type:CustomLineItem) [State](ctp:api:type:State) was performed. TransitionDate time.Time `json:"transitionDate"` // Number of [Custom Line Items](ctp:api:type:CustomLineItem) for which the [State](ctp:api:type:State) was transitioned. Quantity int `json:"quantity"` @@ -20495,58 +21885,172 @@ type CustomLineItemStateTransitionMessagePayload struct { // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj CustomLineItemStateTransitionMessagePayload) MarshalJSON() ([]byte, error) { - type Alias CustomLineItemStateTransitionMessagePayload +func (obj CustomLineItemStateTransitionMessagePayload) MarshalJSON() ([]byte, error) { + type Alias CustomLineItemStateTransitionMessagePayload + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "CustomLineItemStateTransition", Alias: (*Alias)(&obj)}) +} + +/** +* Generated after a successful [Add Delivery](ctp:api:type:OrderAddDeliveryAction) update action. +* + */ +type DeliveryAddedMessagePayload struct { + // [Delivery](ctp:api:type:Delivery) that was added to the [Order](ctp:api:type:Order). The [Delivery](ctp:api:type:Delivery) in the Message body does not contain [Parcels](ctp:api:type:Parcel) if those were part of the initial [Add Delivery](ctp:api:type:OrderAddDeliveryAction) update action. In that case, the update action produces an additional [Parcel Added To Delivery](ctp:api:type:ParcelAddedToDeliveryMessage) Message containing information about the [Parcels](ctp:api:type:Parcel). + Delivery Delivery `json:"delivery"` + // User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). + ShippingKey *string `json:"shippingKey,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj DeliveryAddedMessagePayload) MarshalJSON() ([]byte, error) { + type Alias DeliveryAddedMessagePayload + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "DeliveryAdded", Alias: (*Alias)(&obj)}) +} + +/** +* Generated after a successful [Set Delivery Address](ctp:api:type:OrderSetDeliveryAddressAction) update action. +* + */ +type DeliveryAddressSetMessagePayload struct { + // Unique identifier of the [Delivery](ctp:api:type:Delivery). + DeliveryId string `json:"deliveryId"` + // [Address](ctp:api:type:Address) after the [Set Delivery Address](ctp:api:type:OrderSetDeliveryAddressAction) update action. + Address *Address `json:"address,omitempty"` + // [Address](ctp:api:type:Address) before the [Set Delivery Address](ctp:api:type:OrderSetDeliveryAddressAction) update action. + OldAddress *Address `json:"oldAddress,omitempty"` + // User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). + ShippingKey *string `json:"shippingKey,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj DeliveryAddressSetMessagePayload) MarshalJSON() ([]byte, error) { + type Alias DeliveryAddressSetMessagePayload + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "DeliveryAddressSet", Alias: (*Alias)(&obj)}) +} + +/** +* Generated after adding a Custom Field to a Delivery using the [Set CustomField](ctp:api:type:OrderSetDeliveryCustomFieldAction) update action. +* + */ +type DeliveryCustomFieldAddedMessagePayload struct { + // Name of the Custom Field that was added. + Name string `json:"name"` + // The added [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType). + Value interface{} `json:"value"` + // Unique identifier of the [Delivery](ctp:api:type:Delivery). + DeliveryId string `json:"deliveryId"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj DeliveryCustomFieldAddedMessagePayload) MarshalJSON() ([]byte, error) { + type Alias DeliveryCustomFieldAddedMessagePayload + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "DeliveryCustomFieldAdded", Alias: (*Alias)(&obj)}) +} + +/** +* Generated when an existing Custom Field on a Delivery has been changed using the [Set CustomField](ctp:api:type:OrderSetDeliveryCustomFieldAction) update action. +* + */ +type DeliveryCustomFieldChangedMessagePayload struct { + // Name of the Custom Field that changed. + Name string `json:"name"` + // [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType) after the [Set CustomField](ctp:api:type:OrderSetDeliveryCustomFieldAction) update action. + Value interface{} `json:"value"` + // [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType) before the [Set CustomField](ctp:api:type:OrderSetDeliveryCustomFieldAction) update action. + // When there has not been a Custom Field with the `name` on the Delivery before, a [Delivery Custom Field Added](ctp:api:type:DeliveryCustomFieldAddedMessage) Message is generated instead. + PreviousValue interface{} `json:"previousValue,omitempty"` + // Unique identifier of the [Delivery](ctp:api:type:Delivery). + DeliveryId string `json:"deliveryId"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj DeliveryCustomFieldChangedMessagePayload) MarshalJSON() ([]byte, error) { + type Alias DeliveryCustomFieldChangedMessagePayload + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "DeliveryCustomFieldChanged", Alias: (*Alias)(&obj)}) +} + +/** +* Generated when a Custom Field has been removed from the Delivery using the [Set CustomField](ctp:api:type:OrderSetDeliveryCustomFieldAction) update action. +* + */ +type DeliveryCustomFieldRemovedMessagePayload struct { + // Name of the Custom Field that was removed. + Name string `json:"name"` + // Unique identifier of the [Delivery](ctp:api:type:Delivery). + DeliveryId string `json:"deliveryId"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj DeliveryCustomFieldRemovedMessagePayload) MarshalJSON() ([]byte, error) { + type Alias DeliveryCustomFieldRemovedMessagePayload return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "CustomLineItemStateTransition", Alias: (*Alias)(&obj)}) + }{Action: "DeliveryCustomFieldRemoved", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Add Delivery](ctp:api:type:OrderAddDeliveryAction) update action. +* Generated after removing a Custom Type from a Delivery using the [Set Custom Type](ctp:api:type:OrderSetDeliveryCustomTypeAction) update action with empty parameters. * */ -type DeliveryAddedMessagePayload struct { - // [Delivery](ctp:api:type:Delivery) that was added to the [Order](ctp:api:type:Order). The [Delivery](ctp:api:type:Delivery) in the Message body does not contain [Parcels](ctp:api:type:Parcel) if those were part of the initial [Add Delivery](ctp:api:type:OrderAddDeliveryAction) update action. In that case, the update action produces an additional [Parcel Added To Delivery](ctp:api:type:ParcelAddedToDeliveryMessage) Message containing information about the [Parcels](ctp:api:type:Parcel). - Delivery Delivery `json:"delivery"` - // User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). - ShippingKey *string `json:"shippingKey,omitempty"` +type DeliveryCustomTypeRemovedMessagePayload struct { + // `id` of the [Custom Type](ctp:api:type:Type) that was removed. Absent if there was no previous Custom Type present. + PreviousTypeId *string `json:"previousTypeId,omitempty"` + // Unique identifier of the [Delivery](ctp:api:type:Delivery). + DeliveryId string `json:"deliveryId"` } // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj DeliveryAddedMessagePayload) MarshalJSON() ([]byte, error) { - type Alias DeliveryAddedMessagePayload +func (obj DeliveryCustomTypeRemovedMessagePayload) MarshalJSON() ([]byte, error) { + type Alias DeliveryCustomTypeRemovedMessagePayload return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "DeliveryAdded", Alias: (*Alias)(&obj)}) + }{Action: "DeliveryCustomTypeRemoved", Alias: (*Alias)(&obj)}) } /** -* Generated after a successful [Set Delivery Address](ctp:api:type:OrderSetDeliveryAddressAction) update action. +* Generated after adding a Custom Type to a Delivery using the [Set Custom Type](ctp:api:type:OrderSetDeliveryCustomTypeAction) update action. * */ -type DeliveryAddressSetMessagePayload struct { - // Unique identifier of the [Parcel](ctp:api:type:Delivery). +type DeliveryCustomTypeSetMessagePayload struct { + // The Custom Fields that have been set. + CustomFields CustomFields `json:"customFields"` + // `id` of the previous [Custom Type](ctp:api:type:Type). Absent if there was no previous Custom Type present. + PreviousTypeId *string `json:"previousTypeId,omitempty"` + // Unique identifier of the [Delivery](ctp:api:type:Delivery). DeliveryId string `json:"deliveryId"` - // [Address](ctp:api:type:Address) after the [Set Delivery Address](ctp:api:type:OrderSetDeliveryAddressAction) update action. - Address *Address `json:"address,omitempty"` - // [Address](ctp:api:type:Address) before the [Set Delivery Address](ctp:api:type:OrderSetDeliveryAddressAction) update action. - OldAddress *Address `json:"oldAddress,omitempty"` - // User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). - ShippingKey *string `json:"shippingKey,omitempty"` } // MarshalJSON override to set the discriminator value or remove // optional nil slices -func (obj DeliveryAddressSetMessagePayload) MarshalJSON() ([]byte, error) { - type Alias DeliveryAddressSetMessagePayload +func (obj DeliveryCustomTypeSetMessagePayload) MarshalJSON() ([]byte, error) { + type Alias DeliveryCustomTypeSetMessagePayload return json.Marshal(struct { Action string `json:"type"` *Alias - }{Action: "DeliveryAddressSet", Alias: (*Alias)(&obj)}) + }{Action: "DeliveryCustomTypeSet", Alias: (*Alias)(&obj)}) } /** @@ -20604,7 +22108,7 @@ type LineItemStateTransitionMessagePayload struct { LineItemId string `json:"lineItemId"` // User-defined unique identifier of the LineItem. LineItemKey *string `json:"lineItemKey,omitempty"` - // Date and time (UTC) when the transition of the [Line Item](ctp:api:type:LineItem) [State](ctp:api:type:State) was performed. + // Date and time (UTC) the transition of the [Line Item](ctp:api:type:LineItem) [State](ctp:api:type:State) was performed. TransitionDate time.Time `json:"transitionDate"` // Number of [Line Items](ctp:api:type:LineItem) for which the [State](ctp:api:type:State) was transitioned. Quantity int `json:"quantity"` @@ -21080,7 +22584,7 @@ type OrderLineItemDiscountSetMessagePayload struct { // Array of [DiscountedLineItemPriceForQuantity](ctp:api:type:DiscountedLineItemPriceForQuantity) after the Discount recalculation. DiscountedPricePerQuantity []DiscountedLineItemPriceForQuantity `json:"discountedPricePerQuantity"` // Total Price of the [Line Item](ctp:api:type:LineItem) after the Discount recalculation. - TotalPrice Money `json:"totalPrice"` + TotalPrice CentPrecisionMoney `json:"totalPrice"` // [TaxedItemPrice](ctp:api:type:TaxedItemPrice) of the [Line Item](ctp:api:type:LineItem) after the Discount recalculation. TaxedPrice *TaxedItemPrice `json:"taxedPrice,omitempty"` // Total taxed prices based on the quantity of Line Item assigned to each [Shipping Method](ctp:api:type:ShippingMethod). Only applicable for Carts with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). @@ -21130,19 +22634,19 @@ type OrderLineItemRemovedMessagePayload struct { LineItemId string `json:"lineItemId"` // User-defined unique identifier of the LineItem. LineItemKey *string `json:"lineItemKey,omitempty"` - // Quantity of [Line Items](ctp:api:type:LineItem) that were removed during the [Remove Line Item](ctp:api:type:StagedOrderRemoveLineItemAction) update action. + // Quantity of [Line Items](ctp:api:type:LineItem) that were removed during the [Remove LineItem](ctp:api:type:StagedOrderRemoveLineItemAction) update action. RemovedQuantity int `json:"removedQuantity"` - // [Line Item](ctp:api:type:LineItem) quantity after the [Remove Line Item](ctp:api:type:StagedOrderRemoveLineItemAction) update action. + // [Line Item](ctp:api:type:LineItem) quantity after the [Remove LineItem](ctp:api:type:StagedOrderRemoveLineItemAction) update action. NewQuantity int `json:"newQuantity"` - // [ItemStates](ctp:api:type:ItemState) after the [Remove Line Item](ctp:api:type:StagedOrderRemoveLineItemAction) update action. + // [ItemStates](ctp:api:type:ItemState) after the [Remove LineItem](ctp:api:type:StagedOrderRemoveLineItemAction) update action. NewState []ItemState `json:"newState"` - // `totalPrice` of the [Order](ctp:api:type:Order) after the [Remove Line Item](ctp:api:type:StagedOrderRemoveLineItemAction) update action. + // `totalPrice` of the [Order](ctp:api:type:Order) after the [Remove LineItem](ctp:api:type:StagedOrderRemoveLineItemAction) update action. NewTotalPrice CentPrecisionMoney `json:"newTotalPrice"` - // [TaxedItemPrice](ctp:api:type:TaxedItemPrice) of the [Order](ctp:api:type:Order) after the [Remove Line Item](ctp:api:type:StagedOrderRemoveLineItemAction) update action. + // [TaxedItemPrice](ctp:api:type:TaxedItemPrice) of the [Order](ctp:api:type:Order) after the [Remove LineItem](ctp:api:type:StagedOrderRemoveLineItemAction) update action. NewTaxedPrice *TaxedItemPrice `json:"newTaxedPrice,omitempty"` - // [Price](ctp:api:type:Price) of the [Order](ctp:api:type:Order) after the [Remove Line Item](ctp:api:type:StagedOrderRemoveLineItemAction) update action. + // [Price](ctp:api:type:Price) of the [Order](ctp:api:type:Order) after the [Remove LineItem](ctp:api:type:StagedOrderRemoveLineItemAction) update action. NewPrice *Price `json:"newPrice,omitempty"` - // [Shipping Details](ctp:api:type:ItemShippingDetails) of the [Order](ctp:api:type:Order) after the [Remove Line Item](ctp:api:type:StagedOrderRemoveLineItemAction) update action. + // [Shipping Details](ctp:api:type:ItemShippingDetails) of the [Order](ctp:api:type:Order) after the [Remove LineItem](ctp:api:type:StagedOrderRemoveLineItemAction) update action. NewShippingDetail *ItemShippingDetails `json:"newShippingDetail,omitempty"` } @@ -21744,7 +23248,7 @@ func (obj ProductImageAddedMessagePayload) MarshalJSON() ([]byte, error) { type ProductPriceAddedMessagePayload struct { // Unique identifier of the [ProductVariant](ctp:api:type:ProductVariant) for which the Price was added. VariantId int `json:"variantId"` - // The [Embedded Price](/projects/products#embedded-price) that was added to the [ProductVariant](ctp:api:type:ProductVariant). + // The Embedded Price that was added to the [ProductVariant](ctp:api:type:ProductVariant). Price Price `json:"price"` // Whether the update was only applied to the staged [Product Projection](ctp:api:type:ProductProjection). Staged bool `json:"staged"` @@ -21767,13 +23271,13 @@ func (obj ProductPriceAddedMessagePayload) MarshalJSON() ([]byte, error) { type ProductPriceChangedMessagePayload struct { // Unique identifier of the [ProductVariant](ctp:api:type:ProductVariant) for which the Price was changed. VariantId int `json:"variantId"` - // The current [Embedded Price](/projects/products#embedded-price) before the [Change Embedded Price](ctp:api:type:ProductChangePriceAction) update action. + // The current Embedded Price before the [Change Embedded Price](ctp:api:type:ProductChangePriceAction) update action. OldPrice Price `json:"oldPrice"` - // The [Embedded Price](/projects/products#embedded-price) after the [Change Embedded Price](ctp:api:type:ProductChangePriceAction) update action. + // The Embedded Price after the [Change Embedded Price](ctp:api:type:ProductChangePriceAction) update action. NewPrice Price `json:"newPrice"` // Whether the update was only applied to the staged [Product Projection](ctp:api:type:ProductProjection). Staged bool `json:"staged"` - // The staged [Embedded Price](/projects/products#embedded-price) before the [Change Embedded Price](ctp:api:type:ProductChangePriceAction) update action. + // The staged Embedded Price before the [Change Embedded Price](ctp:api:type:ProductChangePriceAction) update action. OldStagedPrice *Price `json:"oldStagedPrice,omitempty"` } @@ -21787,6 +23291,135 @@ func (obj ProductPriceChangedMessagePayload) MarshalJSON() ([]byte, error) { }{Action: "ProductPriceChanged", Alias: (*Alias)(&obj)}) } +/** +* Generated after adding a Custom Field to a Price using the [Set Price CustomField](ctp:api:type:ProductSetProductPriceCustomFieldAction) update action. +* + */ +type ProductPriceCustomFieldAddedMessagePayload struct { + // Unique identifier of the [Price](ctp:api:type:Price) to which the Custom Field was added. + PriceId string `json:"priceId"` + // Unique identifier of the [ProductVariant](ctp:api:type:ProductVariant) to which the Price belongs. + VariantId int `json:"variantId"` + // Whether the update was only applied to the staged [Product Projection](ctp:api:type:ProductProjection). + Staged bool `json:"staged"` + // Name of the Custom Field that was added. + Name string `json:"name"` + // The added [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType). + Value interface{} `json:"value"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductPriceCustomFieldAddedMessagePayload) MarshalJSON() ([]byte, error) { + type Alias ProductPriceCustomFieldAddedMessagePayload + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "ProductPriceCustomFieldAdded", Alias: (*Alias)(&obj)}) +} + +/** +* Generated after changing an existing Custom Field on a Price using the [Set Price CustomField](ctp:api:type:ProductSetProductPriceCustomFieldAction) update action. +* + */ +type ProductPriceCustomFieldChangedMessagePayload struct { + // Unique identifier of the [Price](ctp:api:type:Price) of which the Custom Field was changed. + PriceId string `json:"priceId"` + // Unique identifier of the [ProductVariant](ctp:api:type:ProductVariant) to which the Price belongs. + VariantId int `json:"variantId"` + // Whether the update was only applied to the staged [Product Projection](ctp:api:type:ProductProjection). + Staged bool `json:"staged"` + // Name of the Custom Field that was changed. + Name string `json:"name"` + // [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType) after the [Set Price CustomField](ctp:api:type:ProductSetProductPriceCustomFieldAction) update action. + Value interface{} `json:"value"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductPriceCustomFieldChangedMessagePayload) MarshalJSON() ([]byte, error) { + type Alias ProductPriceCustomFieldChangedMessagePayload + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "ProductPriceCustomFieldChanged", Alias: (*Alias)(&obj)}) +} + +/** +* Generated after removing a Custom Field from a Price using the [Set Price CustomField](ctp:api:type:ProductSetProductPriceCustomFieldAction) update action. +* + */ +type ProductPriceCustomFieldRemovedMessagePayload struct { + // Unique identifier of the [Price](ctp:api:type:Price) from which the Custom Field was removed. + PriceId string `json:"priceId"` + // Unique identifier of the [ProductVariant](ctp:api:type:ProductVariant) to which the Price belongs. + VariantId int `json:"variantId"` + // Whether the update was only applied to the staged [Product Projection](ctp:api:type:ProductProjection). + Staged bool `json:"staged"` + // Name of the Custom Field that was removed. + Name string `json:"name"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductPriceCustomFieldRemovedMessagePayload) MarshalJSON() ([]byte, error) { + type Alias ProductPriceCustomFieldRemovedMessagePayload + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "ProductPriceCustomFieldRemoved", Alias: (*Alias)(&obj)}) +} + +/** +* Generated after removing a Custom Type from a Price using the [Set Price Custom Type](ctp:api:type:ProductSetProductPriceCustomTypeAction) update action. +* + */ +type ProductPriceCustomFieldsRemovedMessagePayload struct { + // Unique identifier of the [Price](ctp:api:type:Price) from which the Custom Type was removed. + PriceId string `json:"priceId"` + // Unique identifier of the [ProductVariant](ctp:api:type:ProductVariant) to which the Price belongs. + VariantId int `json:"variantId"` + // Whether the update was only applied to the staged [Product Projection](ctp:api:type:ProductProjection). + Staged bool `json:"staged"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductPriceCustomFieldsRemovedMessagePayload) MarshalJSON() ([]byte, error) { + type Alias ProductPriceCustomFieldsRemovedMessagePayload + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "ProductPriceCustomFieldsRemoved", Alias: (*Alias)(&obj)}) +} + +/** +* Generated after a successful [Set Price Custom Type](ctp:api:type:ProductSetProductPriceCustomTypeAction) update action. +* + */ +type ProductPriceCustomFieldsSetMessagePayload struct { + // Unique identifier of the [Price](ctp:api:type:Price) on which the Custom Type was set. + PriceId string `json:"priceId"` + // Unique identifier of the [ProductVariant](ctp:api:type:ProductVariant) to which the Price belongs. + VariantId int `json:"variantId"` + // Whether the update was only applied to the staged [Product Projection](ctp:api:type:ProductProjection). + Staged bool `json:"staged"` + // Custom Fields that were set. + CustomField CustomFields `json:"customField"` + // `id` of the previous [Custom Type](ctp:api:type:Type). Absent if there was no previous Custom Type present. + OldTypeId *string `json:"oldTypeId,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductPriceCustomFieldsSetMessagePayload) MarshalJSON() ([]byte, error) { + type Alias ProductPriceCustomFieldsSetMessagePayload + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "ProductPriceCustomFieldsSet", Alias: (*Alias)(&obj)}) +} + /** * Generated after a Price is updated due to a [Product Discount](ctp:api:type:ProductDiscount). * @@ -21887,7 +23520,7 @@ func (obj ProductPriceModeSetMessagePayload) MarshalJSON() ([]byte, error) { type ProductPriceRemovedMessagePayload struct { // Unique identifier of the [ProductVariant](ctp:api:type:ProductVariant) for which the Price was removed. VariantId int `json:"variantId"` - // The [Embedded Price](/projects/products#embedded-price) that was removed from the [ProductVariant](ctp:api:type:ProductVariant). + // The Embedded Price that was removed from the [ProductVariant](ctp:api:type:ProductVariant). Price Price `json:"price"` // Whether the update was only applied to the staged [Product Projection](ctp:api:type:ProductProjection). Staged bool `json:"staged"` @@ -22237,6 +23870,14 @@ type ProductTailoringCreatedMessagePayload struct { Name *LocalizedString `json:"name,omitempty"` // The slug of the [Product Tailoring](ctp:api:type:ProductTailoring) at the time of creation. Slug *LocalizedString `json:"slug,omitempty"` + // The metaTitle of the [Product Tailoring](ctp:api:type:ProductTailoring) at the time of creation. + MetaTitle *LocalizedString `json:"metaTitle,omitempty"` + // The metaDescription of the [Product Tailoring](ctp:api:type:ProductTailoring) at the time of creation. + MetaDescription *LocalizedString `json:"metaDescription,omitempty"` + // The metaKeywords of the [Product Tailoring](ctp:api:type:ProductTailoring) at the time of creation. + MetaKeywords *LocalizedString `json:"metaKeywords,omitempty"` + // The variants of the [Product Tailoring](ctp:api:type:ProductTailoring) at the time of creation. + Variants []ProductVariantTailoring `json:"variants"` // `true` if the ProductTailoring is published. Published bool `json:"published"` } @@ -22245,10 +23886,25 @@ type ProductTailoringCreatedMessagePayload struct { // optional nil slices func (obj ProductTailoringCreatedMessagePayload) MarshalJSON() ([]byte, error) { type Alias ProductTailoringCreatedMessagePayload - return json.Marshal(struct { + data, err := json.Marshal(struct { Action string `json:"type"` *Alias }{Action: "ProductTailoringCreated", Alias: (*Alias)(&obj)}) + if err != nil { + return nil, err + } + + raw := make(map[string]interface{}) + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + if raw["variants"] == nil { + delete(raw, "variants") + } + + return json.Marshal(raw) + } /** @@ -22302,6 +23958,82 @@ func (obj ProductTailoringDescriptionSetMessagePayload) MarshalJSON() ([]byte, e }{Action: "ProductTailoringDescriptionSet", Alias: (*Alias)(&obj)}) } +/** +* Generated after a successful [Add External Image](ctp:api:type:ProductTailoringAddExternalImageAction) update action +* or after a successful [Upload Product Tailoring image](/projects/product-tailoring#upload-product-tailoring-image) request. +* + */ +type ProductTailoringImageAddedMessagePayload struct { + // The Store to which the Product Tailoring belongs. + Store StoreKeyReference `json:"store"` + // `key` of the tailored Product. + ProductKey *string `json:"productKey,omitempty"` + // Reference to the tailored Product. + Product ProductReference `json:"product"` + // `id` of the tailored [ProductVariant](ctp:api:type:ProductVariant). + VariantId int `json:"variantId"` + // [Image](ctp:api:type:Image) that was added. + Image Image `json:"image"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringImageAddedMessagePayload) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringImageAddedMessagePayload + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "ProductTailoringImageAdded", Alias: (*Alias)(&obj)}) +} + +/** +* Generated after a successful [Set Images](ctp:api:type:ProductTailoringSetExternalImagesAction) update action. +* + */ +type ProductTailoringImagesSetMessagePayload struct { + // The Store to which the Product Tailoring belongs. + Store StoreKeyReference `json:"store"` + // `key` of the tailored Product. + ProductKey *string `json:"productKey,omitempty"` + // Reference to the Product the Product Tailoring belongs to. + Product ProductReference `json:"product"` + // `id` of the tailored Product Variant. + VariantId int `json:"variantId"` + // [Images](ctp:api:type:Image) on the tailored [Product Variant](ctp:api:type:ProductVariantTailoring) before the [Set Images](ctp:api:type:ProductTailoringSetExternalImagesAction) update action. + OldImages []Image `json:"oldImages"` + // [Images](ctp:api:type:Image) on the tailored [Product Variant](ctp:api:type:ProductVariantTailoring) after the [Set Images](ctp:api:type:ProductTailoringSetExternalImagesAction) update action. + Images []Image `json:"images"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringImagesSetMessagePayload) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringImagesSetMessagePayload + data, err := json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "ProductTailoringImagesSet", Alias: (*Alias)(&obj)}) + if err != nil { + return nil, err + } + + raw := make(map[string]interface{}) + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + if raw["oldImages"] == nil { + delete(raw, "oldImages") + } + + if raw["images"] == nil { + delete(raw, "images") + } + + return json.Marshal(raw) + +} + /** * Generated after a successful Product Tailoring [Set Name](ctp:api:type:ProductTailoringSetNameAction) update action. * @@ -22461,6 +24193,60 @@ func (obj ProductVariantDeletedMessagePayload) MarshalJSON() ([]byte, error) { }{Action: "ProductVariantDeleted", Alias: (*Alias)(&obj)}) } +/** +* Generated after a successful [Add ProductVariant Tailoring](ctp:api:type:ProductTailoringAddVariantAction) update action. +* + */ +type ProductVariantTailoringAddedMessagePayload struct { + // The Store to which the Product Tailoring belongs. + Store StoreKeyReference `json:"store"` + // `key` of the tailored Product. + ProductKey *string `json:"productKey,omitempty"` + // Reference to the tailored Product. + Product ProductReference `json:"product"` + // `id` of the [ProductVariant](ctp:api:type:ProductVariant) added to the Tailoring. + VariantId int `json:"variantId"` + // The [ProductVariantTailoring](ctp:api:type:ProductVariantTailoring) that was added to the ProductTailoring. + Variant ProductVariantTailoring `json:"variant"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductVariantTailoringAddedMessagePayload) MarshalJSON() ([]byte, error) { + type Alias ProductVariantTailoringAddedMessagePayload + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "ProductVariantTailoringAdded", Alias: (*Alias)(&obj)}) +} + +/** +* Generated after a successful [Remove ProductVariant Tailoring](ctp:api:type:ProductTailoringRemoveVariantAction) update action. +* + */ +type ProductVariantTailoringRemovedMessagePayload struct { + // The Store to which the Product Tailoring belongs. + Store StoreKeyReference `json:"store"` + // `key` of the tailored Product. + ProductKey *string `json:"productKey,omitempty"` + // Reference to the Product the Product Tailoring belongs to. + Product ProductReference `json:"product"` + // `id` of the [ProductVariant](ctp:api:type:ProductVariant) removed from the Tailoring. + VariantId int `json:"variantId"` + // The [ProductVariantTailoring](ctp:api:type:ProductVariantTailoring) that was removed from the ProductTailoring. + Variant ProductVariantTailoring `json:"variant"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductVariantTailoringRemovedMessagePayload) MarshalJSON() ([]byte, error) { + type Alias ProductVariantTailoringRemovedMessagePayload + return json.Marshal(struct { + Action string `json:"type"` + *Alias + }{Action: "ProductVariantTailoringRemoved", Alias: (*Alias)(&obj)}) +} + /** * Generated after a successful [Create Quote](ctp:api:endpoint:/{projectKey}/quotes:POST) request. * @@ -22845,7 +24631,7 @@ func (obj ReviewStateTransitionMessagePayload) MarshalJSON() ([]byte, error) { } type ShoppingListStoreSetMessagePayload struct { - // [Reference](ctp:api:type:Reference) to a [Store](ctp:api:type:Store) by its key. + // [KeyReference](ctp:api:type:KeyReference) to a [Store](ctp:api:type:Store). Store StoreKeyReference `json:"store"` } @@ -23265,12 +25051,37 @@ func (obj StandalonePriceValidUntilSetMessagePayload) MarshalJSON() ([]byte, err */ type StandalonePriceValueChangedMessagePayload struct { // The new value of the updated [StandalonePrice](ctp:api:type:StandalonePrice). - Value Money `json:"value"` + Value TypedMoney `json:"value"` // Whether the new value was applied to the current or the staged representation of the StandalonePrice. Staged changes are stored on the [StagedStandalonePrice](ctp:api:type:StagedStandalonePrice). Staged bool `json:"staged"` // The old value of the updated [StandalonePrice](ctp:api:type:StandalonePrice). // Present on Messages created after 3 February 2023. Optional for backwards compatibility. - OldValue *Money `json:"oldValue,omitempty"` + OldValue TypedMoney `json:"oldValue,omitempty"` +} + +// UnmarshalJSON override to deserialize correct attribute types based +// on the discriminator value +func (obj *StandalonePriceValueChangedMessagePayload) UnmarshalJSON(data []byte) error { + type Alias StandalonePriceValueChangedMessagePayload + if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + return err + } + if obj.Value != nil { + var err error + obj.Value, err = mapDiscriminatorTypedMoney(obj.Value) + if err != nil { + return err + } + } + if obj.OldValue != nil { + var err error + obj.OldValue, err = mapDiscriminatorTypedMoney(obj.OldValue) + if err != nil { + return err + } + } + + return nil } // MarshalJSON override to set the discriminator value or remove diff --git a/platform/types_order.go b/platform/types_order.go index 70aceab3..4ce6d485 100644 --- a/platform/types_order.go +++ b/platform/types_order.go @@ -490,6 +490,18 @@ func mapDiscriminatorStagedOrderUpdateAction(input interface{}) (StagedOrderUpda return nil, err } return obj, nil + case "setShippingCustomField": + obj := StagedOrderSetShippingCustomFieldAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "setShippingCustomType": + obj := StagedOrderSetShippingCustomTypeAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil case "setShippingMethod": obj := StagedOrderSetShippingMethodAction{} if err := decodeStruct(input, &obj); err != nil { @@ -581,6 +593,31 @@ type OrderPagedSearchResponse struct { Hits []Hit `json:"hits"` } +/** +* Possible values for the `customType` property on [query expressions](/../api/projects/order-search#query-expressions) indicating the data type of the `field`. + */ +type OrderSearchCustomType string + +const ( + OrderSearchCustomTypeBooleanType OrderSearchCustomType = "BooleanType" + OrderSearchCustomTypeStringType OrderSearchCustomType = "StringType" + OrderSearchCustomTypeLocalizedStringType OrderSearchCustomType = "LocalizedStringType" + OrderSearchCustomTypeEnumType OrderSearchCustomType = "EnumType" + OrderSearchCustomTypeLocalizedEnumType OrderSearchCustomType = "LocalizedEnumType" + OrderSearchCustomTypeNumberType OrderSearchCustomType = "NumberType" + OrderSearchCustomTypeDateType OrderSearchCustomType = "DateType" + OrderSearchCustomTypeTimeType OrderSearchCustomType = "TimeType" + OrderSearchCustomTypeDateTimeType OrderSearchCustomType = "DateTimeType" + OrderSearchCustomTypeSetTypeStringType OrderSearchCustomType = "SetType.StringType" + OrderSearchCustomTypeSetTypeLocalizedStringType OrderSearchCustomType = "SetType.LocalizedStringType" + OrderSearchCustomTypeSetTypeEnumType OrderSearchCustomType = "SetType.EnumType" + OrderSearchCustomTypeSetTypeLocalizedEnumType OrderSearchCustomType = "SetType.LocalizedEnumType" + OrderSearchCustomTypeSetTypeNumberType OrderSearchCustomType = "SetType.NumberType" + OrderSearchCustomTypeSetTypeDateType OrderSearchCustomType = "SetType.DateType" + OrderSearchCustomTypeSetTypeTimeType OrderSearchCustomType = "SetType.TimeType" + OrderSearchCustomTypeSetTypeDateTimeType OrderSearchCustomType = "SetType.DateTimeType" +) + type OrderSearchMatchType string const ( @@ -589,51 +626,57 @@ const ( ) type OrderSearchQueryExpressionValue struct { - Field string `json:"field"` - Boost *int `json:"boost,omitempty"` - CustomType *string `json:"customType,omitempty"` + Field string `json:"field"` + Boost *int `json:"boost,omitempty"` + // Possible values for the `customType` property on [query expressions](/../api/projects/order-search#query-expressions) indicating the data type of the `field`. + CustomType *OrderSearchCustomType `json:"customType,omitempty"` } type OrderSearchAnyValue struct { - Field string `json:"field"` - Boost *int `json:"boost,omitempty"` - CustomType *string `json:"customType,omitempty"` - Value interface{} `json:"value"` - Language *string `json:"language,omitempty"` - CaseInsensitive *bool `json:"caseInsensitive,omitempty"` + Field string `json:"field"` + Boost *int `json:"boost,omitempty"` + // Possible values for the `customType` property on [query expressions](/../api/projects/order-search#query-expressions) indicating the data type of the `field`. + CustomType *OrderSearchCustomType `json:"customType,omitempty"` + Value interface{} `json:"value"` + Language *string `json:"language,omitempty"` + CaseInsensitive *bool `json:"caseInsensitive,omitempty"` } type OrderSearchDateRangeValue struct { - Field string `json:"field"` - Boost *int `json:"boost,omitempty"` - CustomType *string `json:"customType,omitempty"` - Gte *time.Time `json:"gte,omitempty"` - Lte *time.Time `json:"lte,omitempty"` + Field string `json:"field"` + Boost *int `json:"boost,omitempty"` + // Possible values for the `customType` property on [query expressions](/../api/projects/order-search#query-expressions) indicating the data type of the `field`. + CustomType *OrderSearchCustomType `json:"customType,omitempty"` + Gte *time.Time `json:"gte,omitempty"` + Lte *time.Time `json:"lte,omitempty"` } type OrderSearchFullTextValue struct { - Field string `json:"field"` - Boost *int `json:"boost,omitempty"` - CustomType *string `json:"customType,omitempty"` - Value string `json:"value"` - Language *string `json:"language,omitempty"` - MustMatch *OrderSearchMatchType `json:"mustMatch,omitempty"` + Field string `json:"field"` + Boost *int `json:"boost,omitempty"` + // Possible values for the `customType` property on [query expressions](/../api/projects/order-search#query-expressions) indicating the data type of the `field`. + CustomType *OrderSearchCustomType `json:"customType,omitempty"` + Value string `json:"value"` + Language *string `json:"language,omitempty"` + MustMatch *OrderSearchMatchType `json:"mustMatch,omitempty"` } type OrderSearchLongRangeValue struct { - Field string `json:"field"` - Boost *int `json:"boost,omitempty"` - CustomType *string `json:"customType,omitempty"` - Gte *int `json:"gte,omitempty"` - Lte *int `json:"lte,omitempty"` + Field string `json:"field"` + Boost *int `json:"boost,omitempty"` + // Possible values for the `customType` property on [query expressions](/../api/projects/order-search#query-expressions) indicating the data type of the `field`. + CustomType *OrderSearchCustomType `json:"customType,omitempty"` + Gte *int `json:"gte,omitempty"` + Lte *int `json:"lte,omitempty"` } type OrderSearchNumberRangeValue struct { - Field string `json:"field"` - Boost *int `json:"boost,omitempty"` - CustomType *string `json:"customType,omitempty"` - Gte *float64 `json:"gte,omitempty"` - Lte *float64 `json:"lte,omitempty"` + Field string `json:"field"` + Boost *int `json:"boost,omitempty"` + // Possible values for the `customType` property on [query expressions](/../api/projects/order-search#query-expressions) indicating the data type of the `field`. + CustomType *OrderSearchCustomType `json:"customType,omitempty"` + Gte *float64 `json:"gte,omitempty"` + Lte *float64 `json:"lte,omitempty"` } type OrderSearchSortMode string @@ -653,12 +696,13 @@ const ( ) type OrderSearchStringValue struct { - Field string `json:"field"` - Boost *int `json:"boost,omitempty"` - CustomType *string `json:"customType,omitempty"` - Value string `json:"value"` - Language *string `json:"language,omitempty"` - CaseInsensitive *bool `json:"caseInsensitive,omitempty"` + Field string `json:"field"` + Boost *int `json:"boost,omitempty"` + // Possible values for the `customType` property on [query expressions](/../api/projects/order-search#query-expressions) indicating the data type of the `field`. + CustomType *OrderSearchCustomType `json:"customType,omitempty"` + Value string `json:"value"` + Language *string `json:"language,omitempty"` + CaseInsensitive *bool `json:"caseInsensitive,omitempty"` } /** @@ -821,7 +865,7 @@ type LineItemImportDraft struct { Price PriceDraft `json:"price"` // The tax rate used to calculate the `taxedPrice` of the Order. TaxRate *TaxRate `json:"taxRate,omitempty"` - // The Channel used to [select a Price](ctp:api:type:LineItemPriceSelection). + // The Channel used to [select a Price](/../api/pricing-and-discounts-overview#line-item-price-selection). // This Channel must have the `ProductDistribution` role. DistributionChannel *ChannelResourceIdentifier `json:"distributionChannel,omitempty"` // The Channel used to supply Line Items. @@ -883,7 +927,7 @@ type Order struct { // Email address of the Customer that the Order belongs to. CustomerEmail *string `json:"customerEmail,omitempty"` // [Reference](ctp:api:type:Reference) to the Customer Group of the Customer that the Order belongs to. - // Used for [LineItem Price selection](ctp:api:type:LineItemPriceSelection). + // Used for [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). CustomerGroup *CustomerGroupReference `json:"customerGroup,omitempty"` // [Anonymous session](ctp:api:type:AnonymousSession) associated with the Order. AnonymousId *string `json:"anonymousId,omitempty"` @@ -954,7 +998,7 @@ type Order struct { RefusedGifts []CartDiscountReference `json:"refusedGifts"` // Payment information related to the Order. PaymentInfo *PaymentInfo `json:"paymentInfo,omitempty"` - // Used for [LineItem Price selection](ctp:api:type:LineItemPriceSelection). + // Used for [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). Country *string `json:"country,omitempty"` // Languages of the Order. // Can only contain languages supported by the [Project](ctp:api:type:Project). @@ -987,9 +1031,9 @@ type Order struct { // User-defined date and time (UTC) of the Order. // Present only on an Order created using [Order Import](ctp:api:endpoint:/{projectKey}/orders/import:POST). CompletedAt *time.Time `json:"completedAt,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the Order. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Order. CreatedBy *CreatedBy `json:"createdBy,omitempty"` } @@ -1308,9 +1352,9 @@ type OrderSearchRequest struct { Query OrderSearchQuery `json:"query"` // Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order. Sort []OrderSearchSorting `json:"sort"` - // The maximum number of search results to be returned. + // The maximum number of search results to be returned on one [page](#pagination). Limit *int `json:"limit,omitempty"` - // The number of search results to be skipped in the response for pagination. + // The number of search results to be skipped in the response for [pagination](#pagination). Offset *int `json:"offset,omitempty"` } @@ -1705,6 +1749,18 @@ func mapDiscriminatorOrderUpdateAction(input interface{}) (OrderUpdateAction, er return nil, err } return obj, nil + case "setShippingCustomField": + obj := OrderSetShippingCustomFieldAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "setShippingCustomType": + obj := OrderSetShippingCustomTypeAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil case "setStore": obj := OrderSetStoreAction{} if err := decodeStruct(input, &obj); err != nil { @@ -2172,9 +2228,9 @@ type SyncInfo struct { } type TaxedItemPriceDraft struct { - // Draft type that stores amounts only in cent precision for the specified currency. + // Draft object to store money in cent amounts for a specific currency. TotalNet Money `json:"totalNet"` - // Draft type that stores amounts only in cent precision for the specified currency. + // Draft object to store money in cent amounts for a specific currency. TotalGross Money `json:"totalGross"` } @@ -3405,6 +3461,55 @@ func (obj OrderSetShippingAddressCustomTypeAction) MarshalJSON() ([]byte, error) }{Action: "setShippingAddressCustomType", Alias: (*Alias)(&obj)}) } +type OrderSetShippingCustomFieldAction struct { + // The `shippingKey` of the [Shipping](ctp:api:type:Shipping) to customize. Used to specify which Shipping Method to customize + // on a Order with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). + // Leave this empty to customize the one and only ShippingMethod on a `Single` ShippingMode Order. + ShippingKey *string `json:"shippingKey,omitempty"` + // Name of the [Custom Field](/../api/projects/custom-fields). + Name string `json:"name"` + // If `value` is absent or `null`, this field will be removed if it exists. + // Trying to remove a field that does not exist will fail with an [InvalidOperation](ctp:api:type:InvalidOperationError) error. + // If `value` is provided, it is set for the field defined by `name`. + Value interface{} `json:"value,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj OrderSetShippingCustomFieldAction) MarshalJSON() ([]byte, error) { + type Alias OrderSetShippingCustomFieldAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "setShippingCustomField", Alias: (*Alias)(&obj)}) +} + +/** +* This action sets, overwrites, or removes any existing Custom Type and Custom Fields for the Order's `shippingMethod` or `shipping`. +* + */ +type OrderSetShippingCustomTypeAction struct { + // The `shippingKey` of the [Shipping](ctp:api:type:Shipping) to customize. Used to specify which Shipping Method to customize + // on a Order with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). + // Leave this empty to customize the one and only ShippingMethod on a `Single` ShippingMode Order. + ShippingKey *string `json:"shippingKey,omitempty"` + // Defines the [Type](ctp:api:type:Type) that extends the specified ShippingMethod with [Custom Fields](/../api/projects/custom-fields). + // If absent, any existing Type and Custom Fields are removed from the ShippingMethod. + Type *TypeResourceIdentifier `json:"type,omitempty"` + // Sets the [Custom Fields](/../api/projects/custom-fields) fields for the `shippingMethod`. + Fields *FieldContainer `json:"fields,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj OrderSetShippingCustomTypeAction) MarshalJSON() ([]byte, error) { + type Alias OrderSetShippingCustomTypeAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "setShippingCustomType", Alias: (*Alias)(&obj)}) +} + /** * Sets the [Store](ctp:api:type:Store) the Order is assigned to. * It should be used to migrate Orders to a new Store. diff --git a/platform/types_order_edit.go b/platform/types_order_edit.go index ff63dc80..0fb7e58c 100644 --- a/platform/types_order_edit.go +++ b/platform/types_order_edit.go @@ -30,9 +30,9 @@ type OrderEdit struct { Comment *string `json:"comment,omitempty"` // Custom Fields of the Order Edit. Custom *CustomFields `json:"custom,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the OrderEdit. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the OrderEdit. CreatedBy *CreatedBy `json:"createdBy,omitempty"` } @@ -515,7 +515,7 @@ type StagedOrder struct { // Email address of the Customer that the Order belongs to. CustomerEmail *string `json:"customerEmail,omitempty"` // [Reference](ctp:api:type:Reference) to the Customer Group of the Customer that the Order belongs to. - // Used for [LineItem Price selection](ctp:api:type:LineItemPriceSelection). + // Used for [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). CustomerGroup *CustomerGroupReference `json:"customerGroup,omitempty"` // [Anonymous session](ctp:api:type:AnonymousSession) associated with the Order. AnonymousId *string `json:"anonymousId,omitempty"` @@ -586,7 +586,7 @@ type StagedOrder struct { RefusedGifts []CartDiscountReference `json:"refusedGifts"` // Payment information related to the Order. PaymentInfo *PaymentInfo `json:"paymentInfo,omitempty"` - // Used for [LineItem Price selection](ctp:api:type:LineItemPriceSelection). + // Used for [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). Country *string `json:"country,omitempty"` // Languages of the Order. // Can only contain languages supported by the [Project](ctp:api:type:Project). @@ -619,9 +619,9 @@ type StagedOrder struct { // User-defined date and time (UTC) of the Order. // Present only on an Order created using [Order Import](ctp:api:endpoint:/{projectKey}/orders/import:POST). CompletedAt *time.Time `json:"completedAt,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the Order. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Order. CreatedBy *CreatedBy `json:"createdBy,omitempty"` } @@ -687,7 +687,7 @@ func (obj StagedOrder) MarshalJSON() ([]byte, error) { } /** -* If the [edit was applied](ctp:api:endpoint:/{projectKey}/orders/edits/{id}/apply:POST), this cannot be updated. +* The `stagedActions` field cannot be updated if the Order Edit `result` is [OrderEdit Applied](/projects/order-edits#orderedit-applied). * */ type OrderEditAddStagedActionAction struct { @@ -793,7 +793,7 @@ func (obj OrderEditSetKeyAction) MarshalJSON() ([]byte, error) { } /** -* If the [edit is applied](ctp:api:endpoint:/{projectKey}/orders/edits/{id}/apply:POST), `stagedActions` cannot be updated. +* The `stagedActions` field cannot be updated if the Order Edit `result` is [OrderEdit Applied](/projects/order-edits#orderedit-applied). * */ type OrderEditSetStagedActionsAction struct { @@ -978,7 +978,7 @@ func (obj StagedOrderAddItemShippingAddressAction) MarshalJSON() ([]byte, error) * If the Cart contains a [LineItem](ctp:api:type:LineItem) for a Product Variant with the same [LineItemMode](ctp:api:type:LineItemMode), [Custom Fields](/../api/projects/custom-fields), supply and distribution channel, then only the quantity of the existing Line Item is increased. * If [LineItem](ctp:api:type:LineItem) `shippingDetails` is set, it is merged. All addresses will be present afterwards and, for address keys present in both shipping details, the quantity will be summed up. * A new Line Item is added when the `externalPrice` or `externalTotalPrice` is set in this update action. -* The [LineItem](ctp:api:type:LineItem) price is set as described in [LineItem Price selection](ctp:api:type:LineItemPriceSelection). +* The [LineItem](ctp:api:type:LineItem) price is set as described in [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). * * If the Tax Rate is not set, a [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) error is returned. * @@ -1008,7 +1008,7 @@ type StagedOrderAddLineItemAction struct { // // Optional for backwards compatibility reasons. AddedAt *time.Time `json:"addedAt,omitempty"` - // Used to [select](/../api/carts-orders-overview#line-item-price-selection) a Product Price. + // Used to [select](/../api/pricing-and-discounts-overview#line-item-price-selection) a Product Price. // The Channel must have the `ProductDistribution` [ChannelRoleEnum](ctp:api:type:ChannelRoleEnum). // If the Cart is bound to a [Store](ctp:api:type:Store) with `distributionChannels` set, the Channel must match one of the Store's distribution channels. DistributionChannel *ChannelResourceIdentifier `json:"distributionChannel,omitempty"` @@ -1019,7 +1019,7 @@ type StagedOrderAddLineItemAction struct { ExternalPrice *Money `json:"externalPrice,omitempty"` // Sets the [LineItem](ctp:api:type:LineItem) `price` and `totalPrice` values, and the `priceMode` to `ExternalTotal` [LineItemPriceMode](ctp:api:type:LineItemPriceMode). ExternalTotalPrice *ExternalLineItemTotalPrice `json:"externalTotalPrice,omitempty"` - // External Tax Rate for the Line Item, if the Cart has the `External` [TaxMode](ctp:api:type:TaxMode). + // Sets the external Tax Rate for the Line Item, if the Cart has the `External` [TaxMode](ctp:api:type:TaxMode). If the Cart has `Multiple` [ShippingMode](ctp:api:type:ShippingMode), the Tax Rate is accepted but ignored. ExternalTaxRate *ExternalTaxRateDraft `json:"externalTaxRate,omitempty"` // Inventory mode specific to the Line Item only, and valid for the entire `quantity` of the Line Item. // Set only if the inventory mode should be different from the `inventoryMode` specified on the [Cart](ctp:api:type:Cart). @@ -1210,7 +1210,7 @@ func (obj StagedOrderChangeCustomLineItemQuantityAction) MarshalJSON() ([]byte, * * To change the Line Item quantity and shipping details together, use this update action in combination with the [Set LineItem ShippingDetails](ctp:api:type:StagedOrderSetLineItemShippingDetailsAction) update action in a single Order update command. * -* The [LineItem](ctp:api:type:LineItem) price is updated as described in [LineItem Price selection](ctp:api:type:LineItemPriceSelection). +* The [LineItem](ctp:api:type:LineItem) price is updated as described in [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). * */ type StagedOrderChangeLineItemQuantityAction struct { @@ -1221,11 +1221,13 @@ type StagedOrderChangeLineItemQuantityAction struct { // New value to set. // If `0`, the LineItem is removed from the Order. Quantity int `json:"quantity"` - // Sets the [LineItem](ctp:api:type:LineItem) `price` to the given value when changing the quantity of a Line Item with the `ExternalPrice` [LineItemPriceMode](ctp:api:type:LineItemPriceMode). + // Required when the Line Item uses `ExternalPrice` [LineItemPriceMode](ctp:api:type:LineItemPriceMode). + // Sets the [LineItem](ctp:api:type:LineItem) `price` to the given value when changing the quantity of a Line Item. // - // The [LineItem](ctp:api:type:LineItem) price is updated as described in [LineItem Price selection](ctp:api:type:LineItemPriceSelection). + // The [LineItem](ctp:api:type:LineItem) price is updated as described in [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). ExternalPrice *Money `json:"externalPrice,omitempty"` // Sets the [LineItem](ctp:api:type:LineItem) `price` and `totalPrice` to the given value when changing the quantity of a Line Item with the `ExternalTotal` [LineItemPriceMode](ctp:api:type:LineItemPriceMode). + // If `externalTotalPrice` is not given and the `priceMode` is `ExternalTotal`, the external price is unset and the `priceMode` is set to `Platform`. ExternalTotalPrice *ExternalLineItemTotalPrice `json:"externalTotalPrice,omitempty"` } @@ -1485,7 +1487,7 @@ func (obj StagedOrderRemoveItemShippingAddressAction) MarshalJSON() ([]byte, err } /** -* The [LineItem](ctp:api:type:LineItem) price is updated as described in [LineItem Price selection](ctp:api:type:LineItemPriceSelection). +* The [LineItem](ctp:api:type:LineItem) price is updated as described in [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). * */ type StagedOrderRemoveLineItemAction struct { @@ -1842,9 +1844,10 @@ func (obj StagedOrderSetCustomerEmailAction) MarshalJSON() ([]byte, error) { } /** -* This update action can only be used if a Customer is not assigned to a Cart. If a Customer is already assigned, the Cart has the same Customer Group as the assigned Customer. +* This update action can only be used if a Customer is not assigned to a Cart. +* If a Customer is already assigned, the Cart uses the Customer Group of the assigned Customer. * -* Setting the Customer Group also updates the [LineItem](ctp:api:type:LineItem) `prices` according to the Customer Group. +* To reflect the new Customer Group, this update action can result in [updates to the Cart](/../carts-orders-overview#cart-updates). When this occurs, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError). * */ type StagedOrderSetCustomerGroupAction struct { @@ -2157,7 +2160,7 @@ func (obj StagedOrderSetLineItemCustomTypeAction) MarshalJSON() ([]byte, error) } /** -* Setting a distribution channel for a [LineItem](ctp:api:type:LineItem) can lead to an updated `price` as described in [LineItem Price selection](ctp:api:type:LineItemPriceSelection). +* Setting a distribution channel for a [LineItem](ctp:api:type:LineItem) can lead to an updated `price` as described in [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). * * Produces the [OrderLineItemDistributionChannelSet](ctp:api:type:OrderLineItemDistributionChannelSetMessage) Message. * @@ -2228,7 +2231,7 @@ func (obj StagedOrderSetLineItemShippingDetailsAction) MarshalJSON() ([]byte, er } /** -* Can be used if the Cart has the `ExternalAmount` [TaxMode](ctp:api:type:TaxMode). +* Can be used if the Cart has the `ExternalAmount` [TaxMode](ctp:api:type:TaxMode). This update action sets the `taxedPrice` and `taxRate` on a Line Item and must be used after any price-affecting change occurs. * */ type StagedOrderSetLineItemTaxAmountAction struct { @@ -2768,6 +2771,55 @@ func (obj StagedOrderSetShippingAddressCustomTypeAction) MarshalJSON() ([]byte, }{Action: "setShippingAddressCustomType", Alias: (*Alias)(&obj)}) } +type StagedOrderSetShippingCustomFieldAction struct { + // The `shippingKey` of the [Shipping](ctp:api:type:Shipping) to customize. Used to specify which Shipping Method to customize + // on a Order with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). + // Leave this empty to customize the one and only ShippingMethod on a `Single` ShippingMode Order. + ShippingKey *string `json:"shippingKey,omitempty"` + // Name of the [Custom Field](/../api/projects/custom-fields). + Name string `json:"name"` + // If `value` is absent or `null`, this field will be removed if it exists. + // Trying to remove a field that does not exist will fail with an [InvalidOperation](ctp:api:type:InvalidOperationError) error. + // If `value` is provided, it is set for the field defined by `name`. + Value interface{} `json:"value,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj StagedOrderSetShippingCustomFieldAction) MarshalJSON() ([]byte, error) { + type Alias StagedOrderSetShippingCustomFieldAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "setShippingCustomField", Alias: (*Alias)(&obj)}) +} + +/** +* This action sets, overwrites, or removes any existing Custom Type and Custom Fields for the Order's `shippingMethod` or `shipping`. +* + */ +type StagedOrderSetShippingCustomTypeAction struct { + // The `shippingKey` of the [Shipping](ctp:api:type:Shipping) to customize. Used to specify which Shipping Method to customize + // on a Order with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). + // Leave this empty to customize the one and only ShippingMethod on a `Single` ShippingMode Order. + ShippingKey *string `json:"shippingKey,omitempty"` + // Defines the [Type](ctp:api:type:Type) that extends the specified ShippingMethod with [Custom Fields](/../api/projects/custom-fields). + // If absent, any existing Type and Custom Fields are removed from the ShippingMethod. + Type *TypeResourceIdentifier `json:"type,omitempty"` + // Sets the [Custom Fields](/../api/projects/custom-fields) fields for the `shippingMethod`. + Fields *FieldContainer `json:"fields,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj StagedOrderSetShippingCustomTypeAction) MarshalJSON() ([]byte, error) { + type Alias StagedOrderSetShippingCustomTypeAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "setShippingCustomType", Alias: (*Alias)(&obj)}) +} + /** * To set the Cart's Shipping Method, the Cart must have the `Single` [ShippingMode](ctp:api:type:ShippingMode) and a `shippingAddress`. * diff --git a/platform/types_payment.go b/platform/types_payment.go index 47a31408..912ce56b 100644 --- a/platform/types_payment.go +++ b/platform/types_payment.go @@ -17,9 +17,9 @@ type Payment struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the Payment was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the Payment. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Payment. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Reference to a [Customer](ctp:api:type:Customer) associated with the Payment. Customer *CustomerReference `json:"customer,omitempty"` @@ -607,7 +607,7 @@ func (obj PaymentChangeTransactionTimestampAction) MarshalJSON() ([]byte, error) } type PaymentSetAmountPaidAction struct { - // Draft type that stores amounts only in cent precision for the specified currency. + // Draft object to store money in cent amounts for a specific currency. Amount *Money `json:"amount,omitempty"` } @@ -622,7 +622,7 @@ func (obj PaymentSetAmountPaidAction) MarshalJSON() ([]byte, error) { } type PaymentSetAmountRefundedAction struct { - // Draft type that stores amounts only in cent precision for the specified currency. + // Draft object to store money in cent amounts for a specific currency. Amount *Money `json:"amount,omitempty"` } @@ -636,9 +636,12 @@ func (obj PaymentSetAmountRefundedAction) MarshalJSON() ([]byte, error) { }{Action: "setAmountRefunded", Alias: (*Alias)(&obj)}) } +/** +* If the Payment is already associated with a Customer, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned. +* + */ type PaymentSetAnonymousIdAction struct { - // Value to set. - // If empty, any existing value will be removed. + // Value to set. If empty, any existing value will be removed. AnonymousId *string `json:"anonymousId,omitempty"` } @@ -653,7 +656,7 @@ func (obj PaymentSetAnonymousIdAction) MarshalJSON() ([]byte, error) { } type PaymentSetAuthorizationAction struct { - // Draft type that stores amounts only in cent precision for the specified currency. + // Draft object to store money in cent amounts for a specific currency. Amount *Money `json:"amount,omitempty"` Until *time.Time `json:"until,omitempty"` } diff --git a/platform/types_product.go b/platform/types_product.go index fa0e504f..559f92f6 100644 --- a/platform/types_product.go +++ b/platform/types_product.go @@ -125,9 +125,9 @@ type Product struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the Product was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the Product. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Product. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // User-defined unique identifier of the Product. // @@ -189,7 +189,7 @@ type ProductData struct { MasterVariant ProductVariant `json:"masterVariant"` // Additional Product Variants. Variants []ProductVariant `json:"variants"` - // Used by [Product Suggestions](ctp:api:type:ProductSuggestions), but is also considered for a full text search. + // Used by [Product Suggestions](/projects/products-suggestions), but is also considered for a [full text search](/projects/products-search#full-text-search). SearchKeywords SearchKeywords `json:"searchKeywords"` } @@ -203,6 +203,8 @@ type ProductDraft struct { // It must match the pattern `[a-zA-Z0-9_\\-]{2,256}`. Slug LocalizedString `json:"slug"` // User-defined unique identifier for the Product. + // + // To update a Product using the [Import API](/../import-export/product), the Product `key` must match the pattern `^[A-Za-z0-9_-]{2,256}$`. Key *string `json:"key,omitempty"` // Description of the Product. Description *LocalizedString `json:"description,omitempty"` @@ -222,7 +224,7 @@ type ProductDraft struct { Variants []ProductVariantDraft `json:"variants"` // The Tax Category to be assigned to the Product. TaxCategory *TaxCategoryResourceIdentifier `json:"taxCategory,omitempty"` - // Used by [Product Suggestions](ctp:api:type:ProductSuggestions), but is also considered for a [full text search](/projects/products-search#full-text-search). + // Used by [Product Suggestions](/projects/products-suggestions), but is also considered for a [full text search](/projects/products-search#full-text-search). SearchKeywords *SearchKeywords `json:"searchKeywords,omitempty"` // State to be assigned to the Product. State *StateResourceIdentifier `json:"state,omitempty"` @@ -282,7 +284,8 @@ type ProductPagedQueryResponse struct { } /** -* This mode determines the type of Prices used for [Product Price Selection](ctp:api:type:ProductPriceSelection) and for [LineItem Price selection](ctp:api:type:LineItemPriceSelection). +* This mode determines the type of Prices used for [price selection](/../api/pricing-and-discounts-overview#price-selection) by Line Items and Products. +* For more information about the difference between the Prices, see [Pricing](/../api/pricing-and-discounts-overview). * */ type ProductPriceModeEnum string @@ -764,7 +767,7 @@ type ProductVariant struct { Prices []Price `json:"prices"` // Attributes of the Product Variant. Attributes []Attribute `json:"attributes"` - // Only available when [Price selection](#price-selection) is used. + // Only available when [price selection](/../api/pricing-and-discounts-overview#price-selection) is used. // Cannot be used in a [Query Predicate](ctp:api:type:QueryPredicate). Price *Price `json:"price,omitempty"` // Images of the Product Variant. @@ -779,11 +782,11 @@ type ProductVariant struct { // Only available in response to a [Product Projection Search](ctp:api:type:ProductProjectionSearch) request. IsMatchingVariant *bool `json:"isMatchingVariant,omitempty"` // Only available in response to a [Product Projection Search](ctp:api:type:ProductProjectionSearch) request - // with [price selection](ctp:api:type:ProductPriceSelection). + // with [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection). // Can be used to sort, [filter](ctp:api:type:ProductProjectionSearchFilterScopedPrice), and facet. ScopedPrice *ScopedPrice `json:"scopedPrice,omitempty"` // Only available in response to a [Product Projection Search](ctp:api:type:ProductProjectionSearchFilterScopedPrice) request - // with [price selection](ctp:api:type:ProductPriceSelection). + // with [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection). ScopedPriceDiscounted *bool `json:"scopedPriceDiscounted,omitempty"` } @@ -831,7 +834,7 @@ type ProductVariantAvailability struct { // For each [InventoryEntry](ctp:api:type:InventoryEntry) with a supply Channel, an entry is added to `channels`. Channels *ProductVariantChannelAvailabilityMap `json:"channels,omitempty"` // Indicates whether a Product Variant is in stock. - IsOnStock bool `json:"isOnStock"` + IsOnStock *bool `json:"isOnStock,omitempty"` // Number of days to restock a Product Variant once it is out of stock. RestockableInDays *int `json:"restockableInDays,omitempty"` // Number of items of the Product Variant that are in stock. @@ -932,7 +935,7 @@ func (obj RangeFacetResult) MarshalJSON() ([]byte, error) { } type SearchKeyword struct { - // Text to return in the result of a [suggest query](ctp:api:type:ProductSuggestionsSuggestQuery). + // Text to return in the [SuggestionResult](ctp:api:type:SuggestionResult). Text string `json:"text"` // If no tokenizer is defined, the `text` is used as a single token. SuggestTokenizer SuggestTokenizer `json:"suggestTokenizer,omitempty"` @@ -957,7 +960,8 @@ func (obj *SearchKeyword) UnmarshalJSON(data []byte) error { } /** -* Search keywords are JSON objects primarily used by [Product Suggestions](ctp:api:type:ProductSuggestions), but are also considered for a full text search. The keys are of type [Locale](ctp:api:type:Locale), and the values are an array of [SearchKeyword](ctp:api:type:SearchKeyword). +* Search keywords are JSON objects primarily used by [Product Suggestions](/projects/products-suggestions), but are also considered for a [full text search](/projects/products-search#full-text-search). +* The keys are of type [Locale](ctp:api:type:Locale), and the values are an array of [SearchKeyword](ctp:api:type:SearchKeyword). * */ type SearchKeywords map[string][]SearchKeyword @@ -1928,6 +1932,8 @@ func (obj ProductSetImageLabelAction) MarshalJSON() ([]byte, error) { type ProductSetKeyAction struct { // Value to set. If empty, any existing value will be removed. + // + // To update a Product using the [Import API](/../import-export/product), the Product `key` must match the pattern `^[A-Za-z0-9_-]{2,256}$`. Key *string `json:"key,omitempty"` } @@ -1993,13 +1999,13 @@ func (obj ProductSetMetaTitleAction) MarshalJSON() ([]byte, error) { } /** -* Sets the key of an [Embedded Price](/projects/products#embedded-price). Produces the [ProductPriceKeySet](ctp:api:type:ProductPriceKeySetMessage) Message. +* Sets the key of an [Embedded Price](ctp:api:type:Price). Produces the [ProductPriceKeySet](ctp:api:type:ProductPriceKeySetMessage) Message. * */ type ProductSetPriceKeyAction struct { // The `id` of the [Price](ctp:api:type:Price) to set the key. PriceId string `json:"priceId"` - // If `true`, only the staged [Embedded Price](/projects/products#embedded-price) is updated. If `false`, both the current and staged Embedded Price are updated. + // If `true`, only the staged [Embedded Price](ctp:api:type:Price) is updated. If `false`, both the current and staged Embedded Price are updated. Staged *bool `json:"staged,omitempty"` // Value to set. If empty, any existing value will be removed. Key *string `json:"key,omitempty"` @@ -2215,7 +2221,10 @@ func (obj ProductTransitionStateAction) MarshalJSON() ([]byte, error) { /** * Removes the current [projection](/../api/projects/productProjections#current--staged) of the Product. The staged projection is unaffected. To retrieve unpublished Products, the `staged` parameter must be set to `false` when [querying](ctp:api:endpoint:/{projectKey}/product-projections:GET)/[searching](/projects/products-search#product-projection-search) Product Projections. Produces the [ProductUnpublished](ctp:api:type:ProductUnpublishedMessage) Message. * -* Unpublished Products cannot be added to a Cart. However, if a Cart contains Line Items for Products that were added before the Product was unpublished, the Cart is unaffected and can still be used to create an Order. To prevent this, in addition to unpublishing the Product you should remove the Prices from the Product using [Remove Price](ctp:api:type:ProductRemovePriceAction) for Embedded Prices or [Delete StandalonePrice](/projects/standalone-prices#delete-standaloneprice) for Standalone Prices. +* When a Product is unpublished, any associated Line Items already present in a Cart remain unaffected and can still be ordered. To prevent this, do the following: +* +* - If the Product uses Embedded Prices, [remove the Embedded Prices](ctp:api:type:ProductRemovePriceAction) from the unpublished Product. +* - If the Product uses Standalone Prices, [inactivate](ctp:api:type:StandalonePriceChangeActiveAction) or [delete](/projects/standalone-prices#delete-standaloneprice) the Standalone Prices. * */ type ProductUnpublishAction struct { diff --git a/platform/types_product_discount.go b/platform/types_product_discount.go index 19d0ee10..db0b24f6 100644 --- a/platform/types_product_discount.go +++ b/platform/types_product_discount.go @@ -17,9 +17,9 @@ type ProductDiscount struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the ProductDiscount was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the ProductDiscount. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the ProductDiscount. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Name of the ProductDiscount. Name LocalizedString `json:"name"` diff --git a/platform/types_product_search.go b/platform/types_product_search.go new file mode 100644 index 00000000..4d86f2ed --- /dev/null +++ b/platform/types_product_search.go @@ -0,0 +1,379 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "encoding/json" +) + +type ProductPagedSearchResponse struct { + // Total number of results matching the query. + Total int `json:"total"` + // Number of [elements skipped](/../api/general-concepts#offset). + Offset int `json:"offset"` + // Number of [results requested](/../api/general-concepts#limit). + Limit int `json:"limit"` + // Results for [facets](/../api/projects/product-search#facets) when requested. + Facets []ProductSearchFacetResult `json:"facets"` + // Search result containing the Products matching the search query. + Results []ProductSearchResult `json:"results"` +} + +type ProductSearchErrorResponse struct { + // The HTTP status code of the response. + StatusCode int `json:"statusCode"` + // Describes the error. + Message string `json:"message"` + // The errors that caused this error response. + Errors []ErrorObject `json:"errors"` +} + +// UnmarshalJSON override to deserialize correct attribute types based +// on the discriminator value +func (obj *ProductSearchErrorResponse) UnmarshalJSON(data []byte) error { + type Alias ProductSearchErrorResponse + if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + return err + } + for i := range obj.Errors { + var err error + obj.Errors[i], err = mapDiscriminatorErrorObject(obj.Errors[i]) + if err != nil { + return err + } + } + + return nil +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductSearchErrorResponse) MarshalJSON() ([]byte, error) { + type Alias ProductSearchErrorResponse + data, err := json.Marshal(struct { + *Alias + }{Alias: (*Alias)(&obj)}) + if err != nil { + return nil, err + } + + raw := make(map[string]interface{}) + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + if raw["errors"] == nil { + delete(raw, "errors") + } + + return json.Marshal(raw) + +} + +func (obj ProductSearchErrorResponse) Error() string { + if obj.Message != "" { + return obj.Message + } + return "unknown ProductSearchErrorResponse: failed to parse error response" +} + +type ProductSearchMatchingVariantEntry struct { + // Unique identifier of the variant. + ID int `json:"id"` + // SKU of the matching variant. + Sku *string `json:"sku,omitempty"` +} + +type ProductSearchMatchingVariants struct { + // Whether the search criteria definitely matches all Variants of the returned Product, like for Product-level fields. Is always `false` for search expressions on Variant-level fields. + AllMatched bool `json:"allMatched"` + // The variants matching the search criteria or empty if all matched. + MatchedVariants []ProductSearchMatchingVariantEntry `json:"matchedVariants"` +} + +type ProductSearchProjectionParams struct { + // Expands a `value` of type [Reference](ctp:api:type:Reference) in a [ProductProjection](ctp:api:type:ProductProjection). + // In case the referenced object does not exist, the API returns the non-expanded reference. + Expand []string `json:"expand"` + // Set to `true` to retrieve the [staged](ctp:api:type:CurrentStaged) Product Projection + Staged *bool `json:"staged,omitempty"` + // The currency used for [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection). + PriceCurrency *string `json:"priceCurrency,omitempty"` + // The country used for [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection). Can only be used **in conjunction with** the `priceCurrency` parameter. + PriceCountry *string `json:"priceCountry,omitempty"` + // `id` of an existing [CustomerGroup](ctp:api:type:CustomerGroup) used for [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection). Can only be used **in conjunction with** the `priceCurrency` parameter. + PriceCustomerGroup *string `json:"priceCustomerGroup,omitempty"` + // `id` of an existing [Channel](ctp:api:type:Channel) used for [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection). Can only be used **in conjunction with** the `priceCurrency` parameter. + PriceChannel *string `json:"priceChannel,omitempty"` + // Used for [locale-based projection](ctp:api:type:ProductProjectionLocales). + LocaleProjection []string `json:"localeProjection"` + // `key` of an existing [Store](ctp:api:type:Store). + // If the Store has defined some languages, countries, distribution or supply Channels, + // they are used for projections based on [locale](ctp:api:type:ProductProjectionLocales), [price](ctp:api:type:ProductProjectionPrices), + // and [inventory](ctp:api:type:ProductProjectionInventoryEntries). + // If the Store has defined [Product Selections](ctp:api:type:ProductSelection) or [Product Tailoring](ctp:api:type:ProductTailoring), they have no effect on the results of this query. + StoreProjection *string `json:"storeProjection,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductSearchProjectionParams) MarshalJSON() ([]byte, error) { + type Alias ProductSearchProjectionParams + data, err := json.Marshal(struct { + *Alias + }{Alias: (*Alias)(&obj)}) + if err != nil { + return nil, err + } + + raw := make(map[string]interface{}) + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + if raw["expand"] == nil { + delete(raw, "expand") + } + + if raw["localeProjection"] == nil { + delete(raw, "localeProjection") + } + + return json.Marshal(raw) + +} + +type ProductSearchRequest struct { + // The search query against [searchable Product fields](/../api/projects/product-search#searchable-product-fields). + Query *SearchQuery `json:"query,omitempty"` + // Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order. + Sort []SearchSorting `json:"sort"` + // The maximum number of search results to be returned. + Limit *int `json:"limit,omitempty"` + // The number of search results to be skipped in the response for pagination. + Offset *int `json:"offset,omitempty"` + // The search can return Products where not all Product Variants match the search criteria. If `true`, the response will include a field called `matchingVariants` that contains the `sku` of Product Variants that match the search query. If the query does not specify any variant-level criteria, `matchingVariants` will be null signifying that all Product Variants are a match. + MarkMatchingVariants *bool `json:"markMatchingVariants,omitempty"` + // Set this field to `{}` to get the [ProductProjection](ctp:api:type:ProductProjection) included in the [ProductSearchResult](ctp:api:type:ProductSearchResult). + // Include query parameters for controlling [Reference Expansion](/../api/general-concepts#reference-expansion) or [projections](/../api/projects/productProjections#projection-dimensions) according to your needs. + // If not set, the result does not include the Product Projection. + ProductProjectionParameters *ProductSearchProjectionParams `json:"productProjectionParameters,omitempty"` + // Set this field to request [facets](/../api/projects/product-search#facets). + Facets []ProductSearchFacetExpression `json:"facets"` + // Specify an additional filter on the result of the `query` after the API calculated `facets`. + // This feature assists you in implementing faceted search. + PostFilter *SearchQuery `json:"postFilter,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductSearchRequest) MarshalJSON() ([]byte, error) { + type Alias ProductSearchRequest + data, err := json.Marshal(struct { + *Alias + }{Alias: (*Alias)(&obj)}) + if err != nil { + return nil, err + } + + raw := make(map[string]interface{}) + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + if raw["sort"] == nil { + delete(raw, "sort") + } + + if raw["facets"] == nil { + delete(raw, "facets") + } + + return json.Marshal(raw) + +} + +type ProductSearchResult struct { + // Unique identifier of the Product. + ID string `json:"id"` + // Contains Product Projection data for Products matching the `projection` field in the Search Products request. + ProductProjection *ProductProjection `json:"productProjection,omitempty"` + // Describes the variants that matched the search criteria. + MatchingVariants *ProductSearchMatchingVariants `json:"matchingVariants,omitempty"` +} + +type ProductSearchFacetCountLevelEnum string + +const ( + ProductSearchFacetCountLevelEnumProducts ProductSearchFacetCountLevelEnum = "products" + ProductSearchFacetCountLevelEnumVariants ProductSearchFacetCountLevelEnum = "variants" +) + +type ProductSearchFacetCountValue struct { + // Name of the count facet to appear in the [ProductSearchFacetResultCount](ctp:api:type:ProductSearchFacetResultCount). + Name string `json:"name"` + // Whether the facet must consider only the Products resulting from the search (`query`) or all the Products (`all`). + Scope *ProductSearchFacetScopeEnum `json:"scope,omitempty"` + // Additional filtering expression to apply to the search result before calculating the facet. + Filter *SearchQuery `json:"filter,omitempty"` + // Specify whether to count Products (`products`) or Product Variants (`variants`). + Level *ProductSearchFacetCountLevelEnum `json:"level,omitempty"` +} + +type ProductSearchFacetDistinctBucketSortBy string + +const ( + ProductSearchFacetDistinctBucketSortByCount ProductSearchFacetDistinctBucketSortBy = "count" + ProductSearchFacetDistinctBucketSortByKey ProductSearchFacetDistinctBucketSortBy = "key" +) + +type ProductSearchFacetDistinctBucketSortExpression struct { + // Defines whether to sort by bucket count or key. + By ProductSearchFacetDistinctBucketSortBy `json:"by"` + // Defines the sorting order. + Order SearchSortOrder `json:"order"` +} + +type ProductSearchFacetDistinctValue struct { + // Name of the distinct facet to appear in the [ProductSearchFacetResultBucket](ctp:api:type:ProductSearchFacetResultBucket). + Name string `json:"name"` + // Whether the facet must consider only the Products resulting from the search (`query`) or all the Products (`all`). + Scope *ProductSearchFacetScopeEnum `json:"scope,omitempty"` + // Additional filtering expression to apply to the search result before calculating the facet. + Filter *SearchQuery `json:"filter,omitempty"` + // Specify whether to count Products (`products`) or Product Variants (`variants`). + Level *ProductSearchFacetCountLevelEnum `json:"level,omitempty"` + // The [searchable Product field](/api/projects/product-search#searchable-product-fields) to facet on. + Field string `json:"field"` + // Specify which bucket keys the facets results should include. + Includes []string `json:"includes"` + // Define how the buckets are sorted. + Sort *ProductSearchFacetDistinctBucketSortExpression `json:"sort,omitempty"` + // Maximum number of buckets to return. + Limit *int `json:"limit,omitempty"` + // String value specifying linguistic and regional preferences using the [IETF language tag format](https://en.wikipedia.org/wiki/IETF_language_tag), as described in [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). The format combines language, script, and region using hyphen-separated subtags. For example: `en`, `en-US`, `zh-Hans-SG`. + Language *string `json:"language,omitempty"` + // If the `field` is not standard, this must be the Attribute type. + FieldType *SearchFieldType `json:"fieldType,omitempty"` + // Default value to use if the specified field is not present on some Products. + Missing *string `json:"missing,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductSearchFacetDistinctValue) MarshalJSON() ([]byte, error) { + type Alias ProductSearchFacetDistinctValue + data, err := json.Marshal(struct { + *Alias + }{Alias: (*Alias)(&obj)}) + if err != nil { + return nil, err + } + + raw := make(map[string]interface{}) + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + if raw["includes"] == nil { + delete(raw, "includes") + } + + return json.Marshal(raw) + +} + +type ProductSearchFacetExpression map[string]interface{} +type ProductSearchFacetCountExpression struct { + // Definition of the count facet. + Count ProductSearchFacetCountValue `json:"count"` +} + +type ProductSearchFacetDistinctExpression struct { + // Definition of the distinct facet. + Distinct ProductSearchFacetDistinctValue `json:"distinct"` +} + +type ProductSearchFacetRangesExpression struct { + // Definition of the ranges facet. + Ranges ProductSearchFacetRangesValue `json:"ranges"` +} + +/** +* Values for `from` and `to` must be a number or [DateTime](ctp:api:type:DateTime). + */ +type ProductSearchFacetRangesFacetRange struct { + // Starting value of the bucket (inclusive). + From interface{} `json:"from,omitempty"` + // Ending value of the bucket (non-inclusive). + To interface{} `json:"to,omitempty"` + // Key to assign the bucket. + Key *string `json:"key,omitempty"` +} + +type ProductSearchFacetRangesValue struct { + // Name of the ranges facet to appear in the [ProductSearchFacetResultBucket](ctp:api:type:ProductSearchFacetResultBucket). + Name string `json:"name"` + // Whether the facet must consider only the Products resulting from the search (`query`) or all the Products (`all`). + Scope *ProductSearchFacetScopeEnum `json:"scope,omitempty"` + // Additional filtering expression to apply to the search result before calculating the facet. + Filter *SearchQuery `json:"filter,omitempty"` + // Specify whether to count Products (`products`) or Product Variants (`variants`). + Level *ProductSearchFacetCountLevelEnum `json:"level,omitempty"` + // The [searchable Product field](/api/projects/product-search#searchable-product-fields) to facet on. + Field string `json:"field"` + // Define ranges for the facet. + Ranges []ProductSearchFacetRangesFacetRange `json:"ranges"` + // String value specifying linguistic and regional preferences using the [IETF language tag format](https://en.wikipedia.org/wiki/IETF_language_tag), as described in [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). The format combines language, script, and region using hyphen-separated subtags. For example: `en`, `en-US`, `zh-Hans-SG`. + Language *string `json:"language,omitempty"` + // If the `field` is not standard, this must be the Attribute type. + FieldType *SearchFieldType `json:"fieldType,omitempty"` +} + +type ProductSearchFacetResult struct { + // Name of the facet. + Name string `json:"name"` +} + +/** +* Result of a [distinct facet](/../api/projects/product-search#distinct-facets) or a [ranges facet](/../api/projects/product-search#ranges-facets). +* + */ +type ProductSearchFacetResultBucket struct { + // Name of the facet. + Name string `json:"name"` + // Contains results of the facet. + Buckets []ProductSearchFacetResultBucketEntry `json:"buckets"` +} + +type ProductSearchFacetResultBucketEntry struct { + // Key of the bucket. + Key string `json:"key"` + // Number of values in the bucket. + Count int `json:"count"` +} + +/** +* Result of a [count facet](/../api/projects/product-search#count-facets). +* + */ +type ProductSearchFacetResultCount struct { + // Name of the facet. + Name string `json:"name"` + // Number of Products (or Product Variants) matching the query. + Value int `json:"value"` +} + +type ProductSearchFacetScope string + +const ( + ProductSearchFacetScopeAll ProductSearchFacetScope = "all" + ProductSearchFacetScopeQuery ProductSearchFacetScope = "query" +) + +type ProductSearchFacetScopeEnum string + +const ( + ProductSearchFacetScopeEnumAll ProductSearchFacetScopeEnum = "all" + ProductSearchFacetScopeEnumQuery ProductSearchFacetScopeEnum = "query" +) diff --git a/platform/types_product_tailoring.go b/platform/types_product_tailoring.go index e32190f2..ba6bd3aa 100644 --- a/platform/types_product_tailoring.go +++ b/platform/types_product_tailoring.go @@ -21,9 +21,9 @@ type ProductTailoring struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the ProductTailoring was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the ProductTailoring. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the ProductTailoring. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // User-defined unique identifier of the ProductTailoring. Key *string `json:"key,omitempty"` @@ -59,6 +59,32 @@ type ProductTailoringData struct { // User-defined identifier used in a deep-link URL for the ProductTailoring. // Matches the pattern `[a-zA-Z0-9_\\-]{2,256}`. Slug *LocalizedString `json:"slug,omitempty"` + // Tailored Variants of the Product. + Variants []ProductVariantTailoring `json:"variants"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringData) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringData + data, err := json.Marshal(struct { + *Alias + }{Alias: (*Alias)(&obj)}) + if err != nil { + return nil, err + } + + raw := make(map[string]interface{}) + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + if raw["variants"] == nil { + delete(raw, "variants") + } + + return json.Marshal(raw) + } /** @@ -87,6 +113,32 @@ type ProductTailoringDraft struct { Slug *LocalizedString `json:"slug,omitempty"` // If `true`, the ProductTailoring is published immediately. Publish *bool `json:"publish,omitempty"` + // Tailored Variants of the Product. + Variants []ProductVariantTailoringDraft `json:"variants"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringDraft) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringDraft + data, err := json.Marshal(struct { + *Alias + }{Alias: (*Alias)(&obj)}) + if err != nil { + return nil, err + } + + raw := make(map[string]interface{}) + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + if raw["variants"] == nil { + delete(raw, "variants") + } + + return json.Marshal(raw) + } /** @@ -113,6 +165,32 @@ type ProductTailoringInStoreDraft struct { Slug *LocalizedString `json:"slug,omitempty"` // If `true`, the ProductTailoring is published immediately. Publish *bool `json:"publish,omitempty"` + // Tailored Variants of the Product. + Variants []ProductVariantTailoringDraft `json:"variants"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringInStoreDraft) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringInStoreDraft + data, err := json.Marshal(struct { + *Alias + }{Alias: (*Alias)(&obj)}) + if err != nil { + return nil, err + } + + raw := make(map[string]interface{}) + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + if raw["variants"] == nil { + delete(raw, "variants") + } + + return json.Marshal(raw) + } /** @@ -192,18 +270,120 @@ func mapDiscriminatorProductTailoringUpdateAction(input interface{}) (ProductTai } switch discriminator { + case "addAsset": + obj := ProductTailoringAddAssetAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "addExternalImage": + obj := ProductTailoringAddExternalImageAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "addVariant": + obj := ProductTailoringAddVariantAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "changeAssetName": + obj := ProductTailoringChangeAssetNameAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "changeAssetOrder": + obj := ProductTailoringChangeAssetOrderAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "moveImageToPosition": + obj := ProductTailoringMoveImageToPositionAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil case "publish": obj := ProductTailoringPublishAction{} if err := decodeStruct(input, &obj); err != nil { return nil, err } return obj, nil + case "removeAsset": + obj := ProductTailoringRemoveAssetAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "removeImage": + obj := ProductTailoringRemoveImageAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "removeVariant": + obj := ProductTailoringRemoveVariantAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "setAssetCustomField": + obj := ProductTailoringSetAssetCustomFieldAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "setAssetCustomType": + obj := ProductTailoringSetAssetCustomTypeAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "setAssetDescription": + obj := ProductTailoringSetAssetDescriptionAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "setAssetKey": + obj := ProductTailoringSetAssetKeyAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "setAssetSources": + obj := ProductTailoringSetAssetSourcesAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "setAssetTags": + obj := ProductTailoringSetAssetTagsAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil case "setDescription": obj := ProductTailoringSetDescriptionAction{} if err := decodeStruct(input, &obj); err != nil { return nil, err } return obj, nil + case "setImages": + obj := ProductTailoringSetExternalImagesAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil + case "setImageLabel": + obj := ProductTailoringSetImageLabelAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil case "setMetaAttributes": obj := ProductTailoringSetMetaAttributesAction{} if err := decodeStruct(input, &obj); err != nil { @@ -250,6 +430,273 @@ func mapDiscriminatorProductTailoringUpdateAction(input interface{}) (ProductTai return nil, nil } +/** +* The tailoring of a [ProductVariant](ctp:api:type:ProductVariant). +* + */ +type ProductVariantTailoring struct { + // The `id` of the tailored [ProductVariant](ctp:api:type:ProductVariant). + ID int `json:"id"` + // Images of the tailored Product Variant. + // If present, these images will override the images of the corresponding [ProductVariant](ctp:api:type:ProductVariant) in total. + Images []Image `json:"images"` + // Media assets of the tailored Product Variant. + // If present, these assets will override the assets of the corresponding [ProductVariant](ctp:api:type:ProductVariant) in total. + Assets []Asset `json:"assets"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductVariantTailoring) MarshalJSON() ([]byte, error) { + type Alias ProductVariantTailoring + data, err := json.Marshal(struct { + *Alias + }{Alias: (*Alias)(&obj)}) + if err != nil { + return nil, err + } + + raw := make(map[string]interface{}) + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + if raw["images"] == nil { + delete(raw, "images") + } + + if raw["assets"] == nil { + delete(raw, "assets") + } + + return json.Marshal(raw) + +} + +/** +* Either `id` or `sku` is required to reference a [ProductVariant](ctp:api:type:ProductVariant) that exists. +* + */ +type ProductVariantTailoringDraft struct { + // The `id` of the [ProductVariant](ctp:api:type:ProductVariant) to be tailored. + ID *int `json:"id,omitempty"` + // The `sku` of the [ProductVariant](ctp:api:type:ProductVariant) to be tailored. + Sku *string `json:"sku,omitempty"` + // Images of the tailored Product Variant. + Images []Image `json:"images"` + // Media assets of the tailored Product Variant. + Assets []Asset `json:"assets"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductVariantTailoringDraft) MarshalJSON() ([]byte, error) { + type Alias ProductVariantTailoringDraft + data, err := json.Marshal(struct { + *Alias + }{Alias: (*Alias)(&obj)}) + if err != nil { + return nil, err + } + + raw := make(map[string]interface{}) + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + if raw["images"] == nil { + delete(raw, "images") + } + + if raw["assets"] == nil { + delete(raw, "assets") + } + + return json.Marshal(raw) + +} + +/** +* Either `variantId` or `sku` is required to reference a [ProductVariant](ctp:api:type:ProductVariant) that exists. +* + */ +type ProductTailoringAddAssetAction struct { + // The `id` of the tailored ProductVariant to update. + VariantId *int `json:"variantId,omitempty"` + // The `sku` of the tailored ProductVariant to update. + Sku *string `json:"sku,omitempty"` + // If `true`, only the staged `assets` are updated. If `false`, both the current and staged `assets` are updated. + Staged *bool `json:"staged,omitempty"` + // Value to append. + Asset AssetDraft `json:"asset"` + // Position in `assets` where the Asset should be put. When specified, the value must be between `0` and the total number of Assets minus `1`. + Position *int `json:"position,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringAddAssetAction) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringAddAssetAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "addAsset", Alias: (*Alias)(&obj)}) +} + +/** +* Either `variantId` or `sku` is required to reference a [ProductVariant](ctp:api:type:ProductVariant) that exists. Produces the [ProductTailoringImageAdded](/projects/messages#product-tailoring-image-added) Message. +* + */ +type ProductTailoringAddExternalImageAction struct { + // The `id` of the tailored ProductVariant to update. + VariantId *int `json:"variantId,omitempty"` + // The `sku` of the tailored ProductVariant to update. + Sku *string `json:"sku,omitempty"` + // Value to add to `images`. + Image Image `json:"image"` + // If `true`, only the staged `images` is updated. If `false`, both the current and staged `images` is updated. + Staged *bool `json:"staged,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringAddExternalImageAction) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringAddExternalImageAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "addExternalImage", Alias: (*Alias)(&obj)}) +} + +/** +* Either `id` or `sku` is required to reference a [ProductVariant](ctp:api:type:ProductVariant) that exists. +* Produces the [ProductVariantTailoringAdded](ctp:api:type:ProductVariantTailoringAddedMessage) Message. +* + */ +type ProductTailoringAddVariantAction struct { + // The `id` of the tailored ProductVariant to update. + ID *int `json:"id,omitempty"` + // The `sku` of the tailored ProductVariant to update. + Sku *string `json:"sku,omitempty"` + // Images for the Product Variant Tailoring. + Images []Image `json:"images"` + // Media assets for the Product Variant Tailoring. + Assets []AssetDraft `json:"assets"` + // If `true` the new Product Variant Tailoring is only staged. If `false` the new Product Variant Tailoring is both current and staged. + Staged *bool `json:"staged,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringAddVariantAction) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringAddVariantAction + data, err := json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "addVariant", Alias: (*Alias)(&obj)}) + if err != nil { + return nil, err + } + + raw := make(map[string]interface{}) + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + if raw["images"] == nil { + delete(raw, "images") + } + + if raw["assets"] == nil { + delete(raw, "assets") + } + + return json.Marshal(raw) + +} + +/** +* Either `variantId` or `sku` is required to reference a [ProductVariant](ctp:api:type:ProductVariant) that exists. +* The Asset to update must be specified using either `assetId` or `assetKey`. +* + */ +type ProductTailoringChangeAssetNameAction struct { + // The `id` of the tailored ProductVariant to update. + VariantId *int `json:"variantId,omitempty"` + // The `sku` of the tailored ProductVariant to update. + Sku *string `json:"sku,omitempty"` + // If `true`, only the staged Asset is updated. If `false`, both the current and staged Asset is updated. + Staged *bool `json:"staged,omitempty"` + // The `id` of the Asset to update. + AssetId *string `json:"assetId,omitempty"` + // The `key` of the Asset to update. + AssetKey *string `json:"assetKey,omitempty"` + // New value to set. Must not be empty. + Name LocalizedString `json:"name"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringChangeAssetNameAction) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringChangeAssetNameAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "changeAssetName", Alias: (*Alias)(&obj)}) +} + +/** +* Either `variantId` or `sku` is required to reference a [ProductVariant](ctp:api:type:ProductVariant) that exists. +* + */ +type ProductTailoringChangeAssetOrderAction struct { + // The `id` of the tailored ProductVariant to update. + VariantId *int `json:"variantId,omitempty"` + // The `sku` of the tailored ProductVariant to update. + Sku *string `json:"sku,omitempty"` + // If `true`, only the staged `assets` is updated. If `false`, both the current and staged `assets` are updated. + Staged *bool `json:"staged,omitempty"` + // All existing Asset `id`s of the ProductTailoringVariant in the desired new order. + AssetOrder []string `json:"assetOrder"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringChangeAssetOrderAction) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringChangeAssetOrderAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "changeAssetOrder", Alias: (*Alias)(&obj)}) +} + +/** +* Either `variantId` or `sku` is required to reference a [ProductVariant](ctp:api:type:ProductVariant) that exists. +* + */ +type ProductTailoringMoveImageToPositionAction struct { + // The `id` of the tailored ProductVariant to update. + VariantId *int `json:"variantId,omitempty"` + // The `sku` of the tailored ProductVariant to update. + Sku *string `json:"sku,omitempty"` + // The URL of the image to update. + ImageUrl string `json:"imageUrl"` + // Position in `images` where the image should be moved. Must be between `0` and the total number of images minus `1`. + Position int `json:"position"` + // If `true`, only the staged `images` is updated. If `false`, both the current and staged `images` is updated. + Staged *bool `json:"staged,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringMoveImageToPositionAction) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringMoveImageToPositionAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "moveImageToPosition", Alias: (*Alias)(&obj)}) +} + /** * Publishes the `staged` data of the ProductTailoring to `current`. Sets `hasStagedChanges` to `false`. * Generates the [ProductTailoringPublished](ctp:api:type:ProductTailoringPublishedMessage) Message. @@ -268,6 +715,282 @@ func (obj ProductTailoringPublishAction) MarshalJSON() ([]byte, error) { }{Action: "publish", Alias: (*Alias)(&obj)}) } +/** +* Either `variantId` or `sku` is required to reference a [ProductVariant](ctp:api:type:ProductVariant) that exists. +* The Asset to remove must be specified using either `assetId` or `assetKey`. +* + */ +type ProductTailoringRemoveAssetAction struct { + // The `id` of the tailored ProductVariant to update. + VariantId *int `json:"variantId,omitempty"` + // The `sku` of the tailored ProductVariant to update. + Sku *string `json:"sku,omitempty"` + // If `true`, only the staged Asset is removed. If `false`, both the current and staged Asset is removed. + Staged *bool `json:"staged,omitempty"` + // The `id` of the Asset to remove. + AssetId *string `json:"assetId,omitempty"` + // The `key` of the Asset to remove. + AssetKey *string `json:"assetKey,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringRemoveAssetAction) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringRemoveAssetAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "removeAsset", Alias: (*Alias)(&obj)}) +} + +/** +* Either `variantId` or `sku` is required to reference a [ProductVariant](ctp:api:type:ProductVariant) that exists. +* + */ +type ProductTailoringRemoveImageAction struct { + // The `id` of the tailored ProductVariant to update. + VariantId *int `json:"variantId,omitempty"` + // The `sku` of the tailored ProductVariant to update. + Sku *string `json:"sku,omitempty"` + // The URL of the image to remove. + ImageUrl string `json:"imageUrl"` + // If `true`, only the staged image is removed. If `false`, both the current and staged image is removed. + Staged *bool `json:"staged,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringRemoveImageAction) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringRemoveImageAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "removeImage", Alias: (*Alias)(&obj)}) +} + +/** +* Either `id` or `sku` is required. +* Produces the [ProductVariantTailoringDeleted](ctp:api:type:ProductVariantTailoringRemovedMessage) Message. +* + */ +type ProductTailoringRemoveVariantAction struct { + // The `id` of the ProductVariant to remove from the Tailoring. + ID *int `json:"id,omitempty"` + // The `sku` of the ProductVariant to remove from the Tailoring. + Sku *string `json:"sku,omitempty"` + // If `true`, only the staged Product Variant Tailoring is removed. If `false`, both the current and staged Product Variant Tailoring is removed. + Staged *bool `json:"staged,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringRemoveVariantAction) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringRemoveVariantAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "removeVariant", Alias: (*Alias)(&obj)}) +} + +/** +* Either `variantId` or `sku` is required to reference a [ProductVariant](ctp:api:type:ProductVariant) that exists. +* The [Asset](ctp:api:type:Asset) to update must be specified using either `assetId` or `assetKey`. +* + */ +type ProductTailoringSetAssetCustomFieldAction struct { + // The `id` of the tailored ProductVariant to update. + VariantId *int `json:"variantId,omitempty"` + // The `sku` of the tailored ProductVariant to update. + Sku *string `json:"sku,omitempty"` + // If `true`, only the staged Asset is updated. If `false`, both the current and staged Asset is updated. + Staged *bool `json:"staged,omitempty"` + // The `id` of the Asset to update. + AssetId *string `json:"assetId,omitempty"` + // The `key` of the Asset to update. + AssetKey *string `json:"assetKey,omitempty"` + // Name of the [Custom Field](/../api/projects/custom-fields). + Name string `json:"name"` + // If `value` is absent or `null`, this field will be removed if it exists. + // Removing a field that does not exist returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error. + // If `value` is provided, it is set for the field defined by `name`. + Value interface{} `json:"value,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringSetAssetCustomFieldAction) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringSetAssetCustomFieldAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "setAssetCustomField", Alias: (*Alias)(&obj)}) +} + +/** +* Either `variantId` or `sku` is required to reference a [ProductVariant](ctp:api:type:ProductVariant) that exists. +* The [Asset](ctp:api:type:Asset) to update must be specified using either `assetId` or `assetKey`. +* + */ +type ProductTailoringSetAssetCustomTypeAction struct { + // The `id` of the tailored ProductVariant to update. + VariantId *int `json:"variantId,omitempty"` + // The `sku` of the tailored ProductVariant to update. + Sku *string `json:"sku,omitempty"` + // If `true`, only the staged Asset is updated. If `false`, both the current and staged Asset is updated. + Staged *bool `json:"staged,omitempty"` + // The `id` of the Asset to update. + AssetId *string `json:"assetId,omitempty"` + // The `key` of the Asset to update. + AssetKey *string `json:"assetKey,omitempty"` + // Defines the [Type](ctp:api:type:Type) that extends the Asset with [Custom Fields](/../api/projects/custom-fields). + // If absent, any existing Type and Custom Fields are removed from the Asset. + Type *TypeResourceIdentifier `json:"type,omitempty"` + // Sets the [Custom Fields](/../api/projects/custom-fields) fields for the Asset. + Fields *FieldContainer `json:"fields,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringSetAssetCustomTypeAction) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringSetAssetCustomTypeAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "setAssetCustomType", Alias: (*Alias)(&obj)}) +} + +/** +* Either `variantId` or `sku` is required to reference a [ProductVariant](ctp:api:type:ProductVariant) that exists. +* The [Asset](ctp:api:type:Asset) to update must be specified using either `assetId` or `assetKey`. +* + */ +type ProductTailoringSetAssetDescriptionAction struct { + // The `id` of the tailored ProductVariant to update. + VariantId *int `json:"variantId,omitempty"` + // The `sku` of the tailored ProductVariant to update. + Sku *string `json:"sku,omitempty"` + // If `true`, only the staged Asset is updated. If `false`, both the current and staged Asset is updated. + Staged *bool `json:"staged,omitempty"` + // The `id` of the Asset to update. + AssetId *string `json:"assetId,omitempty"` + // The `key` of the Asset to update. + AssetKey *string `json:"assetKey,omitempty"` + // Value to set. If empty, any existing value will be removed. + Description *LocalizedString `json:"description,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringSetAssetDescriptionAction) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringSetAssetDescriptionAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "setAssetDescription", Alias: (*Alias)(&obj)}) +} + +/** +* Either `variantId` or `sku` is required to reference a [ProductVariant](ctp:api:type:ProductVariant) that exists. +* + */ +type ProductTailoringSetAssetKeyAction struct { + // The `id` of the tailored ProductVariant to update. + VariantId *int `json:"variantId,omitempty"` + // The `sku` of the tailored ProductVariant to update. + Sku *string `json:"sku,omitempty"` + // If `true`, only the staged Asset is updated. If `false`, both the current and staged Asset is updated. + Staged *bool `json:"staged,omitempty"` + // The `id` of the Asset to update. + AssetId string `json:"assetId"` + // Value to set. If empty, any existing value will be removed. + AssetKey *string `json:"assetKey,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringSetAssetKeyAction) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringSetAssetKeyAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "setAssetKey", Alias: (*Alias)(&obj)}) +} + +/** +* Either `variantId` or `sku` is required to reference a [ProductVariant](ctp:api:type:ProductVariant) that exists. +* The [Asset](ctp:api:type:Asset) to update must be specified using either `assetId` or `assetKey`. +* + */ +type ProductTailoringSetAssetSourcesAction struct { + // The `id` of the tailored ProductVariant to update. + VariantId *int `json:"variantId,omitempty"` + // The `sku` of the tailored ProductVariant to update. + Sku *string `json:"sku,omitempty"` + // If `true`, only the staged Asset is updated. If `false` both the current and staged Asset is updated. + Staged *bool `json:"staged,omitempty"` + // The `id` of the Asset to update. + AssetId *string `json:"assetId,omitempty"` + // The `key` of the Asset to update. + AssetKey *string `json:"assetKey,omitempty"` + // Value to set. + Sources []AssetSource `json:"sources"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringSetAssetSourcesAction) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringSetAssetSourcesAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "setAssetSources", Alias: (*Alias)(&obj)}) +} + +/** +* Either `variantId` or `sku` is required to reference a [ProductVariant](ctp:api:type:ProductVariant) that exists. +* The Asset to update must be specified using either `assetId` or `assetKey`. +* + */ +type ProductTailoringSetAssetTagsAction struct { + // The `id` of the tailored ProductVariant to update. + VariantId *int `json:"variantId,omitempty"` + // The `sku` of the tailored ProductVariant to update. + Sku *string `json:"sku,omitempty"` + // If `true`, only the staged Asset is updated. If `false`, both the current and staged Asset is updated. + Staged *bool `json:"staged,omitempty"` + // The `id` of the Asset to update. + AssetId *string `json:"assetId,omitempty"` + // The `key` of the Asset to update. + AssetKey *string `json:"assetKey,omitempty"` + // Keywords for categorizing and organizing Assets. + Tags []string `json:"tags"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringSetAssetTagsAction) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringSetAssetTagsAction + data, err := json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "setAssetTags", Alias: (*Alias)(&obj)}) + if err != nil { + return nil, err + } + + raw := make(map[string]interface{}) + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + if raw["tags"] == nil { + delete(raw, "tags") + } + + return json.Marshal(raw) + +} + /** * Generates the [ProductTailoringDescriptionSet](ctp:api:type:ProductTailoringDescriptionSetMessage) Message. * @@ -289,6 +1012,58 @@ func (obj ProductTailoringSetDescriptionAction) MarshalJSON() ([]byte, error) { }{Action: "setDescription", Alias: (*Alias)(&obj)}) } +/** +* Either `variantId` or `sku` is required to reference a [ProductVariant](ctp:api:type:ProductVariant) that exists. Produces the [ProductTailoringImagesSet](/projects/messages#product-tailoring-images-set) Message. +* + */ +type ProductTailoringSetExternalImagesAction struct { + // The `id` of the tailored ProductVariant to update. + VariantId *int `json:"variantId,omitempty"` + // The `sku` of the tailored ProductVariant to update. + Sku *string `json:"sku,omitempty"` + // Value to set to `images`. + Images []Image `json:"images"` + // If `true`, only the staged `images` is updated. If `false`, both the current and staged `images` is updated. + Staged *bool `json:"staged,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringSetExternalImagesAction) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringSetExternalImagesAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "setImages", Alias: (*Alias)(&obj)}) +} + +/** +* Either `variantId` or `sku` is required to reference a [ProductVariant](ctp:api:type:ProductVariant) that exists. +* + */ +type ProductTailoringSetImageLabelAction struct { + // The `sku` of the tailored ProductVariant to update. + Sku *string `json:"sku,omitempty"` + // The `id` of the tailored ProductVariant to update. + VariantId *int `json:"variantId,omitempty"` + // The URL of the image to set the label. + ImageUrl string `json:"imageUrl"` + // Value to set. If empty, any existing value will be removed. + Label *string `json:"label,omitempty"` + // If `true`, only the staged image is updated. If `false`, both the current and staged image is updated. + Staged *bool `json:"staged,omitempty"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProductTailoringSetImageLabelAction) MarshalJSON() ([]byte, error) { + type Alias ProductTailoringSetImageLabelAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "setImageLabel", Alias: (*Alias)(&obj)}) +} + /** * Updates all meta attributes at the same time. */ diff --git a/platform/types_product_type.go b/platform/types_product_type.go index 47b84ae8..29bec53b 100644 --- a/platform/types_product_type.go +++ b/platform/types_product_type.go @@ -159,6 +159,7 @@ const ( AttributeReferenceTypeIdCategory AttributeReferenceTypeId = "category" AttributeReferenceTypeIdChannel AttributeReferenceTypeId = "channel" AttributeReferenceTypeIdCustomer AttributeReferenceTypeId = "customer" + AttributeReferenceTypeIdCustomerGroup AttributeReferenceTypeId = "customer-group" AttributeReferenceTypeIdKeyValueDocument AttributeReferenceTypeId = "key-value-document" AttributeReferenceTypeIdOrder AttributeReferenceTypeId = "order" AttributeReferenceTypeIdProduct AttributeReferenceTypeId = "product" @@ -509,9 +510,9 @@ type ProductType struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the ProductType was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the ProductType. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the ProductType. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // User-defined unique identifier of the ProductType. Key *string `json:"key,omitempty"` diff --git a/platform/types_project.go b/platform/types_project.go index cbe9f397..37d7a6c9 100644 --- a/platform/types_project.go +++ b/platform/types_project.go @@ -8,6 +8,19 @@ import ( "time" ) +/** +* The current indexing status of Customer Search. +* + */ +type CustomerIndexingStatus string + +const ( + CustomerIndexingStatusScheduled CustomerIndexingStatus = "Scheduled" + CustomerIndexingStatusIndexing CustomerIndexingStatus = "Indexing" + CustomerIndexingStatusReady CustomerIndexingStatus = "Ready" + CustomerIndexingStatusFailed CustomerIndexingStatus = "Failed" +) + type BusinessUnitConfiguration struct { // Status of Business Units created using the [My Business Unit endpoint](ctp:api:endpoint:/{projectKey}/me/business-units:POST). MyBusinessUnitStatusOnCreation BusinessUnitConfigurationStatus `json:"myBusinessUnitStatusOnCreation"` @@ -35,6 +48,18 @@ type CartsConfiguration struct { CountryTaxRateFallbackEnabled *bool `json:"countryTaxRateFallbackEnabled,omitempty"` } +/** +* Specifies the status of the [Customer Search](/../api/projects/customer-search) index. +* You can change the status using the [Change Customer Search Status](ctp:api:type:ProjectChangeCustomerSearchStatusAction) update action. +* + */ +type CustomerSearchStatus string + +const ( + CustomerSearchStatusActivated CustomerSearchStatus = "Activated" + CustomerSearchStatusDeactivated CustomerSearchStatus = "Deactivated" +) + /** * Represents a RFC 7662 compliant [OAuth 2.0 Token Introspection](https://datatracker.ietf.org/doc/html/rfc7662) endpoint. For more information, see [Requesting an access token using an external OAuth 2.0 server](/../api/authorization#requesting-an-access-token-using-an-external-oauth-server). * @@ -58,6 +83,23 @@ const ( OrderSearchStatusDeactivated OrderSearchStatus = "Deactivated" ) +type ProductSearchIndexingMode string + +const ( + ProductSearchIndexingModeProductProjectionsSearch ProductSearchIndexingMode = "ProductProjectionsSearch" + ProductSearchIndexingModeProductsSearch ProductSearchIndexingMode = "ProductsSearch" +) + +/** +* Specifies the status of the [Product Search](/../api/projects/product-search) index. + */ +type ProductSearchStatus string + +const ( + ProductSearchStatusActivated ProductSearchStatus = "Activated" + ProductSearchStatusDeactivated ProductSearchStatus = "Deactivated" +) + type Project struct { // Current version of the Project. Version int `json:"version"` @@ -179,6 +221,12 @@ func mapDiscriminatorProjectUpdateAction(input interface{}) (ProjectUpdateAction return nil, err } return obj, nil + case "changeCustomerSearchStatus": + obj := ProjectChangeCustomerSearchStatusAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil case "changeLanguages": obj := ProjectChangeLanguagesAction{} if err := decodeStruct(input, &obj); err != nil { @@ -257,6 +305,8 @@ func mapDiscriminatorProjectUpdateAction(input interface{}) (ProjectUpdateAction type SearchIndexingConfiguration struct { // Configuration for the [Product Projection Search](/../api/projects/products-search) and [Product Suggestions](/../api/projects/products-suggestions) endpoints. Products *SearchIndexingConfigurationValues `json:"products,omitempty"` + // Configuration for the [Product Search](/../api/projects/product-search) feature. + ProductsSearch *SearchIndexingConfigurationValues `json:"productsSearch,omitempty"` // Configuration for the [Order Search](/../api/projects/order-search) feature. Orders *SearchIndexingConfigurationValues `json:"orders,omitempty"` } @@ -277,7 +327,7 @@ type SearchIndexingConfigurationValues struct { Status *SearchIndexingConfigurationStatus `json:"status,omitempty"` // Date and time (UTC) the Project was last updated. Only present on Projects last modified after 1 February 2019. LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the SearchIndexingConfigurationValues. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` } @@ -318,7 +368,7 @@ func mapDiscriminatorShippingRateInputType(input interface{}) (ShippingRateInput } /** -* Used when the ShippingRate maps to an abstract Cart categorization expressed by strings (for example, `Light`, `Medium`, or `Heavy`). +* The [ShippingRate](ctp:api:type:ShippingRate) maps to an abstract Cart categorization expressed by strings (for example, `Light`, `Medium`, or `Heavy`). * Only keys defined in the `values` array can be used to create a tier or to set a value of the `shippingRateInput` on the [Cart](ctp:api:type:Cart). * Keys must be unique. * @@ -339,7 +389,7 @@ func (obj CartClassificationType) MarshalJSON() ([]byte, error) { } /** -* Used when the ShippingRate maps to an abstract Cart categorization expressed by integers (such as shipping scores or weight ranges). +* The [ShippingRate](ctp:api:type:ShippingRate) maps to an abstract [Cart](ctp:api:type:Cart) categorization expressed by integers (such as shipping scores or weight ranges). * */ type CartScoreType struct { @@ -356,8 +406,8 @@ func (obj CartScoreType) MarshalJSON() ([]byte, error) { } /** -* Used when the ShippingRate maps to the sum of [LineItem](ctp:api:type:LineItem) Prices. -* The value of the Cart is used to select a tier. +* The [ShippingRate](ctp:api:type:ShippingRate) maps to the value of the Cart and is used to select a tier. +* The value of the [Cart](ctp:api:type:Cart) is the sum of all Line Item totals and Custom Line Item totals (via the `totalPrice` field) after any Product Discounts and Cart Discounts have been applied. * If chosen, it is not possible to set a value for the `shippingRateInput` on the [Cart](ctp:api:type:Cart). * */ @@ -455,6 +505,21 @@ func (obj ProjectChangeCurrenciesAction) MarshalJSON() ([]byte, error) { }{Action: "changeCurrencies", Alias: (*Alias)(&obj)}) } +type ProjectChangeCustomerSearchStatusAction struct { + // Activates or deactivates the [Customer Search](/../api/projects/customer-search) feature. Activation will trigger building a search index for the Customers in the Project. + Status CustomerSearchStatus `json:"status"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ProjectChangeCustomerSearchStatusAction) MarshalJSON() ([]byte, error) { + type Alias ProjectChangeCustomerSearchStatusAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "changeCustomerSearchStatus", Alias: (*Alias)(&obj)}) +} + /** * Removing a language used by a [Store](ctp:api:type:Store) returns a [LanguageUsedInStores](ctp:api:type:LanguageUsedInStoresError) error. * @@ -537,6 +602,8 @@ type ProjectChangeProductSearchIndexingEnabledAction struct { // - If `false`, the indexing of [Product](ctp:api:type:Product) information will stop and the [Product Projection Search](/../api/projects/products-search) as well as the [Product Suggestions](/../api/projects/products-suggestions) endpoint will not be available anymore for this Project. The Project's [SearchIndexingConfiguration](ctp:api:type:SearchIndexingConfiguration) `status` for `products` will be changed to `"Deactivated"`. // - If `true`, the indexing of [Product](ctp:api:type:Product) information will start and the [Product Projection Search](/../api/projects/products-search) as well as the [Product Suggestions](/../api/projects/products-suggestions) endpoint will become available soon after for this Project. Proportional to the amount of information being indexed, the Project's [SearchIndexingConfiguration](ctp:api:type:SearchIndexingConfiguration) `status` for `products` will be shown as `"Indexing"` during this time. As soon as the indexing has finished, the configuration status will be changed to `"Activated"` making the aforementioned endpoints fully available for this Project. Enabled bool `json:"enabled"` + // Controls whether the action should apply to [Product Projection Search](/../api/projects/products-search) or to [Product Search](/../api/projects/product-search). + Mode *ProductSearchIndexingMode `json:"mode,omitempty"` } // MarshalJSON override to set the discriminator value or remove diff --git a/platform/types_quote.go b/platform/types_quote.go index 5c529788..0ee63fdb 100644 --- a/platform/types_quote.go +++ b/platform/types_quote.go @@ -19,9 +19,9 @@ type Quote struct { LastModifiedAt time.Time `json:"lastModifiedAt"` // User-defined unique identifier of the Quote. Key *string `json:"key,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the Quote. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Quote. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Quote Request related to the Quote. QuoteRequest QuoteRequestReference `json:"quoteRequest"` diff --git a/platform/types_quote_request.go b/platform/types_quote_request.go index 9dbeb442..6d9db95d 100644 --- a/platform/types_quote_request.go +++ b/platform/types_quote_request.go @@ -19,9 +19,9 @@ type QuoteRequest struct { LastModifiedAt time.Time `json:"lastModifiedAt"` // User-defined unique identifier of the QuoteRequest. Key *string `json:"key,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the QuoteRequest. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the QuoteRequest. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Indicates the current state of the Quote Request in the negotiation process. QuoteRequestState QuoteRequestState `json:"quoteRequestState"` @@ -143,7 +143,8 @@ func (obj QuoteRequest) MarshalJSON() ([]byte, error) { type QuoteRequestDraft struct { // Cart for which a Quote is requested. - // Anonymous Carts, Carts with [Discount Codes](ctp:api:type:DiscountCode), or Carts with a `Multiple` [ShippingMode](ctp:api:type:ShippingMode) are not supported. + // Anonymous Carts, Carts with [Discount Codes](ctp:api:type:DiscountCode), and Carts with `Multiple` [ShippingMode](ctp:api:type:ShippingMode) are not supported. + // The Cart must have a `shippingAddress` defined, otherwise an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned when [creating a Quote Request](ctp:api:endpoint:/{projectKey}/quote-requests:POST). Cart CartResourceIdentifier `json:"cart"` // Current version of the referenced Cart. CartVersion int `json:"cartVersion"` diff --git a/platform/types_review.go b/platform/types_review.go index e7919b8a..c5405ab2 100644 --- a/platform/types_review.go +++ b/platform/types_review.go @@ -17,9 +17,9 @@ type Review struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the Review was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the Review. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Review. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // User-defined unique identifier of the Review. Key *string `json:"key,omitempty"` diff --git a/platform/types_search.go b/platform/types_search.go new file mode 100644 index 00000000..7022a75c --- /dev/null +++ b/platform/types_search.go @@ -0,0 +1,261 @@ +package platform + +// Generated file, please do not change!!! + +import ( + "time" +) + +/** +* Possible values for the `fieldType` property on [query expressions](/../api/search-query-language#query-expressions) indicating the data type of the `field`. + */ +type SearchFieldType string + +const ( + SearchFieldTypeBoolean SearchFieldType = "boolean" + SearchFieldTypeText SearchFieldType = "text" + SearchFieldTypeLtext SearchFieldType = "ltext" + SearchFieldTypeEnum SearchFieldType = "enum" + SearchFieldTypeLenum SearchFieldType = "lenum" + SearchFieldTypeNumber SearchFieldType = "number" + SearchFieldTypeMoney SearchFieldType = "money" + SearchFieldTypeDate SearchFieldType = "date" + SearchFieldTypeDatetime SearchFieldType = "datetime" + SearchFieldTypeTime SearchFieldType = "time" + SearchFieldTypeReference SearchFieldType = "reference" + SearchFieldTypeSetBoolean SearchFieldType = "set_boolean" + SearchFieldTypeSetText SearchFieldType = "set_text" + SearchFieldTypeSetLtext SearchFieldType = "set_ltext" + SearchFieldTypeSetEnum SearchFieldType = "set_enum" + SearchFieldTypeSetLenum SearchFieldType = "set_lenum" + SearchFieldTypeSetNumber SearchFieldType = "set_number" + SearchFieldTypeSetMoney SearchFieldType = "set_money" + SearchFieldTypeSetDate SearchFieldType = "set_date" + SearchFieldTypeSetDatetime SearchFieldType = "set_datetime" + SearchFieldTypeSetTime SearchFieldType = "set_time" + SearchFieldTypeSetReference SearchFieldType = "set_reference" +) + +type SearchMatchType string + +const ( + SearchMatchTypeAny SearchMatchType = "any" + SearchMatchTypeAll SearchMatchType = "all" +) + +type SearchMatchingVariant struct { + // Unique identifier of the variant. + ID int `json:"id"` + // SKU of the matching variant. + Sku *string `json:"sku,omitempty"` +} + +type SearchQuery map[string]interface{} +type SearchCompoundExpression map[string]interface{} +type SearchAndExpression struct { + And []SearchQuery `json:"and"` +} + +type SearchFilterExpression struct { + Filter []SearchQueryExpression `json:"filter"` +} + +type SearchNotExpression struct { + Not []SearchQuery `json:"not"` +} + +type SearchOrExpression struct { + Or []SearchQuery `json:"or"` +} + +type SearchQueryExpression map[string]interface{} +type SearchDateRangeExpression struct { + Range SearchDateRangeValue `json:"range"` +} + +type SearchDateTimeRangeExpression struct { + Range SearchDateTimeRangeValue `json:"range"` +} + +type SearchExactExpression struct { + Exact SearchAnyValue `json:"exact"` +} + +type SearchExistsExpression struct { + Exists SearchExistsValue `json:"exists"` +} + +type SearchFullTextExpression struct { + FullText SearchFullTextValue `json:"fullText"` +} + +type SearchFullTextPrefixExpression struct { + FullTextPrefix SearchFullTextPrefixValue `json:"fullTextPrefix"` +} + +type SearchLongRangeExpression struct { + Range SearchLongRangeValue `json:"range"` +} + +type SearchNumberRangeExpression struct { + Range SearchNumberRangeValue `json:"range"` +} + +type SearchPrefixExpression struct { + Prefix SearchAnyValue `json:"prefix"` +} + +type SearchQueryExpressionValue struct { + Field string `json:"field"` + Boost *float64 `json:"boost,omitempty"` + // Possible values for the `fieldType` property on [query expressions](/../api/search-query-language#query-expressions) indicating the data type of the `field`. + FieldType *SearchFieldType `json:"fieldType,omitempty"` +} + +type SearchAnyValue struct { + Field string `json:"field"` + Boost *float64 `json:"boost,omitempty"` + // Possible values for the `fieldType` property on [query expressions](/../api/search-query-language#query-expressions) indicating the data type of the `field`. + FieldType *SearchFieldType `json:"fieldType,omitempty"` + Value interface{} `json:"value"` + // String value specifying linguistic and regional preferences using the [IETF language tag format](https://en.wikipedia.org/wiki/IETF_language_tag), as described in [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). The format combines language, script, and region using hyphen-separated subtags. For example: `en`, `en-US`, `zh-Hans-SG`. + Language *string `json:"language,omitempty"` + CaseInsensitive *bool `json:"caseInsensitive,omitempty"` +} + +type SearchDateRangeValue struct { + Field string `json:"field"` + Boost *float64 `json:"boost,omitempty"` + // Possible values for the `fieldType` property on [query expressions](/../api/search-query-language#query-expressions) indicating the data type of the `field`. + FieldType *SearchFieldType `json:"fieldType,omitempty"` + Gte *Date `json:"gte,omitempty"` + Gt *Date `json:"gt,omitempty"` + Lte *Date `json:"lte,omitempty"` + Lt *Date `json:"lt,omitempty"` +} + +type SearchDateTimeRangeValue struct { + Field string `json:"field"` + Boost *float64 `json:"boost,omitempty"` + // Possible values for the `fieldType` property on [query expressions](/../api/search-query-language#query-expressions) indicating the data type of the `field`. + FieldType *SearchFieldType `json:"fieldType,omitempty"` + Gte *time.Time `json:"gte,omitempty"` + Gt *time.Time `json:"gt,omitempty"` + Lte *time.Time `json:"lte,omitempty"` + Lt *time.Time `json:"lt,omitempty"` +} + +type SearchExistsValue struct { + Field string `json:"field"` + Boost *float64 `json:"boost,omitempty"` + // Possible values for the `fieldType` property on [query expressions](/../api/search-query-language#query-expressions) indicating the data type of the `field`. + FieldType *SearchFieldType `json:"fieldType,omitempty"` + // String value specifying linguistic and regional preferences using the [IETF language tag format](https://en.wikipedia.org/wiki/IETF_language_tag), as described in [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). The format combines language, script, and region using hyphen-separated subtags. For example: `en`, `en-US`, `zh-Hans-SG`. + Language *string `json:"language,omitempty"` +} + +type SearchFullTextPrefixValue struct { + Field string `json:"field"` + Boost *float64 `json:"boost,omitempty"` + // Possible values for the `fieldType` property on [query expressions](/../api/search-query-language#query-expressions) indicating the data type of the `field`. + FieldType *SearchFieldType `json:"fieldType,omitempty"` + Value interface{} `json:"value"` + // String value specifying linguistic and regional preferences using the [IETF language tag format](https://en.wikipedia.org/wiki/IETF_language_tag), as described in [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). The format combines language, script, and region using hyphen-separated subtags. For example: `en`, `en-US`, `zh-Hans-SG`. + Language *string `json:"language,omitempty"` + MustMatch *SearchMatchType `json:"mustMatch,omitempty"` +} + +type SearchFullTextValue struct { + Field string `json:"field"` + Boost *float64 `json:"boost,omitempty"` + // Possible values for the `fieldType` property on [query expressions](/../api/search-query-language#query-expressions) indicating the data type of the `field`. + FieldType *SearchFieldType `json:"fieldType,omitempty"` + Value interface{} `json:"value"` + // String value specifying linguistic and regional preferences using the [IETF language tag format](https://en.wikipedia.org/wiki/IETF_language_tag), as described in [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). The format combines language, script, and region using hyphen-separated subtags. For example: `en`, `en-US`, `zh-Hans-SG`. + Language *string `json:"language,omitempty"` + MustMatch *SearchMatchType `json:"mustMatch,omitempty"` +} + +type SearchLongRangeValue struct { + Field string `json:"field"` + Boost *float64 `json:"boost,omitempty"` + // Possible values for the `fieldType` property on [query expressions](/../api/search-query-language#query-expressions) indicating the data type of the `field`. + FieldType *SearchFieldType `json:"fieldType,omitempty"` + Gte *int `json:"gte,omitempty"` + Gt *int `json:"gt,omitempty"` + Lte *int `json:"lte,omitempty"` + Lt *int `json:"lt,omitempty"` +} + +type SearchNumberRangeValue struct { + Field string `json:"field"` + Boost *float64 `json:"boost,omitempty"` + // Possible values for the `fieldType` property on [query expressions](/../api/search-query-language#query-expressions) indicating the data type of the `field`. + FieldType *SearchFieldType `json:"fieldType,omitempty"` + Gte *float64 `json:"gte,omitempty"` + Gt *float64 `json:"gt,omitempty"` + Lte *float64 `json:"lte,omitempty"` + Lt *float64 `json:"lt,omitempty"` +} + +/** +* For set-type fields, only a single value of the set is taken into account for sorting. +* The sort mode determines whether the minimum or maximum value, or a calculated statistical value should be used as sorting value. +* + */ +type SearchSortMode string + +const ( + SearchSortModeMin SearchSortMode = "min" + SearchSortModeMax SearchSortMode = "max" + SearchSortModeAvg SearchSortMode = "avg" + SearchSortModeSum SearchSortMode = "sum" +) + +type SearchSortOrder string + +const ( + SearchSortOrderAsc SearchSortOrder = "asc" + SearchSortOrderDesc SearchSortOrder = "desc" +) + +/** +* Sorting parameters provided with a Search request. +* Sorting allows you to control how results to your query are sorted. +* If no sorting is specified, the results are sorted by relevance in descending (`desc`) order. +* + */ +type SearchSorting struct { + // Use any searchable field of the resource as sort criterion. + Field string `json:"field"` + // String value specifying linguistic and regional preferences using the [IETF language tag format](https://en.wikipedia.org/wiki/IETF_language_tag), as described in [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). The format combines language, script, and region using hyphen-separated subtags. For example: `en`, `en-US`, `zh-Hans-SG`. + Language *string `json:"language,omitempty"` + // Specify the order in which the search results should be sorted. + // Can be `asc` for ascending, or `desc` for descending order. + Order SearchSortOrder `json:"order"` + // Specify the sort mode to be applied for a set-type `field`. + Mode *SearchSortMode `json:"mode,omitempty"` + // Provide the data type of the given `field`. + FieldType *SearchFieldType `json:"fieldType,omitempty"` + // Allows you to apply a [sort filter](/../api/search-query-language#sort-filter). + Filter *SearchQueryExpression `json:"filter,omitempty"` +} + +type SearchTimeRangeExpression struct { + Range SearchTimeRangeValue `json:"range"` +} + +type SearchTimeRangeValue struct { + Field string `json:"field"` + Boost *float64 `json:"boost,omitempty"` + // Possible values for the `fieldType` property on [query expressions](/../api/search-query-language#query-expressions) indicating the data type of the `field`. + FieldType *SearchFieldType `json:"fieldType,omitempty"` + Gte *time.Time `json:"gte,omitempty"` + Gt *time.Time `json:"gt,omitempty"` + Lte *time.Time `json:"lte,omitempty"` + Lt *time.Time `json:"lt,omitempty"` +} + +type SearchWildCardExpression struct { + Wildcard SearchAnyValue `json:"wildcard"` +} diff --git a/platform/types_shipping_method.go b/platform/types_shipping_method.go index c9b0ba73..18987f8c 100644 --- a/platform/types_shipping_method.go +++ b/platform/types_shipping_method.go @@ -26,9 +26,9 @@ type ShippingMethod struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the ShippingMethod was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the ShippingMethod. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the ShippingMethod. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // User-defined unique identifier of the ShippingMethod. Key *string `json:"key,omitempty"` @@ -44,7 +44,11 @@ type ShippingMethod struct { TaxCategory TaxCategoryReference `json:"taxCategory"` // Defines [ShippingRates](ctp:api:type:ShippingRate) (prices) for specific Zones. ZoneRates []ZoneRate `json:"zoneRates"` - // If `true` this ShippingMethod is the [Project](ctp:api:type:Project)'s default ShippingMethod. + // Indicates if the ShippingMethod is active. + // + // If `true`, the ShippingMethod can be used during the creation or update of a Cart or Order. + Active bool `json:"active"` + // If `true`, this ShippingMethod is the [Project](ctp:api:type:Project)'s default ShippingMethod. IsDefault bool `json:"isDefault"` // Valid [Cart predicate](/projects/predicates#cart-predicates) to select a ShippingMethod for a Cart. Predicate *string `json:"predicate,omitempty"` @@ -67,7 +71,9 @@ type ShippingMethodDraft struct { TaxCategory TaxCategoryResourceIdentifier `json:"taxCategory"` // Defines [ShippingRates](ctp:api:type:ShippingRate) (prices) for specific zones. ZoneRates []ZoneRateDraft `json:"zoneRates"` - // If `true` the ShippingMethod will be the [Project](ctp:api:type:Project)'s default ShippingMethod. + // If set to `true`, the ShippingMethod can be used during the creation or update of a Cart or Order. + Active *bool `json:"active,omitempty"` + // If set to `true`, the ShippingMethod will be the [Project](ctp:api:type:Project)'s default ShippingMethod. IsDefault bool `json:"isDefault"` // Valid [Cart predicate](/projects/predicates#cart-predicates) to select a ShippingMethod for a Cart. Predicate *string `json:"predicate,omitempty"` @@ -189,6 +195,12 @@ func mapDiscriminatorShippingMethodUpdateAction(input interface{}) (ShippingMeth return nil, err } return obj, nil + case "changeActive": + obj := ShippingMethodChangeActiveAction{} + if err := decodeStruct(input, &obj); err != nil { + return nil, err + } + return obj, nil case "changeIsDefault": obj := ShippingMethodChangeIsDefaultAction{} if err := decodeStruct(input, &obj); err != nil { @@ -267,9 +279,9 @@ func mapDiscriminatorShippingMethodUpdateAction(input interface{}) (ShippingMeth type ShippingRate struct { // Currency amount of the ShippingRate. - Price TypedMoney `json:"price"` + Price CentPrecisionMoney `json:"price"` // [Free shipping](/../api/shipping-delivery-overview#free-shipping) is applied if the sum of the (Custom) Line Item Prices reaches the specified value. - FreeAbove TypedMoney `json:"freeAbove,omitempty"` + FreeAbove *CentPrecisionMoney `json:"freeAbove,omitempty"` // `true` if the ShippingRate matches given [Cart](ctp:api:type:Cart) or [Location](ctp:api:type:Location). // Only appears in response to requests for [Get ShippingMethods for a Cart](ctp:api:endpoint:/{projectKey}/shipping-methods/matching-cart:GET) or // [Get ShippingMethods for a Location](ctp:api:endpoint:/{projectKey}/shipping-methods/matching-location:GET). @@ -285,20 +297,6 @@ func (obj *ShippingRate) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { return err } - if obj.Price != nil { - var err error - obj.Price, err = mapDiscriminatorTypedMoney(obj.Price) - if err != nil { - return err - } - } - if obj.FreeAbove != nil { - var err error - obj.FreeAbove, err = mapDiscriminatorTypedMoney(obj.FreeAbove) - if err != nil { - return err - } - } for i := range obj.Tiers { var err error obj.Tiers[i], err = mapDiscriminatorShippingRatePriceTier(obj.Tiers[i]) @@ -398,7 +396,7 @@ func mapDiscriminatorShippingRatePriceTier(input interface{}) (ShippingRatePrice } /** -* Used when the ShippingRate maps to an abstract Cart categorization expressed by strings (for example, `Light`, `Medium`, or `Heavy`). +* The [ShippingRate](ctp:api:type:ShippingRate) maps to an abstract Cart categorization expressed by strings (for example, `Light`, `Medium`, or `Heavy`). * */ type CartClassificationTier struct { @@ -421,7 +419,7 @@ func (obj CartClassificationTier) MarshalJSON() ([]byte, error) { } /** -* Used when the ShippingRate maps to an abstract Cart categorization expressed by integers (such as shipping scores or weight ranges). +* The [ShippingRate](ctp:api:type:ShippingRate) maps to an abstract Cart categorization expressed by integers (such as shipping scores or weight ranges). * Either `price` or `priceFunction` is required. * */ @@ -447,8 +445,9 @@ func (obj CartScoreTier) MarshalJSON() ([]byte, error) { } /** -* Used when the ShippingRate maps to the sum of [LineItem](ctp:api:type:LineItem) Prices. -* The value of the Cart is used to select a tier. +* +* The [ShippingRate](ctp:api:type:ShippingRate) maps to the value of the Cart and is used to select a tier. +* The value of the [Cart](ctp:api:type:Cart) is the sum of all Line Item totals and Custom Line Item totals (via the `totalPrice` field) after any Product Discounts and Cart Discounts have been applied. * If chosen, it is not possible to set a value for the `shippingRateInput` on the [Cart](ctp:api:type:Cart). * Tiers contain the `centAmount` (a value of `100` in the currency `USD` corresponds to `$ 1.00`), and start at `1`.' * @@ -530,6 +529,23 @@ func (obj ShippingMethodAddZoneAction) MarshalJSON() ([]byte, error) { }{Action: "addZone", Alias: (*Alias)(&obj)}) } +type ShippingMethodChangeActiveAction struct { + // Value to set. + // + // If set to `false`, the ShippingMethod cannot be used during the creation or update of a Cart or Order. + Active bool `json:"active"` +} + +// MarshalJSON override to set the discriminator value or remove +// optional nil slices +func (obj ShippingMethodChangeActiveAction) MarshalJSON() ([]byte, error) { + type Alias ShippingMethodChangeActiveAction + return json.Marshal(struct { + Action string `json:"action"` + *Alias + }{Action: "changeActive", Alias: (*Alias)(&obj)}) +} + type ShippingMethodChangeIsDefaultAction struct { // Value to set. Only one ShippingMethod can be default in a [Project](ctp:api:type:Project). IsDefault bool `json:"isDefault"` diff --git a/platform/types_shopping_list.go b/platform/types_shopping_list.go index 478491fd..6feb2a19 100644 --- a/platform/types_shopping_list.go +++ b/platform/types_shopping_list.go @@ -41,9 +41,9 @@ type ShoppingList struct { Store *StoreKeyReference `json:"store,omitempty"` // Custom Fields defined for the ShoppingList. Custom *CustomFields `json:"custom,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the ShoppingList. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the ShoppingList. CreatedBy *CreatedBy `json:"createdBy,omitempty"` } @@ -645,6 +645,10 @@ func (obj ShoppingListRemoveTextLineItemAction) MarshalJSON() ([]byte, error) { }{Action: "removeTextLineItem", Alias: (*Alias)(&obj)}) } +/** +* If the Shopping List is already associated with a Customer, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned. +* + */ type ShoppingListSetAnonymousIdAction struct { // Value to set. If empty, any existing value will be removed. AnonymousId *string `json:"anonymousId,omitempty"` diff --git a/platform/types_staged_quote.go b/platform/types_staged_quote.go index 7ed3d4af..82fbb9f6 100644 --- a/platform/types_staged_quote.go +++ b/platform/types_staged_quote.go @@ -19,9 +19,9 @@ type StagedQuote struct { LastModifiedAt time.Time `json:"lastModifiedAt"` // User-specific unique identifier of the staged quote. Key *string `json:"key,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the StagedQuote. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the StagedQuote. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Predefined states tracking the status of the Staged Quote. StagedQuoteState StagedQuoteState `json:"stagedQuoteState"` @@ -45,6 +45,8 @@ type StagedQuote struct { PurchaseOrderNumber *string `json:"purchaseOrderNumber,omitempty"` // The [BusinessUnit](ctp:api:type:BusinessUnit) for the Staged Quote. BusinessUnit *BusinessUnitKeyReference `json:"businessUnit,omitempty"` + // The Store to which the [Buyer](/../api/quotes-overview#buyer) belongs. + Store *StoreKeyReference `json:"store,omitempty"` } type StagedQuoteDraft struct { diff --git a/platform/types_standalone_price.go b/platform/types_standalone_price.go index 0cbabd8a..1c639b8d 100644 --- a/platform/types_standalone_price.go +++ b/platform/types_standalone_price.go @@ -71,9 +71,9 @@ type StandalonePrice struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the StandalonePrice was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the StandalonePrice. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the StandalonePrice. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // User-defined unique identifier of the StandalonePrice. Key *string `json:"key,omitempty"` @@ -95,15 +95,15 @@ type StandalonePrice struct { // // If `discounted` is present, the tiered Price is ignored for a Product Variant. Tiers []PriceTier `json:"tiers"` - // Set if a matching [ProductDiscount](ctp:api:type:ProductDiscount) exists. If set, the API uses the `discounted` value for the [LineItem Price selection](ctp:api:type:LineItemPriceSelection). + // Set if a matching [ProductDiscount](ctp:api:type:ProductDiscount) exists. If set, the API uses the `discounted` value for the [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). // When a [relative discount](/../api/projects/productDiscounts#productdiscountvaluerelative) is applied and the fraction part of the `discounted` price is 0.5, the discounted price is rounded in favor of the customer with the [half down rounding](https://en.wikipedia.org/wiki/Rounding#Round_half_down). Discounted *DiscountedPrice `json:"discounted,omitempty"` // Custom Fields for the StandalonePrice. Custom *CustomFields `json:"custom,omitempty"` // Staged changes of the StandalonePrice. Only present if the StandalonePrice has some changes staged. Staged *StagedStandalonePrice `json:"staged,omitempty"` - // If set to `true`, the StandalonePrice is considered during [price selection](ctp:api:type:ProductPriceSelection). - // If set to `false`, the StandalonePrice is not considered during [price selection](ctp:api:type:ProductPriceSelection). + // If set to `true`, the StandalonePrice is considered during [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection). + // If set to `false`, the StandalonePrice is not considered during [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection) and any associated Line Items in a Cart cannot be ordered. Active bool `json:"active"` } @@ -149,11 +149,6 @@ func (obj StandalonePrice) MarshalJSON() ([]byte, error) { } -/** -* Standalone Prices are defined with a scope consisting of `currency` and optionally `country`, `customerGroup`, and `channel` and/or a validity period (`validFrom` and/or `validTo`). For more information see [price selection](/../api/projects/products#price-selection). -* -* Creating a Standalone Price for an SKU which has a Standalone Price with exactly the same price scope, or with overlapping validity periods within the same price scope returns the [DuplicateStandalonePriceScope](ctp:api:type:DuplicateStandalonePriceScopeError) and [OverlappingStandalonePriceValidity](ctp:api:type:OverlappingStandalonePriceValidityError) errors, respectively. A Price without validity period does not conflict with a Price defined for a time period. - */ type StandalonePriceDraft struct { // User-defined unique identifier for the StandalonePrice. Key *string `json:"key,omitempty"` @@ -182,7 +177,7 @@ type StandalonePriceDraft struct { Custom *CustomFieldsDraft `json:"custom,omitempty"` // Staged changes for the StandalonePrice. Staged *StagedPriceDraft `json:"staged,omitempty"` - // Set to `false`, if the StandalonePrice should not be considered during [price selection](ctp:api:type:ProductPriceSelection). + // Set to `false`, if the StandalonePrice should not be considered during [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection). Active *bool `json:"active,omitempty"` } @@ -210,6 +205,10 @@ func (obj StandalonePriceDraft) MarshalJSON() ([]byte, error) { } +/** +* [PagedQueryResult](/general-concepts#pagedqueryresult) with `results` containing an array of [StandalonePrice](ctp:api:type:StandalonePrice). +* + */ type StandalonePricePagedQueryResponse struct { // Number of requested results. Limit int `json:"limit"` diff --git a/platform/types_state.go b/platform/types_state.go index 551ad2aa..2bc80b0a 100644 --- a/platform/types_state.go +++ b/platform/types_state.go @@ -17,9 +17,9 @@ type State struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the State was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the State. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the State. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // User-defined unique identifier of the State. Key string `json:"key"` diff --git a/platform/types_store.go b/platform/types_store.go index da21af19..bbe45546 100644 --- a/platform/types_store.go +++ b/platform/types_store.go @@ -31,9 +31,9 @@ type Store struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the Store was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the Store. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Store. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // User-defined unique and immutable identifier for the Store. Key string `json:"key"` @@ -124,7 +124,7 @@ func (obj StoreDraft) MarshalJSON() ([]byte, error) { } /** -* [Reference](ctp:api:type:Reference) to a [Store](ctp:api:type:Store) by its key. +* [KeyReference](ctp:api:type:KeyReference) to a [Store](ctp:api:type:Store). * */ type StoreKeyReference struct { diff --git a/platform/types_subscription.go b/platform/types_subscription.go index a571a9c9..3ea902af 100644 --- a/platform/types_subscription.go +++ b/platform/types_subscription.go @@ -39,6 +39,7 @@ const ( ChangeSubscriptionResourceTypeIdApprovalFlow ChangeSubscriptionResourceTypeId = "approval-flow" ChangeSubscriptionResourceTypeIdApprovalRule ChangeSubscriptionResourceTypeId = "approval-rule" ChangeSubscriptionResourceTypeIdAssociateRole ChangeSubscriptionResourceTypeId = "associate-role" + ChangeSubscriptionResourceTypeIdAttributeGroup ChangeSubscriptionResourceTypeId = "attribute-group" ChangeSubscriptionResourceTypeIdBusinessUnit ChangeSubscriptionResourceTypeId = "business-unit" ChangeSubscriptionResourceTypeIdCart ChangeSubscriptionResourceTypeId = "cart" ChangeSubscriptionResourceTypeIdCartDiscount ChangeSubscriptionResourceTypeId = "cart-discount" @@ -57,8 +58,8 @@ const ( ChangeSubscriptionResourceTypeIdPayment ChangeSubscriptionResourceTypeId = "payment" ChangeSubscriptionResourceTypeIdProduct ChangeSubscriptionResourceTypeId = "product" ChangeSubscriptionResourceTypeIdProductDiscount ChangeSubscriptionResourceTypeId = "product-discount" - ChangeSubscriptionResourceTypeIdProductPrice ChangeSubscriptionResourceTypeId = "product-price" ChangeSubscriptionResourceTypeIdProductSelection ChangeSubscriptionResourceTypeId = "product-selection" + ChangeSubscriptionResourceTypeIdProductTailoring ChangeSubscriptionResourceTypeId = "product-tailoring" ChangeSubscriptionResourceTypeIdProductType ChangeSubscriptionResourceTypeId = "product-type" ChangeSubscriptionResourceTypeIdQuote ChangeSubscriptionResourceTypeId = "quote" ChangeSubscriptionResourceTypeIdQuoteRequest ChangeSubscriptionResourceTypeId = "quote-request" @@ -76,7 +77,7 @@ const ( ) /** -* The [CloudEventsFormat](ctp:api:type:CloudEventsFormat) represents event data in a way that conforms to a common specification. The message payload can be found inside the `data` field. +* The [CloudEventsFormat](ctp:api:type:CloudEventsFormat) represents event data in a way that conforms to a common specification. The payload can be found inside the `data` field. * */ type CloudEventsPayload struct { @@ -320,8 +321,8 @@ func mapDiscriminatorDestination(input interface{}) (Destination, error) { } /** -* [Azure Event Grid](https://azure.microsoft.com/en-us/products/event-grid/) can be used to push messages to Azure Functions, HTTP endpoints (webhooks), and several other Azure tools. Event Grid can only be used with the [CloudEventsFormat](ctp:api:type:CloudEventsFormat). -* To set up a Subscription with Azure Event Grid, first create a topic in the [Azure Portal](https://azure.microsoft.com/en-us/get-started/azure-portal/). To allow Composable Commerce to push messages to your topic, provide an [access key](https://docs.microsoft.com/en-us/azure/event-grid/get-access-keys). +* [Azure Event Grid](https://azure.microsoft.com/en-us/products/event-grid/) can be used to push notifications to Azure Functions, HTTP endpoints (webhooks), and several other Azure tools. Event Grid can only be used with the [CloudEventsFormat](ctp:api:type:CloudEventsFormat). +* To set up a Subscription with Azure Event Grid, first create a topic in the [Azure Portal](https://azure.microsoft.com/en-us/get-started/azure-portal/). To allow Composable Commerce to push notifications to your topic, provide an [access key](https://docs.microsoft.com/en-us/azure/event-grid/get-access-keys). * */ type AzureEventGridDestination struct { @@ -342,7 +343,7 @@ func (obj AzureEventGridDestination) MarshalJSON() ([]byte, error) { } /** -* [Azure Service Bus](https://azure.microsoft.com/en-us/products/service-bus/) can be used as a pull-queue with [Queues](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-queues-topics-subscriptions#queues), or to fan-out messages with [Topics and Subscriptions](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-queues-topics-subscriptions). +* [Azure Service Bus](https://azure.microsoft.com/en-us/products/service-bus/) can be used as a pull-queue with [Queues](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-queues-topics-subscriptions#queues), or to fan-out notifications with [Topics and Subscriptions](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-queues-topics-subscriptions). * To set up a Subscription with Azure Service Bus, first create a queue/topic in the [Azure Portal](https://azure.microsoft.com/en-us/get-started/azure-portal/) with a Shared Access Policy including the `Send` permission. * */ @@ -362,9 +363,9 @@ func (obj AzureServiceBusDestination) MarshalJSON() ([]byte, error) { } /** -* This destination can be used to push events and messages to [Confluent Cloud](https://www.confluent.io/confluent-cloud/). +* This destination can be used to push notifications to [Confluent Cloud](https://www.confluent.io/confluent-cloud/). * To set up a Subscription of this type, first, create a topic in Confluent Cloud. -* Then, to allow Composable Commerce to push events and messages to your topic, generate [API keys](https://docs.confluent.io/cloud/current/access-management/authenticate/api-keys/api-keys.html) for your topic, and create the Subscription destination using the generated credentials. +* Then, to allow Composable Commerce to push notifications to your topic, generate [API keys](https://docs.confluent.io/cloud/current/access-management/authenticate/api-keys/api-keys.html) for your topic, and create the Subscription destination using the generated credentials. * * The Composable Commerce producer uses the following values: `SASL_SSL` for`security.protocol`, `PLAIN` for`sasl.mechanism`, and the default value (1048576) for `max.request.size`. * @@ -420,7 +421,7 @@ func (obj EventBridgeDestination) MarshalJSON() ([]byte, error) { * Destination for [Google Cloud Pub/Sub](https://cloud.google.com/pubsub/) that can be used * for [Pull subscriptions](https://cloud.google.com/pubsub/docs/pull) as well as for [Push subscriptions](https://cloud.google.com/pubsub/docs/push). * The `topic` must give the `pubsub.topics.publish` permission to the service account `subscriptions@commercetools-platform.iam.gserviceaccount.com`. -* If used with the [CloudEventsFormat](#cloudeventsformat), the message conforms to the [PubSub Protocol Binding](https://github.com/google/knative-gcp/blob/master/docs/spec/pubsub-protocol-binding.md) of the [Structured Content Mode](https://github.com/google/knative-gcp/blob/master/docs/spec/pubsub-protocol-binding.md#32-structured-content-mode). +* If used with the [CloudEventsFormat](#cloudeventsformat), the notification conforms to the [PubSub Protocol Binding](https://github.com/google/knative-gcp/blob/master/docs/spec/pubsub-protocol-binding.md) of the [Structured Content Mode](https://github.com/google/knative-gcp/blob/master/docs/spec/pubsub-protocol-binding.md#32-structured-content-mode). * */ type GoogleCloudPubSubDestination struct { @@ -460,9 +461,9 @@ func (obj IronMqDestination) MarshalJSON() ([]byte, error) { */ type MessageDeliveryPayload struct { // `key` of the [Project](ctp:api:type:Project). - // Useful in message processing if the Destination receives events from multiple Projects. + // Useful for processing notifications if the Destination receives them from multiple Projects. ProjectKey string `json:"projectKey"` - // Reference to the resource that triggered the message. + // Reference to the resource that triggered the notification. Resource Reference `json:"resource"` // User-defined unique identifiers of the resource. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` @@ -477,7 +478,7 @@ type MessageDeliveryPayload struct { // Used to ensure all messages of the resource are processed in correct order. // The `sequenceNumber` of the next message of the resource is a successor of the `sequenceNumber` of the current message. SequenceNumber int `json:"sequenceNumber"` - // Version of the resource on which the change was performed. + // Version of the resource on which the update was performed. ResourceVersion int `json:"resourceVersion"` // If the payload does not fit into the size limit or its format is not accepted by the messaging service, the `payloadNotIncluded` field is present. PayloadNotIncluded *PayloadNotIncluded `json:"payloadNotIncluded,omitempty"` @@ -608,9 +609,9 @@ func (obj PlatformFormat) MarshalJSON() ([]byte, error) { */ type ResourceCreatedDeliveryPayload struct { // `key` of the [Project](ctp:api:type:Project). - // Useful in message processing if the Destination receives events from multiple Projects. + // Useful for processing notifications if the Destination receives them from multiple Projects. ProjectKey string `json:"projectKey"` - // Reference to the resource that triggered the message. + // Reference to the resource that triggered the notification. Resource Reference `json:"resource"` // User-defined unique identifiers of the resource. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` @@ -654,9 +655,9 @@ func (obj ResourceCreatedDeliveryPayload) MarshalJSON() ([]byte, error) { */ type ResourceDeletedDeliveryPayload struct { // `key` of the [Project](ctp:api:type:Project). - // Useful in message processing if the Destination receives events from multiple Projects. + // Useful for processing notifications if the Destination receives them from multiple Projects. ProjectKey string `json:"projectKey"` - // Reference to the resource that triggered the message. + // Reference to the resource that triggered the notification. Resource Reference `json:"resource"` // User-defined unique identifiers of the resource. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` @@ -702,9 +703,9 @@ func (obj ResourceDeletedDeliveryPayload) MarshalJSON() ([]byte, error) { */ type ResourceUpdatedDeliveryPayload struct { // `key` of the [Project](ctp:api:type:Project). - // Useful in message processing if the Destination receives events from multiple Projects. + // Useful for processing notifications if the Destination receives them from multiple Projects. ProjectKey string `json:"projectKey"` - // Reference to the resource that triggered the message. + // Reference to the resource that triggered the notification. Resource Reference `json:"resource"` // User-defined unique identifiers of the resource. ResourceUserProvidedIdentifiers *UserProvidedIdentifiers `json:"resourceUserProvidedIdentifiers,omitempty"` @@ -747,7 +748,7 @@ func (obj ResourceUpdatedDeliveryPayload) MarshalJSON() ([]byte, error) { /** * [AWS SNS](https://aws.amazon.com/sns/) can be used to push messages to AWS Lambda, HTTP endpoints (webhooks), or fan-out messages to SQS queues. The SQS queue must be a [Standard](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/standard-queues.html) queue type. * -* We recommend setting `authenticationMode` to `IAM`, to avoid unnecessary key management. For IAM authentication and before creating the Subscription, give permissions to the following user account: `arn:aws-cn:iam::417094354346:user/subscriptions` if the Project is hosted in the China (AWS, Ningxia) Region; `arn:aws:iam::362576667341:user/subscriptions` for all other [Regions](/../api/general-concepts#regions). Otherwise, a test message will not be sent. +* We recommend setting `authenticationMode` to `IAM`, to avoid unnecessary key management. For IAM authentication and before creating the Subscription, give permissions to the following user account: `arn:aws-cn:iam::417094354346:user/subscriptions` if the Project is hosted in the China (AWS, Ningxia) Region; `arn:aws:iam::362576667341:user/subscriptions` for all other [Regions](/../api/general-concepts#regions). Otherwise, a test notification will not be sent. * * If you prefer to use `Credentials` for authentication, we recommend [creating an IAM user](https://docs.aws.amazon.com/sns/latest/dg/sns-setting-up.html#create-iam-user) with an `accessKey` and `accessSecret` pair specifically for each Subscription. * @@ -818,13 +819,13 @@ type Subscription struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the Subscription was last modified. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the Subscription. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Subscription. CreatedBy *CreatedBy `json:"createdBy,omitempty"` - // Change notifications subscribed to. + // Changes subscribed to. Changes []ChangeSubscription `json:"changes"` - // Messaging service to which the messages are to be sent. + // Messaging service to which the notifications are sent. Destination Destination `json:"destination"` // User-defined unique identifier of the Subscription. Key *string `json:"key,omitempty"` @@ -866,9 +867,9 @@ func (obj *Subscription) UnmarshalJSON(data []byte) error { * */ type SubscriptionDraft struct { - // Change notifications to be subscribed to. + // Changes to be subscribed to. Changes []ChangeSubscription `json:"changes"` - // Messaging service to which the messages are sent. + // Messaging service to which the notifications are sent. Destination Destination `json:"destination"` // User-defined unique identifier for the Subscription. Key *string `json:"key,omitempty"` @@ -932,7 +933,7 @@ func (obj SubscriptionDraft) MarshalJSON() ([]byte, error) { } /** -* The health status of the Subscription that indicates whether messages are being delivered to the Destination. +* The health status of the Subscription that indicates whether notifications are being delivered. * */ type SubscriptionHealthStatus string @@ -942,6 +943,7 @@ const ( SubscriptionHealthStatusConfigurationError SubscriptionHealthStatus = "ConfigurationError" SubscriptionHealthStatusConfigurationErrorDeliveryStopped SubscriptionHealthStatus = "ConfigurationErrorDeliveryStopped" SubscriptionHealthStatusTemporaryError SubscriptionHealthStatus = "TemporaryError" + SubscriptionHealthStatusManuallySuspended SubscriptionHealthStatus = "ManuallySuspended" ) /** @@ -1041,7 +1043,7 @@ func mapDiscriminatorSubscriptionUpdateAction(input interface{}) (SubscriptionUp } /** -* A test message is sent to ensure the correct configuration of the Destination. If the message cannot be delivered, the update will fail. The payload of the test message is a notification of type [ResourceCreated](ctp:api:type:ResourceCreatedDeliveryPayload) for the `resourceTypeId` `subscription`. The `status` will change to [Healthy](ctp:api:type:SubscriptionHealthStatus), if it isn't already. +* A test notification is sent to ensure the correct configuration of the Destination. If the notification cannot be delivered, the update will fail. The payload of the test notification is of type [ResourceCreated](ctp:api:type:ResourceCreatedDeliveryPayload) for the `resourceTypeId` `subscription`. The `status` will change to [Healthy](ctp:api:type:SubscriptionHealthStatus), if it isn't already. * */ type SubscriptionChangeDestinationAction struct { diff --git a/platform/types_tax_category.go b/platform/types_tax_category.go index 496e7291..83023573 100644 --- a/platform/types_tax_category.go +++ b/platform/types_tax_category.go @@ -26,9 +26,9 @@ type TaxCategory struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the TaxCategory was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the TaxCategory. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the TaxCategory. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // Name of the TaxCategory. Name string `json:"name"` @@ -235,7 +235,8 @@ type TaxRate struct { Country string `json:"country"` // State within the country, such as Texas in the United States. State *string `json:"state,omitempty"` - // Used to calculate the [taxPortions](/../api/projects/carts#taxedprice) field in a Cart or Order. It is useful if the total tax of a country (such as the US) is a combination of multiple taxes (such as state and local taxes). The total of all subrates equals the TaxRate `amount`. + // Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes). The total of all subrates must equal the TaxRate `amount`. + // These subrates are used to calculate the `taxPortions` field of a [Cart](ctp:api:type:Cart) or [Order](ctp:api:type:Order) and the `taxedPrice` field of [LineItems](ctp:api:type:LineItem), [CustomLineItems](ctp:api:type:CustomLineItem), and [ShippingInfos](ctp:api:type:ShippingInfo). SubRates []SubRate `json:"subRates"` } @@ -276,7 +277,8 @@ type TaxRateDraft struct { Country string `json:"country"` // State within the country, such as Texas in the United States. State *string `json:"state,omitempty"` - // Used to calculate the `taxPortions` field in a [Cart or Order](/../api/projects/carts#taxedprice) or [(Custom) Line Items](/../api/projects/carts#taxeditemprice). It is useful if the total tax of a country (such as the US) is a combination of multiple taxes (such as state and local taxes). The total of all subrates must equal the TaxRate `amount`. + // Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes). The total of all subrates must equal the TaxRate `amount`. + // These subrates are used to calculate the `taxPortions` field of a [Cart](ctp:api:type:Cart) or [Order](ctp:api:type:Order) and the `taxedPrice` field of [LineItems](ctp:api:type:LineItem), [CustomLineItems](ctp:api:type:CustomLineItem), and [ShippingInfos](ctp:api:type:ShippingInfo). SubRates []SubRate `json:"subRates"` // User-defined unique identifier of the TaxRate. Key *string `json:"key,omitempty"` diff --git a/platform/types_type.go b/platform/types_type.go index 488883be..4365d155 100644 --- a/platform/types_type.go +++ b/platform/types_type.go @@ -41,9 +41,11 @@ const ( CustomFieldReferenceValueAssociateRole CustomFieldReferenceValue = "associate-role" CustomFieldReferenceValueBusinessUnit CustomFieldReferenceValue = "business-unit" CustomFieldReferenceValueCart CustomFieldReferenceValue = "cart" + CustomFieldReferenceValueCartDiscount CustomFieldReferenceValue = "cart-discount" CustomFieldReferenceValueCategory CustomFieldReferenceValue = "category" CustomFieldReferenceValueChannel CustomFieldReferenceValue = "channel" CustomFieldReferenceValueCustomer CustomFieldReferenceValue = "customer" + CustomFieldReferenceValueCustomerGroup CustomFieldReferenceValue = "customer-group" CustomFieldReferenceValueKeyValueDocument CustomFieldReferenceValue = "key-value-document" CustomFieldReferenceValueOrder CustomFieldReferenceValue = "order" CustomFieldReferenceValueProduct CustomFieldReferenceValue = "product" @@ -494,9 +496,9 @@ type Type struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the Type was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the Type. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Type. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // User-defined unique identifier of the Type. Key string `json:"key"` @@ -939,7 +941,8 @@ func (obj TypeChangeKeyAction) MarshalJSON() ([]byte, error) { type TypeChangeLabelAction struct { // Name of the [Field Definition](ctp:api:type:FieldDefinition) to update. FieldName string `json:"fieldName"` - // JSON object where the keys are of type [Locale](ctp:api:type:Locale), and the values are the strings used for the corresponding language. + // New value to set. + // Must not be empty. Label LocalizedString `json:"label"` } diff --git a/platform/types_zone.go b/platform/types_zone.go index 60369f6c..f3a094a3 100644 --- a/platform/types_zone.go +++ b/platform/types_zone.go @@ -27,9 +27,9 @@ type Zone struct { CreatedAt time.Time `json:"createdAt"` // Date and time (UTC) the Zone was last updated. LastModifiedAt time.Time `json:"lastModifiedAt"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that last modified the Zone. LastModifiedBy *LastModifiedBy `json:"lastModifiedBy,omitempty"` - // Present on resources created after 1 February 2019 except for [events not tracked](/../api/general-concepts#events-tracked). + // IDs and references that created the Zone. CreatedBy *CreatedBy `json:"createdBy,omitempty"` // User-defined unique identifier of the Zone. Key *string `json:"key,omitempty"`