Skip to content

Commit

Permalink
feat: updated sdks
Browse files Browse the repository at this point in the history
  • Loading branch information
demeyerthom committed Oct 22, 2024
1 parent 3c2d9e3 commit 85190d1
Show file tree
Hide file tree
Showing 144 changed files with 1,005 additions and 224 deletions.
3 changes: 3 additions & 0 deletions .changes/unreleased/Added-20241022-104328.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Added
body: Updated sdks
time: 2024-10-22T10:43:28.018867356+02:00
6 changes: 0 additions & 6 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ tasks:
- task: generate-connect
- task: generate-importapi
# - task: generate-frontend
# - task: generate-ml
- task: generate-platform
- task: generate-history

Expand All @@ -53,11 +52,6 @@ tasks:
- task: generate-api
vars: {apiName: frontend, path: frontend-api}

generate-ml:
cmds:
- task: generate-api
vars: {apiName: ml, path: ml}

generate-platform:
cmds:
- task: generate-api
Expand Down
5 changes: 4 additions & 1 deletion connect/types_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ type ApplicationDeployment struct {
SecuredConfiguration []ConfigurationValue `json:"securedConfiguration"`
// URL generated after deployment of service applications.
Url *string `json:"url,omitempty"`
// Pub/Sub Topic generated after deployment of event applications.
// Google Cloud Pub/Sub Topic generated after deployment of event applications.
Topic *string `json:"topic,omitempty"`
// Azure Service Bus connection string generated after deployment of event applications.
ConnectionString *string `json:"connectionString,omitempty"`
// Cron schedule for job applications.
Schedule *string `json:"schedule,omitempty"`
}
Expand Down Expand Up @@ -335,6 +337,7 @@ const (
RegionEuropeWest1Gcp Region = "europe-west1.gcp"
RegionUsCentral1Gcp Region = "us-central1.gcp"
RegionAustraliaSoutheast1Gcp Region = "australia-southeast1.gcp"
RegionEastusAzure Region = "eastus.azure"
)

