Skip to content

Commit

Permalink
Merge pull request #84 from commercetools/gen-sdk-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jenschude authored Jul 4, 2022
2 parents 173da2b + afe4173 commit 0f563d3
Show file tree
Hide file tree
Showing 194 changed files with 883 additions and 327 deletions.
50 changes: 31 additions & 19 deletions lib/commercetools-api/docs/RequestBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -1216,10 +1216,10 @@ $request = $builder
```
## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->post(null)`

Creates a cart in the store specified by {storeKey}.
When using this endpoint the cart's store field is always set to the store specified in the path parameter.
Creating a cart can fail with an InvalidOperation if the referenced shipping method
in the CartDraft has a predicate which does not match the cart.
Creates a [Cart](ctp:api:type:Cart) in the Store specified by `storeKey`.
When using this endpoint the Cart's `store` field is always set to the store specified in the path parameter.
Creating a Cart can fail with an [InvalidOperationError](ctp:api:type:InvalidOperationError) if the referenced [ShippingMethod](ctp:api:type:ShippingMethod)
in the [CartDraft](ctp:api:type:CartDraft) has a predicate which does not match the Cart.


### Example
Expand Down Expand Up @@ -1256,9 +1256,9 @@ $request = $builder
```
## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withId("ID")->post(null)`

Updates a cart in the 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 error.
Updates a [Cart](ctp:api:type:Cart) in the 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 [ResourceNotFoundError](ctp:api:type:ResourceNotFoundError).


### Example
Expand Down Expand Up @@ -1335,9 +1335,9 @@ $request = $builder
```
## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withKey("key")->post(null)`

Updates a cart in the 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 error.
Updates a [Cart](ctp:api:type:Cart) in the 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:ResourceNotFound) error.


### Example
Expand Down Expand Up @@ -2217,9 +2217,9 @@ $request = $builder
```
## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->productProjections()->get()`

You can use the product projections query endpoint to get the current or staged representations of Products.
When used with an API client that has the view_published_products:{projectKey} scope,
this endpoint only returns published (current) product projections.
Use this endpoint to get the current or staged projection of [Products](ctp:api:type:Product) in the Store specified by `storeKey`.
When used with an [API Client](ctp:api:type:ApiClient) that has the `view_published_products:{projectKey}` scope,
this endpoint only returns published (current) Product Projections.


### Example
Expand All @@ -2235,7 +2235,7 @@ $request = $builder
```
## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->productProjections()->withId("ID")->get()`

Gets the current or staged representation of a product by its ID from a specific Store.
Gets the current or staged representation of a [Product](ctp:api:type:Product) by its ID from the specified Store.

### Example
```php
Expand All @@ -2251,7 +2251,7 @@ $request = $builder
```
## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->productProjections()->withKey("key")->get()`

Gets the current or staged representation of a product by its ID from a specific Store.
Gets the current or staged representation of a [Product](ctp:api:type:Product) by its key from the specified Store.

### Example
```php
Expand Down Expand Up @@ -2282,7 +2282,10 @@ $request = $builder
```
## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shippingMethods()->matchingCart()->get()`

null
Retrieves all the ShippingMethods that can ship to the shipping address of the given Cart in a given 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).


### Example
```php
Expand Down Expand Up @@ -4548,7 +4551,10 @@ $request = $builder
```
## `withProjectKey("projectKey")->shippingMethods()->matchingCart()->get()`

null
Retrieves all the 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).


### Example
```php
Expand All @@ -4563,7 +4569,11 @@ $request = $builder
```
## `withProjectKey("projectKey")->shippingMethods()->matchingLocation()->get()`

