From 862e40e2e5071166e6573147986084fda3429836 Mon Sep 17 00:00:00 2001 From: "ct-sdks[bot]" <153784748+ct-sdks[bot]@users.noreply.github.com> Date: Wed, 7 Feb 2024 10:56:58 +0000 Subject: [PATCH] build(codegen): updating SDK --- changes.md | 32 ++ .../main/resources/graphql/schema.graphqls | 45 +- .../ByProjectKeyDiscountCodesByIDDelete.java | 1 + ...ProjectKeyDiscountCodesKeyByKeyDelete.java | 380 +++++++++++++++ .../ByProjectKeyDiscountCodesKeyByKeyGet.java | 208 ++++++++ ...ByProjectKeyDiscountCodesKeyByKeyHead.java | 120 +++++ ...ByProjectKeyDiscountCodesKeyByKeyPost.java | 231 +++++++++ ...ectKeyDiscountCodesKeyByKeyPostString.java | 230 +++++++++ ...eyDiscountCodesKeyByKeyRequestBuilder.java | 53 ++ .../client/ByProjectKeyDiscountCodesPost.java | 1 + .../ByProjectKeyDiscountCodesPostString.java | 1 + ...ProjectKeyDiscountCodesRequestBuilder.java | 4 + .../models/discount_code/DiscountCode.java | 17 + .../discount_code/DiscountCodeBuilder.java | 29 +- .../discount_code/DiscountCodeDraft.java | 17 + .../DiscountCodeDraftBuilder.java | 29 +- .../discount_code/DiscountCodeDraftImpl.java | 28 +- .../discount_code/DiscountCodeImpl.java | 20 + .../DiscountCodeSetKeyAction.java | 124 +++++ .../DiscountCodeSetKeyActionBuilder.java | 84 ++++ .../DiscountCodeSetKeyActionImpl.java | 94 ++++ .../DiscountCodeUpdateAction.java | 13 + .../DiscountCodeUpdateActionBuilder.java | 4 + .../message/DiscountCodeCreatedMessage.java | 159 ++++++ .../DiscountCodeCreatedMessageBuilder.java | 452 ++++++++++++++++++ .../DiscountCodeCreatedMessageImpl.java | 296 ++++++++++++ .../DiscountCodeCreatedMessagePayload.java | 131 +++++ ...countCodeCreatedMessagePayloadBuilder.java | 108 +++++ ...DiscountCodeCreatedMessagePayloadImpl.java | 95 ++++ .../message/DiscountCodeDeletedMessage.java | 136 ++++++ .../DiscountCodeDeletedMessageBuilder.java | 402 ++++++++++++++++ .../DiscountCodeDeletedMessageImpl.java | 276 +++++++++++ .../DiscountCodeDeletedMessagePayload.java | 108 +++++ ...countCodeDeletedMessagePayloadBuilder.java | 57 +++ ...DiscountCodeDeletedMessagePayloadImpl.java | 65 +++ .../message/DiscountCodeKeySetMessage.java | 170 +++++++ .../DiscountCodeKeySetMessageBuilder.java | 452 ++++++++++++++++++ .../DiscountCodeKeySetMessageImpl.java | 315 ++++++++++++ .../DiscountCodeKeySetMessagePayload.java | 141 ++++++ ...scountCodeKeySetMessagePayloadBuilder.java | 109 +++++ .../DiscountCodeKeySetMessagePayloadImpl.java | 113 +++++ .../api/models/message/Message.java | 39 ++ .../api/models/message/MessageBuilder.java | 12 + .../api/models/message/MessagePayload.java | 39 ++ .../models/message/MessagePayloadBuilder.java | 12 + .../DiscountCodeDraftQueryBuilderDsl.java | 5 + .../DiscountCodeQueryBuilderDsl.java | 5 + ...scountCodeSetKeyActionQueryBuilderDsl.java | 25 + ...scountCodeUpdateActionQueryBuilderDsl.java | 7 + ...eCreatedMessagePayloadQueryBuilderDsl.java | 32 ++ ...ountCodeCreatedMessageQueryBuilderDsl.java | 104 ++++ ...eDeletedMessagePayloadQueryBuilderDsl.java | 20 + ...ountCodeDeletedMessageQueryBuilderDsl.java | 94 ++++ ...deKeySetMessagePayloadQueryBuilderDsl.java | 31 ++ ...countCodeKeySetMessageQueryBuilderDsl.java | 105 ++++ .../MessagePayloadQueryBuilderDsl.java | 24 + .../query/message/MessageQueryBuilderDsl.java | 21 + ...ByProjectKeyDiscountCodesKeyByKeyTest.java | 166 +++++++ .../discount_code/DiscountCodeDraftTest.java | 9 +- .../DiscountCodeSetKeyActionTest.java | 36 ++ .../discount_code/DiscountCodeTest.java | 9 +- ...DiscountCodeCreatedMessagePayloadTest.java | 38 ++ .../DiscountCodeCreatedMessageTest.java | 38 ++ ...DiscountCodeDeletedMessagePayloadTest.java | 13 + .../DiscountCodeDeletedMessageTest.java | 13 + .../DiscountCodeKeySetMessagePayloadTest.java | 44 ++ .../DiscountCodeKeySetMessageTest.java | 44 ++ references.txt | 1 + 68 files changed, 6323 insertions(+), 13 deletions(-) create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyDelete.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyGet.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyHead.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyPost.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyPostString.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyRequestBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeSetKeyAction.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeSetKeyActionBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeSetKeyActionImpl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessage.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessageBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessageImpl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessagePayload.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessagePayloadBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessagePayloadImpl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessage.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessageBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessageImpl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessagePayload.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessagePayloadBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessagePayloadImpl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessage.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessageBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessageImpl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessagePayload.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessagePayloadBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessagePayloadImpl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/discount_code/DiscountCodeSetKeyActionQueryBuilderDsl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeCreatedMessagePayloadQueryBuilderDsl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeCreatedMessageQueryBuilderDsl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeDeletedMessagePayloadQueryBuilderDsl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeDeletedMessageQueryBuilderDsl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeKeySetMessagePayloadQueryBuilderDsl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeKeySetMessageQueryBuilderDsl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyDiscountCodesKeyByKeyTest.java create mode 100644 commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/discount_code/DiscountCodeSetKeyActionTest.java create mode 100644 commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessagePayloadTest.java create mode 100644 commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessageTest.java create mode 100644 commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessagePayloadTest.java create mode 100644 commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessageTest.java create mode 100644 commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessagePayloadTest.java create mode 100644 commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessageTest.java diff --git a/changes.md b/changes.md index 71a6410f897..104b9c31004 100644 --- a/changes.md +++ b/changes.md @@ -1,9 +1,41 @@ **Api changes** +
+Added Method(s) + +- added method `apiRoot.withProjectKey().discountCodes().withKey().get()` +- added method `apiRoot.withProjectKey().discountCodes().withKey().head()` +- added method `apiRoot.withProjectKey().discountCodes().withKey().post()` +- added method `apiRoot.withProjectKey().discountCodes().withKey().delete()` +
+ +
Added Property(s) - added property `perMethodExternalTaxRate` to type `CartAddLineItemAction` +- added property `key` to type `DiscountCode` +- added property `key` to type `DiscountCodeDraft` - added property `shippingMode` to type `MyCartDraft`
+ +
+Added Resource(s) + +- added resource `/{projectKey}/discount-codes/key={key}` +
+ + +
+Added Type(s) + +- added type `DiscountCodeSetKeyAction` +- added type `DiscountCodeCreatedMessage` +- added type `DiscountCodeDeletedMessage` +- added type `DiscountCodeKeySetMessage` +- added type `DiscountCodeCreatedMessagePayload` +- added type `DiscountCodeDeletedMessagePayload` +- added type `DiscountCodeKeySetMessagePayload` +
+ 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 b3e8f0ee30d..579acf6a69a 100644 --- a/commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls +++ b/commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls @@ -3880,6 +3880,7 @@ type DirectDiscountDraftOutput { "With discount codes it is possible to give specific cart discounts to an eligible amount of users. They are defined by a string value which can be added to a cart so that specific cart discounts can be applied to the cart." type DiscountCode implements Versioned & ReferenceExpandable { code: String! + key: String isActive: Boolean! maxApplications: Long maxApplicationsPerCustomer: Long @@ -3917,9 +3918,19 @@ type DiscountCode implements Versioned & ReferenceExpandable { lastModifiedBy: Initiator } +type DiscountCodeCreated implements MessagePayload { + discountCode: DiscountCode! + type: String! +} + +type DiscountCodeDeleted implements MessagePayload { + type: String! +} + input DiscountCodeDraft { code: String! name: [LocalizedStringItemInputType!] + key: String description: [LocalizedStringItemInputType!] cartDiscounts: [ReferenceInput!]! isActive: Boolean = true @@ -3938,6 +3949,12 @@ type DiscountCodeInfo { discountCode: DiscountCode } +type DiscountCodeKeySet implements MessagePayload { + key: String + oldKey: String + type: String! +} + type DiscountCodeQueryResult { offset: Int! count: Int! @@ -3974,6 +3991,7 @@ input DiscountCodeUpdateAction { setCustomField: SetDiscountCodeCustomField setCustomType: SetDiscountCodeCustomType setDescription: SetDiscountCodeDescription + setKey: SetDiscountCodeKey setMaxApplications: SetDiscountCodeMaxApplications setMaxApplicationsPerCustomer: SetDiscountCodeMaxApplicationsPerCustomer setName: SetDiscountCodeName @@ -5425,8 +5443,20 @@ type Mutation { "Queries with specified key" key: String): TaxCategory createDiscountCode(draft: DiscountCodeDraft!): DiscountCode - updateDiscountCode(id: String!, version: Long!, actions: [DiscountCodeUpdateAction!]!): DiscountCode - deleteDiscountCode(id: String!, version: Long!): DiscountCode + updateDiscountCode(version: Long!, actions: [DiscountCodeUpdateAction!]!, + + "Queries with specified ID" + id: String, + + "Queries with specified key" + key: String): DiscountCode + deleteDiscountCode(version: Long!, + + "Queries with specified ID" + id: String, + + "Queries with specified key" + key: String): DiscountCode createCartDiscount(draft: CartDiscountDraft!, "The mutation is only performed if the resource is part of the store. Can be used with store-specific OAuth permissions." @@ -8471,7 +8501,12 @@ type Query { "Queries with specified key" key: String): CartDiscount cartDiscounts(where: String, sort: [String!], limit: Int, offset: Int): CartDiscountQueryResult! - discountCode(id: String!): DiscountCode + discountCode( + "Queries with specified ID" + id: String, + + "Queries with specified key" + key: String): DiscountCode discountCodes(where: String, sort: [String!], limit: Int, offset: Int): DiscountCodeQueryResult! productDiscount( "Queries with specified ID" @@ -10451,6 +10486,10 @@ input SetDiscountCodeDescription { description: [LocalizedStringItemInputType!] } +input SetDiscountCodeKey { + key: String +} + input SetDiscountCodeMaxApplications { maxApplications: Long } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesByIDDelete.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesByIDDelete.java index cd6c64b5e48..884703effef 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesByIDDelete.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesByIDDelete.java @@ -20,6 +20,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder; /** + *

Deleting a Discount Code produces the DiscountCodeDeleted Message.

*

Deprecated scope: manage_orders:{projectKey}

* *
diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyDelete.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyDelete.java new file mode 100644 index 00000000000..50c395bd156 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyDelete.java @@ -0,0 +1,380 @@ + +package com.commercetools.api.client; + +import java.net.URI; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import com.fasterxml.jackson.core.type.TypeReference; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + *

Deleting a Discount Code produces the DiscountCodeDeleted Message.

+ *

Deprecated scope: manage_orders:{projectKey}

+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .discountCodes()
+ *            .withKey("{key}")
+ *            .delete()
+ *            .withVersion(version)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyDiscountCodesKeyByKeyDelete extends + TypeApiMethod + implements com.commercetools.api.client.DataerasureTrait, + com.commercetools.api.client.VersionedTrait, + com.commercetools.api.client.ConflictingTrait, + com.commercetools.api.client.ExpandableTrait, + com.commercetools.api.client.ErrorableTrait, + com.commercetools.api.client.Deprecatable200Trait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String key; + + public ByProjectKeyDiscountCodesKeyByKeyDelete(final ApiHttpClient apiHttpClient, String projectKey, String key) { + super(apiHttpClient); + this.projectKey = projectKey; + this.key = key; + } + + public ByProjectKeyDiscountCodesKeyByKeyDelete(ByProjectKeyDiscountCodesKeyByKeyDelete t) { + super(t); + this.projectKey = t.projectKey; + this.key = t.key; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/discount-codes/key=%s", this.projectKey, this.key); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.DELETE, URI.create(httpRequestPath), getHeaders(), null); + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.discount_code.DiscountCode.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.discount_code.DiscountCode.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getKey() { + return this.key; + } + + public List getDataErasure() { + return this.getQueryParam("dataErasure"); + } + + public List getVersion() { + return this.getQueryParam("version"); + } + + public List getExpand() { + return this.getQueryParam("expand"); + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setKey(final String key) { + this.key = key; + } + + /** + * set dataErasure with the specified value + * @param dataErasure value to be set + * @param value type + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete withDataErasure(final TValue dataErasure) { + return copy().withQueryParam("dataErasure", dataErasure); + } + + /** + * add additional dataErasure query parameter + * @param dataErasure value to be added + * @param value type + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete addDataErasure(final TValue dataErasure) { + return copy().addQueryParam("dataErasure", dataErasure); + } + + /** + * set dataErasure with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete withDataErasure(final Supplier supplier) { + return copy().withQueryParam("dataErasure", supplier.get()); + } + + /** + * add additional dataErasure query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete addDataErasure(final Supplier supplier) { + return copy().addQueryParam("dataErasure", supplier.get()); + } + + /** + * set dataErasure with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete withDataErasure(final Function op) { + return copy().withQueryParam("dataErasure", op.apply(new StringBuilder())); + } + + /** + * add additional dataErasure query parameter + * @param op builder for the value to be added + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete addDataErasure(final Function op) { + return copy().addQueryParam("dataErasure", op.apply(new StringBuilder())); + } + + /** + * set dataErasure with the specified values + * @param dataErasure values to be set + * @param value type + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete withDataErasure(final Collection dataErasure) { + return copy().withoutQueryParam("dataErasure") + .addQueryParams(dataErasure.stream() + .map(s -> new ParamEntry<>("dataErasure", s.toString())) + .collect(Collectors.toList())); + } + + /** + * add additional dataErasure query parameters + * @param dataErasure values to be added + * @param value type + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete addDataErasure(final Collection dataErasure) { + return copy().addQueryParams( + dataErasure.stream().map(s -> new ParamEntry<>("dataErasure", s.toString())).collect(Collectors.toList())); + } + + /** + * set version with the specified value + * @param version value to be set + * @param value type + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete withVersion(final TValue version) { + return copy().withQueryParam("version", version); + } + + /** + * add additional version query parameter + * @param version value to be added + * @param value type + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete addVersion(final TValue version) { + return copy().addQueryParam("version", version); + } + + /** + * set version with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete withVersion(final Supplier supplier) { + return copy().withQueryParam("version", supplier.get()); + } + + /** + * add additional version query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete addVersion(final Supplier supplier) { + return copy().addQueryParam("version", supplier.get()); + } + + /** + * set version with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete withVersion(final Function op) { + return copy().withQueryParam("version", op.apply(new StringBuilder())); + } + + /** + * add additional version query parameter + * @param op builder for the value to be added + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete addVersion(final Function op) { + return copy().addQueryParam("version", op.apply(new StringBuilder())); + } + + /** + * set version with the specified values + * @param version values to be set + * @param value type + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete withVersion(final Collection version) { + return copy().withoutQueryParam("version") + .addQueryParams( + version.stream().map(s -> new ParamEntry<>("version", s.toString())).collect(Collectors.toList())); + } + + /** + * add additional version query parameters + * @param version values to be added + * @param value type + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete addVersion(final Collection version) { + return copy().addQueryParams( + version.stream().map(s -> new ParamEntry<>("version", s.toString())).collect(Collectors.toList())); + } + + /** + * set expand with the specified value + * @param expand value to be set + * @param value type + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete addExpand(final TValue expand) { + return copy().addQueryParam("expand", expand); + } + + /** + * set expand with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete withExpand(final Supplier supplier) { + return copy().withQueryParam("expand", supplier.get()); + } + + /** + * add additional expand query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete addExpand(final Supplier supplier) { + return copy().addQueryParam("expand", supplier.get()); + } + + /** + * set expand with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete withExpand(final Function op) { + return copy().withQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * add additional expand query parameter + * @param op builder for the value to be added + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete addExpand(final Function op) { + return copy().addQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * set expand with the specified values + * @param expand values to be set + * @param value type + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete withExpand(final Collection expand) { + return copy().withoutQueryParam("expand") + .addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + /** + * add additional expand query parameters + * @param expand values to be added + * @param value type + * @return ByProjectKeyDiscountCodesKeyByKeyDelete + */ + public ByProjectKeyDiscountCodesKeyByKeyDelete addExpand(final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyDiscountCodesKeyByKeyDelete that = (ByProjectKeyDiscountCodesKeyByKeyDelete) o; + + return new EqualsBuilder().append(projectKey, that.projectKey).append(key, that.key).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(key).toHashCode(); + } + + @Override + protected ByProjectKeyDiscountCodesKeyByKeyDelete copy() { + return new ByProjectKeyDiscountCodesKeyByKeyDelete(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyGet.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyGet.java new file mode 100644 index 00000000000..cbc48fe8c67 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyGet.java @@ -0,0 +1,208 @@ + +package com.commercetools.api.client; + +import java.net.URI; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import com.fasterxml.jackson.core.type.TypeReference; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + *

Deprecated scope: view_orders:{projectKey}

+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .discountCodes()
+ *            .withKey("{key}")
+ *            .get()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyDiscountCodesKeyByKeyGet extends + TypeApiMethod + implements com.commercetools.api.client.ExpandableTrait, + com.commercetools.api.client.ErrorableTrait, + com.commercetools.api.client.Deprecatable200Trait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String key; + + public ByProjectKeyDiscountCodesKeyByKeyGet(final ApiHttpClient apiHttpClient, String projectKey, String key) { + super(apiHttpClient); + this.projectKey = projectKey; + this.key = key; + } + + public ByProjectKeyDiscountCodesKeyByKeyGet(ByProjectKeyDiscountCodesKeyByKeyGet t) { + super(t); + this.projectKey = t.projectKey; + this.key = t.key; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/discount-codes/key=%s", this.projectKey, this.key); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.GET, URI.create(httpRequestPath), getHeaders(), null); + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.discount_code.DiscountCode.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.discount_code.DiscountCode.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getKey() { + return this.key; + } + + public List getExpand() { + return this.getQueryParam("expand"); + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setKey(final String key) { + this.key = key; + } + + /** + * set expand with the specified value + * @param expand value to be set + * @param value type + * @return ByProjectKeyDiscountCodesKeyByKeyGet + */ + public ByProjectKeyDiscountCodesKeyByKeyGet withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyDiscountCodesKeyByKeyGet + */ + public ByProjectKeyDiscountCodesKeyByKeyGet addExpand(final TValue expand) { + return copy().addQueryParam("expand", expand); + } + + /** + * set expand with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyDiscountCodesKeyByKeyGet + */ + public ByProjectKeyDiscountCodesKeyByKeyGet withExpand(final Supplier supplier) { + return copy().withQueryParam("expand", supplier.get()); + } + + /** + * add additional expand query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyDiscountCodesKeyByKeyGet + */ + public ByProjectKeyDiscountCodesKeyByKeyGet addExpand(final Supplier supplier) { + return copy().addQueryParam("expand", supplier.get()); + } + + /** + * set expand with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyDiscountCodesKeyByKeyGet + */ + public ByProjectKeyDiscountCodesKeyByKeyGet withExpand(final Function op) { + return copy().withQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * add additional expand query parameter + * @param op builder for the value to be added + * @return ByProjectKeyDiscountCodesKeyByKeyGet + */ + public ByProjectKeyDiscountCodesKeyByKeyGet addExpand(final Function op) { + return copy().addQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * set expand with the specified values + * @param expand values to be set + * @param value type + * @return ByProjectKeyDiscountCodesKeyByKeyGet + */ + public ByProjectKeyDiscountCodesKeyByKeyGet withExpand(final Collection expand) { + return copy().withoutQueryParam("expand") + .addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + /** + * add additional expand query parameters + * @param expand values to be added + * @param value type + * @return ByProjectKeyDiscountCodesKeyByKeyGet + */ + public ByProjectKeyDiscountCodesKeyByKeyGet addExpand(final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyDiscountCodesKeyByKeyGet that = (ByProjectKeyDiscountCodesKeyByKeyGet) o; + + return new EqualsBuilder().append(projectKey, that.projectKey).append(key, that.key).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(key).toHashCode(); + } + + @Override + protected ByProjectKeyDiscountCodesKeyByKeyGet copy() { + return new ByProjectKeyDiscountCodesKeyByKeyGet(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyHead.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyHead.java new file mode 100644 index 00000000000..b82bb463d31 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyHead.java @@ -0,0 +1,120 @@ + +package com.commercetools.api.client; + +import java.net.URI; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +import com.fasterxml.jackson.core.type.TypeReference; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + *

Checks if a DiscountCode exists for a given key. Returns a 200 OK status if the DiscountCode exists or a 404 Not Found otherwise.

+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .discountCodes()
+ *            .withKey("{key}")
+ *            .head()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyDiscountCodesKeyByKeyHead + extends TypeApiMethod + implements com.commercetools.api.client.ErrorableTrait, + com.commercetools.api.client.Deprecatable200Trait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String key; + + public ByProjectKeyDiscountCodesKeyByKeyHead(final ApiHttpClient apiHttpClient, String projectKey, String key) { + super(apiHttpClient); + this.projectKey = projectKey; + this.key = key; + } + + public ByProjectKeyDiscountCodesKeyByKeyHead(ByProjectKeyDiscountCodesKeyByKeyHead t) { + super(t); + this.projectKey = t.projectKey; + this.key = t.key; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/discount-codes/key=%s", this.projectKey, this.key); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.HEAD, URI.create(httpRequestPath), getHeaders(), null); + } + + @Override + public ApiHttpResponse executeBlocking(final ApiHttpClient client, + final Duration timeout) { + return executeBlocking(client, timeout, com.fasterxml.jackson.databind.JsonNode.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.fasterxml.jackson.databind.JsonNode.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getKey() { + return this.key; + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setKey(final String key) { + this.key = key; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyDiscountCodesKeyByKeyHead that = (ByProjectKeyDiscountCodesKeyByKeyHead) o; + + return new EqualsBuilder().append(projectKey, that.projectKey).append(key, that.key).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(key).toHashCode(); + } + + @Override + protected ByProjectKeyDiscountCodesKeyByKeyHead copy() { + return new ByProjectKeyDiscountCodesKeyByKeyHead(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyPost.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyPost.java new file mode 100644 index 00000000000..0bacdc01e66 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyPost.java @@ -0,0 +1,231 @@ + +package com.commercetools.api.client; + +import java.net.URI; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import com.fasterxml.jackson.core.type.TypeReference; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + *

Deprecated scope: manage_orders:{projectKey}

+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .discountCodes()
+ *            .withKey("{key}")
+ *            .post(null)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyDiscountCodesKeyByKeyPost extends + TypeBodyApiMethod + implements com.commercetools.api.client.ConflictingTrait, + com.commercetools.api.client.ExpandableTrait, + com.commercetools.api.client.Deprecatable200Trait, + com.commercetools.api.client.ErrorableTrait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String key; + + private com.commercetools.api.models.discount_code.DiscountCodeUpdate discountCodeUpdate; + + public ByProjectKeyDiscountCodesKeyByKeyPost(final ApiHttpClient apiHttpClient, String projectKey, String key, + com.commercetools.api.models.discount_code.DiscountCodeUpdate discountCodeUpdate) { + super(apiHttpClient); + this.projectKey = projectKey; + this.key = key; + this.discountCodeUpdate = discountCodeUpdate; + } + + public ByProjectKeyDiscountCodesKeyByKeyPost(ByProjectKeyDiscountCodesKeyByKeyPost t) { + super(t); + this.projectKey = t.projectKey; + this.key = t.key; + this.discountCodeUpdate = t.discountCodeUpdate; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/discount-codes/key=%s", this.projectKey, this.key); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(), + io.vrap.rmf.base.client.utils.json.JsonUtils + .executing(() -> apiHttpClient().getSerializerService().toJsonByteArray(discountCodeUpdate))); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.discount_code.DiscountCode.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.discount_code.DiscountCode.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getKey() { + return this.key; + } + + public List getExpand() { + return this.getQueryParam("expand"); + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setKey(final String key) { + this.key = key; + } + + /** + * set expand with the specified value + * @param expand value to be set + * @param value type + * @return ByProjectKeyDiscountCodesKeyByKeyPost + */ + public ByProjectKeyDiscountCodesKeyByKeyPost withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyDiscountCodesKeyByKeyPost + */ + public ByProjectKeyDiscountCodesKeyByKeyPost addExpand(final TValue expand) { + return copy().addQueryParam("expand", expand); + } + + /** + * set expand with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyDiscountCodesKeyByKeyPost + */ + public ByProjectKeyDiscountCodesKeyByKeyPost withExpand(final Supplier supplier) { + return copy().withQueryParam("expand", supplier.get()); + } + + /** + * add additional expand query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyDiscountCodesKeyByKeyPost + */ + public ByProjectKeyDiscountCodesKeyByKeyPost addExpand(final Supplier supplier) { + return copy().addQueryParam("expand", supplier.get()); + } + + /** + * set expand with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyDiscountCodesKeyByKeyPost + */ + public ByProjectKeyDiscountCodesKeyByKeyPost withExpand(final Function op) { + return copy().withQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * add additional expand query parameter + * @param op builder for the value to be added + * @return ByProjectKeyDiscountCodesKeyByKeyPost + */ + public ByProjectKeyDiscountCodesKeyByKeyPost addExpand(final Function op) { + return copy().addQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * set expand with the specified values + * @param expand values to be set + * @param value type + * @return ByProjectKeyDiscountCodesKeyByKeyPost + */ + public ByProjectKeyDiscountCodesKeyByKeyPost withExpand(final Collection expand) { + return copy().withoutQueryParam("expand") + .addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + /** + * add additional expand query parameters + * @param expand values to be added + * @param value type + * @return ByProjectKeyDiscountCodesKeyByKeyPost + */ + public ByProjectKeyDiscountCodesKeyByKeyPost addExpand(final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public com.commercetools.api.models.discount_code.DiscountCodeUpdate getBody() { + return discountCodeUpdate; + } + + public ByProjectKeyDiscountCodesKeyByKeyPost withBody( + com.commercetools.api.models.discount_code.DiscountCodeUpdate discountCodeUpdate) { + ByProjectKeyDiscountCodesKeyByKeyPost t = copy(); + t.discountCodeUpdate = discountCodeUpdate; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyDiscountCodesKeyByKeyPost that = (ByProjectKeyDiscountCodesKeyByKeyPost) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(key, that.key) + .append(discountCodeUpdate, that.discountCodeUpdate) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(key).append(discountCodeUpdate).toHashCode(); + } + + @Override + protected ByProjectKeyDiscountCodesKeyByKeyPost copy() { + return new ByProjectKeyDiscountCodesKeyByKeyPost(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyPostString.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyPostString.java new file mode 100644 index 00000000000..a5fc20b26ee --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyPostString.java @@ -0,0 +1,230 @@ + +package com.commercetools.api.client; + +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import com.fasterxml.jackson.core.type.TypeReference; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + *

Deprecated scope: manage_orders:{projectKey}

+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .discountCodes()
+ *            .withKey("{key}")
+ *            .post("")
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyDiscountCodesKeyByKeyPostString extends + StringBodyApiMethod + implements com.commercetools.api.client.ConflictingTrait, + com.commercetools.api.client.ExpandableTrait, + com.commercetools.api.client.Deprecatable200Trait, + com.commercetools.api.client.ErrorableTrait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String key; + + private String discountCodeUpdate; + + public ByProjectKeyDiscountCodesKeyByKeyPostString(final ApiHttpClient apiHttpClient, String projectKey, String key, + String discountCodeUpdate) { + super(apiHttpClient); + this.projectKey = projectKey; + this.key = key; + this.discountCodeUpdate = discountCodeUpdate; + } + + public ByProjectKeyDiscountCodesKeyByKeyPostString(ByProjectKeyDiscountCodesKeyByKeyPostString t) { + super(t); + this.projectKey = t.projectKey; + this.key = t.key; + this.discountCodeUpdate = t.discountCodeUpdate; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/discount-codes/key=%s", this.projectKey, this.key); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(), + discountCodeUpdate.getBytes(StandardCharsets.UTF_8)); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.discount_code.DiscountCode.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.discount_code.DiscountCode.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getKey() { + return this.key; + } + + public List getExpand() { + return this.getQueryParam("expand"); + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setKey(final String key) { + this.key = key; + } + + /** + * set expand with the specified value + * @param value type + * @param expand value to be set + * @return ByProjectKeyDiscountCodesKeyByKeyPostString + */ + public ByProjectKeyDiscountCodesKeyByKeyPostString withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param value type + * @param expand value to be added + * @return ByProjectKeyDiscountCodesKeyByKeyPostString + */ + public ByProjectKeyDiscountCodesKeyByKeyPostString addExpand(final TValue expand) { + return copy().addQueryParam("expand", expand); + } + + /** + * set expand with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyDiscountCodesKeyByKeyPostString + */ + public ByProjectKeyDiscountCodesKeyByKeyPostString withExpand(final Supplier supplier) { + return copy().withQueryParam("expand", supplier.get()); + } + + /** + * add additional expand query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyDiscountCodesKeyByKeyPostString + */ + public ByProjectKeyDiscountCodesKeyByKeyPostString addExpand(final Supplier supplier) { + return copy().addQueryParam("expand", supplier.get()); + } + + /** + * set expand with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyDiscountCodesKeyByKeyPostString + */ + public ByProjectKeyDiscountCodesKeyByKeyPostString withExpand(final Function op) { + return copy().withQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * add additional expand query parameter + * @param op builder for the value to be added + * @return ByProjectKeyDiscountCodesKeyByKeyPostString + */ + public ByProjectKeyDiscountCodesKeyByKeyPostString addExpand(final Function op) { + return copy().addQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * set expand with the specified values + * @param value type + * @param expand values to be set + * @return ByProjectKeyDiscountCodesKeyByKeyPostString + */ + public ByProjectKeyDiscountCodesKeyByKeyPostString withExpand(final Collection expand) { + return copy().withoutQueryParam("expand") + .addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + /** + * add additional expand query parameters + * @param value type + * @param expand values to be added + * @return ByProjectKeyDiscountCodesKeyByKeyPostString + */ + public ByProjectKeyDiscountCodesKeyByKeyPostString addExpand(final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public String getBody() { + return discountCodeUpdate; + } + + public ByProjectKeyDiscountCodesKeyByKeyPostString withBody(String discountCodeUpdate) { + ByProjectKeyDiscountCodesKeyByKeyPostString t = copy(); + t.discountCodeUpdate = discountCodeUpdate; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyDiscountCodesKeyByKeyPostString that = (ByProjectKeyDiscountCodesKeyByKeyPostString) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(key, that.key) + .append(discountCodeUpdate, that.discountCodeUpdate) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(key).append(discountCodeUpdate).toHashCode(); + } + + @Override + protected ByProjectKeyDiscountCodesKeyByKeyPostString copy() { + return new ByProjectKeyDiscountCodesKeyByKeyPostString(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyRequestBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyRequestBuilder.java new file mode 100644 index 00000000000..1562de999dc --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesKeyByKeyRequestBuilder.java @@ -0,0 +1,53 @@ + +package com.commercetools.api.client; + +import java.util.function.UnaryOperator; + +import io.vrap.rmf.base.client.ApiHttpClient; +import io.vrap.rmf.base.client.utils.Generated; + +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyDiscountCodesKeyByKeyRequestBuilder { + + private final ApiHttpClient apiHttpClient; + private final String projectKey; + private final String key; + + public ByProjectKeyDiscountCodesKeyByKeyRequestBuilder(final ApiHttpClient apiHttpClient, final String projectKey, + final String key) { + this.apiHttpClient = apiHttpClient; + this.projectKey = projectKey; + this.key = key; + } + + public ByProjectKeyDiscountCodesKeyByKeyGet get() { + return new ByProjectKeyDiscountCodesKeyByKeyGet(apiHttpClient, projectKey, key); + } + + public ByProjectKeyDiscountCodesKeyByKeyHead head() { + return new ByProjectKeyDiscountCodesKeyByKeyHead(apiHttpClient, projectKey, key); + } + + public ByProjectKeyDiscountCodesKeyByKeyPost post( + com.commercetools.api.models.discount_code.DiscountCodeUpdate discountCodeUpdate) { + return new ByProjectKeyDiscountCodesKeyByKeyPost(apiHttpClient, projectKey, key, discountCodeUpdate); + } + + public ByProjectKeyDiscountCodesKeyByKeyPostString post(final String discountCodeUpdate) { + return new ByProjectKeyDiscountCodesKeyByKeyPostString(apiHttpClient, projectKey, key, discountCodeUpdate); + } + + public ByProjectKeyDiscountCodesKeyByKeyPost post( + UnaryOperator op) { + return post(op.apply(com.commercetools.api.models.discount_code.DiscountCodeUpdateBuilder.of()).build()); + } + + public ByProjectKeyDiscountCodesKeyByKeyDelete delete() { + return new ByProjectKeyDiscountCodesKeyByKeyDelete(apiHttpClient, projectKey, key); + } + + public ByProjectKeyDiscountCodesKeyByKeyDelete delete(TValue version) { + return delete().withVersion(version); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesPost.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesPost.java index 6b36a3f7ebd..61fef7d1317 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesPost.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesPost.java @@ -20,6 +20,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder; /** + *

Creating a Discount Code produces the DiscountCodeCreated Message.

*

Deprecated scope: manage_orders:{projectKey}

* *
diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesPostString.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesPostString.java index f736b8bcc7b..d90f6e87570 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesPostString.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesPostString.java @@ -21,6 +21,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder; /** + *

Creating a Discount Code produces the DiscountCodeCreated Message.

*

Deprecated scope: manage_orders:{projectKey}

* *
diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesRequestBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesRequestBuilder.java index 960f11d163d..ea01f79984d 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesRequestBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountCodesRequestBuilder.java @@ -43,4 +43,8 @@ public ByProjectKeyDiscountCodesByIDRequestBuilder withId(String ID) { return new ByProjectKeyDiscountCodesByIDRequestBuilder(apiHttpClient, projectKey, ID); } + public ByProjectKeyDiscountCodesKeyByKeyRequestBuilder withKey(String key) { + return new ByProjectKeyDiscountCodesKeyByKeyRequestBuilder(apiHttpClient, projectKey, key); + } + } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCode.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCode.java index a8927f0b791..0d082ecd3a3 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCode.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCode.java @@ -60,6 +60,14 @@ public interface DiscountCode @JsonProperty("id") public String getId(); + /** + *

User-defined unique identifier of the DiscountCode.

+ * @return key + */ + + @JsonProperty("key") + public String getKey(); + /** *

Current version of the DiscountCode.

* @return version @@ -221,6 +229,13 @@ public interface DiscountCode public void setId(final String id); + /** + *

User-defined unique identifier of the DiscountCode.

+ * @param key value to be set + */ + + public void setKey(final String key); + /** *

Current version of the DiscountCode.

* @param version value to be set @@ -397,6 +412,7 @@ public static DiscountCode of(final DiscountCode template) { instance.setVersion(template.getVersion()); instance.setCreatedAt(template.getCreatedAt()); instance.setLastModifiedAt(template.getLastModifiedAt()); + instance.setKey(template.getKey()); instance.setLastModifiedBy(template.getLastModifiedBy()); instance.setCreatedBy(template.getCreatedBy()); instance.setName(template.getName()); @@ -431,6 +447,7 @@ public static DiscountCode deepCopy(@Nullable final DiscountCode template) { instance.setVersion(template.getVersion()); instance.setCreatedAt(template.getCreatedAt()); instance.setLastModifiedAt(template.getLastModifiedAt()); + instance.setKey(template.getKey()); instance.setLastModifiedBy( com.commercetools.api.models.common.LastModifiedBy.deepCopy(template.getLastModifiedBy())); instance.setCreatedBy(com.commercetools.api.models.common.CreatedBy.deepCopy(template.getCreatedBy())); diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeBuilder.java index 5aa7ad67a95..c842d800a82 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeBuilder.java @@ -40,6 +40,9 @@ public class DiscountCodeBuilder implements Builder { private java.time.ZonedDateTime lastModifiedAt; + @Nullable + private String key; + @Nullable private com.commercetools.api.models.common.LastModifiedBy lastModifiedBy; @@ -127,6 +130,17 @@ public DiscountCodeBuilder lastModifiedAt(final java.time.ZonedDateTime lastModi return this; } + /** + *

User-defined unique identifier of the DiscountCode.

+ * @param key value to be set + * @return Builder + */ + + public DiscountCodeBuilder key(@Nullable final String key) { + this.key = key; + return this; + } + /** *

Present on resources created after 1 February 2019 except for events not tracked.

* @param builder function to build the lastModifiedBy value @@ -622,6 +636,16 @@ public java.time.ZonedDateTime getLastModifiedAt() { return this.lastModifiedAt; } + /** + *

User-defined unique identifier of the DiscountCode.

+ * @return key + */ + + @Nullable + public String getKey() { + return this.key; + } + /** *

Present on resources created after 1 February 2019 except for events not tracked.

* @return lastModifiedBy @@ -791,7 +815,7 @@ public DiscountCode build() { Objects.requireNonNull(isActive, DiscountCode.class + ": isActive is missing"); Objects.requireNonNull(references, DiscountCode.class + ": references is missing"); Objects.requireNonNull(groups, DiscountCode.class + ": groups is missing"); - return new DiscountCodeImpl(id, version, createdAt, lastModifiedAt, lastModifiedBy, createdBy, name, + return new DiscountCodeImpl(id, version, createdAt, lastModifiedAt, key, lastModifiedBy, createdBy, name, description, code, cartDiscounts, cartPredicate, isActive, references, maxApplications, maxApplicationsPerCustomer, custom, groups, validFrom, validUntil, applicationVersion); } @@ -801,7 +825,7 @@ public DiscountCode build() { * @return DiscountCode */ public DiscountCode buildUnchecked() { - return new DiscountCodeImpl(id, version, createdAt, lastModifiedAt, lastModifiedBy, createdBy, name, + return new DiscountCodeImpl(id, version, createdAt, lastModifiedAt, key, lastModifiedBy, createdBy, name, description, code, cartDiscounts, cartPredicate, isActive, references, maxApplications, maxApplicationsPerCustomer, custom, groups, validFrom, validUntil, applicationVersion); } @@ -825,6 +849,7 @@ public static DiscountCodeBuilder of(final DiscountCode template) { builder.version = template.getVersion(); builder.createdAt = template.getCreatedAt(); builder.lastModifiedAt = template.getLastModifiedAt(); + builder.key = template.getKey(); builder.lastModifiedBy = template.getLastModifiedBy(); builder.createdBy = template.getCreatedBy(); builder.name = template.getName(); diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeDraft.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeDraft.java index aa2e782099d..a67b5570a65 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeDraft.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeDraft.java @@ -38,6 +38,14 @@ public interface DiscountCodeDraft extends com.commercetools.api.models.CustomizableDraft, io.vrap.rmf.base.client.Draft { + /** + *

User-defined unique identifier for the DiscountCode.

+ * @return key + */ + + @JsonProperty("key") + public String getKey(); + /** *

Name of the DiscountCode.

* @return name @@ -135,6 +143,13 @@ public interface DiscountCodeDraft extends com.commercetools.api.models.Customiz @JsonProperty("validUntil") public ZonedDateTime getValidUntil(); + /** + *

User-defined unique identifier for the DiscountCode.

+ * @param key value to be set + */ + + public void setKey(final String key); + /** *

Name of the DiscountCode.

* @param name value to be set @@ -250,6 +265,7 @@ public static DiscountCodeDraft of() { */ public static DiscountCodeDraft of(final DiscountCodeDraft template) { DiscountCodeDraftImpl instance = new DiscountCodeDraftImpl(); + instance.setKey(template.getKey()); instance.setName(template.getName()); instance.setDescription(template.getDescription()); instance.setCode(template.getCode()); @@ -276,6 +292,7 @@ public static DiscountCodeDraft deepCopy(@Nullable final DiscountCodeDraft templ return null; } DiscountCodeDraftImpl instance = new DiscountCodeDraftImpl(); + instance.setKey(template.getKey()); instance.setName(com.commercetools.api.models.common.LocalizedString.deepCopy(template.getName())); instance.setDescription( com.commercetools.api.models.common.LocalizedString.deepCopy(template.getDescription())); diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeDraftBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeDraftBuilder.java index 77bff2e91ce..6671e7a9175 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeDraftBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeDraftBuilder.java @@ -25,6 +25,9 @@ @Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") public class DiscountCodeDraftBuilder implements Builder { + @Nullable + private String key; + @Nullable private com.commercetools.api.models.common.LocalizedString name; @@ -59,6 +62,17 @@ public class DiscountCodeDraftBuilder implements Builder { @Nullable private java.time.ZonedDateTime validUntil; + /** + *

User-defined unique identifier for the DiscountCode.

+ * @param key value to be set + * @return Builder + */ + + public DiscountCodeDraftBuilder key(@Nullable final String key) { + this.key = key; + return this; + } + /** *

Name of the DiscountCode.

* @param builder function to build the name value @@ -373,6 +387,16 @@ public DiscountCodeDraftBuilder validUntil(@Nullable final java.time.ZonedDateTi return this; } + /** + *

User-defined unique identifier for the DiscountCode.

+ * @return key + */ + + @Nullable + public String getKey() { + return this.key; + } + /** *

Name of the DiscountCode.

* @return name @@ -498,7 +522,7 @@ public java.time.ZonedDateTime getValidUntil() { public DiscountCodeDraft build() { Objects.requireNonNull(code, DiscountCodeDraft.class + ": code is missing"); Objects.requireNonNull(cartDiscounts, DiscountCodeDraft.class + ": cartDiscounts is missing"); - return new DiscountCodeDraftImpl(name, description, code, cartDiscounts, cartPredicate, isActive, + return new DiscountCodeDraftImpl(key, name, description, code, cartDiscounts, cartPredicate, isActive, maxApplications, maxApplicationsPerCustomer, custom, groups, validFrom, validUntil); } @@ -507,7 +531,7 @@ public DiscountCodeDraft build() { * @return DiscountCodeDraft */ public DiscountCodeDraft buildUnchecked() { - return new DiscountCodeDraftImpl(name, description, code, cartDiscounts, cartPredicate, isActive, + return new DiscountCodeDraftImpl(key, name, description, code, cartDiscounts, cartPredicate, isActive, maxApplications, maxApplicationsPerCustomer, custom, groups, validFrom, validUntil); } @@ -526,6 +550,7 @@ public static DiscountCodeDraftBuilder of() { */ public static DiscountCodeDraftBuilder of(final DiscountCodeDraft template) { DiscountCodeDraftBuilder builder = new DiscountCodeDraftBuilder(); + builder.key = template.getKey(); builder.name = template.getName(); builder.description = template.getDescription(); builder.code = template.getCode(); diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeDraftImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeDraftImpl.java index 7edce5d1a4a..9858ca3cd5b 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeDraftImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeDraftImpl.java @@ -22,6 +22,8 @@ @Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") public class DiscountCodeDraftImpl implements DiscountCodeDraft, ModelBase { + private String key; + private com.commercetools.api.models.common.LocalizedString name; private com.commercetools.api.models.common.LocalizedString description; @@ -50,7 +52,8 @@ public class DiscountCodeDraftImpl implements DiscountCodeDraft, ModelBase { * create instance with all properties */ @JsonCreator - DiscountCodeDraftImpl(@JsonProperty("name") final com.commercetools.api.models.common.LocalizedString name, + DiscountCodeDraftImpl(@JsonProperty("key") final String key, + @JsonProperty("name") final com.commercetools.api.models.common.LocalizedString name, @JsonProperty("description") final com.commercetools.api.models.common.LocalizedString description, @JsonProperty("code") final String code, @JsonProperty("cartDiscounts") final java.util.List cartDiscounts, @@ -61,6 +64,7 @@ public class DiscountCodeDraftImpl implements DiscountCodeDraft, ModelBase { @JsonProperty("groups") final java.util.List groups, @JsonProperty("validFrom") final java.time.ZonedDateTime validFrom, @JsonProperty("validUntil") final java.time.ZonedDateTime validUntil) { + this.key = key; this.name = name; this.description = description; this.code = code; @@ -81,6 +85,14 @@ public class DiscountCodeDraftImpl implements DiscountCodeDraft, ModelBase { public DiscountCodeDraftImpl() { } + /** + *

User-defined unique identifier for the DiscountCode.

+ */ + + public String getKey() { + return this.key; + } + /** *

Name of the DiscountCode.

*/ @@ -177,6 +189,10 @@ public java.time.ZonedDateTime getValidUntil() { return this.validUntil; } + public void setKey(final String key) { + this.key = key; + } + public void setName(final com.commercetools.api.models.common.LocalizedString name) { this.name = name; } @@ -245,7 +261,8 @@ public boolean equals(Object o) { DiscountCodeDraftImpl that = (DiscountCodeDraftImpl) o; - return new EqualsBuilder().append(name, that.name) + return new EqualsBuilder().append(key, that.key) + .append(name, that.name) .append(description, that.description) .append(code, that.code) .append(cartDiscounts, that.cartDiscounts) @@ -257,6 +274,7 @@ public boolean equals(Object o) { .append(groups, that.groups) .append(validFrom, that.validFrom) .append(validUntil, that.validUntil) + .append(key, that.key) .append(name, that.name) .append(description, that.description) .append(code, that.code) @@ -274,7 +292,8 @@ public boolean equals(Object o) { @Override public int hashCode() { - return new HashCodeBuilder(17, 37).append(name) + return new HashCodeBuilder(17, 37).append(key) + .append(name) .append(description) .append(code) .append(cartDiscounts) @@ -291,7 +310,8 @@ public int hashCode() { @Override public String toString() { - return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("name", name) + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("key", key) + .append("name", name) .append("description", description) .append("code", code) .append("cartDiscounts", cartDiscounts) diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeImpl.java index 6249d90d47a..576ea3684e2 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeImpl.java @@ -30,6 +30,8 @@ public class DiscountCodeImpl implements DiscountCode, ModelBase { private java.time.ZonedDateTime lastModifiedAt; + private String key; + private com.commercetools.api.models.common.LastModifiedBy lastModifiedBy; private com.commercetools.api.models.common.CreatedBy createdBy; @@ -69,6 +71,7 @@ public class DiscountCodeImpl implements DiscountCode, ModelBase { DiscountCodeImpl(@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("key") final String key, @JsonProperty("lastModifiedBy") final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy, @JsonProperty("createdBy") final com.commercetools.api.models.common.CreatedBy createdBy, @JsonProperty("name") final com.commercetools.api.models.common.LocalizedString name, @@ -88,6 +91,7 @@ public class DiscountCodeImpl implements DiscountCode, ModelBase { this.version = version; this.createdAt = createdAt; this.lastModifiedAt = lastModifiedAt; + this.key = key; this.lastModifiedBy = lastModifiedBy; this.createdBy = createdBy; this.name = name; @@ -144,6 +148,14 @@ public java.time.ZonedDateTime getLastModifiedAt() { return this.lastModifiedAt; } + /** + *

User-defined unique identifier of the DiscountCode.

+ */ + + public String getKey() { + return this.key; + } + /** *

Present on resources created after 1 February 2019 except for events not tracked.

*/ @@ -288,6 +300,10 @@ public void setLastModifiedAt(final java.time.ZonedDateTime lastModifiedAt) { this.lastModifiedAt = lastModifiedAt; } + public void setKey(final String key) { + this.key = key; + } + public void setLastModifiedBy(final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy) { this.lastModifiedBy = lastModifiedBy; } @@ -380,6 +396,7 @@ public boolean equals(Object o) { .append(version, that.version) .append(createdAt, that.createdAt) .append(lastModifiedAt, that.lastModifiedAt) + .append(key, that.key) .append(lastModifiedBy, that.lastModifiedBy) .append(createdBy, that.createdBy) .append(name, that.name) @@ -400,6 +417,7 @@ public boolean equals(Object o) { .append(version, that.version) .append(createdAt, that.createdAt) .append(lastModifiedAt, that.lastModifiedAt) + .append(key, that.key) .append(lastModifiedBy, that.lastModifiedBy) .append(createdBy, that.createdBy) .append(name, that.name) @@ -425,6 +443,7 @@ public int hashCode() { .append(version) .append(createdAt) .append(lastModifiedAt) + .append(key) .append(lastModifiedBy) .append(createdBy) .append(name) @@ -450,6 +469,7 @@ public String toString() { .append("version", version) .append("createdAt", createdAt) .append("lastModifiedAt", lastModifiedAt) + .append("key", key) .append("lastModifiedBy", lastModifiedBy) .append("createdBy", createdBy) .append("name", name) diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeSetKeyAction.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeSetKeyAction.java new file mode 100644 index 00000000000..df676b1b2ff --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeSetKeyAction.java @@ -0,0 +1,124 @@ + +package com.commercetools.api.models.discount_code; + +import java.time.*; +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +/** + *

This action generates a DiscountCodeKeySet Message.

+ * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     DiscountCodeSetKeyAction discountCodeSetKeyAction = DiscountCodeSetKeyAction.builder()
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = DiscountCodeSetKeyActionImpl.class) +public interface DiscountCodeSetKeyAction extends DiscountCodeUpdateAction { + + /** + * discriminator value for DiscountCodeSetKeyAction + */ + String SET_KEY = "setKey"; + + /** + *

Unique value to set. If empty, any existing value will be removed.

+ * @return key + */ + + @JsonProperty("key") + public String getKey(); + + /** + *

Unique value to set. If empty, any existing value will be removed.

+ * @param key value to be set + */ + + public void setKey(final String key); + + /** + * factory method + * @return instance of DiscountCodeSetKeyAction + */ + public static DiscountCodeSetKeyAction of() { + return new DiscountCodeSetKeyActionImpl(); + } + + /** + * factory method to create a shallow copy DiscountCodeSetKeyAction + * @param template instance to be copied + * @return copy instance + */ + public static DiscountCodeSetKeyAction of(final DiscountCodeSetKeyAction template) { + DiscountCodeSetKeyActionImpl instance = new DiscountCodeSetKeyActionImpl(); + instance.setKey(template.getKey()); + return instance; + } + + /** + * factory method to create a deep copy of DiscountCodeSetKeyAction + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static DiscountCodeSetKeyAction deepCopy(@Nullable final DiscountCodeSetKeyAction template) { + if (template == null) { + return null; + } + DiscountCodeSetKeyActionImpl instance = new DiscountCodeSetKeyActionImpl(); + instance.setKey(template.getKey()); + return instance; + } + + /** + * builder factory method for DiscountCodeSetKeyAction + * @return builder + */ + public static DiscountCodeSetKeyActionBuilder builder() { + return DiscountCodeSetKeyActionBuilder.of(); + } + + /** + * create builder for DiscountCodeSetKeyAction instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static DiscountCodeSetKeyActionBuilder builder(final DiscountCodeSetKeyAction template) { + return DiscountCodeSetKeyActionBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withDiscountCodeSetKeyAction(Function helper) { + return helper.apply(this); + } + + /** + * gives a TypeReference for usage with Jackson DataBind + * @return TypeReference + */ + public static com.fasterxml.jackson.core.type.TypeReference typeReference() { + return new com.fasterxml.jackson.core.type.TypeReference() { + @Override + public String toString() { + return "TypeReference"; + } + }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeSetKeyActionBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeSetKeyActionBuilder.java new file mode 100644 index 00000000000..f02b1eab1bf --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeSetKeyActionBuilder.java @@ -0,0 +1,84 @@ + +package com.commercetools.api.models.discount_code; + +import java.util.*; + +import javax.annotation.Nullable; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * DiscountCodeSetKeyActionBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     DiscountCodeSetKeyAction discountCodeSetKeyAction = DiscountCodeSetKeyAction.builder()
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class DiscountCodeSetKeyActionBuilder implements Builder { + + @Nullable + private String key; + + /** + *

Unique value to set. If empty, any existing value will be removed.

+ * @param key value to be set + * @return Builder + */ + + public DiscountCodeSetKeyActionBuilder key(@Nullable final String key) { + this.key = key; + return this; + } + + /** + *

Unique value to set. If empty, any existing value will be removed.

+ * @return key + */ + + @Nullable + public String getKey() { + return this.key; + } + + /** + * builds DiscountCodeSetKeyAction with checking for non-null required values + * @return DiscountCodeSetKeyAction + */ + public DiscountCodeSetKeyAction build() { + return new DiscountCodeSetKeyActionImpl(key); + } + + /** + * builds DiscountCodeSetKeyAction without checking for non-null required values + * @return DiscountCodeSetKeyAction + */ + public DiscountCodeSetKeyAction buildUnchecked() { + return new DiscountCodeSetKeyActionImpl(key); + } + + /** + * factory method for an instance of DiscountCodeSetKeyActionBuilder + * @return builder + */ + public static DiscountCodeSetKeyActionBuilder of() { + return new DiscountCodeSetKeyActionBuilder(); + } + + /** + * create builder for DiscountCodeSetKeyAction instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static DiscountCodeSetKeyActionBuilder of(final DiscountCodeSetKeyAction template) { + DiscountCodeSetKeyActionBuilder builder = new DiscountCodeSetKeyActionBuilder(); + builder.key = template.getKey(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeSetKeyActionImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeSetKeyActionImpl.java new file mode 100644 index 00000000000..c9b9ccc1943 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeSetKeyActionImpl.java @@ -0,0 +1,94 @@ + +package com.commercetools.api.models.discount_code; + +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; + +/** + *

This action generates a DiscountCodeKeySet Message.

+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class DiscountCodeSetKeyActionImpl implements DiscountCodeSetKeyAction, ModelBase { + + private String action; + + private String key; + + /** + * create instance with all properties + */ + @JsonCreator + DiscountCodeSetKeyActionImpl(@JsonProperty("key") final String key) { + this.key = key; + this.action = SET_KEY; + } + + /** + * create empty instance + */ + public DiscountCodeSetKeyActionImpl() { + this.action = SET_KEY; + } + + /** + * + */ + + public String getAction() { + return this.action; + } + + /** + *

Unique value to set. If empty, any existing value will be removed.

+ */ + + public String getKey() { + return this.key; + } + + public void setKey(final String key) { + this.key = key; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + DiscountCodeSetKeyActionImpl that = (DiscountCodeSetKeyActionImpl) o; + + return new EqualsBuilder().append(action, that.action) + .append(key, that.key) + .append(action, that.action) + .append(key, that.key) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(action).append(key).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("action", action) + .append("key", key) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeUpdateAction.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeUpdateAction.java index cc33ea03899..48fd522e542 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeUpdateAction.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeUpdateAction.java @@ -34,6 +34,7 @@ @JsonSubTypes.Type(value = com.commercetools.api.models.discount_code.DiscountCodeSetCustomFieldActionImpl.class, name = DiscountCodeSetCustomFieldAction.SET_CUSTOM_FIELD), @JsonSubTypes.Type(value = com.commercetools.api.models.discount_code.DiscountCodeSetCustomTypeActionImpl.class, name = DiscountCodeSetCustomTypeAction.SET_CUSTOM_TYPE), @JsonSubTypes.Type(value = com.commercetools.api.models.discount_code.DiscountCodeSetDescriptionActionImpl.class, name = DiscountCodeSetDescriptionAction.SET_DESCRIPTION), + @JsonSubTypes.Type(value = com.commercetools.api.models.discount_code.DiscountCodeSetKeyActionImpl.class, name = DiscountCodeSetKeyAction.SET_KEY), @JsonSubTypes.Type(value = com.commercetools.api.models.discount_code.DiscountCodeSetMaxApplicationsActionImpl.class, name = DiscountCodeSetMaxApplicationsAction.SET_MAX_APPLICATIONS), @JsonSubTypes.Type(value = com.commercetools.api.models.discount_code.DiscountCodeSetMaxApplicationsPerCustomerActionImpl.class, name = DiscountCodeSetMaxApplicationsPerCustomerAction.SET_MAX_APPLICATIONS_PER_CUSTOMER), @JsonSubTypes.Type(value = com.commercetools.api.models.discount_code.DiscountCodeSetNameActionImpl.class, name = DiscountCodeSetNameAction.SET_NAME), @@ -92,6 +93,10 @@ public static DiscountCodeUpdateAction deepCopy(@Nullable final DiscountCodeUpda return com.commercetools.api.models.discount_code.DiscountCodeSetDescriptionAction .deepCopy((com.commercetools.api.models.discount_code.DiscountCodeSetDescriptionAction) template); } + if (template instanceof com.commercetools.api.models.discount_code.DiscountCodeSetKeyAction) { + return com.commercetools.api.models.discount_code.DiscountCodeSetKeyAction + .deepCopy((com.commercetools.api.models.discount_code.DiscountCodeSetKeyAction) template); + } if (template instanceof com.commercetools.api.models.discount_code.DiscountCodeSetMaxApplicationsAction) { return com.commercetools.api.models.discount_code.DiscountCodeSetMaxApplicationsAction.deepCopy( (com.commercetools.api.models.discount_code.DiscountCodeSetMaxApplicationsAction) template); @@ -176,6 +181,14 @@ public static com.commercetools.api.models.discount_code.DiscountCodeSetDescript return com.commercetools.api.models.discount_code.DiscountCodeSetDescriptionActionBuilder.of(); } + /** + * builder for setKey subtype + * @return builder + */ + public static com.commercetools.api.models.discount_code.DiscountCodeSetKeyActionBuilder setKeyBuilder() { + return com.commercetools.api.models.discount_code.DiscountCodeSetKeyActionBuilder.of(); + } + /** * builder for setMaxApplications subtype * @return builder diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeUpdateActionBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeUpdateActionBuilder.java index 5e6719f0d59..a90a0f0df9c 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeUpdateActionBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_code/DiscountCodeUpdateActionBuilder.java @@ -39,6 +39,10 @@ public com.commercetools.api.models.discount_code.DiscountCodeSetDescriptionActi return com.commercetools.api.models.discount_code.DiscountCodeSetDescriptionActionBuilder.of(); } + public com.commercetools.api.models.discount_code.DiscountCodeSetKeyActionBuilder setKeyBuilder() { + return com.commercetools.api.models.discount_code.DiscountCodeSetKeyActionBuilder.of(); + } + public com.commercetools.api.models.discount_code.DiscountCodeSetMaxApplicationsActionBuilder setMaxApplicationsBuilder() { return com.commercetools.api.models.discount_code.DiscountCodeSetMaxApplicationsActionBuilder.of(); } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessage.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessage.java new file mode 100644 index 00000000000..06bc8cb17c6 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessage.java @@ -0,0 +1,159 @@ + +package com.commercetools.api.models.message; + +import java.time.*; +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; +import javax.validation.Valid; +import javax.validation.constraints.NotNull; + +import com.commercetools.api.models.discount_code.DiscountCode; +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +/** + *

Generated after a successful Create DiscountCode request.

+ * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     DiscountCodeCreatedMessage discountCodeCreatedMessage = DiscountCodeCreatedMessage.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)
+ *             .discountCode(discountCodeBuilder -> discountCodeBuilder)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = DiscountCodeCreatedMessageImpl.class) +public interface DiscountCodeCreatedMessage extends Message { + + /** + * discriminator value for DiscountCodeCreatedMessage + */ + String DISCOUNT_CODE_CREATED = "DiscountCodeCreated"; + + /** + *

The Discount Code that was created.

+ * @return discountCode + */ + @NotNull + @Valid + @JsonProperty("discountCode") + public DiscountCode getDiscountCode(); + + /** + *

The Discount Code that was created.

+ * @param discountCode value to be set + */ + + public void setDiscountCode(final DiscountCode discountCode); + + /** + * factory method + * @return instance of DiscountCodeCreatedMessage + */ + public static DiscountCodeCreatedMessage of() { + return new DiscountCodeCreatedMessageImpl(); + } + + /** + * factory method to create a shallow copy DiscountCodeCreatedMessage + * @param template instance to be copied + * @return copy instance + */ + public static DiscountCodeCreatedMessage of(final DiscountCodeCreatedMessage template) { + DiscountCodeCreatedMessageImpl instance = new DiscountCodeCreatedMessageImpl(); + 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.setDiscountCode(template.getDiscountCode()); + return instance; + } + + /** + * factory method to create a deep copy of DiscountCodeCreatedMessage + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static DiscountCodeCreatedMessage deepCopy(@Nullable final DiscountCodeCreatedMessage template) { + if (template == null) { + return null; + } + DiscountCodeCreatedMessageImpl instance = new DiscountCodeCreatedMessageImpl(); + 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.setDiscountCode( + com.commercetools.api.models.discount_code.DiscountCode.deepCopy(template.getDiscountCode())); + return instance; + } + + /** + * builder factory method for DiscountCodeCreatedMessage + * @return builder + */ + public static DiscountCodeCreatedMessageBuilder builder() { + return DiscountCodeCreatedMessageBuilder.of(); + } + + /** + * create builder for DiscountCodeCreatedMessage instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static DiscountCodeCreatedMessageBuilder builder(final DiscountCodeCreatedMessage template) { + return DiscountCodeCreatedMessageBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withDiscountCodeCreatedMessage(Function helper) { + return helper.apply(this); + } + + /** + * gives a TypeReference for usage with Jackson DataBind + * @return TypeReference + */ + public static com.fasterxml.jackson.core.type.TypeReference typeReference() { + return new com.fasterxml.jackson.core.type.TypeReference() { + @Override + public String toString() { + return "TypeReference"; + } + }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessageBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessageBuilder.java new file mode 100644 index 00000000000..2013b9ab74d --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessageBuilder.java @@ -0,0 +1,452 @@ + +package com.commercetools.api.models.message; + +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * DiscountCodeCreatedMessageBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     DiscountCodeCreatedMessage discountCodeCreatedMessage = DiscountCodeCreatedMessage.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)
+ *             .discountCode(discountCodeBuilder -> discountCodeBuilder)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class DiscountCodeCreatedMessageBuilder implements Builder { + + private String id; + + private Long version; + + private java.time.ZonedDateTime createdAt; + + private java.time.ZonedDateTime lastModifiedAt; + + @Nullable + private com.commercetools.api.models.common.LastModifiedBy lastModifiedBy; + + @Nullable + private com.commercetools.api.models.common.CreatedBy createdBy; + + private Long sequenceNumber; + + private com.commercetools.api.models.common.Reference resource; + + private Long resourceVersion; + + @Nullable + private com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers; + + private com.commercetools.api.models.discount_code.DiscountCode discountCode; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * @param id value to be set + * @return Builder + */ + + public DiscountCodeCreatedMessageBuilder id(final String id) { + this.id = id; + return this; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * @param version value to be set + * @return Builder + */ + + public DiscountCodeCreatedMessageBuilder version(final Long version) { + this.version = version; + return this; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * @param createdAt value to be set + * @return Builder + */ + + public DiscountCodeCreatedMessageBuilder createdAt(final java.time.ZonedDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + *

Value of createdAt.

+ * @param lastModifiedAt value to be set + * @return Builder + */ + + public DiscountCodeCreatedMessageBuilder lastModifiedAt(final java.time.ZonedDateTime lastModifiedAt) { + this.lastModifiedAt = lastModifiedAt; + return this; + } + + /** + *

Value of createdBy.

+ * @param builder function to build the lastModifiedBy value + * @return Builder + */ + + public DiscountCodeCreatedMessageBuilder lastModifiedBy( + Function builder) { + this.lastModifiedBy = builder.apply(com.commercetools.api.models.common.LastModifiedByBuilder.of()).build(); + return this; + } + + /** + *

Value of createdBy.

+ * @param builder function to build the lastModifiedBy value + * @return Builder + */ + + public DiscountCodeCreatedMessageBuilder withLastModifiedBy( + Function builder) { + this.lastModifiedBy = builder.apply(com.commercetools.api.models.common.LastModifiedByBuilder.of()); + return this; + } + + /** + *

Value of createdBy.

+ * @param lastModifiedBy value to be set + * @return Builder + */ + + public DiscountCodeCreatedMessageBuilder lastModifiedBy( + @Nullable final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + return this; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * @param builder function to build the createdBy value + * @return Builder + */ + + public DiscountCodeCreatedMessageBuilder createdBy( + Function builder) { + this.createdBy = builder.apply(com.commercetools.api.models.common.CreatedByBuilder.of()).build(); + return this; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * @param builder function to build the createdBy value + * @return Builder + */ + + public DiscountCodeCreatedMessageBuilder withCreatedBy( + Function builder) { + this.createdBy = builder.apply(com.commercetools.api.models.common.CreatedByBuilder.of()); + return this; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * @param createdBy value to be set + * @return Builder + */ + + public DiscountCodeCreatedMessageBuilder 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.

+ * @param sequenceNumber value to be set + * @return Builder + */ + + public DiscountCodeCreatedMessageBuilder sequenceNumber(final Long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * @param resource value to be set + * @return Builder + */ + + public DiscountCodeCreatedMessageBuilder 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 DiscountCodeCreatedMessageBuilder resource( + Function> builder) { + this.resource = builder.apply(com.commercetools.api.models.common.ReferenceBuilder.of()).build(); + return this; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * @param resourceVersion value to be set + * @return Builder + */ + + public DiscountCodeCreatedMessageBuilder 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.

+ * @param builder function to build the resourceUserProvidedIdentifiers value + * @return Builder + */ + + public DiscountCodeCreatedMessageBuilder resourceUserProvidedIdentifiers( + Function builder) { + this.resourceUserProvidedIdentifiers = builder + .apply(com.commercetools.api.models.message.UserProvidedIdentifiersBuilder.of()) + .build(); + return this; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * @param builder function to build the resourceUserProvidedIdentifiers value + * @return Builder + */ + + public DiscountCodeCreatedMessageBuilder withResourceUserProvidedIdentifiers( + Function builder) { + this.resourceUserProvidedIdentifiers = builder + .apply(com.commercetools.api.models.message.UserProvidedIdentifiersBuilder.of()); + return this; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * @param resourceUserProvidedIdentifiers value to be set + * @return Builder + */ + + public DiscountCodeCreatedMessageBuilder resourceUserProvidedIdentifiers( + @Nullable final com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers) { + this.resourceUserProvidedIdentifiers = resourceUserProvidedIdentifiers; + return this; + } + + /** + *

The Discount Code that was created.

+ * @param builder function to build the discountCode value + * @return Builder + */ + + public DiscountCodeCreatedMessageBuilder discountCode( + Function builder) { + this.discountCode = builder.apply(com.commercetools.api.models.discount_code.DiscountCodeBuilder.of()).build(); + return this; + } + + /** + *

The Discount Code that was created.

+ * @param builder function to build the discountCode value + * @return Builder + */ + + public DiscountCodeCreatedMessageBuilder withDiscountCode( + Function builder) { + this.discountCode = builder.apply(com.commercetools.api.models.discount_code.DiscountCodeBuilder.of()); + return this; + } + + /** + *

The Discount Code that was created.

+ * @param discountCode value to be set + * @return Builder + */ + + public DiscountCodeCreatedMessageBuilder discountCode( + final com.commercetools.api.models.discount_code.DiscountCode discountCode) { + this.discountCode = discountCode; + 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.

+ * @return version + */ + + public Long getVersion() { + return this.version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * @return createdAt + */ + + public java.time.ZonedDateTime getCreatedAt() { + return this.createdAt; + } + + /** + *

Value of createdAt.

+ * @return lastModifiedAt + */ + + public java.time.ZonedDateTime getLastModifiedAt() { + return this.lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * @return lastModifiedBy + */ + + @Nullable + public com.commercetools.api.models.common.LastModifiedBy getLastModifiedBy() { + return this.lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * @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.

+ * @return sequenceNumber + */ + + public Long getSequenceNumber() { + return this.sequenceNumber; + } + + /** + *

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.

+ * @return resourceUserProvidedIdentifiers + */ + + @Nullable + public com.commercetools.api.models.message.UserProvidedIdentifiers getResourceUserProvidedIdentifiers() { + return this.resourceUserProvidedIdentifiers; + } + + /** + *

The Discount Code that was created.

+ * @return discountCode + */ + + public com.commercetools.api.models.discount_code.DiscountCode getDiscountCode() { + return this.discountCode; + } + + /** + * builds DiscountCodeCreatedMessage with checking for non-null required values + * @return DiscountCodeCreatedMessage + */ + public DiscountCodeCreatedMessage build() { + Objects.requireNonNull(id, DiscountCodeCreatedMessage.class + ": id is missing"); + Objects.requireNonNull(version, DiscountCodeCreatedMessage.class + ": version is missing"); + Objects.requireNonNull(createdAt, DiscountCodeCreatedMessage.class + ": createdAt is missing"); + Objects.requireNonNull(lastModifiedAt, DiscountCodeCreatedMessage.class + ": lastModifiedAt is missing"); + Objects.requireNonNull(sequenceNumber, DiscountCodeCreatedMessage.class + ": sequenceNumber is missing"); + Objects.requireNonNull(resource, DiscountCodeCreatedMessage.class + ": resource is missing"); + Objects.requireNonNull(resourceVersion, DiscountCodeCreatedMessage.class + ": resourceVersion is missing"); + Objects.requireNonNull(discountCode, DiscountCodeCreatedMessage.class + ": discountCode is missing"); + return new DiscountCodeCreatedMessageImpl(id, version, createdAt, lastModifiedAt, lastModifiedBy, createdBy, + sequenceNumber, resource, resourceVersion, resourceUserProvidedIdentifiers, discountCode); + } + + /** + * builds DiscountCodeCreatedMessage without checking for non-null required values + * @return DiscountCodeCreatedMessage + */ + public DiscountCodeCreatedMessage buildUnchecked() { + return new DiscountCodeCreatedMessageImpl(id, version, createdAt, lastModifiedAt, lastModifiedBy, createdBy, + sequenceNumber, resource, resourceVersion, resourceUserProvidedIdentifiers, discountCode); + } + + /** + * factory method for an instance of DiscountCodeCreatedMessageBuilder + * @return builder + */ + public static DiscountCodeCreatedMessageBuilder of() { + return new DiscountCodeCreatedMessageBuilder(); + } + + /** + * create builder for DiscountCodeCreatedMessage instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static DiscountCodeCreatedMessageBuilder of(final DiscountCodeCreatedMessage template) { + DiscountCodeCreatedMessageBuilder builder = new DiscountCodeCreatedMessageBuilder(); + 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.discountCode = template.getDiscountCode(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessageImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessageImpl.java new file mode 100644 index 00000000000..034370b6bc0 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessageImpl.java @@ -0,0 +1,296 @@ + +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 Create DiscountCode request.

+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class DiscountCodeCreatedMessageImpl implements DiscountCodeCreatedMessage, 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.discount_code.DiscountCode discountCode; + + /** + * create instance with all properties + */ + @JsonCreator + DiscountCodeCreatedMessageImpl(@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("discountCode") final com.commercetools.api.models.discount_code.DiscountCode discountCode) { + 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.discountCode = discountCode; + this.type = DISCOUNT_CODE_CREATED; + } + + /** + * create empty instance + */ + public DiscountCodeCreatedMessageImpl() { + this.type = DISCOUNT_CODE_CREATED; + } + + /** + *

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.

+ */ + + public Long getVersion() { + return this.version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ */ + + public java.time.ZonedDateTime getCreatedAt() { + return this.createdAt; + } + + /** + *

Value of createdAt.

+ */ + + public java.time.ZonedDateTime getLastModifiedAt() { + return this.lastModifiedAt; + } + + /** + *

Value of createdBy.

+ */ + + public com.commercetools.api.models.common.LastModifiedBy getLastModifiedBy() { + return this.lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ */ + + 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.

+ */ + + public Long getSequenceNumber() { + return this.sequenceNumber; + } + + /** + *

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.

+ */ + + public com.commercetools.api.models.message.UserProvidedIdentifiers getResourceUserProvidedIdentifiers() { + return this.resourceUserProvidedIdentifiers; + } + + /** + *

The Discount Code that was created.

+ */ + + public com.commercetools.api.models.discount_code.DiscountCode getDiscountCode() { + return this.discountCode; + } + + 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 setDiscountCode(final com.commercetools.api.models.discount_code.DiscountCode discountCode) { + this.discountCode = discountCode; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + DiscountCodeCreatedMessageImpl that = (DiscountCodeCreatedMessageImpl) 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(discountCode, that.discountCode) + .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(discountCode, that.discountCode) + .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(discountCode) + .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("discountCode", discountCode) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessagePayload.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessagePayload.java new file mode 100644 index 00000000000..556424db5ea --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessagePayload.java @@ -0,0 +1,131 @@ + +package com.commercetools.api.models.message; + +import java.time.*; +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; +import javax.validation.Valid; +import javax.validation.constraints.NotNull; + +import com.commercetools.api.models.discount_code.DiscountCode; +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +/** + *

Generated after a successful Create DiscountCode request.

+ * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     DiscountCodeCreatedMessagePayload discountCodeCreatedMessagePayload = DiscountCodeCreatedMessagePayload.builder()
+ *             .discountCode(discountCodeBuilder -> discountCodeBuilder)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = DiscountCodeCreatedMessagePayloadImpl.class) +public interface DiscountCodeCreatedMessagePayload extends MessagePayload { + + /** + * discriminator value for DiscountCodeCreatedMessagePayload + */ + String DISCOUNT_CODE_CREATED = "DiscountCodeCreated"; + + /** + *

The Discount Code that was created.

+ * @return discountCode + */ + @NotNull + @Valid + @JsonProperty("discountCode") + public DiscountCode getDiscountCode(); + + /** + *

The Discount Code that was created.

+ * @param discountCode value to be set + */ + + public void setDiscountCode(final DiscountCode discountCode); + + /** + * factory method + * @return instance of DiscountCodeCreatedMessagePayload + */ + public static DiscountCodeCreatedMessagePayload of() { + return new DiscountCodeCreatedMessagePayloadImpl(); + } + + /** + * factory method to create a shallow copy DiscountCodeCreatedMessagePayload + * @param template instance to be copied + * @return copy instance + */ + public static DiscountCodeCreatedMessagePayload of(final DiscountCodeCreatedMessagePayload template) { + DiscountCodeCreatedMessagePayloadImpl instance = new DiscountCodeCreatedMessagePayloadImpl(); + instance.setDiscountCode(template.getDiscountCode()); + return instance; + } + + /** + * factory method to create a deep copy of DiscountCodeCreatedMessagePayload + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static DiscountCodeCreatedMessagePayload deepCopy( + @Nullable final DiscountCodeCreatedMessagePayload template) { + if (template == null) { + return null; + } + DiscountCodeCreatedMessagePayloadImpl instance = new DiscountCodeCreatedMessagePayloadImpl(); + instance.setDiscountCode( + com.commercetools.api.models.discount_code.DiscountCode.deepCopy(template.getDiscountCode())); + return instance; + } + + /** + * builder factory method for DiscountCodeCreatedMessagePayload + * @return builder + */ + public static DiscountCodeCreatedMessagePayloadBuilder builder() { + return DiscountCodeCreatedMessagePayloadBuilder.of(); + } + + /** + * create builder for DiscountCodeCreatedMessagePayload instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static DiscountCodeCreatedMessagePayloadBuilder builder(final DiscountCodeCreatedMessagePayload template) { + return DiscountCodeCreatedMessagePayloadBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withDiscountCodeCreatedMessagePayload(Function helper) { + return helper.apply(this); + } + + /** + * gives a TypeReference for usage with Jackson DataBind + * @return TypeReference + */ + public static com.fasterxml.jackson.core.type.TypeReference typeReference() { + return new com.fasterxml.jackson.core.type.TypeReference() { + @Override + public String toString() { + return "TypeReference"; + } + }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessagePayloadBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessagePayloadBuilder.java new file mode 100644 index 00000000000..71fdc44f244 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessagePayloadBuilder.java @@ -0,0 +1,108 @@ + +package com.commercetools.api.models.message; + +import java.util.*; +import java.util.function.Function; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * DiscountCodeCreatedMessagePayloadBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     DiscountCodeCreatedMessagePayload discountCodeCreatedMessagePayload = DiscountCodeCreatedMessagePayload.builder()
+ *             .discountCode(discountCodeBuilder -> discountCodeBuilder)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class DiscountCodeCreatedMessagePayloadBuilder implements Builder { + + private com.commercetools.api.models.discount_code.DiscountCode discountCode; + + /** + *

The Discount Code that was created.

+ * @param builder function to build the discountCode value + * @return Builder + */ + + public DiscountCodeCreatedMessagePayloadBuilder discountCode( + Function builder) { + this.discountCode = builder.apply(com.commercetools.api.models.discount_code.DiscountCodeBuilder.of()).build(); + return this; + } + + /** + *

The Discount Code that was created.

+ * @param builder function to build the discountCode value + * @return Builder + */ + + public DiscountCodeCreatedMessagePayloadBuilder withDiscountCode( + Function builder) { + this.discountCode = builder.apply(com.commercetools.api.models.discount_code.DiscountCodeBuilder.of()); + return this; + } + + /** + *

The Discount Code that was created.

+ * @param discountCode value to be set + * @return Builder + */ + + public DiscountCodeCreatedMessagePayloadBuilder discountCode( + final com.commercetools.api.models.discount_code.DiscountCode discountCode) { + this.discountCode = discountCode; + return this; + } + + /** + *

The Discount Code that was created.

+ * @return discountCode + */ + + public com.commercetools.api.models.discount_code.DiscountCode getDiscountCode() { + return this.discountCode; + } + + /** + * builds DiscountCodeCreatedMessagePayload with checking for non-null required values + * @return DiscountCodeCreatedMessagePayload + */ + public DiscountCodeCreatedMessagePayload build() { + Objects.requireNonNull(discountCode, DiscountCodeCreatedMessagePayload.class + ": discountCode is missing"); + return new DiscountCodeCreatedMessagePayloadImpl(discountCode); + } + + /** + * builds DiscountCodeCreatedMessagePayload without checking for non-null required values + * @return DiscountCodeCreatedMessagePayload + */ + public DiscountCodeCreatedMessagePayload buildUnchecked() { + return new DiscountCodeCreatedMessagePayloadImpl(discountCode); + } + + /** + * factory method for an instance of DiscountCodeCreatedMessagePayloadBuilder + * @return builder + */ + public static DiscountCodeCreatedMessagePayloadBuilder of() { + return new DiscountCodeCreatedMessagePayloadBuilder(); + } + + /** + * create builder for DiscountCodeCreatedMessagePayload instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static DiscountCodeCreatedMessagePayloadBuilder of(final DiscountCodeCreatedMessagePayload template) { + DiscountCodeCreatedMessagePayloadBuilder builder = new DiscountCodeCreatedMessagePayloadBuilder(); + builder.discountCode = template.getDiscountCode(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessagePayloadImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessagePayloadImpl.java new file mode 100644 index 00000000000..0d3789d38be --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessagePayloadImpl.java @@ -0,0 +1,95 @@ + +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 Create DiscountCode request.

+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class DiscountCodeCreatedMessagePayloadImpl implements DiscountCodeCreatedMessagePayload, ModelBase { + + private String type; + + private com.commercetools.api.models.discount_code.DiscountCode discountCode; + + /** + * create instance with all properties + */ + @JsonCreator + DiscountCodeCreatedMessagePayloadImpl( + @JsonProperty("discountCode") final com.commercetools.api.models.discount_code.DiscountCode discountCode) { + this.discountCode = discountCode; + this.type = DISCOUNT_CODE_CREATED; + } + + /** + * create empty instance + */ + public DiscountCodeCreatedMessagePayloadImpl() { + this.type = DISCOUNT_CODE_CREATED; + } + + /** + * + */ + + public String getType() { + return this.type; + } + + /** + *

The Discount Code that was created.

+ */ + + public com.commercetools.api.models.discount_code.DiscountCode getDiscountCode() { + return this.discountCode; + } + + public void setDiscountCode(final com.commercetools.api.models.discount_code.DiscountCode discountCode) { + this.discountCode = discountCode; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + DiscountCodeCreatedMessagePayloadImpl that = (DiscountCodeCreatedMessagePayloadImpl) o; + + return new EqualsBuilder().append(type, that.type) + .append(discountCode, that.discountCode) + .append(type, that.type) + .append(discountCode, that.discountCode) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(type).append(discountCode).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("type", type) + .append("discountCode", discountCode) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessage.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessage.java new file mode 100644 index 00000000000..5ef2bc23bc1 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessage.java @@ -0,0 +1,136 @@ + +package com.commercetools.api.models.message; + +import java.time.*; +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +/** + *

Generated after a successful Delete DiscountCode request.

+ * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     DiscountCodeDeletedMessage discountCodeDeletedMessage = DiscountCodeDeletedMessage.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()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = DiscountCodeDeletedMessageImpl.class) +public interface DiscountCodeDeletedMessage extends Message { + + /** + * discriminator value for DiscountCodeDeletedMessage + */ + String DISCOUNT_CODE_DELETED = "DiscountCodeDeleted"; + + /** + * factory method + * @return instance of DiscountCodeDeletedMessage + */ + public static DiscountCodeDeletedMessage of() { + return new DiscountCodeDeletedMessageImpl(); + } + + /** + * factory method to create a shallow copy DiscountCodeDeletedMessage + * @param template instance to be copied + * @return copy instance + */ + public static DiscountCodeDeletedMessage of(final DiscountCodeDeletedMessage template) { + DiscountCodeDeletedMessageImpl instance = new DiscountCodeDeletedMessageImpl(); + 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()); + return instance; + } + + /** + * factory method to create a deep copy of DiscountCodeDeletedMessage + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static DiscountCodeDeletedMessage deepCopy(@Nullable final DiscountCodeDeletedMessage template) { + if (template == null) { + return null; + } + DiscountCodeDeletedMessageImpl instance = new DiscountCodeDeletedMessageImpl(); + 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())); + return instance; + } + + /** + * builder factory method for DiscountCodeDeletedMessage + * @return builder + */ + public static DiscountCodeDeletedMessageBuilder builder() { + return DiscountCodeDeletedMessageBuilder.of(); + } + + /** + * create builder for DiscountCodeDeletedMessage instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static DiscountCodeDeletedMessageBuilder builder(final DiscountCodeDeletedMessage template) { + return DiscountCodeDeletedMessageBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withDiscountCodeDeletedMessage(Function helper) { + return helper.apply(this); + } + + /** + * gives a TypeReference for usage with Jackson DataBind + * @return TypeReference + */ + public static com.fasterxml.jackson.core.type.TypeReference typeReference() { + return new com.fasterxml.jackson.core.type.TypeReference() { + @Override + public String toString() { + return "TypeReference"; + } + }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessageBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessageBuilder.java new file mode 100644 index 00000000000..fe2f8bf2de8 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessageBuilder.java @@ -0,0 +1,402 @@ + +package com.commercetools.api.models.message; + +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * DiscountCodeDeletedMessageBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     DiscountCodeDeletedMessage discountCodeDeletedMessage = DiscountCodeDeletedMessage.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()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class DiscountCodeDeletedMessageBuilder implements Builder { + + private String id; + + private Long version; + + private java.time.ZonedDateTime createdAt; + + private java.time.ZonedDateTime lastModifiedAt; + + @Nullable + private com.commercetools.api.models.common.LastModifiedBy lastModifiedBy; + + @Nullable + private com.commercetools.api.models.common.CreatedBy createdBy; + + private Long sequenceNumber; + + private com.commercetools.api.models.common.Reference resource; + + private Long resourceVersion; + + @Nullable + private com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * @param id value to be set + * @return Builder + */ + + public DiscountCodeDeletedMessageBuilder id(final String id) { + this.id = id; + return this; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * @param version value to be set + * @return Builder + */ + + public DiscountCodeDeletedMessageBuilder version(final Long version) { + this.version = version; + return this; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * @param createdAt value to be set + * @return Builder + */ + + public DiscountCodeDeletedMessageBuilder createdAt(final java.time.ZonedDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + *

Value of createdAt.

+ * @param lastModifiedAt value to be set + * @return Builder + */ + + public DiscountCodeDeletedMessageBuilder lastModifiedAt(final java.time.ZonedDateTime lastModifiedAt) { + this.lastModifiedAt = lastModifiedAt; + return this; + } + + /** + *

Value of createdBy.

+ * @param builder function to build the lastModifiedBy value + * @return Builder + */ + + public DiscountCodeDeletedMessageBuilder lastModifiedBy( + Function builder) { + this.lastModifiedBy = builder.apply(com.commercetools.api.models.common.LastModifiedByBuilder.of()).build(); + return this; + } + + /** + *

Value of createdBy.

+ * @param builder function to build the lastModifiedBy value + * @return Builder + */ + + public DiscountCodeDeletedMessageBuilder withLastModifiedBy( + Function builder) { + this.lastModifiedBy = builder.apply(com.commercetools.api.models.common.LastModifiedByBuilder.of()); + return this; + } + + /** + *

Value of createdBy.

+ * @param lastModifiedBy value to be set + * @return Builder + */ + + public DiscountCodeDeletedMessageBuilder lastModifiedBy( + @Nullable final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + return this; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * @param builder function to build the createdBy value + * @return Builder + */ + + public DiscountCodeDeletedMessageBuilder createdBy( + Function builder) { + this.createdBy = builder.apply(com.commercetools.api.models.common.CreatedByBuilder.of()).build(); + return this; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * @param builder function to build the createdBy value + * @return Builder + */ + + public DiscountCodeDeletedMessageBuilder withCreatedBy( + Function builder) { + this.createdBy = builder.apply(com.commercetools.api.models.common.CreatedByBuilder.of()); + return this; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * @param createdBy value to be set + * @return Builder + */ + + public DiscountCodeDeletedMessageBuilder 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.

+ * @param sequenceNumber value to be set + * @return Builder + */ + + public DiscountCodeDeletedMessageBuilder sequenceNumber(final Long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * @param resource value to be set + * @return Builder + */ + + public DiscountCodeDeletedMessageBuilder 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 DiscountCodeDeletedMessageBuilder resource( + Function> builder) { + this.resource = builder.apply(com.commercetools.api.models.common.ReferenceBuilder.of()).build(); + return this; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * @param resourceVersion value to be set + * @return Builder + */ + + public DiscountCodeDeletedMessageBuilder 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.

+ * @param builder function to build the resourceUserProvidedIdentifiers value + * @return Builder + */ + + public DiscountCodeDeletedMessageBuilder resourceUserProvidedIdentifiers( + Function builder) { + this.resourceUserProvidedIdentifiers = builder + .apply(com.commercetools.api.models.message.UserProvidedIdentifiersBuilder.of()) + .build(); + return this; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * @param builder function to build the resourceUserProvidedIdentifiers value + * @return Builder + */ + + public DiscountCodeDeletedMessageBuilder withResourceUserProvidedIdentifiers( + Function builder) { + this.resourceUserProvidedIdentifiers = builder + .apply(com.commercetools.api.models.message.UserProvidedIdentifiersBuilder.of()); + return this; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * @param resourceUserProvidedIdentifiers value to be set + * @return Builder + */ + + public DiscountCodeDeletedMessageBuilder resourceUserProvidedIdentifiers( + @Nullable final com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers) { + this.resourceUserProvidedIdentifiers = resourceUserProvidedIdentifiers; + 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.

+ * @return version + */ + + public Long getVersion() { + return this.version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * @return createdAt + */ + + public java.time.ZonedDateTime getCreatedAt() { + return this.createdAt; + } + + /** + *

Value of createdAt.

+ * @return lastModifiedAt + */ + + public java.time.ZonedDateTime getLastModifiedAt() { + return this.lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * @return lastModifiedBy + */ + + @Nullable + public com.commercetools.api.models.common.LastModifiedBy getLastModifiedBy() { + return this.lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * @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.

+ * @return sequenceNumber + */ + + public Long getSequenceNumber() { + return this.sequenceNumber; + } + + /** + *

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.

+ * @return resourceUserProvidedIdentifiers + */ + + @Nullable + public com.commercetools.api.models.message.UserProvidedIdentifiers getResourceUserProvidedIdentifiers() { + return this.resourceUserProvidedIdentifiers; + } + + /** + * builds DiscountCodeDeletedMessage with checking for non-null required values + * @return DiscountCodeDeletedMessage + */ + public DiscountCodeDeletedMessage build() { + Objects.requireNonNull(id, DiscountCodeDeletedMessage.class + ": id is missing"); + Objects.requireNonNull(version, DiscountCodeDeletedMessage.class + ": version is missing"); + Objects.requireNonNull(createdAt, DiscountCodeDeletedMessage.class + ": createdAt is missing"); + Objects.requireNonNull(lastModifiedAt, DiscountCodeDeletedMessage.class + ": lastModifiedAt is missing"); + Objects.requireNonNull(sequenceNumber, DiscountCodeDeletedMessage.class + ": sequenceNumber is missing"); + Objects.requireNonNull(resource, DiscountCodeDeletedMessage.class + ": resource is missing"); + Objects.requireNonNull(resourceVersion, DiscountCodeDeletedMessage.class + ": resourceVersion is missing"); + return new DiscountCodeDeletedMessageImpl(id, version, createdAt, lastModifiedAt, lastModifiedBy, createdBy, + sequenceNumber, resource, resourceVersion, resourceUserProvidedIdentifiers); + } + + /** + * builds DiscountCodeDeletedMessage without checking for non-null required values + * @return DiscountCodeDeletedMessage + */ + public DiscountCodeDeletedMessage buildUnchecked() { + return new DiscountCodeDeletedMessageImpl(id, version, createdAt, lastModifiedAt, lastModifiedBy, createdBy, + sequenceNumber, resource, resourceVersion, resourceUserProvidedIdentifiers); + } + + /** + * factory method for an instance of DiscountCodeDeletedMessageBuilder + * @return builder + */ + public static DiscountCodeDeletedMessageBuilder of() { + return new DiscountCodeDeletedMessageBuilder(); + } + + /** + * create builder for DiscountCodeDeletedMessage instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static DiscountCodeDeletedMessageBuilder of(final DiscountCodeDeletedMessage template) { + DiscountCodeDeletedMessageBuilder builder = new DiscountCodeDeletedMessageBuilder(); + 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(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessageImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessageImpl.java new file mode 100644 index 00000000000..ab3289c9e4c --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessageImpl.java @@ -0,0 +1,276 @@ + +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 Delete DiscountCode request.

+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class DiscountCodeDeletedMessageImpl implements DiscountCodeDeletedMessage, 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; + + /** + * create instance with all properties + */ + @JsonCreator + DiscountCodeDeletedMessageImpl(@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) { + 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.type = DISCOUNT_CODE_DELETED; + } + + /** + * create empty instance + */ + public DiscountCodeDeletedMessageImpl() { + this.type = DISCOUNT_CODE_DELETED; + } + + /** + *

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.

+ */ + + public Long getVersion() { + return this.version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ */ + + public java.time.ZonedDateTime getCreatedAt() { + return this.createdAt; + } + + /** + *

Value of createdAt.

+ */ + + public java.time.ZonedDateTime getLastModifiedAt() { + return this.lastModifiedAt; + } + + /** + *

Value of createdBy.

+ */ + + public com.commercetools.api.models.common.LastModifiedBy getLastModifiedBy() { + return this.lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ */ + + 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.

+ */ + + public Long getSequenceNumber() { + return this.sequenceNumber; + } + + /** + *

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.

+ */ + + public com.commercetools.api.models.message.UserProvidedIdentifiers getResourceUserProvidedIdentifiers() { + return this.resourceUserProvidedIdentifiers; + } + + 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + DiscountCodeDeletedMessageImpl that = (DiscountCodeDeletedMessageImpl) 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(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) + .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) + .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) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessagePayload.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessagePayload.java new file mode 100644 index 00000000000..ea75329d4d5 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessagePayload.java @@ -0,0 +1,108 @@ + +package com.commercetools.api.models.message; + +import java.time.*; +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +/** + *

Generated after a successful Delete DiscountCode request.

+ * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     DiscountCodeDeletedMessagePayload discountCodeDeletedMessagePayload = DiscountCodeDeletedMessagePayload.builder()
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = DiscountCodeDeletedMessagePayloadImpl.class) +public interface DiscountCodeDeletedMessagePayload extends MessagePayload { + + /** + * discriminator value for DiscountCodeDeletedMessagePayload + */ + String DISCOUNT_CODE_DELETED = "DiscountCodeDeleted"; + + /** + * factory method + * @return instance of DiscountCodeDeletedMessagePayload + */ + public static DiscountCodeDeletedMessagePayload of() { + return new DiscountCodeDeletedMessagePayloadImpl(); + } + + /** + * factory method to create a shallow copy DiscountCodeDeletedMessagePayload + * @param template instance to be copied + * @return copy instance + */ + public static DiscountCodeDeletedMessagePayload of(final DiscountCodeDeletedMessagePayload template) { + DiscountCodeDeletedMessagePayloadImpl instance = new DiscountCodeDeletedMessagePayloadImpl(); + return instance; + } + + /** + * factory method to create a deep copy of DiscountCodeDeletedMessagePayload + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static DiscountCodeDeletedMessagePayload deepCopy( + @Nullable final DiscountCodeDeletedMessagePayload template) { + if (template == null) { + return null; + } + DiscountCodeDeletedMessagePayloadImpl instance = new DiscountCodeDeletedMessagePayloadImpl(); + return instance; + } + + /** + * builder factory method for DiscountCodeDeletedMessagePayload + * @return builder + */ + public static DiscountCodeDeletedMessagePayloadBuilder builder() { + return DiscountCodeDeletedMessagePayloadBuilder.of(); + } + + /** + * create builder for DiscountCodeDeletedMessagePayload instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static DiscountCodeDeletedMessagePayloadBuilder builder(final DiscountCodeDeletedMessagePayload template) { + return DiscountCodeDeletedMessagePayloadBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withDiscountCodeDeletedMessagePayload(Function helper) { + return helper.apply(this); + } + + /** + * gives a TypeReference for usage with Jackson DataBind + * @return TypeReference + */ + public static com.fasterxml.jackson.core.type.TypeReference typeReference() { + return new com.fasterxml.jackson.core.type.TypeReference() { + @Override + public String toString() { + return "TypeReference"; + } + }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessagePayloadBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessagePayloadBuilder.java new file mode 100644 index 00000000000..08ab17d0b66 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessagePayloadBuilder.java @@ -0,0 +1,57 @@ + +package com.commercetools.api.models.message; + +import java.util.*; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * DiscountCodeDeletedMessagePayloadBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     DiscountCodeDeletedMessagePayload discountCodeDeletedMessagePayload = DiscountCodeDeletedMessagePayload.builder()
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class DiscountCodeDeletedMessagePayloadBuilder implements Builder { + + /** + * builds DiscountCodeDeletedMessagePayload with checking for non-null required values + * @return DiscountCodeDeletedMessagePayload + */ + public DiscountCodeDeletedMessagePayload build() { + return new DiscountCodeDeletedMessagePayloadImpl(); + } + + /** + * builds DiscountCodeDeletedMessagePayload without checking for non-null required values + * @return DiscountCodeDeletedMessagePayload + */ + public DiscountCodeDeletedMessagePayload buildUnchecked() { + return new DiscountCodeDeletedMessagePayloadImpl(); + } + + /** + * factory method for an instance of DiscountCodeDeletedMessagePayloadBuilder + * @return builder + */ + public static DiscountCodeDeletedMessagePayloadBuilder of() { + return new DiscountCodeDeletedMessagePayloadBuilder(); + } + + /** + * create builder for DiscountCodeDeletedMessagePayload instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static DiscountCodeDeletedMessagePayloadBuilder of(final DiscountCodeDeletedMessagePayload template) { + DiscountCodeDeletedMessagePayloadBuilder builder = new DiscountCodeDeletedMessagePayloadBuilder(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessagePayloadImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessagePayloadImpl.java new file mode 100644 index 00000000000..feb76c653f9 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessagePayloadImpl.java @@ -0,0 +1,65 @@ + +package com.commercetools.api.models.message; + +import java.time.*; +import java.util.*; + +import com.fasterxml.jackson.annotation.JsonCreator; +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 Delete DiscountCode request.

+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class DiscountCodeDeletedMessagePayloadImpl implements DiscountCodeDeletedMessagePayload, ModelBase { + + private String type; + + /** + * create instance with all properties + */ + @JsonCreator + DiscountCodeDeletedMessagePayloadImpl() { + this.type = DISCOUNT_CODE_DELETED; + } + + /** + * + */ + + public String getType() { + return this.type; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + DiscountCodeDeletedMessagePayloadImpl that = (DiscountCodeDeletedMessagePayloadImpl) o; + + return new EqualsBuilder().append(type, that.type).append(type, that.type).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(type).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("type", type).build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessage.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessage.java new file mode 100644 index 00000000000..6729f61f33e --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessage.java @@ -0,0 +1,170 @@ + +package com.commercetools.api.models.message; + +import java.time.*; +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +/** + *

Generated after a successful Set Key update action.

+ * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     DiscountCodeKeySetMessage discountCodeKeySetMessage = DiscountCodeKeySetMessage.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()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = DiscountCodeKeySetMessageImpl.class) +public interface DiscountCodeKeySetMessage extends Message { + + /** + * discriminator value for DiscountCodeKeySetMessage + */ + String DISCOUNT_CODE_KEY_SET = "DiscountCodeKeySet"; + + /** + *

key value of the Discount Code after the Set Key update action.

+ * @return key + */ + + @JsonProperty("key") + public String getKey(); + + /** + *

key value of the Discount Code before the Set Key update action.

+ * @return oldKey + */ + + @JsonProperty("oldKey") + public String getOldKey(); + + /** + *

key value of the Discount Code after the Set Key update action.

+ * @param key value to be set + */ + + public void setKey(final String key); + + /** + *

key value of the Discount Code before the Set Key update action.

+ * @param oldKey value to be set + */ + + public void setOldKey(final String oldKey); + + /** + * factory method + * @return instance of DiscountCodeKeySetMessage + */ + public static DiscountCodeKeySetMessage of() { + return new DiscountCodeKeySetMessageImpl(); + } + + /** + * factory method to create a shallow copy DiscountCodeKeySetMessage + * @param template instance to be copied + * @return copy instance + */ + public static DiscountCodeKeySetMessage of(final DiscountCodeKeySetMessage template) { + DiscountCodeKeySetMessageImpl instance = new DiscountCodeKeySetMessageImpl(); + 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.setKey(template.getKey()); + instance.setOldKey(template.getOldKey()); + return instance; + } + + /** + * factory method to create a deep copy of DiscountCodeKeySetMessage + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static DiscountCodeKeySetMessage deepCopy(@Nullable final DiscountCodeKeySetMessage template) { + if (template == null) { + return null; + } + DiscountCodeKeySetMessageImpl instance = new DiscountCodeKeySetMessageImpl(); + 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.setKey(template.getKey()); + instance.setOldKey(template.getOldKey()); + return instance; + } + + /** + * builder factory method for DiscountCodeKeySetMessage + * @return builder + */ + public static DiscountCodeKeySetMessageBuilder builder() { + return DiscountCodeKeySetMessageBuilder.of(); + } + + /** + * create builder for DiscountCodeKeySetMessage instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static DiscountCodeKeySetMessageBuilder builder(final DiscountCodeKeySetMessage template) { + return DiscountCodeKeySetMessageBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withDiscountCodeKeySetMessage(Function helper) { + return helper.apply(this); + } + + /** + * gives a TypeReference for usage with Jackson DataBind + * @return TypeReference + */ + public static com.fasterxml.jackson.core.type.TypeReference typeReference() { + return new com.fasterxml.jackson.core.type.TypeReference() { + @Override + public String toString() { + return "TypeReference"; + } + }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessageBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessageBuilder.java new file mode 100644 index 00000000000..0c29800636c --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessageBuilder.java @@ -0,0 +1,452 @@ + +package com.commercetools.api.models.message; + +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * DiscountCodeKeySetMessageBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     DiscountCodeKeySetMessage discountCodeKeySetMessage = DiscountCodeKeySetMessage.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()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class DiscountCodeKeySetMessageBuilder implements Builder { + + private String id; + + private Long version; + + private java.time.ZonedDateTime createdAt; + + private java.time.ZonedDateTime lastModifiedAt; + + @Nullable + private com.commercetools.api.models.common.LastModifiedBy lastModifiedBy; + + @Nullable + private com.commercetools.api.models.common.CreatedBy createdBy; + + private Long sequenceNumber; + + private com.commercetools.api.models.common.Reference resource; + + private Long resourceVersion; + + @Nullable + private com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers; + + @Nullable + private String key; + + @Nullable + private String oldKey; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * @param id value to be set + * @return Builder + */ + + public DiscountCodeKeySetMessageBuilder id(final String id) { + this.id = id; + return this; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * @param version value to be set + * @return Builder + */ + + public DiscountCodeKeySetMessageBuilder version(final Long version) { + this.version = version; + return this; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * @param createdAt value to be set + * @return Builder + */ + + public DiscountCodeKeySetMessageBuilder createdAt(final java.time.ZonedDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + *

Value of createdAt.

+ * @param lastModifiedAt value to be set + * @return Builder + */ + + public DiscountCodeKeySetMessageBuilder lastModifiedAt(final java.time.ZonedDateTime lastModifiedAt) { + this.lastModifiedAt = lastModifiedAt; + return this; + } + + /** + *

Value of createdBy.

+ * @param builder function to build the lastModifiedBy value + * @return Builder + */ + + public DiscountCodeKeySetMessageBuilder lastModifiedBy( + Function builder) { + this.lastModifiedBy = builder.apply(com.commercetools.api.models.common.LastModifiedByBuilder.of()).build(); + return this; + } + + /** + *

Value of createdBy.

+ * @param builder function to build the lastModifiedBy value + * @return Builder + */ + + public DiscountCodeKeySetMessageBuilder withLastModifiedBy( + Function builder) { + this.lastModifiedBy = builder.apply(com.commercetools.api.models.common.LastModifiedByBuilder.of()); + return this; + } + + /** + *

Value of createdBy.

+ * @param lastModifiedBy value to be set + * @return Builder + */ + + public DiscountCodeKeySetMessageBuilder lastModifiedBy( + @Nullable final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + return this; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * @param builder function to build the createdBy value + * @return Builder + */ + + public DiscountCodeKeySetMessageBuilder createdBy( + Function builder) { + this.createdBy = builder.apply(com.commercetools.api.models.common.CreatedByBuilder.of()).build(); + return this; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * @param builder function to build the createdBy value + * @return Builder + */ + + public DiscountCodeKeySetMessageBuilder withCreatedBy( + Function builder) { + this.createdBy = builder.apply(com.commercetools.api.models.common.CreatedByBuilder.of()); + return this; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * @param createdBy value to be set + * @return Builder + */ + + public DiscountCodeKeySetMessageBuilder 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.

+ * @param sequenceNumber value to be set + * @return Builder + */ + + public DiscountCodeKeySetMessageBuilder sequenceNumber(final Long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * @param resource value to be set + * @return Builder + */ + + public DiscountCodeKeySetMessageBuilder 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 DiscountCodeKeySetMessageBuilder resource( + Function> builder) { + this.resource = builder.apply(com.commercetools.api.models.common.ReferenceBuilder.of()).build(); + return this; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * @param resourceVersion value to be set + * @return Builder + */ + + public DiscountCodeKeySetMessageBuilder 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.

+ * @param builder function to build the resourceUserProvidedIdentifiers value + * @return Builder + */ + + public DiscountCodeKeySetMessageBuilder resourceUserProvidedIdentifiers( + Function builder) { + this.resourceUserProvidedIdentifiers = builder + .apply(com.commercetools.api.models.message.UserProvidedIdentifiersBuilder.of()) + .build(); + return this; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * @param builder function to build the resourceUserProvidedIdentifiers value + * @return Builder + */ + + public DiscountCodeKeySetMessageBuilder withResourceUserProvidedIdentifiers( + Function builder) { + this.resourceUserProvidedIdentifiers = builder + .apply(com.commercetools.api.models.message.UserProvidedIdentifiersBuilder.of()); + return this; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * @param resourceUserProvidedIdentifiers value to be set + * @return Builder + */ + + public DiscountCodeKeySetMessageBuilder resourceUserProvidedIdentifiers( + @Nullable final com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers) { + this.resourceUserProvidedIdentifiers = resourceUserProvidedIdentifiers; + return this; + } + + /** + *

key value of the Discount Code after the Set Key update action.

+ * @param key value to be set + * @return Builder + */ + + public DiscountCodeKeySetMessageBuilder key(@Nullable final String key) { + this.key = key; + return this; + } + + /** + *

key value of the Discount Code before the Set Key update action.

+ * @param oldKey value to be set + * @return Builder + */ + + public DiscountCodeKeySetMessageBuilder oldKey(@Nullable final String oldKey) { + this.oldKey = oldKey; + 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.

+ * @return version + */ + + public Long getVersion() { + return this.version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * @return createdAt + */ + + public java.time.ZonedDateTime getCreatedAt() { + return this.createdAt; + } + + /** + *

Value of createdAt.

+ * @return lastModifiedAt + */ + + public java.time.ZonedDateTime getLastModifiedAt() { + return this.lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * @return lastModifiedBy + */ + + @Nullable + public com.commercetools.api.models.common.LastModifiedBy getLastModifiedBy() { + return this.lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * @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.

+ * @return sequenceNumber + */ + + public Long getSequenceNumber() { + return this.sequenceNumber; + } + + /** + *

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.

+ * @return resourceUserProvidedIdentifiers + */ + + @Nullable + public com.commercetools.api.models.message.UserProvidedIdentifiers getResourceUserProvidedIdentifiers() { + return this.resourceUserProvidedIdentifiers; + } + + /** + *

key value of the Discount Code after the Set Key update action.

+ * @return key + */ + + @Nullable + public String getKey() { + return this.key; + } + + /** + *

key value of the Discount Code before the Set Key update action.

+ * @return oldKey + */ + + @Nullable + public String getOldKey() { + return this.oldKey; + } + + /** + * builds DiscountCodeKeySetMessage with checking for non-null required values + * @return DiscountCodeKeySetMessage + */ + public DiscountCodeKeySetMessage build() { + Objects.requireNonNull(id, DiscountCodeKeySetMessage.class + ": id is missing"); + Objects.requireNonNull(version, DiscountCodeKeySetMessage.class + ": version is missing"); + Objects.requireNonNull(createdAt, DiscountCodeKeySetMessage.class + ": createdAt is missing"); + Objects.requireNonNull(lastModifiedAt, DiscountCodeKeySetMessage.class + ": lastModifiedAt is missing"); + Objects.requireNonNull(sequenceNumber, DiscountCodeKeySetMessage.class + ": sequenceNumber is missing"); + Objects.requireNonNull(resource, DiscountCodeKeySetMessage.class + ": resource is missing"); + Objects.requireNonNull(resourceVersion, DiscountCodeKeySetMessage.class + ": resourceVersion is missing"); + return new DiscountCodeKeySetMessageImpl(id, version, createdAt, lastModifiedAt, lastModifiedBy, createdBy, + sequenceNumber, resource, resourceVersion, resourceUserProvidedIdentifiers, key, oldKey); + } + + /** + * builds DiscountCodeKeySetMessage without checking for non-null required values + * @return DiscountCodeKeySetMessage + */ + public DiscountCodeKeySetMessage buildUnchecked() { + return new DiscountCodeKeySetMessageImpl(id, version, createdAt, lastModifiedAt, lastModifiedBy, createdBy, + sequenceNumber, resource, resourceVersion, resourceUserProvidedIdentifiers, key, oldKey); + } + + /** + * factory method for an instance of DiscountCodeKeySetMessageBuilder + * @return builder + */ + public static DiscountCodeKeySetMessageBuilder of() { + return new DiscountCodeKeySetMessageBuilder(); + } + + /** + * create builder for DiscountCodeKeySetMessage instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static DiscountCodeKeySetMessageBuilder of(final DiscountCodeKeySetMessage template) { + DiscountCodeKeySetMessageBuilder builder = new DiscountCodeKeySetMessageBuilder(); + 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.key = template.getKey(); + builder.oldKey = template.getOldKey(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessageImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessageImpl.java new file mode 100644 index 00000000000..1ce944f5b83 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessageImpl.java @@ -0,0 +1,315 @@ + +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 Key update action.

+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class DiscountCodeKeySetMessageImpl implements DiscountCodeKeySetMessage, 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 String key; + + private String oldKey; + + /** + * create instance with all properties + */ + @JsonCreator + DiscountCodeKeySetMessageImpl(@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("key") final String key, @JsonProperty("oldKey") final String oldKey) { + 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.key = key; + this.oldKey = oldKey; + this.type = DISCOUNT_CODE_KEY_SET; + } + + /** + * create empty instance + */ + public DiscountCodeKeySetMessageImpl() { + this.type = DISCOUNT_CODE_KEY_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.

+ */ + + public Long getVersion() { + return this.version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ */ + + public java.time.ZonedDateTime getCreatedAt() { + return this.createdAt; + } + + /** + *

Value of createdAt.

+ */ + + public java.time.ZonedDateTime getLastModifiedAt() { + return this.lastModifiedAt; + } + + /** + *

Value of createdBy.

+ */ + + public com.commercetools.api.models.common.LastModifiedBy getLastModifiedBy() { + return this.lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ */ + + 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.

+ */ + + public Long getSequenceNumber() { + return this.sequenceNumber; + } + + /** + *

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.

+ */ + + public com.commercetools.api.models.message.UserProvidedIdentifiers getResourceUserProvidedIdentifiers() { + return this.resourceUserProvidedIdentifiers; + } + + /** + *

key value of the Discount Code after the Set Key update action.

+ */ + + public String getKey() { + return this.key; + } + + /** + *

key value of the Discount Code before the Set Key update action.

+ */ + + public String getOldKey() { + return this.oldKey; + } + + 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 setKey(final String key) { + this.key = key; + } + + public void setOldKey(final String oldKey) { + this.oldKey = oldKey; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + DiscountCodeKeySetMessageImpl that = (DiscountCodeKeySetMessageImpl) 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(key, that.key) + .append(oldKey, that.oldKey) + .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(key, that.key) + .append(oldKey, that.oldKey) + .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(key) + .append(oldKey) + .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("key", key) + .append("oldKey", oldKey) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessagePayload.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessagePayload.java new file mode 100644 index 00000000000..58ab0387f5e --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessagePayload.java @@ -0,0 +1,141 @@ + +package com.commercetools.api.models.message; + +import java.time.*; +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +/** + *

Generated after a successful Set Key update action.

+ * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     DiscountCodeKeySetMessagePayload discountCodeKeySetMessagePayload = DiscountCodeKeySetMessagePayload.builder()
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = DiscountCodeKeySetMessagePayloadImpl.class) +public interface DiscountCodeKeySetMessagePayload extends MessagePayload { + + /** + * discriminator value for DiscountCodeKeySetMessagePayload + */ + String DISCOUNT_CODE_KEY_SET = "DiscountCodeKeySet"; + + /** + *

key value of the Discount Code after the Set Key update action.

+ * @return key + */ + + @JsonProperty("key") + public String getKey(); + + /** + *

key value of the Discount Code before the Set Key update action.

+ * @return oldKey + */ + + @JsonProperty("oldKey") + public String getOldKey(); + + /** + *

key value of the Discount Code after the Set Key update action.

+ * @param key value to be set + */ + + public void setKey(final String key); + + /** + *

key value of the Discount Code before the Set Key update action.

+ * @param oldKey value to be set + */ + + public void setOldKey(final String oldKey); + + /** + * factory method + * @return instance of DiscountCodeKeySetMessagePayload + */ + public static DiscountCodeKeySetMessagePayload of() { + return new DiscountCodeKeySetMessagePayloadImpl(); + } + + /** + * factory method to create a shallow copy DiscountCodeKeySetMessagePayload + * @param template instance to be copied + * @return copy instance + */ + public static DiscountCodeKeySetMessagePayload of(final DiscountCodeKeySetMessagePayload template) { + DiscountCodeKeySetMessagePayloadImpl instance = new DiscountCodeKeySetMessagePayloadImpl(); + instance.setKey(template.getKey()); + instance.setOldKey(template.getOldKey()); + return instance; + } + + /** + * factory method to create a deep copy of DiscountCodeKeySetMessagePayload + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static DiscountCodeKeySetMessagePayload deepCopy(@Nullable final DiscountCodeKeySetMessagePayload template) { + if (template == null) { + return null; + } + DiscountCodeKeySetMessagePayloadImpl instance = new DiscountCodeKeySetMessagePayloadImpl(); + instance.setKey(template.getKey()); + instance.setOldKey(template.getOldKey()); + return instance; + } + + /** + * builder factory method for DiscountCodeKeySetMessagePayload + * @return builder + */ + public static DiscountCodeKeySetMessagePayloadBuilder builder() { + return DiscountCodeKeySetMessagePayloadBuilder.of(); + } + + /** + * create builder for DiscountCodeKeySetMessagePayload instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static DiscountCodeKeySetMessagePayloadBuilder builder(final DiscountCodeKeySetMessagePayload template) { + return DiscountCodeKeySetMessagePayloadBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withDiscountCodeKeySetMessagePayload(Function helper) { + return helper.apply(this); + } + + /** + * gives a TypeReference for usage with Jackson DataBind + * @return TypeReference + */ + public static com.fasterxml.jackson.core.type.TypeReference typeReference() { + return new com.fasterxml.jackson.core.type.TypeReference() { + @Override + public String toString() { + return "TypeReference"; + } + }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessagePayloadBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessagePayloadBuilder.java new file mode 100644 index 00000000000..e4b4a336d99 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessagePayloadBuilder.java @@ -0,0 +1,109 @@ + +package com.commercetools.api.models.message; + +import java.util.*; + +import javax.annotation.Nullable; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * DiscountCodeKeySetMessagePayloadBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     DiscountCodeKeySetMessagePayload discountCodeKeySetMessagePayload = DiscountCodeKeySetMessagePayload.builder()
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class DiscountCodeKeySetMessagePayloadBuilder implements Builder { + + @Nullable + private String key; + + @Nullable + private String oldKey; + + /** + *

key value of the Discount Code after the Set Key update action.

+ * @param key value to be set + * @return Builder + */ + + public DiscountCodeKeySetMessagePayloadBuilder key(@Nullable final String key) { + this.key = key; + return this; + } + + /** + *

key value of the Discount Code before the Set Key update action.

+ * @param oldKey value to be set + * @return Builder + */ + + public DiscountCodeKeySetMessagePayloadBuilder oldKey(@Nullable final String oldKey) { + this.oldKey = oldKey; + return this; + } + + /** + *

key value of the Discount Code after the Set Key update action.

+ * @return key + */ + + @Nullable + public String getKey() { + return this.key; + } + + /** + *

key value of the Discount Code before the Set Key update action.

+ * @return oldKey + */ + + @Nullable + public String getOldKey() { + return this.oldKey; + } + + /** + * builds DiscountCodeKeySetMessagePayload with checking for non-null required values + * @return DiscountCodeKeySetMessagePayload + */ + public DiscountCodeKeySetMessagePayload build() { + return new DiscountCodeKeySetMessagePayloadImpl(key, oldKey); + } + + /** + * builds DiscountCodeKeySetMessagePayload without checking for non-null required values + * @return DiscountCodeKeySetMessagePayload + */ + public DiscountCodeKeySetMessagePayload buildUnchecked() { + return new DiscountCodeKeySetMessagePayloadImpl(key, oldKey); + } + + /** + * factory method for an instance of DiscountCodeKeySetMessagePayloadBuilder + * @return builder + */ + public static DiscountCodeKeySetMessagePayloadBuilder of() { + return new DiscountCodeKeySetMessagePayloadBuilder(); + } + + /** + * create builder for DiscountCodeKeySetMessagePayload instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static DiscountCodeKeySetMessagePayloadBuilder of(final DiscountCodeKeySetMessagePayload template) { + DiscountCodeKeySetMessagePayloadBuilder builder = new DiscountCodeKeySetMessagePayloadBuilder(); + builder.key = template.getKey(); + builder.oldKey = template.getOldKey(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessagePayloadImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessagePayloadImpl.java new file mode 100644 index 00000000000..48079dabeb2 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessagePayloadImpl.java @@ -0,0 +1,113 @@ + +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 Key update action.

+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class DiscountCodeKeySetMessagePayloadImpl implements DiscountCodeKeySetMessagePayload, ModelBase { + + private String type; + + private String key; + + private String oldKey; + + /** + * create instance with all properties + */ + @JsonCreator + DiscountCodeKeySetMessagePayloadImpl(@JsonProperty("key") final String key, + @JsonProperty("oldKey") final String oldKey) { + this.key = key; + this.oldKey = oldKey; + this.type = DISCOUNT_CODE_KEY_SET; + } + + /** + * create empty instance + */ + public DiscountCodeKeySetMessagePayloadImpl() { + this.type = DISCOUNT_CODE_KEY_SET; + } + + /** + * + */ + + public String getType() { + return this.type; + } + + /** + *

key value of the Discount Code after the Set Key update action.

+ */ + + public String getKey() { + return this.key; + } + + /** + *

key value of the Discount Code before the Set Key update action.

+ */ + + public String getOldKey() { + return this.oldKey; + } + + public void setKey(final String key) { + this.key = key; + } + + public void setOldKey(final String oldKey) { + this.oldKey = oldKey; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + DiscountCodeKeySetMessagePayloadImpl that = (DiscountCodeKeySetMessagePayloadImpl) o; + + return new EqualsBuilder().append(type, that.type) + .append(key, that.key) + .append(oldKey, that.oldKey) + .append(type, that.type) + .append(key, that.key) + .append(oldKey, that.oldKey) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(type).append(key).append(oldKey).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("type", type) + .append("key", key) + .append("oldKey", oldKey) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/Message.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/Message.java index 444e5b5d3b0..384759cb4a6 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/Message.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/Message.java @@ -137,6 +137,9 @@ @JsonSubTypes.Type(value = com.commercetools.api.models.message.DeliveryAddressSetMessageImpl.class, name = DeliveryAddressSetMessage.DELIVERY_ADDRESS_SET), @JsonSubTypes.Type(value = com.commercetools.api.models.message.DeliveryItemsUpdatedMessageImpl.class, name = DeliveryItemsUpdatedMessage.DELIVERY_ITEMS_UPDATED), @JsonSubTypes.Type(value = com.commercetools.api.models.message.DeliveryRemovedMessageImpl.class, name = DeliveryRemovedMessage.DELIVERY_REMOVED), + @JsonSubTypes.Type(value = com.commercetools.api.models.message.DiscountCodeCreatedMessageImpl.class, name = DiscountCodeCreatedMessage.DISCOUNT_CODE_CREATED), + @JsonSubTypes.Type(value = com.commercetools.api.models.message.DiscountCodeDeletedMessageImpl.class, name = DiscountCodeDeletedMessage.DISCOUNT_CODE_DELETED), + @JsonSubTypes.Type(value = com.commercetools.api.models.message.DiscountCodeKeySetMessageImpl.class, name = DiscountCodeKeySetMessage.DISCOUNT_CODE_KEY_SET), @JsonSubTypes.Type(value = com.commercetools.api.models.message.InventoryEntryCreatedMessageImpl.class, name = InventoryEntryCreatedMessage.INVENTORY_ENTRY_CREATED), @JsonSubTypes.Type(value = com.commercetools.api.models.message.InventoryEntryDeletedMessageImpl.class, name = InventoryEntryDeletedMessage.INVENTORY_ENTRY_DELETED), @JsonSubTypes.Type(value = com.commercetools.api.models.message.InventoryEntryQuantitySetMessageImpl.class, name = InventoryEntryQuantitySetMessage.INVENTORY_ENTRY_QUANTITY_SET), @@ -797,6 +800,18 @@ public static Message deepCopy(@Nullable final Message template) { return com.commercetools.api.models.message.CustomerTitleSetMessage .deepCopy((com.commercetools.api.models.message.CustomerTitleSetMessage) template); } + if (template instanceof com.commercetools.api.models.message.DiscountCodeCreatedMessage) { + return com.commercetools.api.models.message.DiscountCodeCreatedMessage + .deepCopy((com.commercetools.api.models.message.DiscountCodeCreatedMessage) template); + } + if (template instanceof com.commercetools.api.models.message.DiscountCodeDeletedMessage) { + return com.commercetools.api.models.message.DiscountCodeDeletedMessage + .deepCopy((com.commercetools.api.models.message.DiscountCodeDeletedMessage) template); + } + if (template instanceof com.commercetools.api.models.message.DiscountCodeKeySetMessage) { + return com.commercetools.api.models.message.DiscountCodeKeySetMessage + .deepCopy((com.commercetools.api.models.message.DiscountCodeKeySetMessage) template); + } if (template instanceof com.commercetools.api.models.message.InventoryEntryCreatedMessage) { return com.commercetools.api.models.message.InventoryEntryCreatedMessage .deepCopy((com.commercetools.api.models.message.InventoryEntryCreatedMessage) template); @@ -1905,6 +1920,30 @@ public static com.commercetools.api.models.message.DeliveryRemovedMessageBuilder return com.commercetools.api.models.message.DeliveryRemovedMessageBuilder.of(); } + /** + * builder for discountCodeCreated subtype + * @return builder + */ + public static com.commercetools.api.models.message.DiscountCodeCreatedMessageBuilder discountCodeCreatedBuilder() { + return com.commercetools.api.models.message.DiscountCodeCreatedMessageBuilder.of(); + } + + /** + * builder for discountCodeDeleted subtype + * @return builder + */ + public static com.commercetools.api.models.message.DiscountCodeDeletedMessageBuilder discountCodeDeletedBuilder() { + return com.commercetools.api.models.message.DiscountCodeDeletedMessageBuilder.of(); + } + + /** + * builder for discountCodeKeySet subtype + * @return builder + */ + public static com.commercetools.api.models.message.DiscountCodeKeySetMessageBuilder discountCodeKeySetBuilder() { + return com.commercetools.api.models.message.DiscountCodeKeySetMessageBuilder.of(); + } + /** * builder for inventoryEntryCreated subtype * @return builder diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/MessageBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/MessageBuilder.java index b8bc4baacc8..06ba24a56f1 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/MessageBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/MessageBuilder.java @@ -395,6 +395,18 @@ public com.commercetools.api.models.message.DeliveryRemovedMessageBuilder delive return com.commercetools.api.models.message.DeliveryRemovedMessageBuilder.of(); } + public com.commercetools.api.models.message.DiscountCodeCreatedMessageBuilder discountCodeCreatedBuilder() { + return com.commercetools.api.models.message.DiscountCodeCreatedMessageBuilder.of(); + } + + public com.commercetools.api.models.message.DiscountCodeDeletedMessageBuilder discountCodeDeletedBuilder() { + return com.commercetools.api.models.message.DiscountCodeDeletedMessageBuilder.of(); + } + + public com.commercetools.api.models.message.DiscountCodeKeySetMessageBuilder discountCodeKeySetBuilder() { + return com.commercetools.api.models.message.DiscountCodeKeySetMessageBuilder.of(); + } + public com.commercetools.api.models.message.InventoryEntryCreatedMessageBuilder inventoryEntryCreatedBuilder() { return com.commercetools.api.models.message.InventoryEntryCreatedMessageBuilder.of(); } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/MessagePayload.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/MessagePayload.java index 545c91b9a33..f269ac9b733 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/MessagePayload.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/MessagePayload.java @@ -124,6 +124,9 @@ @JsonSubTypes.Type(value = com.commercetools.api.models.message.DeliveryAddressSetMessagePayloadImpl.class, name = DeliveryAddressSetMessagePayload.DELIVERY_ADDRESS_SET), @JsonSubTypes.Type(value = com.commercetools.api.models.message.DeliveryItemsUpdatedMessagePayloadImpl.class, name = DeliveryItemsUpdatedMessagePayload.DELIVERY_ITEMS_UPDATED), @JsonSubTypes.Type(value = com.commercetools.api.models.message.DeliveryRemovedMessagePayloadImpl.class, name = DeliveryRemovedMessagePayload.DELIVERY_REMOVED), + @JsonSubTypes.Type(value = com.commercetools.api.models.message.DiscountCodeCreatedMessagePayloadImpl.class, name = DiscountCodeCreatedMessagePayload.DISCOUNT_CODE_CREATED), + @JsonSubTypes.Type(value = com.commercetools.api.models.message.DiscountCodeDeletedMessagePayloadImpl.class, name = DiscountCodeDeletedMessagePayload.DISCOUNT_CODE_DELETED), + @JsonSubTypes.Type(value = com.commercetools.api.models.message.DiscountCodeKeySetMessagePayloadImpl.class, name = DiscountCodeKeySetMessagePayload.DISCOUNT_CODE_KEY_SET), @JsonSubTypes.Type(value = com.commercetools.api.models.message.InventoryEntryCreatedMessagePayloadImpl.class, name = InventoryEntryCreatedMessagePayload.INVENTORY_ENTRY_CREATED), @JsonSubTypes.Type(value = com.commercetools.api.models.message.InventoryEntryDeletedMessagePayloadImpl.class, name = InventoryEntryDeletedMessagePayload.INVENTORY_ENTRY_DELETED), @JsonSubTypes.Type(value = com.commercetools.api.models.message.InventoryEntryQuantitySetMessagePayloadImpl.class, name = InventoryEntryQuantitySetMessagePayload.INVENTORY_ENTRY_QUANTITY_SET), @@ -634,6 +637,18 @@ public static MessagePayload deepCopy(@Nullable final MessagePayload template) { return com.commercetools.api.models.message.CustomerTitleSetMessagePayload .deepCopy((com.commercetools.api.models.message.CustomerTitleSetMessagePayload) template); } + if (template instanceof com.commercetools.api.models.message.DiscountCodeCreatedMessagePayload) { + return com.commercetools.api.models.message.DiscountCodeCreatedMessagePayload + .deepCopy((com.commercetools.api.models.message.DiscountCodeCreatedMessagePayload) template); + } + if (template instanceof com.commercetools.api.models.message.DiscountCodeDeletedMessagePayload) { + return com.commercetools.api.models.message.DiscountCodeDeletedMessagePayload + .deepCopy((com.commercetools.api.models.message.DiscountCodeDeletedMessagePayload) template); + } + if (template instanceof com.commercetools.api.models.message.DiscountCodeKeySetMessagePayload) { + return com.commercetools.api.models.message.DiscountCodeKeySetMessagePayload + .deepCopy((com.commercetools.api.models.message.DiscountCodeKeySetMessagePayload) template); + } if (template instanceof com.commercetools.api.models.message.InventoryEntryCreatedMessagePayload) { return com.commercetools.api.models.message.InventoryEntryCreatedMessagePayload .deepCopy((com.commercetools.api.models.message.InventoryEntryCreatedMessagePayload) template); @@ -1734,6 +1749,30 @@ public static com.commercetools.api.models.message.DeliveryRemovedMessagePayload return com.commercetools.api.models.message.DeliveryRemovedMessagePayloadBuilder.of(); } + /** + * builder for discountCodeCreated subtype + * @return builder + */ + public static com.commercetools.api.models.message.DiscountCodeCreatedMessagePayloadBuilder discountCodeCreatedBuilder() { + return com.commercetools.api.models.message.DiscountCodeCreatedMessagePayloadBuilder.of(); + } + + /** + * builder for discountCodeDeleted subtype + * @return builder + */ + public static com.commercetools.api.models.message.DiscountCodeDeletedMessagePayloadBuilder discountCodeDeletedBuilder() { + return com.commercetools.api.models.message.DiscountCodeDeletedMessagePayloadBuilder.of(); + } + + /** + * builder for discountCodeKeySet subtype + * @return builder + */ + public static com.commercetools.api.models.message.DiscountCodeKeySetMessagePayloadBuilder discountCodeKeySetBuilder() { + return com.commercetools.api.models.message.DiscountCodeKeySetMessagePayloadBuilder.of(); + } + /** * builder for inventoryEntryCreated subtype * @return builder diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/MessagePayloadBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/MessagePayloadBuilder.java index 77d2e3ded5a..1b24eef1030 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/MessagePayloadBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/MessagePayloadBuilder.java @@ -395,6 +395,18 @@ public com.commercetools.api.models.message.DeliveryRemovedMessagePayloadBuilder return com.commercetools.api.models.message.DeliveryRemovedMessagePayloadBuilder.of(); } + public com.commercetools.api.models.message.DiscountCodeCreatedMessagePayloadBuilder discountCodeCreatedBuilder() { + return com.commercetools.api.models.message.DiscountCodeCreatedMessagePayloadBuilder.of(); + } + + public com.commercetools.api.models.message.DiscountCodeDeletedMessagePayloadBuilder discountCodeDeletedBuilder() { + return com.commercetools.api.models.message.DiscountCodeDeletedMessagePayloadBuilder.of(); + } + + public com.commercetools.api.models.message.DiscountCodeKeySetMessagePayloadBuilder discountCodeKeySetBuilder() { + return com.commercetools.api.models.message.DiscountCodeKeySetMessagePayloadBuilder.of(); + } + public com.commercetools.api.models.message.InventoryEntryCreatedMessagePayloadBuilder inventoryEntryCreatedBuilder() { return com.commercetools.api.models.message.InventoryEntryCreatedMessagePayloadBuilder.of(); } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/discount_code/DiscountCodeDraftQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/discount_code/DiscountCodeDraftQueryBuilderDsl.java index 87da12af127..ecce59c7d1a 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/discount_code/DiscountCodeDraftQueryBuilderDsl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/discount_code/DiscountCodeDraftQueryBuilderDsl.java @@ -13,6 +13,11 @@ public static DiscountCodeDraftQueryBuilderDsl of() { return new DiscountCodeDraftQueryBuilderDsl(); } + public StringComparisonPredicateBuilder key() { + return new StringComparisonPredicateBuilder<>(BinaryQueryPredicate.of().left(new ConstantQueryPredicate("key")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeDraftQueryBuilderDsl::of)); + } + public CombinationQueryPredicate name( Function> fn) { return new CombinationQueryPredicate<>( diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/discount_code/DiscountCodeQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/discount_code/DiscountCodeQueryBuilderDsl.java index e8f4c18387a..9698f82491e 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/discount_code/DiscountCodeQueryBuilderDsl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/discount_code/DiscountCodeQueryBuilderDsl.java @@ -36,6 +36,11 @@ public DateTimeComparisonPredicateBuilder lastModif p -> new CombinationQueryPredicate<>(p, DiscountCodeQueryBuilderDsl::of)); } + public StringComparisonPredicateBuilder key() { + return new StringComparisonPredicateBuilder<>(BinaryQueryPredicate.of().left(new ConstantQueryPredicate("key")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeQueryBuilderDsl::of)); + } + public CombinationQueryPredicate lastModifiedBy( Function> fn) { return new CombinationQueryPredicate<>( diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/discount_code/DiscountCodeSetKeyActionQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/discount_code/DiscountCodeSetKeyActionQueryBuilderDsl.java new file mode 100644 index 00000000000..89281c3f064 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/discount_code/DiscountCodeSetKeyActionQueryBuilderDsl.java @@ -0,0 +1,25 @@ + +package com.commercetools.api.predicates.query.discount_code; + +import com.commercetools.api.predicates.query.*; + +public class DiscountCodeSetKeyActionQueryBuilderDsl { + public DiscountCodeSetKeyActionQueryBuilderDsl() { + } + + public static DiscountCodeSetKeyActionQueryBuilderDsl of() { + return new DiscountCodeSetKeyActionQueryBuilderDsl(); + } + + public StringComparisonPredicateBuilder action() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("action")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeSetKeyActionQueryBuilderDsl::of)); + } + + public StringComparisonPredicateBuilder key() { + return new StringComparisonPredicateBuilder<>(BinaryQueryPredicate.of().left(new ConstantQueryPredicate("key")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeSetKeyActionQueryBuilderDsl::of)); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/discount_code/DiscountCodeUpdateActionQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/discount_code/DiscountCodeUpdateActionQueryBuilderDsl.java index d790e6338af..0561a43056b 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/discount_code/DiscountCodeUpdateActionQueryBuilderDsl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/discount_code/DiscountCodeUpdateActionQueryBuilderDsl.java @@ -70,6 +70,13 @@ public CombinationQueryPredicate asSetD DiscountCodeUpdateActionQueryBuilderDsl::of); } + public CombinationQueryPredicate asSetKey( + Function> fn) { + return new CombinationQueryPredicate<>( + fn.apply(com.commercetools.api.predicates.query.discount_code.DiscountCodeSetKeyActionQueryBuilderDsl.of()), + DiscountCodeUpdateActionQueryBuilderDsl::of); + } + public CombinationQueryPredicate asSetMaxApplications( Function> fn) { return new CombinationQueryPredicate<>(fn.apply( diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeCreatedMessagePayloadQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeCreatedMessagePayloadQueryBuilderDsl.java new file mode 100644 index 00000000000..31836f96909 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeCreatedMessagePayloadQueryBuilderDsl.java @@ -0,0 +1,32 @@ + +package com.commercetools.api.predicates.query.message; + +import java.util.function.Function; + +import com.commercetools.api.predicates.query.*; + +public class DiscountCodeCreatedMessagePayloadQueryBuilderDsl { + public DiscountCodeCreatedMessagePayloadQueryBuilderDsl() { + } + + public static DiscountCodeCreatedMessagePayloadQueryBuilderDsl of() { + return new DiscountCodeCreatedMessagePayloadQueryBuilderDsl(); + } + + public StringComparisonPredicateBuilder type() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("type")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeCreatedMessagePayloadQueryBuilderDsl::of)); + } + + public CombinationQueryPredicate discountCode( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("discountCode")) + .inner(fn.apply( + com.commercetools.api.predicates.query.discount_code.DiscountCodeQueryBuilderDsl.of())), + DiscountCodeCreatedMessagePayloadQueryBuilderDsl::of); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeCreatedMessageQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeCreatedMessageQueryBuilderDsl.java new file mode 100644 index 00000000000..aac9ca5b817 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeCreatedMessageQueryBuilderDsl.java @@ -0,0 +1,104 @@ + +package com.commercetools.api.predicates.query.message; + +import java.util.function.Function; + +import com.commercetools.api.predicates.query.*; + +public class DiscountCodeCreatedMessageQueryBuilderDsl { + public DiscountCodeCreatedMessageQueryBuilderDsl() { + } + + public static DiscountCodeCreatedMessageQueryBuilderDsl of() { + return new DiscountCodeCreatedMessageQueryBuilderDsl(); + } + + public StringComparisonPredicateBuilder id() { + return new StringComparisonPredicateBuilder<>(BinaryQueryPredicate.of().left(new ConstantQueryPredicate("id")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeCreatedMessageQueryBuilderDsl::of)); + } + + public LongComparisonPredicateBuilder version() { + return new LongComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("version")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeCreatedMessageQueryBuilderDsl::of)); + } + + public DateTimeComparisonPredicateBuilder createdAt() { + return new DateTimeComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("createdAt")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeCreatedMessageQueryBuilderDsl::of)); + } + + public DateTimeComparisonPredicateBuilder lastModifiedAt() { + return new DateTimeComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("lastModifiedAt")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeCreatedMessageQueryBuilderDsl::of)); + } + + public CombinationQueryPredicate lastModifiedBy( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("lastModifiedBy")) + .inner(fn.apply(com.commercetools.api.predicates.query.common.LastModifiedByQueryBuilderDsl.of())), + DiscountCodeCreatedMessageQueryBuilderDsl::of); + } + + public CombinationQueryPredicate createdBy( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("createdBy")) + .inner(fn.apply(com.commercetools.api.predicates.query.common.CreatedByQueryBuilderDsl.of())), + DiscountCodeCreatedMessageQueryBuilderDsl::of); + } + + public LongComparisonPredicateBuilder sequenceNumber() { + return new LongComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("sequenceNumber")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeCreatedMessageQueryBuilderDsl::of)); + } + + public CombinationQueryPredicate resource( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("resource")) + .inner(fn.apply(com.commercetools.api.predicates.query.common.ReferenceQueryBuilderDsl.of())), + DiscountCodeCreatedMessageQueryBuilderDsl::of); + } + + public LongComparisonPredicateBuilder resourceVersion() { + return new LongComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("resourceVersion")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeCreatedMessageQueryBuilderDsl::of)); + } + + public StringComparisonPredicateBuilder type() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("type")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeCreatedMessageQueryBuilderDsl::of)); + } + + public CombinationQueryPredicate resourceUserProvidedIdentifiers( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("resourceUserProvidedIdentifiers")) + .inner(fn.apply( + com.commercetools.api.predicates.query.message.UserProvidedIdentifiersQueryBuilderDsl.of())), + DiscountCodeCreatedMessageQueryBuilderDsl::of); + } + + public CombinationQueryPredicate discountCode( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("discountCode")) + .inner(fn.apply( + com.commercetools.api.predicates.query.discount_code.DiscountCodeQueryBuilderDsl.of())), + DiscountCodeCreatedMessageQueryBuilderDsl::of); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeDeletedMessagePayloadQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeDeletedMessagePayloadQueryBuilderDsl.java new file mode 100644 index 00000000000..48e9b32b64b --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeDeletedMessagePayloadQueryBuilderDsl.java @@ -0,0 +1,20 @@ + +package com.commercetools.api.predicates.query.message; + +import com.commercetools.api.predicates.query.*; + +public class DiscountCodeDeletedMessagePayloadQueryBuilderDsl { + public DiscountCodeDeletedMessagePayloadQueryBuilderDsl() { + } + + public static DiscountCodeDeletedMessagePayloadQueryBuilderDsl of() { + return new DiscountCodeDeletedMessagePayloadQueryBuilderDsl(); + } + + public StringComparisonPredicateBuilder type() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("type")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeDeletedMessagePayloadQueryBuilderDsl::of)); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeDeletedMessageQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeDeletedMessageQueryBuilderDsl.java new file mode 100644 index 00000000000..8182e416507 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeDeletedMessageQueryBuilderDsl.java @@ -0,0 +1,94 @@ + +package com.commercetools.api.predicates.query.message; + +import java.util.function.Function; + +import com.commercetools.api.predicates.query.*; + +public class DiscountCodeDeletedMessageQueryBuilderDsl { + public DiscountCodeDeletedMessageQueryBuilderDsl() { + } + + public static DiscountCodeDeletedMessageQueryBuilderDsl of() { + return new DiscountCodeDeletedMessageQueryBuilderDsl(); + } + + public StringComparisonPredicateBuilder id() { + return new StringComparisonPredicateBuilder<>(BinaryQueryPredicate.of().left(new ConstantQueryPredicate("id")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeDeletedMessageQueryBuilderDsl::of)); + } + + public LongComparisonPredicateBuilder version() { + return new LongComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("version")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeDeletedMessageQueryBuilderDsl::of)); + } + + public DateTimeComparisonPredicateBuilder createdAt() { + return new DateTimeComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("createdAt")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeDeletedMessageQueryBuilderDsl::of)); + } + + public DateTimeComparisonPredicateBuilder lastModifiedAt() { + return new DateTimeComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("lastModifiedAt")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeDeletedMessageQueryBuilderDsl::of)); + } + + public CombinationQueryPredicate lastModifiedBy( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("lastModifiedBy")) + .inner(fn.apply(com.commercetools.api.predicates.query.common.LastModifiedByQueryBuilderDsl.of())), + DiscountCodeDeletedMessageQueryBuilderDsl::of); + } + + public CombinationQueryPredicate createdBy( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("createdBy")) + .inner(fn.apply(com.commercetools.api.predicates.query.common.CreatedByQueryBuilderDsl.of())), + DiscountCodeDeletedMessageQueryBuilderDsl::of); + } + + public LongComparisonPredicateBuilder sequenceNumber() { + return new LongComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("sequenceNumber")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeDeletedMessageQueryBuilderDsl::of)); + } + + public CombinationQueryPredicate resource( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("resource")) + .inner(fn.apply(com.commercetools.api.predicates.query.common.ReferenceQueryBuilderDsl.of())), + DiscountCodeDeletedMessageQueryBuilderDsl::of); + } + + public LongComparisonPredicateBuilder resourceVersion() { + return new LongComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("resourceVersion")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeDeletedMessageQueryBuilderDsl::of)); + } + + public StringComparisonPredicateBuilder type() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("type")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeDeletedMessageQueryBuilderDsl::of)); + } + + public CombinationQueryPredicate resourceUserProvidedIdentifiers( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("resourceUserProvidedIdentifiers")) + .inner(fn.apply( + com.commercetools.api.predicates.query.message.UserProvidedIdentifiersQueryBuilderDsl.of())), + DiscountCodeDeletedMessageQueryBuilderDsl::of); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeKeySetMessagePayloadQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeKeySetMessagePayloadQueryBuilderDsl.java new file mode 100644 index 00000000000..0ba78aae26d --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeKeySetMessagePayloadQueryBuilderDsl.java @@ -0,0 +1,31 @@ + +package com.commercetools.api.predicates.query.message; + +import com.commercetools.api.predicates.query.*; + +public class DiscountCodeKeySetMessagePayloadQueryBuilderDsl { + public DiscountCodeKeySetMessagePayloadQueryBuilderDsl() { + } + + public static DiscountCodeKeySetMessagePayloadQueryBuilderDsl of() { + return new DiscountCodeKeySetMessagePayloadQueryBuilderDsl(); + } + + public StringComparisonPredicateBuilder type() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("type")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeKeySetMessagePayloadQueryBuilderDsl::of)); + } + + public StringComparisonPredicateBuilder key() { + return new StringComparisonPredicateBuilder<>(BinaryQueryPredicate.of().left(new ConstantQueryPredicate("key")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeKeySetMessagePayloadQueryBuilderDsl::of)); + } + + public StringComparisonPredicateBuilder oldKey() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("oldKey")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeKeySetMessagePayloadQueryBuilderDsl::of)); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeKeySetMessageQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeKeySetMessageQueryBuilderDsl.java new file mode 100644 index 00000000000..d07aa7b8b69 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/DiscountCodeKeySetMessageQueryBuilderDsl.java @@ -0,0 +1,105 @@ + +package com.commercetools.api.predicates.query.message; + +import java.util.function.Function; + +import com.commercetools.api.predicates.query.*; + +public class DiscountCodeKeySetMessageQueryBuilderDsl { + public DiscountCodeKeySetMessageQueryBuilderDsl() { + } + + public static DiscountCodeKeySetMessageQueryBuilderDsl of() { + return new DiscountCodeKeySetMessageQueryBuilderDsl(); + } + + public StringComparisonPredicateBuilder id() { + return new StringComparisonPredicateBuilder<>(BinaryQueryPredicate.of().left(new ConstantQueryPredicate("id")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeKeySetMessageQueryBuilderDsl::of)); + } + + public LongComparisonPredicateBuilder version() { + return new LongComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("version")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeKeySetMessageQueryBuilderDsl::of)); + } + + public DateTimeComparisonPredicateBuilder createdAt() { + return new DateTimeComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("createdAt")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeKeySetMessageQueryBuilderDsl::of)); + } + + public DateTimeComparisonPredicateBuilder lastModifiedAt() { + return new DateTimeComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("lastModifiedAt")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeKeySetMessageQueryBuilderDsl::of)); + } + + public CombinationQueryPredicate lastModifiedBy( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("lastModifiedBy")) + .inner(fn.apply(com.commercetools.api.predicates.query.common.LastModifiedByQueryBuilderDsl.of())), + DiscountCodeKeySetMessageQueryBuilderDsl::of); + } + + public CombinationQueryPredicate createdBy( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("createdBy")) + .inner(fn.apply(com.commercetools.api.predicates.query.common.CreatedByQueryBuilderDsl.of())), + DiscountCodeKeySetMessageQueryBuilderDsl::of); + } + + public LongComparisonPredicateBuilder sequenceNumber() { + return new LongComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("sequenceNumber")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeKeySetMessageQueryBuilderDsl::of)); + } + + public CombinationQueryPredicate resource( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("resource")) + .inner(fn.apply(com.commercetools.api.predicates.query.common.ReferenceQueryBuilderDsl.of())), + DiscountCodeKeySetMessageQueryBuilderDsl::of); + } + + public LongComparisonPredicateBuilder resourceVersion() { + return new LongComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("resourceVersion")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeKeySetMessageQueryBuilderDsl::of)); + } + + public StringComparisonPredicateBuilder type() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("type")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeKeySetMessageQueryBuilderDsl::of)); + } + + public CombinationQueryPredicate resourceUserProvidedIdentifiers( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("resourceUserProvidedIdentifiers")) + .inner(fn.apply( + com.commercetools.api.predicates.query.message.UserProvidedIdentifiersQueryBuilderDsl.of())), + DiscountCodeKeySetMessageQueryBuilderDsl::of); + } + + public StringComparisonPredicateBuilder key() { + return new StringComparisonPredicateBuilder<>(BinaryQueryPredicate.of().left(new ConstantQueryPredicate("key")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeKeySetMessageQueryBuilderDsl::of)); + } + + public StringComparisonPredicateBuilder oldKey() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("oldKey")), + p -> new CombinationQueryPredicate<>(p, DiscountCodeKeySetMessageQueryBuilderDsl::of)); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/MessagePayloadQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/MessagePayloadQueryBuilderDsl.java index 5d8661f538a..069577d85a8 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/MessagePayloadQueryBuilderDsl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/MessagePayloadQueryBuilderDsl.java @@ -720,6 +720,30 @@ public CombinationQueryPredicate asCustomerTitleS MessagePayloadQueryBuilderDsl::of); } + public CombinationQueryPredicate asDiscountCodeCreated( + Function> fn) { + return new CombinationQueryPredicate<>( + fn.apply( + com.commercetools.api.predicates.query.message.DiscountCodeCreatedMessagePayloadQueryBuilderDsl.of()), + MessagePayloadQueryBuilderDsl::of); + } + + public CombinationQueryPredicate asDiscountCodeDeleted( + Function> fn) { + return new CombinationQueryPredicate<>( + fn.apply( + com.commercetools.api.predicates.query.message.DiscountCodeDeletedMessagePayloadQueryBuilderDsl.of()), + MessagePayloadQueryBuilderDsl::of); + } + + public CombinationQueryPredicate asDiscountCodeKeySet( + Function> fn) { + return new CombinationQueryPredicate<>( + fn.apply( + com.commercetools.api.predicates.query.message.DiscountCodeKeySetMessagePayloadQueryBuilderDsl.of()), + MessagePayloadQueryBuilderDsl::of); + } + public CombinationQueryPredicate asInventoryEntryCreated( Function> fn) { return new CombinationQueryPredicate<>( diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/MessageQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/MessageQueryBuilderDsl.java index d93d2e52ba6..7066a1d1c88 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/MessageQueryBuilderDsl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/message/MessageQueryBuilderDsl.java @@ -769,6 +769,27 @@ public CombinationQueryPredicate asCustomerTitleSet( MessageQueryBuilderDsl::of); } + public CombinationQueryPredicate asDiscountCodeCreated( + Function> fn) { + return new CombinationQueryPredicate<>( + fn.apply(com.commercetools.api.predicates.query.message.DiscountCodeCreatedMessageQueryBuilderDsl.of()), + MessageQueryBuilderDsl::of); + } + + public CombinationQueryPredicate asDiscountCodeDeleted( + Function> fn) { + return new CombinationQueryPredicate<>( + fn.apply(com.commercetools.api.predicates.query.message.DiscountCodeDeletedMessageQueryBuilderDsl.of()), + MessageQueryBuilderDsl::of); + } + + public CombinationQueryPredicate asDiscountCodeKeySet( + Function> fn) { + return new CombinationQueryPredicate<>( + fn.apply(com.commercetools.api.predicates.query.message.DiscountCodeKeySetMessageQueryBuilderDsl.of()), + MessageQueryBuilderDsl::of); + } + public CombinationQueryPredicate asInventoryEntryCreated( Function> fn) { return new CombinationQueryPredicate<>( diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyDiscountCodesKeyByKeyTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyDiscountCodesKeyByKeyTest.java new file mode 100644 index 00000000000..6f86a488955 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyDiscountCodesKeyByKeyTest.java @@ -0,0 +1,166 @@ + +package com.commercetools.api.client.resource; + +import java.nio.charset.StandardCharsets; +import java.util.concurrent.CompletableFuture; + +import com.commercetools.api.client.ApiRoot; +import com.tngtech.junit.dataprovider.DataProvider; +import com.tngtech.junit.dataprovider.DataProviderExtension; +import com.tngtech.junit.dataprovider.UseDataProvider; +import com.tngtech.junit.dataprovider.UseDataProviderExtension; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.ApiHttpClient; +import io.vrap.rmf.base.client.ApiHttpRequest; +import io.vrap.rmf.base.client.VrapHttpClient; +import io.vrap.rmf.base.client.error.ApiClientException; +import io.vrap.rmf.base.client.error.ApiServerException; +import io.vrap.rmf.base.client.utils.Generated; + +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mockito; + +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@ExtendWith(UseDataProviderExtension.class) +@ExtendWith(DataProviderExtension.class) +public class ByProjectKeyDiscountCodesKeyByKeyTest { + private final VrapHttpClient httpClientMock = Mockito.mock(VrapHttpClient.class); + private final String projectKey = "test_projectKey"; + private final static ApiRoot apiRoot = ApiRoot.of(); + private final ApiHttpClient client = ClientBuilder.of(httpClientMock).defaultClient("").build(); + + @TestTemplate + @UseDataProvider("requestWithMethodParameters") + public void withMethods(ApiHttpRequest request, String httpMethod, String uri) { + Assertions.assertThat(httpMethod).isEqualTo(request.getMethod().name().toLowerCase()); + Assertions.assertThat(uri).isEqualTo(request.getUri().toString()); + } + + @TestTemplate + @UseDataProvider("executeMethodParameters") + public void executeServerException(HttpRequestCommand httpRequest) throws Exception { + Mockito.when(httpClientMock.execute(Mockito.any())) + .thenReturn(CompletableFuture.completedFuture( + new ApiHttpResponse<>(500, null, "".getBytes(StandardCharsets.UTF_8), "Oops!"))); + + Assertions.assertThatThrownBy(() -> client.execute(httpRequest).toCompletableFuture().get()) + .hasCauseInstanceOf(ApiServerException.class); + } + + @TestTemplate + @UseDataProvider("executeMethodParameters") + public void executeClientException(HttpRequestCommand httpRequest) throws Exception { + Mockito.when(httpClientMock.execute(Mockito.any())) + .thenReturn(CompletableFuture.completedFuture( + new ApiHttpResponse<>(400, null, "".getBytes(StandardCharsets.UTF_8), "Oops!"))); + + Assertions.assertThatThrownBy(() -> client.execute(httpRequest).toCompletableFuture().get()) + .hasCauseInstanceOf(ApiClientException.class); + } + + @DataProvider + public static Object[][] requestWithMethodParameters() { + return new Object[][] { + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .discountCodes() + .withKey("test_key") + .get() + .withExpand("expand") + .createHttpRequest(), + "get", "test_projectKey/discount-codes/key=test_key?expand=expand", }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .discountCodes() + .withKey("test_key") + .get() + .createHttpRequest(), "get", "test_projectKey/discount-codes/key=test_key", }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .discountCodes() + .withKey("test_key") + .head() + .createHttpRequest(), "head", "test_projectKey/discount-codes/key=test_key", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .discountCodes() + .withKey("test_key") + .post(com.commercetools.api.models.discount_code.DiscountCodeUpdate.of()) + .withExpand("expand") + .createHttpRequest(), + "post", "test_projectKey/discount-codes/key=test_key?expand=expand", }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .discountCodes() + .withKey("test_key") + .post(com.commercetools.api.models.discount_code.DiscountCodeUpdate.of()) + .createHttpRequest(), "post", "test_projectKey/discount-codes/key=test_key", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .discountCodes() + .withKey("test_key") + .delete() + .withDataErasure(true) + .createHttpRequest(), + "delete", "test_projectKey/discount-codes/key=test_key?dataErasure=true", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .discountCodes() + .withKey("test_key") + .delete() + .withVersion(2) + .createHttpRequest(), + "delete", "test_projectKey/discount-codes/key=test_key?version=2", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .discountCodes() + .withKey("test_key") + .delete() + .withExpand("expand") + .createHttpRequest(), + "delete", "test_projectKey/discount-codes/key=test_key?expand=expand", }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .discountCodes() + .withKey("test_key") + .delete() + .createHttpRequest(), "delete", "test_projectKey/discount-codes/key=test_key", } }; + } + + @DataProvider + public static Object[][] executeMethodParameters() { + return new Object[][] { + new Object[] { apiRoot.withProjectKey("test_projectKey") + .discountCodes() + .withKey("test_key") + .get() + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey").discountCodes().withKey("test_key").get(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey").discountCodes().withKey("test_key").head(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .discountCodes() + .withKey("test_key") + .post(com.commercetools.api.models.discount_code.DiscountCodeUpdate.of()) + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .discountCodes() + .withKey("test_key") + .post(com.commercetools.api.models.discount_code.DiscountCodeUpdate.of()), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .discountCodes() + .withKey("test_key") + .delete() + .withDataErasure(true), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .discountCodes() + .withKey("test_key") + .delete() + .withVersion(2), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .discountCodes() + .withKey("test_key") + .delete() + .withExpand("expand"), }, + new Object[] { + apiRoot.withProjectKey("test_projectKey").discountCodes().withKey("test_key").delete(), } }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/discount_code/DiscountCodeDraftTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/discount_code/DiscountCodeDraftTest.java index a665a3f9335..bcc65d47dec 100644 --- a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/discount_code/DiscountCodeDraftTest.java +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/discount_code/DiscountCodeDraftTest.java @@ -27,7 +27,7 @@ public void buildUnchecked(DiscountCodeDraftBuilder builder) { @DataProvider public static Object[][] objectBuilder() { - return new Object[][] { + return new Object[][] { new Object[] { DiscountCodeDraft.builder().key("key") }, new Object[] { DiscountCodeDraft.builder() .name(new com.commercetools.api.models.common.LocalizedStringImpl()) }, new Object[] { DiscountCodeDraft.builder() @@ -47,6 +47,13 @@ public static Object[][] objectBuilder() { new Object[] { DiscountCodeDraft.builder().validUntil(ZonedDateTime.parse("2023-06-01T12:00Z")) } }; } + @Test + public void key() { + DiscountCodeDraft value = DiscountCodeDraft.of(); + value.setKey("key"); + Assertions.assertThat(value.getKey()).isEqualTo("key"); + } + @Test public void name() { DiscountCodeDraft value = DiscountCodeDraft.of(); diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/discount_code/DiscountCodeSetKeyActionTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/discount_code/DiscountCodeSetKeyActionTest.java new file mode 100644 index 00000000000..f0e84c875b8 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/discount_code/DiscountCodeSetKeyActionTest.java @@ -0,0 +1,36 @@ + +package com.commercetools.api.models.discount_code; + +import com.tngtech.junit.dataprovider.DataProvider; +import com.tngtech.junit.dataprovider.DataProviderExtension; +import com.tngtech.junit.dataprovider.UseDataProvider; +import com.tngtech.junit.dataprovider.UseDataProviderExtension; + +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.extension.ExtendWith; + +@ExtendWith(UseDataProviderExtension.class) +@ExtendWith(DataProviderExtension.class) +public class DiscountCodeSetKeyActionTest { + + @TestTemplate + @UseDataProvider("objectBuilder") + public void buildUnchecked(DiscountCodeSetKeyActionBuilder builder) { + DiscountCodeSetKeyAction discountCodeSetKeyAction = builder.buildUnchecked(); + Assertions.assertThat(discountCodeSetKeyAction).isInstanceOf(DiscountCodeSetKeyAction.class); + } + + @DataProvider + public static Object[][] objectBuilder() { + return new Object[][] { new Object[] { DiscountCodeSetKeyAction.builder().key("key") } }; + } + + @Test + public void key() { + DiscountCodeSetKeyAction value = DiscountCodeSetKeyAction.of(); + value.setKey("key"); + Assertions.assertThat(value.getKey()).isEqualTo("key"); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/discount_code/DiscountCodeTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/discount_code/DiscountCodeTest.java index b51d85aa060..be6377a3b2b 100644 --- a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/discount_code/DiscountCodeTest.java +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/discount_code/DiscountCodeTest.java @@ -28,7 +28,7 @@ public void buildUnchecked(DiscountCodeBuilder builder) { @DataProvider public static Object[][] objectBuilder() { return new Object[][] { new Object[] { DiscountCode.builder().id("id") }, - new Object[] { DiscountCode.builder().version(2L) }, + new Object[] { DiscountCode.builder().key("key") }, new Object[] { DiscountCode.builder().version(2L) }, new Object[] { DiscountCode.builder().createdAt(ZonedDateTime.parse("2023-06-01T12:00Z")) }, new Object[] { DiscountCode.builder().lastModifiedAt(ZonedDateTime.parse("2023-06-01T12:00Z")) }, new Object[] { DiscountCode.builder() @@ -66,6 +66,13 @@ public void id() { Assertions.assertThat(value.getId()).isEqualTo("id"); } + @Test + public void key() { + DiscountCode value = DiscountCode.of(); + value.setKey("key"); + Assertions.assertThat(value.getKey()).isEqualTo("key"); + } + @Test public void version() { DiscountCode value = DiscountCode.of(); diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessagePayloadTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessagePayloadTest.java new file mode 100644 index 00000000000..e09756f92d7 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessagePayloadTest.java @@ -0,0 +1,38 @@ + +package com.commercetools.api.models.message; + +import com.tngtech.junit.dataprovider.DataProvider; +import com.tngtech.junit.dataprovider.DataProviderExtension; +import com.tngtech.junit.dataprovider.UseDataProvider; +import com.tngtech.junit.dataprovider.UseDataProviderExtension; + +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.extension.ExtendWith; + +@ExtendWith(UseDataProviderExtension.class) +@ExtendWith(DataProviderExtension.class) +public class DiscountCodeCreatedMessagePayloadTest { + + @TestTemplate + @UseDataProvider("objectBuilder") + public void buildUnchecked(DiscountCodeCreatedMessagePayloadBuilder builder) { + DiscountCodeCreatedMessagePayload discountCodeCreatedMessagePayload = builder.buildUnchecked(); + Assertions.assertThat(discountCodeCreatedMessagePayload).isInstanceOf(DiscountCodeCreatedMessagePayload.class); + } + + @DataProvider + public static Object[][] objectBuilder() { + return new Object[][] { new Object[] { DiscountCodeCreatedMessagePayload.builder() + .discountCode(new com.commercetools.api.models.discount_code.DiscountCodeImpl()) } }; + } + + @Test + public void discountCode() { + DiscountCodeCreatedMessagePayload value = DiscountCodeCreatedMessagePayload.of(); + value.setDiscountCode(new com.commercetools.api.models.discount_code.DiscountCodeImpl()); + Assertions.assertThat(value.getDiscountCode()) + .isEqualTo(new com.commercetools.api.models.discount_code.DiscountCodeImpl()); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessageTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessageTest.java new file mode 100644 index 00000000000..1929d6df361 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeCreatedMessageTest.java @@ -0,0 +1,38 @@ + +package com.commercetools.api.models.message; + +import com.tngtech.junit.dataprovider.DataProvider; +import com.tngtech.junit.dataprovider.DataProviderExtension; +import com.tngtech.junit.dataprovider.UseDataProvider; +import com.tngtech.junit.dataprovider.UseDataProviderExtension; + +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.extension.ExtendWith; + +@ExtendWith(UseDataProviderExtension.class) +@ExtendWith(DataProviderExtension.class) +public class DiscountCodeCreatedMessageTest { + + @TestTemplate + @UseDataProvider("objectBuilder") + public void buildUnchecked(DiscountCodeCreatedMessageBuilder builder) { + DiscountCodeCreatedMessage discountCodeCreatedMessage = builder.buildUnchecked(); + Assertions.assertThat(discountCodeCreatedMessage).isInstanceOf(DiscountCodeCreatedMessage.class); + } + + @DataProvider + public static Object[][] objectBuilder() { + return new Object[][] { new Object[] { DiscountCodeCreatedMessage.builder() + .discountCode(new com.commercetools.api.models.discount_code.DiscountCodeImpl()) } }; + } + + @Test + public void discountCode() { + DiscountCodeCreatedMessage value = DiscountCodeCreatedMessage.of(); + value.setDiscountCode(new com.commercetools.api.models.discount_code.DiscountCodeImpl()); + Assertions.assertThat(value.getDiscountCode()) + .isEqualTo(new com.commercetools.api.models.discount_code.DiscountCodeImpl()); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessagePayloadTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessagePayloadTest.java new file mode 100644 index 00000000000..da2a800d4b6 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessagePayloadTest.java @@ -0,0 +1,13 @@ + +package com.commercetools.api.models.message; + +import com.tngtech.junit.dataprovider.DataProviderExtension; +import com.tngtech.junit.dataprovider.UseDataProviderExtension; + +import org.junit.jupiter.api.extension.ExtendWith; + +@ExtendWith(UseDataProviderExtension.class) +@ExtendWith(DataProviderExtension.class) +public class DiscountCodeDeletedMessagePayloadTest { + +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessageTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessageTest.java new file mode 100644 index 00000000000..7064c757a68 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeDeletedMessageTest.java @@ -0,0 +1,13 @@ + +package com.commercetools.api.models.message; + +import com.tngtech.junit.dataprovider.DataProviderExtension; +import com.tngtech.junit.dataprovider.UseDataProviderExtension; + +import org.junit.jupiter.api.extension.ExtendWith; + +@ExtendWith(UseDataProviderExtension.class) +@ExtendWith(DataProviderExtension.class) +public class DiscountCodeDeletedMessageTest { + +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessagePayloadTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessagePayloadTest.java new file mode 100644 index 00000000000..e8acc39fbcc --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessagePayloadTest.java @@ -0,0 +1,44 @@ + +package com.commercetools.api.models.message; + +import com.tngtech.junit.dataprovider.DataProvider; +import com.tngtech.junit.dataprovider.DataProviderExtension; +import com.tngtech.junit.dataprovider.UseDataProvider; +import com.tngtech.junit.dataprovider.UseDataProviderExtension; + +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.extension.ExtendWith; + +@ExtendWith(UseDataProviderExtension.class) +@ExtendWith(DataProviderExtension.class) +public class DiscountCodeKeySetMessagePayloadTest { + + @TestTemplate + @UseDataProvider("objectBuilder") + public void buildUnchecked(DiscountCodeKeySetMessagePayloadBuilder builder) { + DiscountCodeKeySetMessagePayload discountCodeKeySetMessagePayload = builder.buildUnchecked(); + Assertions.assertThat(discountCodeKeySetMessagePayload).isInstanceOf(DiscountCodeKeySetMessagePayload.class); + } + + @DataProvider + public static Object[][] objectBuilder() { + return new Object[][] { new Object[] { DiscountCodeKeySetMessagePayload.builder().key("key") }, + new Object[] { DiscountCodeKeySetMessagePayload.builder().oldKey("oldKey") } }; + } + + @Test + public void key() { + DiscountCodeKeySetMessagePayload value = DiscountCodeKeySetMessagePayload.of(); + value.setKey("key"); + Assertions.assertThat(value.getKey()).isEqualTo("key"); + } + + @Test + public void oldKey() { + DiscountCodeKeySetMessagePayload value = DiscountCodeKeySetMessagePayload.of(); + value.setOldKey("oldKey"); + Assertions.assertThat(value.getOldKey()).isEqualTo("oldKey"); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessageTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessageTest.java new file mode 100644 index 00000000000..0c84ec513aa --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/message/DiscountCodeKeySetMessageTest.java @@ -0,0 +1,44 @@ + +package com.commercetools.api.models.message; + +import com.tngtech.junit.dataprovider.DataProvider; +import com.tngtech.junit.dataprovider.DataProviderExtension; +import com.tngtech.junit.dataprovider.UseDataProvider; +import com.tngtech.junit.dataprovider.UseDataProviderExtension; + +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.extension.ExtendWith; + +@ExtendWith(UseDataProviderExtension.class) +@ExtendWith(DataProviderExtension.class) +public class DiscountCodeKeySetMessageTest { + + @TestTemplate + @UseDataProvider("objectBuilder") + public void buildUnchecked(DiscountCodeKeySetMessageBuilder builder) { + DiscountCodeKeySetMessage discountCodeKeySetMessage = builder.buildUnchecked(); + Assertions.assertThat(discountCodeKeySetMessage).isInstanceOf(DiscountCodeKeySetMessage.class); + } + + @DataProvider + public static Object[][] objectBuilder() { + return new Object[][] { new Object[] { DiscountCodeKeySetMessage.builder().key("key") }, + new Object[] { DiscountCodeKeySetMessage.builder().oldKey("oldKey") } }; + } + + @Test + public void key() { + DiscountCodeKeySetMessage value = DiscountCodeKeySetMessage.of(); + value.setKey("key"); + Assertions.assertThat(value.getKey()).isEqualTo("key"); + } + + @Test + public void oldKey() { + DiscountCodeKeySetMessage value = DiscountCodeKeySetMessage.of(); + value.setOldKey("oldKey"); + Assertions.assertThat(value.getOldKey()).isEqualTo("oldKey"); + } +} diff --git a/references.txt b/references.txt index 0f755f173de..c17b1c58cfa 100644 --- a/references.txt +++ b/references.txt @@ -193,3 +193,4 @@ d10443de67d8c8e684b4e63415b5720fc3bcf169 886f8d7e51ee9afd3dea683e0b6ed042eec469f1 5b5166eedb28e48364c82c3fcf2d795983fe9fa8 82856ccfbe173150763c81a98f37eb012ce30e86 +941e8656001becbc52907ad541f2c61e461d865d