Skip to content

Commit

Permalink
build(codegen): updating SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
ct-sdks[bot] committed Jul 12, 2024
1 parent ae15c49 commit 958d590
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .changeset/changes_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
- added property `variants` to type `ProductTailoringData`
- added property `variants` to type `ProductTailoringDraft`
- added property `variants` to type `ProductTailoringInStoreDraft`
- added property `active` to type `ShippingMethod`
- added property `active` to type `ShippingMethodDraft`
- added property `store` to type `StagedQuote`
</details>

Expand Down Expand Up @@ -183,6 +185,7 @@
- added type `ProductTailoringSetImageLabelAction`
- added type `CustomerSearchStatus`
- added type `ProjectChangeCustomerSearchStatusAction`
- added type `ShippingMethodChangeActiveAction`
</details>

<details>
Expand Down
3 changes: 3 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
- added property `variants` to type `ProductTailoringData`
- added property `variants` to type `ProductTailoringDraft`
- added property `variants` to type `ProductTailoringInStoreDraft`
- added property `active` to type `ShippingMethod`
- added property `active` to type `ShippingMethodDraft`
- added property `store` to type `StagedQuote`
</details>

Expand Down Expand Up @@ -179,6 +181,7 @@
- added type `ProductTailoringSetImageLabelAction`
- added type `CustomerSearchStatus`
- added type `ProjectChangeCustomerSearchStatusAction`
- added type `ShippingMethodChangeActiveAction`
</details>

<details>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ export class ByProjectKeyCartsRequestBuilder {
)
}
/**
* 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:
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export class ByProjectKeyInStoreKeyByStoreKeyCartsRequestBuilder {
/**
* 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:
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class ByProjectKeyShippingMethodsMatchingCartLocationRequestBuilder {
}
) {}
/**
* 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).
Expand Down Expand Up @@ -52,7 +52,7 @@ export class ByProjectKeyShippingMethodsMatchingCartLocationRequestBuilder {
)
}
/**
* 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.
*/
public head(methodArgs: {
queryArgs: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class ByProjectKeyInStoreKeyByStoreKeyShippingMethodsMatchingCartRequestB
}
) {}
/**
* 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).
*
Expand Down Expand Up @@ -51,7 +51,7 @@ export class ByProjectKeyInStoreKeyByStoreKeyShippingMethodsMatchingCartRequestB
)
}
/**
* 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.
*/
public head(methodArgs: {
queryArgs: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class ByProjectKeyShippingMethodsMatchingCartRequestBuilder {
}
) {}
/**
* 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).
*
Expand Down Expand Up @@ -49,7 +49,7 @@ export class ByProjectKeyShippingMethodsMatchingCartRequestBuilder {
)
}
/**
* 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.
*/
public head(methodArgs: {
queryArgs: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class ByProjectKeyShippingMethodsMatchingLocationRequestBuilder {
}
) {}
/**
* 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`.
Expand Down Expand Up @@ -54,7 +54,7 @@ export class ByProjectKeyShippingMethodsMatchingLocationRequestBuilder {
)
}
/**
* 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.
*/
public head(methodArgs: {
queryArgs: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class ByProjectKeyShippingMethodsMatchingOrdereditRequestBuilder {
}
) {}
/**
* 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.
*
Expand Down Expand Up @@ -50,7 +50,7 @@ export class ByProjectKeyShippingMethodsMatchingOrdereditRequestBuilder {
)
}
/**
* 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.
*/
public head(methodArgs: {
queryArgs: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export class ByProjectKeyInStoreKeyByStoreKeyOrdersRequestBuilder {
* - [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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export class ByProjectKeyOrdersRequestBuilder {
* - [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)
*
Expand Down
30 changes: 28 additions & 2 deletions packages/platform-sdk/src/generated/models/shipping-method.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,15 @@ export interface ShippingMethod extends BaseResource {
*/
readonly zoneRates: ZoneRate[]
/**
* 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.
*
*
*/
readonly active: boolean
/**
* If `true`, this ShippingMethod is the [Project](ctp:api:type:Project)'s default ShippingMethod.
*
*/
readonly isDefault: boolean
Expand Down Expand Up @@ -165,7 +173,13 @@ export interface ShippingMethodDraft {
*/
readonly zoneRates: ZoneRateDraft[]
/**
* 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.
*
*
*/
readonly active?: boolean
/**
* If set to `true`, the ShippingMethod will be the [Project](ctp:api:type:Project)'s default ShippingMethod.
*
*/
readonly isDefault: boolean
Expand Down Expand Up @@ -276,6 +290,7 @@ export interface ShippingMethodUpdate {
export type ShippingMethodUpdateAction =
| ShippingMethodAddShippingRateAction
| ShippingMethodAddZoneAction
| ShippingMethodChangeActiveAction
| ShippingMethodChangeIsDefaultAction
| ShippingMethodChangeNameAction
| ShippingMethodChangeTaxCategoryAction
Expand Down Expand Up @@ -480,6 +495,17 @@ export interface ShippingMethodAddZoneAction {
*/
readonly zone: ZoneResourceIdentifier
}
export interface ShippingMethodChangeActiveAction {
readonly action: 'changeActive'
/**
* Value to set.
*
* If set to `false`, the ShippingMethod cannot be used during the creation or update of a Cart or Order.
*
*
*/
readonly active: boolean
}
export interface ShippingMethodChangeIsDefaultAction {
readonly action: 'changeIsDefault'
/**
Expand Down
1 change: 1 addition & 0 deletions references.txt
Original file line number Diff line number Diff line change
Expand Up @@ -285,3 +285,4 @@ c163df6435d9b4770f1d07cd2cb379c1f620ceb5
27eb558d5297d7de059ae558e28bf81cb165235b
067176dd4ee6c3116d0eae0291ba14c68c8f7b06
d74a87f613d9efd31448c3b11f505f7bf6bf57c0
369fbe55d487e70a626a9c12a2cf3cfe891b5bf0

0 comments on commit 958d590

Please sign in to comment.