null
Retrieves all the ShippingMethods that can ship to the given [Location](/projects/zones#location).
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`.
If the `currency` parameter is given, exactly one ShippingRate will contain it.


### Example
```php
Expand All @@ -4578,7 +4588,9 @@ $request = $builder
```
## `withProjectKey("projectKey")->shippingMethods()->matchingOrderedit()->get()`

null
Retrieves all the ShippingMethods that can ship to the given [Location](/projects/zones#location) for an [OrderEdit](/projects/order-edits).
In case the OrderEdit preview cannot be created an [EditPreviewFailed](ctp:api:type:EditPreviewFailedError) error is raised.


### Example
```php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface MaxResourceLimitExceededError extends ErrorObject
public const FIELD_EXCEEDED_RESOURCE = 'exceededResource';

/**
* <p>supported resource type identifiers:</p>
* <p>Type of resource the value should reference. Supported resource type identifiers are:</p>
*
* @return null|string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function getMessage()
}

/**
* <p>supported resource type identifiers:</p>
* <p>Type of resource the value should reference. Supported resource type identifiers are:</p>
*
* @return null|string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function getMessage()
}

/**
* <p>supported resource type identifiers:</p>
* <p>Type of resource the value should reference. Supported resource type identifiers are:</p>
*
* @return null|string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface ReferenceExistsError extends ErrorObject
public const FIELD_REFERENCED_BY = 'referencedBy';

/**
* <p>supported resource type identifiers:</p>
* <p>Type of resource the value should reference. Supported resource type identifiers are:</p>
*
* @return null|string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function getMessage()
}

/**
* <p>supported resource type identifiers:</p>
* <p>Type of resource the value should reference. Supported resource type identifiers are:</p>
*
* @return null|string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function getMessage()
}

/**
* <p>supported resource type identifiers:</p>
* <p>Type of resource the value should reference. Supported resource type identifiers are:</p>
*
* @return null|string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface ReferencedResourceNotFoundError extends ErrorObject
public const FIELD_KEY = 'key';

/**
* <p>supported resource type identifiers:</p>
* <p>Type of resource the value should reference. Supported resource type identifiers are:</p>
*
* @return null|string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function getMessage()
}

/**
* <p>supported resource type identifiers:</p>
* <p>Type of resource the value should reference. Supported resource type identifiers are:</p>
*
* @return null|string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function getMessage()
}

/**
* <p>supported resource type identifiers:</p>
* <p>Type of resource the value should reference. Supported resource type identifiers are:</p>
*
* @return null|string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,66 +24,60 @@ interface AttributeDefinition extends JsonObject
public const FIELD_IS_SEARCHABLE = 'isSearchable';

/**
* <p>Describes the type of the attribute.</p>
* <p>Describes the Type of the Attribute.</p>
*
* @return null|AttributeType
*/
public function getType();

/**
* <p>The unique name of the attribute used in the API.
* The name must be between two and 256 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (<code>_</code>) and the hyphen-minus (<code>-</code>).
* When using the same <code>name</code> for an attribute in two or more product types all fields of the AttributeDefinition of this attribute need to be the same across the product types, otherwise an AttributeDefinitionAlreadyExists error code will be returned.
* An exception to this are the values of an <code>enum</code> or <code>lenum</code> type and sets thereof.</p>
* <p>User-defined name of the Attribute that is unique within the <a href="ctp:api:type:Project">Project</a>.</p>
*
* @return null|string
*/
public function getName();

/**
* <p>A human-readable label for the attribute.</p>
* <p>Human-readable label for the Attribute.</p>
*
* @return null|LocalizedString
*/
public function getLabel();

/**
* <p>Whether the attribute is required to have a value.</p>
* <p>If <code>true</code>, the Attribute must have a value on a <a href="ctp:api:type:ProductVariant">ProductVariant</a>.</p>
*
* @return null|bool
*/
public function getIsRequired();

/**
* <p>Describes how an attribute or a set of attributes should be validated across all variants of a product.</p>
* <p>Specifies how Attributes are validated across all variants of a Product.</p>
*
* @return null|string
*/
public function getAttributeConstraint();

/**
* <p>Additional information about the attribute that aids content managers when setting product details.</p>
* <p>Provides additional Attribute information to aid content managers configure Product details.</p>
*
* @return null|LocalizedString
*/
public function getInputTip();

/**
* <p>Provides a visual representation type for this attribute.
* only relevant for text-based attribute types
* like TextType and LocalizableTextType.</p>
* <p>Provides a visual representation directive for values of this Attribute (only relevant for <a href="ctp:api:type:AttributeTextType">AttributeTextType</a> and <a href="ctp:api:type:AttributeLocalizableTextType">AttributeLocalizableTextType</a>).</p>
*
* @return null|string
*/
public function getInputHint();

/**
* <p>Whether the attribute's values should generally be enabled in product search.
* This determines whether the value is stored in products for matching terms in the context of full-text search queries and can be used in facets &amp; filters as part of product search queries.
* The exact features that are enabled/disabled with this flag depend on the concrete attribute type and are described there.
* The max size of a searchable field is <strong>restricted to 10922 characters</strong>.
* This constraint is enforced at both product creation and product update.
* If the length of the input exceeds the maximum size an InvalidField error is returned.</p>
* <p>If <code>true</code>, the Attribute's values are available for the <a href="/../api/projects/products-search">Product Projections Search API</a> for use in full-text search queries, filters, and facets.</p>
* <p>Which exact features are available with this flag depends on the specific <a href="ctp:api:type:AttributeType">AttributeType</a>.
* The maximum size of a searchable field is <strong>restricted</strong> by the <a href="/../api/limits#field-content-size">Field content size limit</a>.
* This constraint is enforced at both <a href="/../api/projects/products#create-a-product">Product creation</a> and <a href="/../api/projects/products#update-product">Product update</a>.
* If the length of the input exceeds the maximum size, an <a href="ctp:api:type:InvalidFieldError">InvalidFieldError</a> is returned.</p>
*
* @return null|bool
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ final class AttributeDefinitionBuilder implements Builder
private $isSearchable;

/**
* <p>Describes the type of the attribute.</p>
* <p>Describes the Type of the Attribute.</p>
*
* @return null|AttributeType
*/
Expand All @@ -73,10 +73,7 @@ public function getType()
}