/**
Expand Down
6 changes: 3 additions & 3 deletions connect/types_connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type Connector struct {
Configurations []ConnectorConfigurationApplication `json:"configurations"`
// If `true`, only Composable Commerce Projects specified in `privateProjects` can access the Connector.
Private bool `json:"private"`
// If not empty, Connectors can only be deployed in these Regions. If empty, Connectors can be deployed in any [supported Region](hosts-and-authorization#hosts).
// If provided, Connectors can only be deployed in these Regions. If not provided, Connectors can be deployed in any [supported Region](hosts-and-authorization#hosts). For faster request processing, we recommend adding only the required Region.
SupportedRegions []Region `json:"supportedRegions"`
// If `true`, the Connector is certified.
Certified bool `json:"certified"`
Expand Down Expand Up @@ -73,7 +73,7 @@ type ConnectorDraft struct {
Creator Creator `json:"creator"`
// GitHub repository details of the Connector.
Repository Repository `json:"repository"`
// If provided, Connectors can only be deployed in these Regions. If not provided, Connectors can be deployed in any [supported Region](hosts-and-authorization#hosts).
// If provided, Connectors can only be deployed in these Regions. If not provided, Connectors can be deployed in any [supported Region](hosts-and-authorization#hosts). For faster request processing, we recommend adding only the required Region.
SupportedRegions []Region `json:"supportedRegions"`
// Composable Commerce Projects that can access the Connector. If empty, only the creator can access this Connector.
PrivateProjects []string `json:"privateProjects"`
Expand Down Expand Up @@ -136,7 +136,7 @@ type ConnectorStaged struct {
Private bool `json:"private"`
// If `private` is true, only these Composable Commerce Projects can access the Connector.
PrivateProjects []string `json:"privateProjects"`
// If not empty, Connectors can only be deployed in these Regions. If empty, Connectors can be deployed in any [supported Region](hosts-and-authorization#hosts).
// If provided, Connectors can only be deployed in these Regions. If not provided, Connectors can be deployed in any [supported Region](hosts-and-authorization#hosts). For faster request processing, we recommend adding only the required Region.
SupportedRegions []Region `json:"supportedRegions"`
// Comments made during the certification process.
CertificationInfo *CertificationInfo `json:"certificationInfo,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion connect/types_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ func (obj BadGatewayError) Error() string {

/**
* Returned when the request conflicts with the current state of the involved resources. Typically, the request attempts to modify a resource that is out of date (that is modified by another client since it was last retrieved).
* The client application should resolve the conflict (with or without involving the end-user) before retrying the request.
* The client application should resolve the conflict (with or without involving the end user) before retrying the request.
*
*/
type ConcurrentModificationError struct {
Expand Down
2 changes: 2 additions & 0 deletions importapi/types_discount_codes.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ type DiscountCodeImport struct {
// 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.
//
// The value cannot be updated. Attempting to update the value will result in an [InvalidFieldsUpdate](/error#invalidfieldsupdateerror) error.
Code string `json:"code"`
// Reference to CartDiscounts that can be applied to the Cart once the DiscountCode is applied.
CartDiscounts []CartDiscountKeyReference `json:"cartDiscounts"`
Expand Down
65 changes: 65 additions & 0 deletions importapi/types_errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ func mapDiscriminatorErrorObject(input interface{}) (ErrorObject, error) {
return nil, err
}
return obj, nil
case "InvalidFieldUpdate":
obj := InvalidFieldsUpdateError{}
if err := decodeStruct(input, &obj); err != nil {
return nil, err
}
return obj, nil
case "InvalidJsonInput":
obj := InvalidJsonInput{}
if err := decodeStruct(input, &obj); err != nil {
Expand Down Expand Up @@ -236,6 +242,12 @@ func mapDiscriminatorErrorObject(input interface{}) (ErrorObject, error) {
return nil, err
}
return obj, nil
case "ReferencedResourceNotFound":
obj := ReferencedResourceNotFound{}
if err := decodeStruct(input, &obj); err != nil {
return nil, err
}
return obj, nil
}
return nil, nil
}
Expand Down Expand Up @@ -586,6 +598,34 @@ func (obj InvalidFieldError) Error() string {
return "unknown InvalidFieldError: failed to parse error response"
}

/**
* Returned when a field cannot be updated.
*
*/
type InvalidFieldsUpdateError struct {
// `"The following fields are currently not supported for changes/updates"`
Message string `json:"message"`
// Fields that cannot be updated.
Fields []string `json:"fields"`
}

// MarshalJSON override to set the discriminator value or remove
// optional nil slices
func (obj InvalidFieldsUpdateError) MarshalJSON() ([]byte, error) {
type Alias InvalidFieldsUpdateError
return json.Marshal(struct {
Action string `json:"code"`
*Alias
}{Action: "InvalidFieldUpdate", Alias: (*Alias)(&obj)})
}

func (obj InvalidFieldsUpdateError) Error() string {
if obj.Message != "" {
return obj.Message
}
return "unknown InvalidFieldsUpdateError: failed to parse error response"
}

/**
* An invalid JSON input has been sent to the service.
* Either the JSON is syntactically incorrect or the JSON has an unexpected shape, for example, a required field is missing.
Expand Down Expand Up @@ -838,3 +878,28 @@ func (obj GenericError) Error() string {
}
return "unknown GenericError: failed to parse error response"
}

/**
* Returned when a resource referenced by a [Reference](/../api/types#reference) or a [ResourceIdentifier](/../api/types#resourceidentifier) could not be found.
*
*/
type ReferencedResourceNotFound struct {
// `"The referenced object of type $typeId $predicate was not found. It either doesn't exist, or it can't be accessed from this endpoint (e.g., if the endpoint filters by store or customer account)."`
Message string `json:"message"`
// Type of referenced resource.
TypeId ReferenceType `json:"typeId"`
// Unique identifier of the referenced resource, if known.
ID *string `json:"id,omitempty"`
// User-defined unique identifier of the referenced resource, if known.
Key *string `json:"key,omitempty"`
}

// MarshalJSON override to set the discriminator value or remove
// optional nil slices
func (obj ReferencedResourceNotFound) MarshalJSON() ([]byte, error) {
type Alias ReferencedResourceNotFound
return json.Marshal(struct {
Action string `json:"code"`
*Alias
}{Action: "ReferencedResourceNotFound", Alias: (*Alias)(&obj)})
}
8 changes: 7 additions & 1 deletion importapi/types_standalone_prices.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,16 @@ type StandalonePriceImport struct {
// Sets the money value of this Price.
Value TypedMoney `json:"value"`
// Sets the country for which this Price is valid.
//
// The value cannot be updated. Attempting to update the value will result in an [InvalidFieldsUpdate](/error#invalidfieldsupdateerror) error.
Country *string `json:"country,omitempty"`
// Sets the CustomerGroup for which this Price is valid.
//
// The value cannot be updated. Attempting to update the value will result in an [InvalidFieldsUpdate](/error#invalidfieldsupdateerror) error.
CustomerGroup *CustomerGroupKeyReference `json:"customerGroup,omitempty"`
// Sets the product distribution Channel for which this Price is valid
// Sets the product distribution Channel for which this Price is valid.
//
// The value cannot be updated. Attempting to update the value will result in an [InvalidFieldsUpdate](/error#invalidfieldsupdateerror) error.
Channel *ChannelKeyReference `json:"channel,omitempty"`
// Sets the date from which the Price is valid.
ValidFrom *time.Time `json:"validFrom,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type ByProjectKeyInStoreKeyByStoreKeyMeActiveCartRequestBuilder struct {
*
* - 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.
* - If an active Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#composable-commerce-oauth) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#composable-commerce-oauth) scope.
*
*/
func (rb *ByProjectKeyInStoreKeyByStoreKeyMeActiveCartRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyMeActiveCartRequestMethodGet {
Expand All @@ -38,7 +38,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeActiveCartRequestBuilder) Get() *ByP
*
* - 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.
* - If an active Cart exists but does not contain a `customerId` that matches the [customer:{id}](/scopes#composable-commerce-oauth) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#composable-commerce-oauth) scope.
*
*/
func (rb *ByProjectKeyInStoreKeyByStoreKeyMeActiveCartRequestBuilder) Head() *ByProjectKeyInStoreKeyByStoreKeyMeActiveCartRequestMethodHead {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeActiveCartRequestMethodGet) WithHead
*
* - 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.
* - If an active Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#composable-commerce-oauth) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#composable-commerce-oauth) scope.
*
*/
func (rb *ByProjectKeyInStoreKeyByStoreKeyMeActiveCartRequestMethodGet) Execute(ctx context.Context) (result *Cart, err error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeActiveCartRequestMethodHead) WithHea
*
* - 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.
* - If an active Cart exists but does not contain a `customerId` that matches the [customer:{id}](/scopes#composable-commerce-oauth) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#composable-commerce-oauth) scope.
*
*/
func (rb *ByProjectKeyInStoreKeyByStoreKeyMeActiveCartRequestMethodHead) Execute(ctx context.Context) error {
Expand Down
4 changes: 2 additions & 2 deletions platform/client_active_cart_by_project_key_me_active_cart.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type ByProjectKeyMeActiveCartRequestBuilder struct {
* 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.
* - If an active Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#composable-commerce-oauth) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#composable-commerce-oauth) scope.
*
*/
func (rb *ByProjectKeyMeActiveCartRequestBuilder) Get() *ByProjectKeyMeActiveCartRequestMethodGet {
Expand All @@ -35,7 +35,7 @@ func (rb *ByProjectKeyMeActiveCartRequestBuilder) Get() *ByProjectKeyMeActiveCar
* 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.
* - If an active Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#composable-commerce-oauth) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#composable-commerce-oauth) scope.
*
*/
func (rb *ByProjectKeyMeActiveCartRequestBuilder) Head() *ByProjectKeyMeActiveCartRequestMethodHead {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (rb *ByProjectKeyMeActiveCartRequestMethodGet) WithHeaders(headers http.Hea
* 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.
* - If an active Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#composable-commerce-oauth) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#composable-commerce-oauth) scope.
*
*/
func (rb *ByProjectKeyMeActiveCartRequestMethodGet) Execute(ctx context.Context) (result *Cart, err error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (rb *ByProjectKeyMeActiveCartRequestMethodHead) WithHeaders(headers http.He
* 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.
* - If an active Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#composable-commerce-oauth) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#composable-commerce-oauth) scope.
*
*/
func (rb *ByProjectKeyMeActiveCartRequestMethodHead) Execute(ctx context.Context) error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ 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.
* 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#composable-commerce-oauth) or [anonymous_id:{id}](/scopes#composable-commerce-oauth) scope.
*
* The `store` field in the created [Cart](ctp:api:type:Cart) is set to the Store specified by the `storeKey` path parameter.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestBuilder struct {
*
* - 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.
* - If the Cart exists but does not have either a `customerId` that matches the [customer:{id}](/scopes#composable-commerce-oauth) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#composable-commerce-oauth) scope.
*
*/
func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestMethodGet {
Expand All @@ -44,7 +44,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestBuilder) Head() *ByP
*
* - 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.
* - If the Cart exists but does not have either a `customerId` that matches the [customer:{id}](/scopes#composable-commerce-oauth) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#composable-commerce-oauth) scope.
*
*/
func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestBuilder) Post(body MyCartUpdate) *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestMethodPost {
Expand All @@ -62,7 +62,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestBuilder) Post(body M
*
* - 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.
* - If the Cart exists in the Project but does not have either a `customerId` that matches the [customer:{id}](/scopes#composable-commerce-oauth) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#composable-commerce-oauth) scope.
*
*/
func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestBuilder) Delete() *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestMethodDelete {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestMethodDelete) WithHe
*
* - 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.
* - If the Cart exists in the Project but does not have either a `customerId` that matches the [customer:{id}](/scopes#composable-commerce-oauth) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#composable-commerce-oauth) scope.
*
*/
func (rb *ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestMethodDelete) Execute(ctx context.Context) (result *Cart, err error) {
Expand Down
Loading

0 comments on commit 85190d1

Please sign in to comment.