diff --git a/changes.md b/changes.md index 38abf6ec2f1..b53b51dc64e 100644 --- a/changes.md +++ b/changes.md @@ -7,6 +7,10 @@ - added type `BestDeal` - added type `DiscountTypeCombination` - added type `Stacking` +- added type `OrderBusinessUnitSetMessage` +- added type `OrderBusinessUnitSetMessagePayload` +- added type `StagedOrderSetBusinessUnitAction` +- added type `OrderSetBusinessUnitAction` diff --git a/commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls b/commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls index 81aad3e3a72..938115b261c 100644 --- a/commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls +++ b/commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls @@ -6886,6 +6886,12 @@ type OrderBillingAddressSet implements MessagePayload & OrderMessagePayload { type: String! } +type OrderBusinessUnitSet implements MessagePayload & OrderMessagePayload { + businessUnit: KeyReferenceInput + oldBusinessUnit: KeyReferenceInput + type: String! +} + input OrderCartCommand { id: String cart: ResourceIdentifierInput @@ -7302,6 +7308,7 @@ input OrderUpdateAction { setLineItemCustomType: SetOrderLineItemCustomType setLineItemShippingDetails: SetOrderLineItemShippingDetails setLocale: SetOrderLocale + setBusinessUnit: SetOrderBusinessUnit setOrderNumber: SetOrderNumber setParcelCustomField: SetOrderParcelCustomField setParcelCustomType: SetOrderParcelCustomType @@ -11465,6 +11472,10 @@ input SetOrderBillingAddressCustomType { typeId: String } +input SetOrderBusinessUnit { + businessUnit: ResourceIdentifierInput +} + input SetOrderCustomField { name: String! value: String @@ -12372,6 +12383,15 @@ type SetStagedOrderBillingAddressOutput implements StagedOrderUpdateActionOutput address: AddressDraft } +input SetStagedOrderBusinessUnit { + businessUnit: ResourceIdentifierInput +} + +type SetStagedOrderBusinessUnitOutput implements StagedOrderUpdateActionOutput { + type: String! + businessUnitResId: ResourceIdentifier +} + input SetStagedOrderCountry { country: Country } @@ -13745,6 +13765,7 @@ input StagedOrderUpdateAction { setLineItemTaxRate: SetStagedOrderLineItemTaxRate setLineItemTotalPrice: SetStagedOrderLineItemTotalPrice setLocale: SetStagedOrderLocale + setBusinessUnit: SetStagedOrderBusinessUnit setOrderNumber: SetStagedOrderOrderNumber setOrderTotalTax: SetStagedOrderOrderTotalTax setParcelCustomField: SetStagedOrderParcelCustomField diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyCartsByIDDelete.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyCartsByIDDelete.java index b5ae9194f7f..b2ba851e19b 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyCartsByIDDelete.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyCartsByIDDelete.java @@ -20,7 +20,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder; /** - * + *
Deletes a Cart in the Project.
* *To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the Recalculate update action.
+ *Retrieves a Cart with the provided id
. To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the Recalculate update action.
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 the provided id
. Returns a 200 OK
status if the Cart exists or a 404 Not Found
otherwise.
Updates a Cart in the Project using one or more update actions.
* *Updates a Cart in the Project using one or more update actions.
* *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 exists for a Customer. Returns a 200 OK
status if the Cart exists or a 404 Not Found
otherwise.
Retrieves all Carts in the Project.
* *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 one or more Carts exist for the provided query predicate. Returns a 200 OK
status if any Carts match the query predicate, or a 404 Not Found
otherwise.
Deletes a Cart in the Project.
* *To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the Recalculate update action.
+ *Retrieves a Cart with the provided key
. To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the Recalculate update action.
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 the provided key
. Returns a 200 OK
status if the Cart exists or a 404 Not Found
otherwise.
Updates a Cart in the Project using one or more update actions.
* *Updates a Cart in the Project using one or more update actions.
* *Creates a Cart in the Project.
*If the referenced ShippingMethod in the CartDraft has a predicate that does not match, or if the Shipping Method is not active, an InvalidOperation error is returned.
*Specific Error Codes:
*Creates a Cart in the Project.
*If the referenced ShippingMethod in the CartDraft has a predicate that does not match, or if the Shipping Method is not active, an InvalidOperation error is returned.
*Specific Error Codes:
*Deletes a Cart in a Store.
*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 error.
Retrieves a Cart with the provided id
in a Store.
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 error.
To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the Recalculate update action.
* diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyCartsByIDHead.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyCartsByIDHead.java index 99dae6457db..7f3d6aaabfc 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyCartsByIDHead.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyCartsByIDHead.java @@ -16,7 +16,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder; /** - *Checks if a Cart exists for a given id
. Returns a 200 OK
status if the Cart exists or a ResourceNotFound error otherwise.
Checks if a Cart exists for the provided id
in a Store. Returns a 200 OK
status if the Cart exists or a ResourceNotFound error otherwise.
Updates a Cart in the Store specified by storeKey
. 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 error.
Updates a Cart in a Store using one or more update actions.
+ *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 error.
Updates a Cart in the Store specified by storeKey
. 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 error.
Updates a Cart in a Store using one or more update actions.
+ *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 error.
Checks if a Cart of a Customer exists. Returns a 200 OK
status if the Cart exists or a ResourceNotFound error otherwise.
Checks if one or more Carts exist for a Customer in a Store. Returns a 200 OK
status if the Cart exists or a ResourceNotFound error otherwise.
Queries Carts in a specific Store.
+ *Retrieves all Carts in a Store.
* *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 error otherwise.
Checks if one or more Carts exist for the provided query predicate in a Store. Returns a 200 OK
status if any Carts match the query predicate or a ResourceNotFound error otherwise.
Deletes a Cart in a Store.
*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 error.
Retrieves a Cart with the provided key
in a Store.
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 error.
To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the Recalculate update action.
* diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyHead.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyHead.java index dbc0de8788f..57cff3cccb8 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyHead.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyHead.java @@ -16,7 +16,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder; /** - *Checks if a Cart exists for a given key
. Returns a 200 OK
status if the Cart exists or a ResourceNotFound error otherwise.
Checks if a Cart exists for the provided key
in a Store. Returns a 200 OK
status if the Cart exists or a ResourceNotFound error otherwise.
Updates a Cart in a Store using one or more update actions.
*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 error.
Updates a Cart in a Store using one or more update actions.
*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 error.
Creates a Cart in the Store specified by storeKey
.
Creates a Cart in a Store.
*If the referenced ShippingMethod in the CartDraft has a predicate that does not match, or if the Shipping Method is not active, an InvalidOperation error is returned.
*Specific Error Codes:
*Creates a Cart in the Store specified by storeKey
.
Creates a Cart in a Store.
*If the referenced ShippingMethod in the CartDraft has a predicate that does not match, or if the Shipping Method is not active, an InvalidOperation error is returned.
*Specific Error Codes:
*Generated after a successful Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * + *
+ * OrderBusinessUnitSetMessage orderBusinessUnitSetMessage = OrderBusinessUnitSetMessage.builder()
+ * .id("{id}")
+ * .version(0.3)
+ * .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
+ * .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
+ * .sequenceNumber(0.3)
+ * .resource(resourceBuilder -> resourceBuilder)
+ * .resourceVersion(0.3)
+ * .build()
+ *
+ * BusinessUnit on the Order after the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @return businessUnit + */ + @Valid + @JsonProperty("businessUnit") + public BusinessUnitKeyReference getBusinessUnit(); + + /** + *BusinessUnit on the Order before the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @return oldbusinessUnit + */ + @Valid + @JsonProperty("oldbusinessUnit") + public BusinessUnitKeyReference getOldbusinessUnit(); + + /** + *BusinessUnit on the Order after the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @param businessUnit value to be set + */ + + public void setBusinessUnit(final BusinessUnitKeyReference businessUnit); + + /** + *BusinessUnit on the Order before the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @param oldbusinessUnit value to be set + */ + + public void setOldbusinessUnit(final BusinessUnitKeyReference oldbusinessUnit); + + /** + * factory method + * @return instance of OrderBusinessUnitSetMessage + */ + public static OrderBusinessUnitSetMessage of() { + return new OrderBusinessUnitSetMessageImpl(); + } + + /** + * factory method to create a shallow copy OrderBusinessUnitSetMessage + * @param template instance to be copied + * @return copy instance + */ + public static OrderBusinessUnitSetMessage of(final OrderBusinessUnitSetMessage template) { + OrderBusinessUnitSetMessageImpl instance = new OrderBusinessUnitSetMessageImpl(); + instance.setId(template.getId()); + instance.setVersion(template.getVersion()); + instance.setCreatedAt(template.getCreatedAt()); + instance.setLastModifiedAt(template.getLastModifiedAt()); + instance.setLastModifiedBy(template.getLastModifiedBy()); + instance.setCreatedBy(template.getCreatedBy()); + instance.setSequenceNumber(template.getSequenceNumber()); + instance.setResource(template.getResource()); + instance.setResourceVersion(template.getResourceVersion()); + instance.setResourceUserProvidedIdentifiers(template.getResourceUserProvidedIdentifiers()); + instance.setBusinessUnit(template.getBusinessUnit()); + instance.setOldbusinessUnit(template.getOldbusinessUnit()); + return instance; + } + + /** + * factory method to create a deep copy of OrderBusinessUnitSetMessage + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static OrderBusinessUnitSetMessage deepCopy(@Nullable final OrderBusinessUnitSetMessage template) { + if (template == null) { + return null; + } + OrderBusinessUnitSetMessageImpl instance = new OrderBusinessUnitSetMessageImpl(); + instance.setId(template.getId()); + instance.setVersion(template.getVersion()); + instance.setCreatedAt(template.getCreatedAt()); + instance.setLastModifiedAt(template.getLastModifiedAt()); + instance.setLastModifiedBy( + com.commercetools.api.models.common.LastModifiedBy.deepCopy(template.getLastModifiedBy())); + instance.setCreatedBy(com.commercetools.api.models.common.CreatedBy.deepCopy(template.getCreatedBy())); + instance.setSequenceNumber(template.getSequenceNumber()); + instance.setResource(com.commercetools.api.models.common.Reference.deepCopy(template.getResource())); + instance.setResourceVersion(template.getResourceVersion()); + instance.setResourceUserProvidedIdentifiers(com.commercetools.api.models.message.UserProvidedIdentifiers + .deepCopy(template.getResourceUserProvidedIdentifiers())); + instance.setBusinessUnit( + com.commercetools.api.models.business_unit.BusinessUnitKeyReference.deepCopy(template.getBusinessUnit())); + instance.setOldbusinessUnit(com.commercetools.api.models.business_unit.BusinessUnitKeyReference + .deepCopy(template.getOldbusinessUnit())); + return instance; + } + + /** + * builder factory method for OrderBusinessUnitSetMessage + * @return builder + */ + public static OrderBusinessUnitSetMessageBuilder builder() { + return OrderBusinessUnitSetMessageBuilder.of(); + } + + /** + * create builder for OrderBusinessUnitSetMessage instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static OrderBusinessUnitSetMessageBuilder builder(final OrderBusinessUnitSetMessage template) { + return OrderBusinessUnitSetMessageBuilder.of(template); + } + + /** + * accessor map function + * @param
+ * OrderBusinessUnitSetMessage orderBusinessUnitSetMessage = OrderBusinessUnitSetMessage.builder()
+ * .id("{id}")
+ * .version(0.3)
+ * .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
+ * .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
+ * .sequenceNumber(0.3)
+ * .resource(resourceBuilder -> resourceBuilder)
+ * .resourceVersion(0.3)
+ * .build()
+ *
+ * Unique identifier of the Message. Can be used to track which Messages have been processed.
+ * @param id value to be set + * @return Builder + */ + + public OrderBusinessUnitSetMessageBuilder id(final String id) { + this.id = id; + return this; + } + + /** + *Version of a resource. In case of Messages, this is always 1
.
Date and time (UTC) the Message was generated.
+ * @param createdAt value to be set + * @return Builder + */ + + public OrderBusinessUnitSetMessageBuilder createdAt(final java.time.ZonedDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + *Value of createdAt
.
IDs and references that last modified the Message.
+ * @param builder function to build the lastModifiedBy value + * @return Builder + */ + + public OrderBusinessUnitSetMessageBuilder lastModifiedBy( + FunctionIDs and references that last modified the Message.
+ * @param builder function to build the lastModifiedBy value + * @return Builder + */ + + public OrderBusinessUnitSetMessageBuilder withLastModifiedBy( + FunctionIDs and references that last modified the Message.
+ * @param lastModifiedBy value to be set + * @return Builder + */ + + public OrderBusinessUnitSetMessageBuilder lastModifiedBy( + @Nullable final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + return this; + } + + /** + *IDs and references that created the Message.
+ * @param builder function to build the createdBy value + * @return Builder + */ + + public OrderBusinessUnitSetMessageBuilder createdBy( + FunctionIDs and references that created the Message.
+ * @param builder function to build the createdBy value + * @return Builder + */ + + public OrderBusinessUnitSetMessageBuilder withCreatedBy( + FunctionIDs and references that created the Message.
+ * @param createdBy value to be set + * @return Builder + */ + + public OrderBusinessUnitSetMessageBuilder createdBy( + @Nullable final com.commercetools.api.models.common.CreatedBy createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + *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.
Reference to the resource on which the change or action was performed.
+ * @param resource value to be set + * @return Builder + */ + + public OrderBusinessUnitSetMessageBuilder resource(final com.commercetools.api.models.common.Reference resource) { + this.resource = resource; + return this; + } + + /** + *Reference to the resource on which the change or action was performed.
+ * @param builder function to build the resource value + * @return Builder + */ + + public OrderBusinessUnitSetMessageBuilder resource( + FunctionVersion of the resource on which the change or action was performed.
+ * @param resourceVersion value to be set + * @return Builder + */ + + public OrderBusinessUnitSetMessageBuilder resourceVersion(final Long resourceVersion) { + this.resourceVersion = resourceVersion; + return this; + } + + /** + *User-provided identifiers of the resource, such as key
or externalId
. Only present if the resource has such identifiers.
User-provided identifiers of the resource, such as key
or externalId
. Only present if the resource has such identifiers.
User-provided identifiers of the resource, such as key
or externalId
. Only present if the resource has such identifiers.
BusinessUnit on the Order after the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @param builder function to build the businessUnit value + * @return Builder + */ + + public OrderBusinessUnitSetMessageBuilder businessUnit( + FunctionBusinessUnit on the Order after the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @param builder function to build the businessUnit value + * @return Builder + */ + + public OrderBusinessUnitSetMessageBuilder withBusinessUnit( + FunctionBusinessUnit on the Order after the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @param businessUnit value to be set + * @return Builder + */ + + public OrderBusinessUnitSetMessageBuilder businessUnit( + @Nullable final com.commercetools.api.models.business_unit.BusinessUnitKeyReference businessUnit) { + this.businessUnit = businessUnit; + return this; + } + + /** + *BusinessUnit on the Order before the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @param builder function to build the oldbusinessUnit value + * @return Builder + */ + + public OrderBusinessUnitSetMessageBuilder oldbusinessUnit( + FunctionBusinessUnit on the Order before the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @param builder function to build the oldbusinessUnit value + * @return Builder + */ + + public OrderBusinessUnitSetMessageBuilder withOldbusinessUnit( + FunctionBusinessUnit on the Order before the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @param oldbusinessUnit value to be set + * @return Builder + */ + + public OrderBusinessUnitSetMessageBuilder oldbusinessUnit( + @Nullable final com.commercetools.api.models.business_unit.BusinessUnitKeyReference oldbusinessUnit) { + this.oldbusinessUnit = oldbusinessUnit; + return this; + } + + /** + *Unique identifier of the Message. Can be used to track which Messages have been processed.
+ * @return id + */ + + public String getId() { + return this.id; + } + + /** + *Version of a resource. In case of Messages, this is always 1
.
Date and time (UTC) the Message was generated.
+ * @return createdAt + */ + + public java.time.ZonedDateTime getCreatedAt() { + return this.createdAt; + } + + /** + *Value of createdAt
.
IDs and references that last modified the Message.
+ * @return lastModifiedBy + */ + + @Nullable + public com.commercetools.api.models.common.LastModifiedBy getLastModifiedBy() { + return this.lastModifiedBy; + } + + /** + *IDs and references that created the Message.
+ * @return createdBy + */ + + @Nullable + public com.commercetools.api.models.common.CreatedBy getCreatedBy() { + return this.createdBy; + } + + /** + *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.
Reference to the resource on which the change or action was performed.
+ * @return resource + */ + + public com.commercetools.api.models.common.Reference getResource() { + return this.resource; + } + + /** + *Version of the resource on which the change or action was performed.
+ * @return resourceVersion + */ + + public Long getResourceVersion() { + return this.resourceVersion; + } + + /** + *User-provided identifiers of the resource, such as key
or externalId
. Only present if the resource has such identifiers.
BusinessUnit on the Order after the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @return businessUnit + */ + + @Nullable + public com.commercetools.api.models.business_unit.BusinessUnitKeyReference getBusinessUnit() { + return this.businessUnit; + } + + /** + *BusinessUnit on the Order before the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @return oldbusinessUnit + */ + + @Nullable + public com.commercetools.api.models.business_unit.BusinessUnitKeyReference getOldbusinessUnit() { + return this.oldbusinessUnit; + } + + /** + * builds OrderBusinessUnitSetMessage with checking for non-null required values + * @return OrderBusinessUnitSetMessage + */ + public OrderBusinessUnitSetMessage build() { + Objects.requireNonNull(id, OrderBusinessUnitSetMessage.class + ": id is missing"); + Objects.requireNonNull(version, OrderBusinessUnitSetMessage.class + ": version is missing"); + Objects.requireNonNull(createdAt, OrderBusinessUnitSetMessage.class + ": createdAt is missing"); + Objects.requireNonNull(lastModifiedAt, OrderBusinessUnitSetMessage.class + ": lastModifiedAt is missing"); + Objects.requireNonNull(sequenceNumber, OrderBusinessUnitSetMessage.class + ": sequenceNumber is missing"); + Objects.requireNonNull(resource, OrderBusinessUnitSetMessage.class + ": resource is missing"); + Objects.requireNonNull(resourceVersion, OrderBusinessUnitSetMessage.class + ": resourceVersion is missing"); + return new OrderBusinessUnitSetMessageImpl(id, version, createdAt, lastModifiedAt, lastModifiedBy, createdBy, + sequenceNumber, resource, resourceVersion, resourceUserProvidedIdentifiers, businessUnit, oldbusinessUnit); + } + + /** + * builds OrderBusinessUnitSetMessage without checking for non-null required values + * @return OrderBusinessUnitSetMessage + */ + public OrderBusinessUnitSetMessage buildUnchecked() { + return new OrderBusinessUnitSetMessageImpl(id, version, createdAt, lastModifiedAt, lastModifiedBy, createdBy, + sequenceNumber, resource, resourceVersion, resourceUserProvidedIdentifiers, businessUnit, oldbusinessUnit); + } + + /** + * factory method for an instance of OrderBusinessUnitSetMessageBuilder + * @return builder + */ + public static OrderBusinessUnitSetMessageBuilder of() { + return new OrderBusinessUnitSetMessageBuilder(); + } + + /** + * create builder for OrderBusinessUnitSetMessage instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static OrderBusinessUnitSetMessageBuilder of(final OrderBusinessUnitSetMessage template) { + OrderBusinessUnitSetMessageBuilder builder = new OrderBusinessUnitSetMessageBuilder(); + builder.id = template.getId(); + builder.version = template.getVersion(); + builder.createdAt = template.getCreatedAt(); + builder.lastModifiedAt = template.getLastModifiedAt(); + builder.lastModifiedBy = template.getLastModifiedBy(); + builder.createdBy = template.getCreatedBy(); + builder.sequenceNumber = template.getSequenceNumber(); + builder.resource = template.getResource(); + builder.resourceVersion = template.getResourceVersion(); + builder.resourceUserProvidedIdentifiers = template.getResourceUserProvidedIdentifiers(); + builder.businessUnit = template.getBusinessUnit(); + builder.oldbusinessUnit = template.getOldbusinessUnit(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/OrderBusinessUnitSetMessageImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/OrderBusinessUnitSetMessageImpl.java new file mode 100644 index 00000000000..1aba171a52c --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/OrderBusinessUnitSetMessageImpl.java @@ -0,0 +1,318 @@ + +package com.commercetools.api.models.message; + +import java.time.*; +import java.util.*; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.ModelBase; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + *Generated after a successful Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class OrderBusinessUnitSetMessageImpl implements OrderBusinessUnitSetMessage, ModelBase { + + private String id; + + private Long version; + + private java.time.ZonedDateTime createdAt; + + private java.time.ZonedDateTime lastModifiedAt; + + private com.commercetools.api.models.common.LastModifiedBy lastModifiedBy; + + private com.commercetools.api.models.common.CreatedBy createdBy; + + private Long sequenceNumber; + + private com.commercetools.api.models.common.Reference resource; + + private Long resourceVersion; + + private String type; + + private com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers; + + private com.commercetools.api.models.business_unit.BusinessUnitKeyReference businessUnit; + + private com.commercetools.api.models.business_unit.BusinessUnitKeyReference oldbusinessUnit; + + /** + * create instance with all properties + */ + @JsonCreator + OrderBusinessUnitSetMessageImpl(@JsonProperty("id") final String id, @JsonProperty("version") final Long version, + @JsonProperty("createdAt") final java.time.ZonedDateTime createdAt, + @JsonProperty("lastModifiedAt") final java.time.ZonedDateTime lastModifiedAt, + @JsonProperty("lastModifiedBy") final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy, + @JsonProperty("createdBy") final com.commercetools.api.models.common.CreatedBy createdBy, + @JsonProperty("sequenceNumber") final Long sequenceNumber, + @JsonProperty("resource") final com.commercetools.api.models.common.Reference resource, + @JsonProperty("resourceVersion") final Long resourceVersion, + @JsonProperty("resourceUserProvidedIdentifiers") final com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers, + @JsonProperty("businessUnit") final com.commercetools.api.models.business_unit.BusinessUnitKeyReference businessUnit, + @JsonProperty("oldbusinessUnit") final com.commercetools.api.models.business_unit.BusinessUnitKeyReference oldbusinessUnit) { + this.id = id; + this.version = version; + this.createdAt = createdAt; + this.lastModifiedAt = lastModifiedAt; + this.lastModifiedBy = lastModifiedBy; + this.createdBy = createdBy; + this.sequenceNumber = sequenceNumber; + this.resource = resource; + this.resourceVersion = resourceVersion; + this.resourceUserProvidedIdentifiers = resourceUserProvidedIdentifiers; + this.businessUnit = businessUnit; + this.oldbusinessUnit = oldbusinessUnit; + this.type = ORDER_BUSINESS_UNIT_SET; + } + + /** + * create empty instance + */ + public OrderBusinessUnitSetMessageImpl() { + this.type = ORDER_BUSINESS_UNIT_SET; + } + + /** + *Unique identifier of the Message. Can be used to track which Messages have been processed.
+ */ + + public String getId() { + return this.id; + } + + /** + *Version of a resource. In case of Messages, this is always 1
.
Date and time (UTC) the Message was generated.
+ */ + + public java.time.ZonedDateTime getCreatedAt() { + return this.createdAt; + } + + /** + *Value of createdAt
.
IDs and references that last modified the Message.
+ */ + + public com.commercetools.api.models.common.LastModifiedBy getLastModifiedBy() { + return this.lastModifiedBy; + } + + /** + *IDs and references that created the Message.
+ */ + + public com.commercetools.api.models.common.CreatedBy getCreatedBy() { + return this.createdBy; + } + + /** + *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.
Reference to the resource on which the change or action was performed.
+ */ + + public com.commercetools.api.models.common.Reference getResource() { + return this.resource; + } + + /** + *Version of the resource on which the change or action was performed.
+ */ + + public Long getResourceVersion() { + return this.resourceVersion; + } + + /** + *Message Type of the Message.
+ */ + + public String getType() { + return this.type; + } + + /** + *User-provided identifiers of the resource, such as key
or externalId
. Only present if the resource has such identifiers.
BusinessUnit on the Order after the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ */ + + public com.commercetools.api.models.business_unit.BusinessUnitKeyReference getBusinessUnit() { + return this.businessUnit; + } + + /** + *BusinessUnit on the Order before the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ */ + + public com.commercetools.api.models.business_unit.BusinessUnitKeyReference getOldbusinessUnit() { + return this.oldbusinessUnit; + } + + public void setId(final String id) { + this.id = id; + } + + public void setVersion(final Long version) { + this.version = version; + } + + public void setCreatedAt(final java.time.ZonedDateTime createdAt) { + this.createdAt = createdAt; + } + + public void setLastModifiedAt(final java.time.ZonedDateTime lastModifiedAt) { + this.lastModifiedAt = lastModifiedAt; + } + + public void setLastModifiedBy(final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + } + + public void setCreatedBy(final com.commercetools.api.models.common.CreatedBy createdBy) { + this.createdBy = createdBy; + } + + public void setSequenceNumber(final Long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + public void setResource(final com.commercetools.api.models.common.Reference resource) { + this.resource = resource; + } + + public void setResourceVersion(final Long resourceVersion) { + this.resourceVersion = resourceVersion; + } + + public void setResourceUserProvidedIdentifiers( + final com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers) { + this.resourceUserProvidedIdentifiers = resourceUserProvidedIdentifiers; + } + + public void setBusinessUnit( + final com.commercetools.api.models.business_unit.BusinessUnitKeyReference businessUnit) { + this.businessUnit = businessUnit; + } + + public void setOldbusinessUnit( + final com.commercetools.api.models.business_unit.BusinessUnitKeyReference oldbusinessUnit) { + this.oldbusinessUnit = oldbusinessUnit; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + OrderBusinessUnitSetMessageImpl that = (OrderBusinessUnitSetMessageImpl) o; + + return new EqualsBuilder().append(id, that.id) + .append(version, that.version) + .append(createdAt, that.createdAt) + .append(lastModifiedAt, that.lastModifiedAt) + .append(lastModifiedBy, that.lastModifiedBy) + .append(createdBy, that.createdBy) + .append(sequenceNumber, that.sequenceNumber) + .append(resource, that.resource) + .append(resourceVersion, that.resourceVersion) + .append(type, that.type) + .append(resourceUserProvidedIdentifiers, that.resourceUserProvidedIdentifiers) + .append(businessUnit, that.businessUnit) + .append(oldbusinessUnit, that.oldbusinessUnit) + .append(id, that.id) + .append(version, that.version) + .append(createdAt, that.createdAt) + .append(lastModifiedAt, that.lastModifiedAt) + .append(lastModifiedBy, that.lastModifiedBy) + .append(createdBy, that.createdBy) + .append(sequenceNumber, that.sequenceNumber) + .append(resource, that.resource) + .append(resourceVersion, that.resourceVersion) + .append(type, that.type) + .append(resourceUserProvidedIdentifiers, that.resourceUserProvidedIdentifiers) + .append(businessUnit, that.businessUnit) + .append(oldbusinessUnit, that.oldbusinessUnit) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(id) + .append(version) + .append(createdAt) + .append(lastModifiedAt) + .append(lastModifiedBy) + .append(createdBy) + .append(sequenceNumber) + .append(resource) + .append(resourceVersion) + .append(type) + .append(resourceUserProvidedIdentifiers) + .append(businessUnit) + .append(oldbusinessUnit) + .toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("id", id) + .append("version", version) + .append("createdAt", createdAt) + .append("lastModifiedAt", lastModifiedAt) + .append("lastModifiedBy", lastModifiedBy) + .append("createdBy", createdBy) + .append("sequenceNumber", sequenceNumber) + .append("resource", resource) + .append("resourceVersion", resourceVersion) + .append("type", type) + .append("resourceUserProvidedIdentifiers", resourceUserProvidedIdentifiers) + .append("businessUnit", businessUnit) + .append("oldbusinessUnit", oldbusinessUnit) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/OrderBusinessUnitSetMessagePayload.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/OrderBusinessUnitSetMessagePayload.java new file mode 100644 index 00000000000..8c282b0f029 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/OrderBusinessUnitSetMessagePayload.java @@ -0,0 +1,147 @@ + +package com.commercetools.api.models.message; + +import java.time.*; +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import com.commercetools.api.models.business_unit.BusinessUnitKeyReference; +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +import jakarta.validation.Valid; + +/** + *Generated after a successful Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * + *
+ * OrderBusinessUnitSetMessagePayload orderBusinessUnitSetMessagePayload = OrderBusinessUnitSetMessagePayload.builder()
+ * .build()
+ *
+ * BusinessUnit on the Order after the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @return businessUnit + */ + @Valid + @JsonProperty("businessUnit") + public BusinessUnitKeyReference getBusinessUnit(); + + /** + *BusinessUnit on the Order before the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @return oldbusinessUnit + */ + @Valid + @JsonProperty("oldbusinessUnit") + public BusinessUnitKeyReference getOldbusinessUnit(); + + /** + *BusinessUnit on the Order after the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @param businessUnit value to be set + */ + + public void setBusinessUnit(final BusinessUnitKeyReference businessUnit); + + /** + *BusinessUnit on the Order before the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @param oldbusinessUnit value to be set + */ + + public void setOldbusinessUnit(final BusinessUnitKeyReference oldbusinessUnit); + + /** + * factory method + * @return instance of OrderBusinessUnitSetMessagePayload + */ + public static OrderBusinessUnitSetMessagePayload of() { + return new OrderBusinessUnitSetMessagePayloadImpl(); + } + + /** + * factory method to create a shallow copy OrderBusinessUnitSetMessagePayload + * @param template instance to be copied + * @return copy instance + */ + public static OrderBusinessUnitSetMessagePayload of(final OrderBusinessUnitSetMessagePayload template) { + OrderBusinessUnitSetMessagePayloadImpl instance = new OrderBusinessUnitSetMessagePayloadImpl(); + instance.setBusinessUnit(template.getBusinessUnit()); + instance.setOldbusinessUnit(template.getOldbusinessUnit()); + return instance; + } + + /** + * factory method to create a deep copy of OrderBusinessUnitSetMessagePayload + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static OrderBusinessUnitSetMessagePayload deepCopy( + @Nullable final OrderBusinessUnitSetMessagePayload template) { + if (template == null) { + return null; + } + OrderBusinessUnitSetMessagePayloadImpl instance = new OrderBusinessUnitSetMessagePayloadImpl(); + instance.setBusinessUnit( + com.commercetools.api.models.business_unit.BusinessUnitKeyReference.deepCopy(template.getBusinessUnit())); + instance.setOldbusinessUnit(com.commercetools.api.models.business_unit.BusinessUnitKeyReference + .deepCopy(template.getOldbusinessUnit())); + return instance; + } + + /** + * builder factory method for OrderBusinessUnitSetMessagePayload + * @return builder + */ + public static OrderBusinessUnitSetMessagePayloadBuilder builder() { + return OrderBusinessUnitSetMessagePayloadBuilder.of(); + } + + /** + * create builder for OrderBusinessUnitSetMessagePayload instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static OrderBusinessUnitSetMessagePayloadBuilder builder(final OrderBusinessUnitSetMessagePayload template) { + return OrderBusinessUnitSetMessagePayloadBuilder.of(template); + } + + /** + * accessor map function + * @param
+ * OrderBusinessUnitSetMessagePayload orderBusinessUnitSetMessagePayload = OrderBusinessUnitSetMessagePayload.builder()
+ * .build()
+ *
+ * BusinessUnit on the Order after the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @param builder function to build the businessUnit value + * @return Builder + */ + + public OrderBusinessUnitSetMessagePayloadBuilder businessUnit( + FunctionBusinessUnit on the Order after the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @param builder function to build the businessUnit value + * @return Builder + */ + + public OrderBusinessUnitSetMessagePayloadBuilder withBusinessUnit( + FunctionBusinessUnit on the Order after the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @param businessUnit value to be set + * @return Builder + */ + + public OrderBusinessUnitSetMessagePayloadBuilder businessUnit( + @Nullable final com.commercetools.api.models.business_unit.BusinessUnitKeyReference businessUnit) { + this.businessUnit = businessUnit; + return this; + } + + /** + *BusinessUnit on the Order before the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @param builder function to build the oldbusinessUnit value + * @return Builder + */ + + public OrderBusinessUnitSetMessagePayloadBuilder oldbusinessUnit( + FunctionBusinessUnit on the Order before the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @param builder function to build the oldbusinessUnit value + * @return Builder + */ + + public OrderBusinessUnitSetMessagePayloadBuilder withOldbusinessUnit( + FunctionBusinessUnit on the Order before the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @param oldbusinessUnit value to be set + * @return Builder + */ + + public OrderBusinessUnitSetMessagePayloadBuilder oldbusinessUnit( + @Nullable final com.commercetools.api.models.business_unit.BusinessUnitKeyReference oldbusinessUnit) { + this.oldbusinessUnit = oldbusinessUnit; + return this; + } + + /** + *BusinessUnit on the Order after the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @return businessUnit + */ + + @Nullable + public com.commercetools.api.models.business_unit.BusinessUnitKeyReference getBusinessUnit() { + return this.businessUnit; + } + + /** + *BusinessUnit on the Order before the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ * @return oldbusinessUnit + */ + + @Nullable + public com.commercetools.api.models.business_unit.BusinessUnitKeyReference getOldbusinessUnit() { + return this.oldbusinessUnit; + } + + /** + * builds OrderBusinessUnitSetMessagePayload with checking for non-null required values + * @return OrderBusinessUnitSetMessagePayload + */ + public OrderBusinessUnitSetMessagePayload build() { + return new OrderBusinessUnitSetMessagePayloadImpl(businessUnit, oldbusinessUnit); + } + + /** + * builds OrderBusinessUnitSetMessagePayload without checking for non-null required values + * @return OrderBusinessUnitSetMessagePayload + */ + public OrderBusinessUnitSetMessagePayload buildUnchecked() { + return new OrderBusinessUnitSetMessagePayloadImpl(businessUnit, oldbusinessUnit); + } + + /** + * factory method for an instance of OrderBusinessUnitSetMessagePayloadBuilder + * @return builder + */ + public static OrderBusinessUnitSetMessagePayloadBuilder of() { + return new OrderBusinessUnitSetMessagePayloadBuilder(); + } + + /** + * create builder for OrderBusinessUnitSetMessagePayload instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static OrderBusinessUnitSetMessagePayloadBuilder of(final OrderBusinessUnitSetMessagePayload template) { + OrderBusinessUnitSetMessagePayloadBuilder builder = new OrderBusinessUnitSetMessagePayloadBuilder(); + builder.businessUnit = template.getBusinessUnit(); + builder.oldbusinessUnit = template.getOldbusinessUnit(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/OrderBusinessUnitSetMessagePayloadImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/OrderBusinessUnitSetMessagePayloadImpl.java new file mode 100644 index 00000000000..1259cb80b82 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/OrderBusinessUnitSetMessagePayloadImpl.java @@ -0,0 +1,116 @@ + +package com.commercetools.api.models.message; + +import java.time.*; +import java.util.*; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.ModelBase; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + *Generated after a successful Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class OrderBusinessUnitSetMessagePayloadImpl implements OrderBusinessUnitSetMessagePayload, ModelBase { + + private String type; + + private com.commercetools.api.models.business_unit.BusinessUnitKeyReference businessUnit; + + private com.commercetools.api.models.business_unit.BusinessUnitKeyReference oldbusinessUnit; + + /** + * create instance with all properties + */ + @JsonCreator + OrderBusinessUnitSetMessagePayloadImpl( + @JsonProperty("businessUnit") final com.commercetools.api.models.business_unit.BusinessUnitKeyReference businessUnit, + @JsonProperty("oldbusinessUnit") final com.commercetools.api.models.business_unit.BusinessUnitKeyReference oldbusinessUnit) { + this.businessUnit = businessUnit; + this.oldbusinessUnit = oldbusinessUnit; + this.type = ORDER_BUSINESS_UNIT_SET; + } + + /** + * create empty instance + */ + public OrderBusinessUnitSetMessagePayloadImpl() { + this.type = ORDER_BUSINESS_UNIT_SET; + } + + /** + * + */ + + public String getType() { + return this.type; + } + + /** + *BusinessUnit on the Order after the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ */ + + public com.commercetools.api.models.business_unit.BusinessUnitKeyReference getBusinessUnit() { + return this.businessUnit; + } + + /** + *BusinessUnit on the Order before the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.
+ */ + + public com.commercetools.api.models.business_unit.BusinessUnitKeyReference getOldbusinessUnit() { + return this.oldbusinessUnit; + } + + public void setBusinessUnit( + final com.commercetools.api.models.business_unit.BusinessUnitKeyReference businessUnit) { + this.businessUnit = businessUnit; + } + + public void setOldbusinessUnit( + final com.commercetools.api.models.business_unit.BusinessUnitKeyReference oldbusinessUnit) { + this.oldbusinessUnit = oldbusinessUnit; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + OrderBusinessUnitSetMessagePayloadImpl that = (OrderBusinessUnitSetMessagePayloadImpl) o; + + return new EqualsBuilder().append(type, that.type) + .append(businessUnit, that.businessUnit) + .append(oldbusinessUnit, that.oldbusinessUnit) + .append(type, that.type) + .append(businessUnit, that.businessUnit) + .append(oldbusinessUnit, that.oldbusinessUnit) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(type).append(businessUnit).append(oldbusinessUnit).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("type", type) + .append("businessUnit", businessUnit) + .append("oldbusinessUnit", oldbusinessUnit) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/OrderMessage.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/OrderMessage.java index dc460d587f1..878afc534b3 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/OrderMessage.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/OrderMessage.java @@ -92,6 +92,10 @@ public static OrderMessage deepCopy(@Nullable final OrderMessage template) { return com.commercetools.api.models.message.OrderBillingAddressSetMessage .deepCopy((com.commercetools.api.models.message.OrderBillingAddressSetMessage) template); } + if (template instanceof com.commercetools.api.models.message.OrderBusinessUnitSetMessage) { + return com.commercetools.api.models.message.OrderBusinessUnitSetMessage + .deepCopy((com.commercetools.api.models.message.OrderBusinessUnitSetMessage) template); + } if (template instanceof com.commercetools.api.models.message.OrderCreatedMessage) { return com.commercetools.api.models.message.OrderCreatedMessage .deepCopy((com.commercetools.api.models.message.OrderCreatedMessage) template); diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/OrderMessagePayload.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/OrderMessagePayload.java index 407e75a4f11..148b85f20f3 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/OrderMessagePayload.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/OrderMessagePayload.java @@ -85,6 +85,10 @@ public static OrderMessagePayload deepCopy(@Nullable final OrderMessagePayload t return com.commercetools.api.models.message.OrderBillingAddressSetMessagePayload .deepCopy((com.commercetools.api.models.message.OrderBillingAddressSetMessagePayload) template); } + if (template instanceof com.commercetools.api.models.message.OrderBusinessUnitSetMessagePayload) { + return com.commercetools.api.models.message.OrderBusinessUnitSetMessagePayload + .deepCopy((com.commercetools.api.models.message.OrderBusinessUnitSetMessagePayload) template); + } if (template instanceof com.commercetools.api.models.message.OrderCreatedMessagePayload) { return com.commercetools.api.models.message.OrderCreatedMessagePayload .deepCopy((com.commercetools.api.models.message.OrderCreatedMessagePayload) template); diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/OrderSetBusinessUnitAction.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/OrderSetBusinessUnitAction.java new file mode 100644 index 00000000000..9621df4fbd8 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/OrderSetBusinessUnitAction.java @@ -0,0 +1,131 @@ + +package com.commercetools.api.models.order; + +import java.time.*; +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier; +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +import jakarta.validation.Valid; + +/** + *Updates the Business Unit on the Order. Setting the Order's businessUnit
does not recalculate prices or discounts on the Order.
Produces the OrderBusinessUnitSet Message.
+ * + *
+ * OrderSetBusinessUnitAction orderSetBusinessUnitAction = OrderSetBusinessUnitAction.builder()
+ * .build()
+ *
+ * New Business Unit to assign to the Order. If empty, any existing value is removed.
+ *If the referenced Business Unit does not exist, a ReferencedResourceNotFound error is returned.
+ * @return businessUnit + */ + @Valid + @JsonProperty("businessUnit") + public BusinessUnitResourceIdentifier getBusinessUnit(); + + /** + *New Business Unit to assign to the Order. If empty, any existing value is removed.
+ *If the referenced Business Unit does not exist, a ReferencedResourceNotFound error is returned.
+ * @param businessUnit value to be set + */ + + public void setBusinessUnit(final BusinessUnitResourceIdentifier businessUnit); + + /** + * factory method + * @return instance of OrderSetBusinessUnitAction + */ + public static OrderSetBusinessUnitAction of() { + return new OrderSetBusinessUnitActionImpl(); + } + + /** + * factory method to create a shallow copy OrderSetBusinessUnitAction + * @param template instance to be copied + * @return copy instance + */ + public static OrderSetBusinessUnitAction of(final OrderSetBusinessUnitAction template) { + OrderSetBusinessUnitActionImpl instance = new OrderSetBusinessUnitActionImpl(); + instance.setBusinessUnit(template.getBusinessUnit()); + return instance; + } + + /** + * factory method to create a deep copy of OrderSetBusinessUnitAction + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static OrderSetBusinessUnitAction deepCopy(@Nullable final OrderSetBusinessUnitAction template) { + if (template == null) { + return null; + } + OrderSetBusinessUnitActionImpl instance = new OrderSetBusinessUnitActionImpl(); + instance.setBusinessUnit(com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier + .deepCopy(template.getBusinessUnit())); + return instance; + } + + /** + * builder factory method for OrderSetBusinessUnitAction + * @return builder + */ + public static OrderSetBusinessUnitActionBuilder builder() { + return OrderSetBusinessUnitActionBuilder.of(); + } + + /** + * create builder for OrderSetBusinessUnitAction instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static OrderSetBusinessUnitActionBuilder builder(final OrderSetBusinessUnitAction template) { + return OrderSetBusinessUnitActionBuilder.of(template); + } + + /** + * accessor map function + * @param
+ * OrderSetBusinessUnitAction orderSetBusinessUnitAction = OrderSetBusinessUnitAction.builder()
+ * .build()
+ *
+ * New Business Unit to assign to the Order. If empty, any existing value is removed.
+ *If the referenced Business Unit does not exist, a ReferencedResourceNotFound error is returned.
+ * @param builder function to build the businessUnit value + * @return Builder + */ + + public OrderSetBusinessUnitActionBuilder businessUnit( + FunctionNew Business Unit to assign to the Order. If empty, any existing value is removed.
+ *If the referenced Business Unit does not exist, a ReferencedResourceNotFound error is returned.
+ * @param builder function to build the businessUnit value + * @return Builder + */ + + public OrderSetBusinessUnitActionBuilder withBusinessUnit( + FunctionNew Business Unit to assign to the Order. If empty, any existing value is removed.
+ *If the referenced Business Unit does not exist, a ReferencedResourceNotFound error is returned.
+ * @param businessUnit value to be set + * @return Builder + */ + + public OrderSetBusinessUnitActionBuilder businessUnit( + @Nullable final com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier businessUnit) { + this.businessUnit = businessUnit; + return this; + } + + /** + *New Business Unit to assign to the Order. If empty, any existing value is removed.
+ *If the referenced Business Unit does not exist, a ReferencedResourceNotFound error is returned.
+ * @return businessUnit + */ + + @Nullable + public com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier getBusinessUnit() { + return this.businessUnit; + } + + /** + * builds OrderSetBusinessUnitAction with checking for non-null required values + * @return OrderSetBusinessUnitAction + */ + public OrderSetBusinessUnitAction build() { + return new OrderSetBusinessUnitActionImpl(businessUnit); + } + + /** + * builds OrderSetBusinessUnitAction without checking for non-null required values + * @return OrderSetBusinessUnitAction + */ + public OrderSetBusinessUnitAction buildUnchecked() { + return new OrderSetBusinessUnitActionImpl(businessUnit); + } + + /** + * factory method for an instance of OrderSetBusinessUnitActionBuilder + * @return builder + */ + public static OrderSetBusinessUnitActionBuilder of() { + return new OrderSetBusinessUnitActionBuilder(); + } + + /** + * create builder for OrderSetBusinessUnitAction instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static OrderSetBusinessUnitActionBuilder of(final OrderSetBusinessUnitAction template) { + OrderSetBusinessUnitActionBuilder builder = new OrderSetBusinessUnitActionBuilder(); + builder.businessUnit = template.getBusinessUnit(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/OrderSetBusinessUnitActionImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/OrderSetBusinessUnitActionImpl.java new file mode 100644 index 00000000000..76a37f45fa0 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/OrderSetBusinessUnitActionImpl.java @@ -0,0 +1,98 @@ + +package com.commercetools.api.models.order; + +import java.time.*; +import java.util.*; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.ModelBase; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + *Updates the Business Unit on the Order. Setting the Order's businessUnit
does not recalculate prices or discounts on the Order.
Produces the OrderBusinessUnitSet Message.
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class OrderSetBusinessUnitActionImpl implements OrderSetBusinessUnitAction, ModelBase { + + private String action; + + private com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier businessUnit; + + /** + * create instance with all properties + */ + @JsonCreator + OrderSetBusinessUnitActionImpl( + @JsonProperty("businessUnit") final com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier businessUnit) { + this.businessUnit = businessUnit; + this.action = SET_BUSINESS_UNIT; + } + + /** + * create empty instance + */ + public OrderSetBusinessUnitActionImpl() { + this.action = SET_BUSINESS_UNIT; + } + + /** + * + */ + + public String getAction() { + return this.action; + } + + /** + *New Business Unit to assign to the Order. If empty, any existing value is removed.
+ *If the referenced Business Unit does not exist, a ReferencedResourceNotFound error is returned.
+ */ + + public com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier getBusinessUnit() { + return this.businessUnit; + } + + public void setBusinessUnit( + final com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier businessUnit) { + this.businessUnit = businessUnit; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + OrderSetBusinessUnitActionImpl that = (OrderSetBusinessUnitActionImpl) o; + + return new EqualsBuilder().append(action, that.action) + .append(businessUnit, that.businessUnit) + .append(action, that.action) + .append(businessUnit, that.businessUnit) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(action).append(businessUnit).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("action", action) + .append("businessUnit", businessUnit) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/OrderUpdateAction.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/OrderUpdateAction.java index 7031a253b7f..f20eb99fcf8 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/OrderUpdateAction.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/OrderUpdateAction.java @@ -44,6 +44,7 @@ @JsonSubTypes.Type(value = com.commercetools.api.models.order.OrderSetBillingAddressActionImpl.class, name = OrderSetBillingAddressAction.SET_BILLING_ADDRESS), @JsonSubTypes.Type(value = com.commercetools.api.models.order.OrderSetBillingAddressCustomFieldActionImpl.class, name = OrderSetBillingAddressCustomFieldAction.SET_BILLING_ADDRESS_CUSTOM_FIELD), @JsonSubTypes.Type(value = com.commercetools.api.models.order.OrderSetBillingAddressCustomTypeActionImpl.class, name = OrderSetBillingAddressCustomTypeAction.SET_BILLING_ADDRESS_CUSTOM_TYPE), + @JsonSubTypes.Type(value = com.commercetools.api.models.order.OrderSetBusinessUnitActionImpl.class, name = OrderSetBusinessUnitAction.SET_BUSINESS_UNIT), @JsonSubTypes.Type(value = com.commercetools.api.models.order.OrderSetCustomFieldActionImpl.class, name = OrderSetCustomFieldAction.SET_CUSTOM_FIELD), @JsonSubTypes.Type(value = com.commercetools.api.models.order.OrderSetCustomLineItemCustomFieldActionImpl.class, name = OrderSetCustomLineItemCustomFieldAction.SET_CUSTOM_LINE_ITEM_CUSTOM_FIELD), @JsonSubTypes.Type(value = com.commercetools.api.models.order.OrderSetCustomLineItemCustomTypeActionImpl.class, name = OrderSetCustomLineItemCustomTypeAction.SET_CUSTOM_LINE_ITEM_CUSTOM_TYPE), @@ -177,6 +178,10 @@ public static OrderUpdateAction deepCopy(@Nullable final OrderUpdateAction templ return com.commercetools.api.models.order.OrderSetBillingAddressCustomTypeAction .deepCopy((com.commercetools.api.models.order.OrderSetBillingAddressCustomTypeAction) template); } + if (template instanceof com.commercetools.api.models.order.OrderSetBusinessUnitAction) { + return com.commercetools.api.models.order.OrderSetBusinessUnitAction + .deepCopy((com.commercetools.api.models.order.OrderSetBusinessUnitAction) template); + } if (template instanceof com.commercetools.api.models.order.OrderSetCustomFieldAction) { return com.commercetools.api.models.order.OrderSetCustomFieldAction .deepCopy((com.commercetools.api.models.order.OrderSetCustomFieldAction) template); @@ -485,6 +490,14 @@ public static com.commercetools.api.models.order.OrderSetBillingAddressCustomTyp return com.commercetools.api.models.order.OrderSetBillingAddressCustomTypeActionBuilder.of(); } + /** + * builder for setBusinessUnit subtype + * @return builder + */ + public static com.commercetools.api.models.order.OrderSetBusinessUnitActionBuilder setBusinessUnitBuilder() { + return com.commercetools.api.models.order.OrderSetBusinessUnitActionBuilder.of(); + } + /** * builder for setCustomField subtype * @return builder diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/OrderUpdateActionBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/OrderUpdateActionBuilder.java index 36bdbb7bbc8..a2b9ca15485 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/OrderUpdateActionBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/OrderUpdateActionBuilder.java @@ -79,6 +79,10 @@ public com.commercetools.api.models.order.OrderSetBillingAddressCustomTypeAction return com.commercetools.api.models.order.OrderSetBillingAddressCustomTypeActionBuilder.of(); } + public com.commercetools.api.models.order.OrderSetBusinessUnitActionBuilder setBusinessUnitBuilder() { + return com.commercetools.api.models.order.OrderSetBusinessUnitActionBuilder.of(); + } + public com.commercetools.api.models.order.OrderSetCustomFieldActionBuilder setCustomFieldBuilder() { return com.commercetools.api.models.order.OrderSetCustomFieldActionBuilder.of(); } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/StagedOrderUpdateAction.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/StagedOrderUpdateAction.java index 197fdfd569a..f4050ecfab9 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/StagedOrderUpdateAction.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/StagedOrderUpdateAction.java @@ -37,6 +37,7 @@ import com.commercetools.api.models.order_edit.StagedOrderSetBillingAddressAction; import com.commercetools.api.models.order_edit.StagedOrderSetBillingAddressCustomFieldAction; import com.commercetools.api.models.order_edit.StagedOrderSetBillingAddressCustomTypeAction; +import com.commercetools.api.models.order_edit.StagedOrderSetBusinessUnitAction; import com.commercetools.api.models.order_edit.StagedOrderSetCountryAction; import com.commercetools.api.models.order_edit.StagedOrderSetCustomFieldAction; import com.commercetools.api.models.order_edit.StagedOrderSetCustomLineItemCustomFieldAction; @@ -150,6 +151,7 @@ @JsonSubTypes.Type(value = com.commercetools.api.models.order_edit.StagedOrderSetBillingAddressActionImpl.class, name = StagedOrderSetBillingAddressAction.SET_BILLING_ADDRESS), @JsonSubTypes.Type(value = com.commercetools.api.models.order_edit.StagedOrderSetBillingAddressCustomFieldActionImpl.class, name = StagedOrderSetBillingAddressCustomFieldAction.SET_BILLING_ADDRESS_CUSTOM_FIELD), @JsonSubTypes.Type(value = com.commercetools.api.models.order_edit.StagedOrderSetBillingAddressCustomTypeActionImpl.class, name = StagedOrderSetBillingAddressCustomTypeAction.SET_BILLING_ADDRESS_CUSTOM_TYPE), + @JsonSubTypes.Type(value = com.commercetools.api.models.order_edit.StagedOrderSetBusinessUnitActionImpl.class, name = StagedOrderSetBusinessUnitAction.SET_BUSINESS_UNIT), @JsonSubTypes.Type(value = com.commercetools.api.models.order_edit.StagedOrderSetCountryActionImpl.class, name = StagedOrderSetCountryAction.SET_COUNTRY), @JsonSubTypes.Type(value = com.commercetools.api.models.order_edit.StagedOrderSetCustomFieldActionImpl.class, name = StagedOrderSetCustomFieldAction.SET_CUSTOM_FIELD), @JsonSubTypes.Type(value = com.commercetools.api.models.order_edit.StagedOrderSetCustomLineItemCustomFieldActionImpl.class, name = StagedOrderSetCustomLineItemCustomFieldAction.SET_CUSTOM_LINE_ITEM_CUSTOM_FIELD), @@ -354,6 +356,10 @@ public static StagedOrderUpdateAction deepCopy(@Nullable final StagedOrderUpdate return com.commercetools.api.models.order_edit.StagedOrderSetBillingAddressCustomTypeAction.deepCopy( (com.commercetools.api.models.order_edit.StagedOrderSetBillingAddressCustomTypeAction) template); } + if (template instanceof com.commercetools.api.models.order_edit.StagedOrderSetBusinessUnitAction) { + return com.commercetools.api.models.order_edit.StagedOrderSetBusinessUnitAction + .deepCopy((com.commercetools.api.models.order_edit.StagedOrderSetBusinessUnitAction) template); + } if (template instanceof com.commercetools.api.models.order_edit.StagedOrderSetCountryAction) { return com.commercetools.api.models.order_edit.StagedOrderSetCountryAction .deepCopy((com.commercetools.api.models.order_edit.StagedOrderSetCountryAction) template); @@ -840,6 +846,14 @@ public static com.commercetools.api.models.order_edit.StagedOrderSetBillingAddre return com.commercetools.api.models.order_edit.StagedOrderSetBillingAddressCustomTypeActionBuilder.of(); } + /** + * builder for setBusinessUnit subtype + * @return builder + */ + public static com.commercetools.api.models.order_edit.StagedOrderSetBusinessUnitActionBuilder setBusinessUnitBuilder() { + return com.commercetools.api.models.order_edit.StagedOrderSetBusinessUnitActionBuilder.of(); + } + /** * builder for setCountry subtype * @return builder diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/StagedOrderUpdateActionBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/StagedOrderUpdateActionBuilder.java index 6beb62891b8..24a30709e29 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/StagedOrderUpdateActionBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/StagedOrderUpdateActionBuilder.java @@ -131,6 +131,10 @@ public com.commercetools.api.models.order_edit.StagedOrderSetBillingAddressCusto return com.commercetools.api.models.order_edit.StagedOrderSetBillingAddressCustomTypeActionBuilder.of(); } + public com.commercetools.api.models.order_edit.StagedOrderSetBusinessUnitActionBuilder setBusinessUnitBuilder() { + return com.commercetools.api.models.order_edit.StagedOrderSetBusinessUnitActionBuilder.of(); + } + public com.commercetools.api.models.order_edit.StagedOrderSetCountryActionBuilder setCountryBuilder() { return com.commercetools.api.models.order_edit.StagedOrderSetCountryActionBuilder.of(); } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order_edit/StagedOrderSetBusinessUnitAction.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order_edit/StagedOrderSetBusinessUnitAction.java new file mode 100644 index 00000000000..c27a47f99e9 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order_edit/StagedOrderSetBusinessUnitAction.java @@ -0,0 +1,132 @@ + +package com.commercetools.api.models.order_edit; + +import java.time.*; +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier; +import com.commercetools.api.models.order.StagedOrderUpdateAction; +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +import jakarta.validation.Valid; + +/** + *Updates the Business Unit on the Order. Setting the Order's businessUnit
does not recalculate prices or discounts on the Order.
Produces the OrderBusinessUnitSet Message.
+ * + *
+ * StagedOrderSetBusinessUnitAction stagedOrderSetBusinessUnitAction = StagedOrderSetBusinessUnitAction.builder()
+ * .build()
+ *
+ * New Business Unit to assign to the Order. If empty, any existing value is removed.
+ *If the referenced Business Unit does not exist, a ReferencedResourceNotFound error is returned.
+ * @return businessUnit + */ + @Valid + @JsonProperty("businessUnit") + public BusinessUnitResourceIdentifier getBusinessUnit(); + + /** + *New Business Unit to assign to the Order. If empty, any existing value is removed.
+ *If the referenced Business Unit does not exist, a ReferencedResourceNotFound error is returned.
+ * @param businessUnit value to be set + */ + + public void setBusinessUnit(final BusinessUnitResourceIdentifier businessUnit); + + /** + * factory method + * @return instance of StagedOrderSetBusinessUnitAction + */ + public static StagedOrderSetBusinessUnitAction of() { + return new StagedOrderSetBusinessUnitActionImpl(); + } + + /** + * factory method to create a shallow copy StagedOrderSetBusinessUnitAction + * @param template instance to be copied + * @return copy instance + */ + public static StagedOrderSetBusinessUnitAction of(final StagedOrderSetBusinessUnitAction template) { + StagedOrderSetBusinessUnitActionImpl instance = new StagedOrderSetBusinessUnitActionImpl(); + instance.setBusinessUnit(template.getBusinessUnit()); + return instance; + } + + /** + * factory method to create a deep copy of StagedOrderSetBusinessUnitAction + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static StagedOrderSetBusinessUnitAction deepCopy(@Nullable final StagedOrderSetBusinessUnitAction template) { + if (template == null) { + return null; + } + StagedOrderSetBusinessUnitActionImpl instance = new StagedOrderSetBusinessUnitActionImpl(); + instance.setBusinessUnit(com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier + .deepCopy(template.getBusinessUnit())); + return instance; + } + + /** + * builder factory method for StagedOrderSetBusinessUnitAction + * @return builder + */ + public static StagedOrderSetBusinessUnitActionBuilder builder() { + return StagedOrderSetBusinessUnitActionBuilder.of(); + } + + /** + * create builder for StagedOrderSetBusinessUnitAction instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static StagedOrderSetBusinessUnitActionBuilder builder(final StagedOrderSetBusinessUnitAction template) { + return StagedOrderSetBusinessUnitActionBuilder.of(template); + } + + /** + * accessor map function + * @param
+ * StagedOrderSetBusinessUnitAction stagedOrderSetBusinessUnitAction = StagedOrderSetBusinessUnitAction.builder()
+ * .build()
+ *
+ * New Business Unit to assign to the Order. If empty, any existing value is removed.
+ *If the referenced Business Unit does not exist, a ReferencedResourceNotFound error is returned.
+ * @param builder function to build the businessUnit value + * @return Builder + */ + + public StagedOrderSetBusinessUnitActionBuilder businessUnit( + FunctionNew Business Unit to assign to the Order. If empty, any existing value is removed.
+ *If the referenced Business Unit does not exist, a ReferencedResourceNotFound error is returned.
+ * @param builder function to build the businessUnit value + * @return Builder + */ + + public StagedOrderSetBusinessUnitActionBuilder withBusinessUnit( + FunctionNew Business Unit to assign to the Order. If empty, any existing value is removed.
+ *If the referenced Business Unit does not exist, a ReferencedResourceNotFound error is returned.
+ * @param businessUnit value to be set + * @return Builder + */ + + public StagedOrderSetBusinessUnitActionBuilder businessUnit( + @Nullable final com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier businessUnit) { + this.businessUnit = businessUnit; + return this; + } + + /** + *New Business Unit to assign to the Order. If empty, any existing value is removed.
+ *If the referenced Business Unit does not exist, a ReferencedResourceNotFound error is returned.
+ * @return businessUnit + */ + + @Nullable + public com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier getBusinessUnit() { + return this.businessUnit; + } + + /** + * builds StagedOrderSetBusinessUnitAction with checking for non-null required values + * @return StagedOrderSetBusinessUnitAction + */ + public StagedOrderSetBusinessUnitAction build() { + return new StagedOrderSetBusinessUnitActionImpl(businessUnit); + } + + /** + * builds StagedOrderSetBusinessUnitAction without checking for non-null required values + * @return StagedOrderSetBusinessUnitAction + */ + public StagedOrderSetBusinessUnitAction buildUnchecked() { + return new StagedOrderSetBusinessUnitActionImpl(businessUnit); + } + + /** + * factory method for an instance of StagedOrderSetBusinessUnitActionBuilder + * @return builder + */ + public static StagedOrderSetBusinessUnitActionBuilder of() { + return new StagedOrderSetBusinessUnitActionBuilder(); + } + + /** + * create builder for StagedOrderSetBusinessUnitAction instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static StagedOrderSetBusinessUnitActionBuilder of(final StagedOrderSetBusinessUnitAction template) { + StagedOrderSetBusinessUnitActionBuilder builder = new StagedOrderSetBusinessUnitActionBuilder(); + builder.businessUnit = template.getBusinessUnit(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order_edit/StagedOrderSetBusinessUnitActionImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order_edit/StagedOrderSetBusinessUnitActionImpl.java new file mode 100644 index 00000000000..c5bc1ef0218 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order_edit/StagedOrderSetBusinessUnitActionImpl.java @@ -0,0 +1,98 @@ + +package com.commercetools.api.models.order_edit; + +import java.time.*; +import java.util.*; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.ModelBase; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + *Updates the Business Unit on the Order. Setting the Order's businessUnit
does not recalculate prices or discounts on the Order.
Produces the OrderBusinessUnitSet Message.
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class StagedOrderSetBusinessUnitActionImpl implements StagedOrderSetBusinessUnitAction, ModelBase { + + private String action; + + private com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier businessUnit; + + /** + * create instance with all properties + */ + @JsonCreator + StagedOrderSetBusinessUnitActionImpl( + @JsonProperty("businessUnit") final com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier businessUnit) { + this.businessUnit = businessUnit; + this.action = SET_BUSINESS_UNIT; + } + + /** + * create empty instance + */ + public StagedOrderSetBusinessUnitActionImpl() { + this.action = SET_BUSINESS_UNIT; + } + + /** + * + */ + + public String getAction() { + return this.action; + } + + /** + *New Business Unit to assign to the Order. If empty, any existing value is removed.
+ *If the referenced Business Unit does not exist, a ReferencedResourceNotFound error is returned.
+ */ + + public com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier getBusinessUnit() { + return this.businessUnit; + } + + public void setBusinessUnit( + final com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier businessUnit) { + this.businessUnit = businessUnit; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + StagedOrderSetBusinessUnitActionImpl that = (StagedOrderSetBusinessUnitActionImpl) o; + + return new EqualsBuilder().append(action, that.action) + .append(businessUnit, that.businessUnit) + .append(action, that.action) + .append(businessUnit, that.businessUnit) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(action).append(businessUnit).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("action", action) + .append("businessUnit", businessUnit) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/expansion/message/OrderBusinessUnitSetMessageExpansionBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/expansion/message/OrderBusinessUnitSetMessageExpansionBuilderDsl.java new file mode 100644 index 00000000000..4300938a44e --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/expansion/message/OrderBusinessUnitSetMessageExpansionBuilderDsl.java @@ -0,0 +1,46 @@ + +package com.commercetools.api.predicates.expansion.message; + +import static com.commercetools.api.predicates.expansion.ExpansionUtil.appendOne; + +import java.util.Collections; +import java.util.List; + +import com.commercetools.api.predicates.expansion.ExpansionDsl; + +public class OrderBusinessUnitSetMessageExpansionBuilderDsl implements ExpansionDsl { + + private final List