/**
* <p>The unique name of the attribute used in the API.
* The name must be between two and 256 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (<code>_</code>) and the hyphen-minus (<code>-</code>).
* When using the same <code>name</code> for an attribute in two or more product types all fields of the AttributeDefinition of this attribute need to be the same across the product types, otherwise an AttributeDefinitionAlreadyExists error code will be returned.
* An exception to this are the values of an <code>enum</code> or <code>lenum</code> type and sets thereof.</p>
* <p>User-defined name of the Attribute that is unique within the <a href="ctp:api:type:Project">Project</a>.</p>
*
* @return null|string
*/
Expand All @@ -86,7 +83,7 @@ public function getName()
}

/**
* <p>A human-readable label for the attribute.</p>
* <p>Human-readable label for the Attribute.</p>
*
* @return null|LocalizedString
*/
Expand All @@ -96,7 +93,7 @@ public function getLabel()
}

/**
* <p>Whether the attribute is required to have a value.</p>
* <p>If <code>true</code>, the Attribute must have a value on a <a href="ctp:api:type:ProductVariant">ProductVariant</a>.</p>
*
* @return null|bool
*/
Expand All @@ -106,7 +103,7 @@ public function getIsRequired()
}

/**
* <p>Describes how an attribute or a set of attributes should be validated across all variants of a product.</p>
* <p>Specifies how Attributes are validated across all variants of a Product.</p>
*
* @return null|string
*/
Expand All @@ -116,7 +113,7 @@ public function getAttributeConstraint()
}

/**
* <p>Additional information about the attribute that aids content managers when setting product details.</p>
* <p>Provides additional Attribute information to aid content managers configure Product details.</p>
*
* @return null|LocalizedString
*/
Expand All @@ -126,9 +123,7 @@ public function getInputTip()
}

/**
* <p>Provides a visual representation type for this attribute.
* only relevant for text-based attribute types
* like TextType and LocalizableTextType.</p>
* <p>Provides a visual representation directive for values of this Attribute (only relevant for <a href="ctp:api:type:AttributeTextType">AttributeTextType</a> and <a href="ctp:api:type:AttributeLocalizableTextType">AttributeLocalizableTextType</a>).</p>
*
* @return null|string
*/
Expand All @@ -138,12 +133,11 @@ public function getInputHint()
}

/**
* <p>Whether the attribute's values should generally be enabled in product search.
* This determines whether the value is stored in products for matching terms in the context of full-text search queries and can be used in facets &amp; filters as part of product search queries.
* The exact features that are enabled/disabled with this flag depend on the concrete attribute type and are described there.
* The max size of a searchable field is <strong>restricted to 10922 characters</strong>.
* This constraint is enforced at both product creation and product update.
* If the length of the input exceeds the maximum size an InvalidField error is returned.</p>
* <p>If <code>true</code>, the Attribute's values are available for the <a href="/../api/projects/products-search">Product Projections Search API</a> for use in full-text search queries, filters, and facets.</p>
* <p>Which exact features are available with this flag depends on the specific <a href="ctp:api:type:AttributeType">AttributeType</a>.
* The maximum size of a searchable field is <strong>restricted</strong> by the <a href="/../api/limits#field-content-size">Field content size limit</a>.
* This constraint is enforced at both <a href="/../api/projects/products#create-a-product">Product creation</a> and <a href="/../api/projects/products#update-product">Product update</a>.
* If the length of the input exceeds the maximum size, an <a href="ctp:api:type:InvalidFieldError">InvalidFieldError</a> is returned.</p>
*
* @return null|bool
*/
Expand Down
Loading

0 comments on commit 0f563d3

Please sign in to comment.