From 097fffe766f493ec2e368c0019375a9b818e5df8 Mon Sep 17 00:00:00 2001
From: "ct-sdks[bot]" <153784748+ct-sdks[bot]@users.noreply.github.com>
Date: Thu, 4 Apr 2024 13:25:44 +0000
Subject: [PATCH] build(codegen): updating SDK
---
changes.md | 142 +----
...ortContainersByImportContainerKeyPost.java | 149 +++++
...tainersByImportContainerKeyPostString.java | 148 +++++
...ersByImportContainerKeyRequestBuilder.java | 41 ++
...ntCodesImportContainersRequestBuilder.java | 25 +
...ProjectKeyDiscountCodesRequestBuilder.java | 22 +
.../client/ByProjectKeyRequestBuilder.java | 4 +
...Secured_by_manage_discount_codesTrait.java | 22 +
.../models/common/ImportResource.java | 4 +
.../models/common/ImportResourceType.java | 10 +-
.../discount_codes/DiscountCodeImport.java | 357 +++++++++++
.../DiscountCodeImportBuilder.java | 569 ++++++++++++++++++
.../DiscountCodeImportImpl.java | 329 ++++++++++
.../DiscountCodeImportRequest.java | 142 +++++
.../DiscountCodeImportRequestBuilder.java | 165 +++++
.../DiscountCodeImportRequestImpl.java | 101 ++++
.../models/importrequests/ImportRequest.java | 13 +
.../importrequests/ImportRequestBuilder.java | 4 +
...ortContainersByImportContainerKeyTest.java | 84 +++
...tKeyDiscountCodesImportContainersTest.java | 35 ++
.../ByProjectKeyDiscountCodesTest.java | 35 ++
.../DiscountCodeImportTest.java | 146 +++++
.../DiscountCodeImportRequestTest.java | 43 ++
references.txt | 1 +
24 files changed, 2456 insertions(+), 135 deletions(-)
create mode 100644 commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/client/ByProjectKeyDiscountCodesImportContainersByImportContainerKeyPost.java
create mode 100644 commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/client/ByProjectKeyDiscountCodesImportContainersByImportContainerKeyPostString.java
create mode 100644 commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/client/ByProjectKeyDiscountCodesImportContainersByImportContainerKeyRequestBuilder.java
create mode 100644 commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/client/ByProjectKeyDiscountCodesImportContainersRequestBuilder.java
create mode 100644 commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/client/ByProjectKeyDiscountCodesRequestBuilder.java
create mode 100644 commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/client/Secured_by_manage_discount_codesTrait.java
create mode 100644 commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/discount_codes/DiscountCodeImport.java
create mode 100644 commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/discount_codes/DiscountCodeImportBuilder.java
create mode 100644 commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/discount_codes/DiscountCodeImportImpl.java
create mode 100644 commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/importrequests/DiscountCodeImportRequest.java
create mode 100644 commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/importrequests/DiscountCodeImportRequestBuilder.java
create mode 100644 commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/importrequests/DiscountCodeImportRequestImpl.java
create mode 100644 commercetools/commercetools-sdk-java-importapi/src/test/java-generated/com/commercetools/importapi/client/resource/ByProjectKeyDiscountCodesImportContainersByImportContainerKeyTest.java
create mode 100644 commercetools/commercetools-sdk-java-importapi/src/test/java-generated/com/commercetools/importapi/client/resource/ByProjectKeyDiscountCodesImportContainersTest.java
create mode 100644 commercetools/commercetools-sdk-java-importapi/src/test/java-generated/com/commercetools/importapi/client/resource/ByProjectKeyDiscountCodesTest.java
create mode 100644 commercetools/commercetools-sdk-java-importapi/src/test/java-generated/com/commercetools/importapi/models/discount_codes/DiscountCodeImportTest.java
create mode 100644 commercetools/commercetools-sdk-java-importapi/src/test/java-generated/com/commercetools/importapi/models/importrequests/DiscountCodeImportRequestTest.java
diff --git a/changes.md b/changes.md
index 7653e8e8d9a..36c7ab98765 100644
--- a/changes.md
+++ b/changes.md
@@ -1,158 +1,32 @@
-**Api changes**
+**Import changes**
Added Enum(s)
-- added enum `product-tailoring` to type `ReferenceTypeId`
-- added enum `ManuallySuspended` to type `SubscriptionHealthStatus`
-Added Property(s)
-
-- added property `taxPortions` to type `TaxedItemPrice`
-- added property `productsSearch` to type `SearchIndexingConfiguration`
-- added property `mode` to type `ProjectChangeProductSearchIndexingEnabledAction`
+- added enum `discount-code` to type `ImportResourceType`
Added Method(s)
-- added method `apiRoot.withProjectKey().productTailoring().get()`
-- added method `apiRoot.withProjectKey().productTailoring().post()`
-- added method `apiRoot.withProjectKey().products().search().post()`
-- added method `apiRoot.withProjectKey().products().search().head()`
-- added method `apiRoot.withProjectKey().productTailoring().withKey().get()`
-- added method `apiRoot.withProjectKey().productTailoring().withKey().post()`
-- added method `apiRoot.withProjectKey().productTailoring().withKey().delete()`
-- added method `apiRoot.withProjectKey().productTailoring().withId().get()`
-- added method `apiRoot.withProjectKey().productTailoring().withId().post()`
-- added method `apiRoot.withProjectKey().productTailoring().withId().delete()`
-- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().productTailoring().get()`
-- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().productTailoring().post()`
-- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().products().withProductId().productTailoring().get()`
-- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().products().withProductId().productTailoring().post()`
-- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().products().withProductId().productTailoring().delete()`
-- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().products().withProductKey().productTailoring().get()`
-- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().products().withProductKey().productTailoring().post()`
-- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().products().withProductKey().productTailoring().delete()`
+- added method `apiRoot.withProjectKeyValue().discountCodes().importContainers().withImportContainerKeyValue().post()`
Added Resource(s)
-- added resource `/{projectKey}/product-tailoring`
-- added resource `/{projectKey}/products/search`
-- added resource `/{projectKey}/product-tailoring/key={key}`
-- added resource `/{projectKey}/product-tailoring/{ID}`
-- added resource `/{projectKey}/in-store/key={storeKey}/product-tailoring`
-- added resource `/{projectKey}/in-store/key={storeKey}/products`
-- added resource `/{projectKey}/in-store/key={storeKey}/products/{productID}`
-- added resource `/{projectKey}/in-store/key={storeKey}/products/key={productKey}`
-- added resource `/{projectKey}/in-store/key={storeKey}/products/{productID}/product-tailoring`
-- added resource `/{projectKey}/in-store/key={storeKey}/products/key={productKey}/product-tailoring`
+- added resource `/{projectKey}/discount-codes`
+- added resource `/{projectKey}/discount-codes/import-containers`
+- added resource `/{projectKey}/discount-codes/import-containers/{importContainerKey}`
Added Type(s)
-- added type `LockedFieldError`
-- added type `GraphQLLockedFieldError`
-- added type `ProductTailoringCreatedMessage`
-- added type `ProductTailoringDeletedMessage`
-- added type `ProductTailoringDescriptionSetMessage`
-- added type `ProductTailoringNameSetMessage`
-- added type `ProductTailoringPublishedMessage`
-- added type `ProductTailoringSlugSetMessage`
-- added type `ProductTailoringUnpublishedMessage`
-- added type `ProductTailoringCreatedMessagePayload`
-- added type `ProductTailoringDeletedMessagePayload`
-- added type `ProductTailoringDescriptionSetMessagePayload`
-- added type `ProductTailoringNameSetMessagePayload`
-- added type `ProductTailoringPublishedMessagePayload`
-- added type `ProductTailoringSlugSetMessagePayload`
-- added type `ProductTailoringUnpublishedMessagePayload`
-- added type `ProductPagedSearchResponse`
-- added type `ProductSearchErrorResponse`
-- added type `ProductSearchMatchingVariantEntry`
-- added type `ProductSearchMatchingVariants`
-- added type `ProductSearchProjectionParams`
-- added type `ProductSearchRequest`
-- added type `ProductSearchResult`
-- added type `ProductSearchFacetCountExpression`
-- added type `ProductSearchFacetCountLevelEnum`
-- added type `ProductSearchFacetCountValue`
-- added type `ProductSearchFacetDistinctBucketSortBy`
-- added type `ProductSearchFacetDistinctBucketSortExpression`
-- added type `ProductSearchFacetDistinctExpression`
-- added type `ProductSearchFacetDistinctValue`
-- added type `ProductSearchFacetExpression`
-- added type `ProductSearchFacetRangesExpression`
-- added type `ProductSearchFacetRangesFacetRange`
-- added type `ProductSearchFacetRangesValue`
-- added type `ProductSearchFacetResult`
-- added type `ProductSearchFacetResultBucket`
-- added type `ProductSearchFacetResultBucketEntry`
-- added type `ProductSearchFacetResultCount`
-- added type `ProductSearchFacetScope`
-- added type `ProductSearchFacetScopeEnum`
-- added type `ProductTailoring`
-- added type `ProductTailoringData`
-- added type `ProductTailoringDraft`
-- added type `ProductTailoringInStoreDraft`
-- added type `ProductTailoringPagedQueryResponse`
-- added type `ProductTailoringReference`
-- added type `ProductTailoringResourceIdentifier`
-- added type `ProductTailoringUpdate`
-- added type `ProductTailoringUpdateAction`
-- added type `ProductTailoringPublishAction`
-- added type `ProductTailoringSetDescriptionAction`
-- added type `ProductTailoringSetMetaAttributesAction`
-- added type `ProductTailoringSetMetaDescriptionAction`
-- added type `ProductTailoringSetMetaKeywordsAction`
-- added type `ProductTailoringSetMetaTitleAction`
-- added type `ProductTailoringSetNameAction`
-- added type `ProductTailoringSetSlugAction`
-- added type `ProductTailoringUnpublishAction`
-- added type `ProductSearchIndexingMode`
-- added type `ProductSearchStatus`
-- added type `SearchAndExpression`
-- added type `SearchAnyValue`
-- added type `SearchCompoundExpression`
-- added type `SearchDateRangeExpression`
-- added type `SearchDateRangeValue`
-- added type `SearchDateTimeRangeExpression`
-- added type `SearchDateTimeRangeValue`
-- added type `SearchExactExpression`
-- added type `SearchExistsExpression`
-- added type `SearchExistsValue`
-- added type `SearchFieldType`
-- added type `SearchFilterExpression`
-- added type `SearchFullTextExpression`
-- added type `SearchFullTextPrefixExpression`
-- added type `SearchFullTextPrefixValue`
-- added type `SearchFullTextValue`
-- added type `SearchLongRangeExpression`
-- added type `SearchLongRangeValue`
-- added type `SearchMatchType`
-- added type `SearchMatchingVariant`
-- added type `SearchNotExpression`
-- added type `SearchNumberRangeExpression`
-- added type `SearchNumberRangeValue`
-- added type `SearchOrExpression`
-- added type `SearchPrefixExpression`
-- added type `SearchQuery`
-- added type `SearchQueryExpression`
-- added type `SearchQueryExpressionValue`
-- added type `SearchSortMode`
-- added type `SearchSortOrder`
-- added type `SearchSorting`
-- added type `SearchTimeRangeExpression`
-- added type `SearchTimeRangeValue`
-- added type `SearchWildCardExpression`
+- added type `DiscountCodeImportRequest`
+- added type `DiscountCodeImport`
Creates a request for creating new Discount Codes or updating existing ones.
+ * + *{@code
+ * CompletableFuture> result = apiRoot
+ * .withProjectKeyValue("{projectKey}")
+ * .discountCodes()
+ * .importContainers()
+ * .withImportContainerKeyValue("{importContainerKey}")
+ * .post(null)
+ * .execute()
+ * }
+ * Creates a request for creating new Discount Codes or updating existing ones.
+ * + *{@code
+ * CompletableFuture> result = apiRoot
+ * .withProjectKeyValue("{projectKey}")
+ * .discountCodes()
+ * .importContainers()
+ * .withImportContainerKeyValue("{importContainerKey}")
+ * .post("")
+ * .execute()
+ * }
+ * The Type import resource type.
*/ ImportResourceType TYPE = ImportResourceTypeEnum.TYPE; + /** +The Discount Code import resource type.
*/ + ImportResourceType DISCOUNT_CODE = ImportResourceTypeEnum.DISCOUNT_CODE; /** * possible values of ImportResourceType @@ -123,7 +126,12 @@ enum ImportResourceTypeEnum implements ImportResourceType { /** * type */ - TYPE("type"); + TYPE("type"), + + /** + * discount-code + */ + DISCOUNT_CODE("discount-code"); private final String jsonName; private ImportResourceTypeEnum(final String jsonName) { diff --git a/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/discount_codes/DiscountCodeImport.java b/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/discount_codes/DiscountCodeImport.java new file mode 100644 index 00000000000..6af8e48aeec --- /dev/null +++ b/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/discount_codes/DiscountCodeImport.java @@ -0,0 +1,357 @@ + +package com.commercetools.importapi.models.discount_codes; + +import java.time.*; +import java.time.ZonedDateTime; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +import javax.annotation.Nullable; +import javax.validation.Valid; +import javax.validation.constraints.NotNull; + +import com.commercetools.importapi.models.common.CartDiscountKeyReference; +import com.commercetools.importapi.models.common.ImportResource; +import com.commercetools.importapi.models.common.LocalizedString; +import com.commercetools.importapi.models.customfields.Custom; +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +/** + *The data representation for a Discount Code to be imported that is persisted as a Discount Code in the Project.
+ * + *
+ * DiscountCodeImport discountCodeImport = DiscountCodeImport.builder()
+ * .key("{key}")
+ * .code("{code}")
+ * .plusCartDiscounts(cartDiscountsBuilder -> cartDiscountsBuilder)
+ * .isActive(true)
+ * .build()
+ *
+ * User-defined unique identifier. If a Discount Code with this key
exists, it will be updated with the imported data.
Maps to DiscountCode.name
.
Maps to DiscountCode.description
.
User-defined unique identifier of the DiscountCode that is used by the customer to apply the discount.
+ * @return code + */ + @NotNull + @JsonProperty("code") + public String getCode(); + + /** + *Reference to CartDiscounts that can be applied to the Cart once the DiscountCode is applied.
+ * @return cartDiscounts + */ + @NotNull + @Valid + @JsonProperty("cartDiscounts") + public ListDiscountCode can only be applied to Carts that match this predicate.
+ * @return cartPredicate + */ + + @JsonProperty("cartPredicate") + public String getCartPredicate(); + + /** + *Indicates if the DiscountCode is active and can be applied to the Cart.
+ * @return isActive + */ + @NotNull + @JsonProperty("isActive") + public Boolean getIsActive(); + + /** + *Number of times the DiscountCode can be applied. DiscountCode application is counted at the time of Order creation or update. However, Order cancellation or deletion does not decrement the count.
+ * @return maxApplications + */ + + @JsonProperty("maxApplications") + public Long getMaxApplications(); + + /** + *Number of times the DiscountCode can be applied per Customer (anonymous Carts are not supported). DiscountCode application is counted at the time of Order creation or update. However, Order cancellation or deletion does not decrement the count.
+ * @return maxApplicationsPerCustomer + */ + + @JsonProperty("maxApplicationsPerCustomer") + public Long getMaxApplicationsPerCustomer(); + + /** + *Groups to which the DiscountCode belongs.
+ * @return groups + */ + + @JsonProperty("groups") + public ListDate and time (UTC) from which the DiscountCode is effective.
+ * @return validFrom + */ + + @JsonProperty("validFrom") + public ZonedDateTime getValidFrom(); + + /** + *Date and time (UTC) until which the DiscountCode is effective.
+ * @return validUntil + */ + + @JsonProperty("validUntil") + public ZonedDateTime getValidUntil(); + + /** + *Custom Fields of the DiscountCode.
+ * @return custom + */ + @Valid + @JsonProperty("custom") + public Custom getCustom(); + + /** + *User-defined unique identifier. If a Discount Code with this key
exists, it will be updated with the imported data.
Maps to DiscountCode.name
.
Maps to DiscountCode.description
.
User-defined unique identifier of the DiscountCode that is used by the customer to apply the discount.
+ * @param code value to be set + */ + + public void setCode(final String code); + + /** + *Reference to CartDiscounts that can be applied to the Cart once the DiscountCode is applied.
+ * @param cartDiscounts values to be set + */ + + @JsonIgnore + public void setCartDiscounts(final CartDiscountKeyReference... cartDiscounts); + + /** + *Reference to CartDiscounts that can be applied to the Cart once the DiscountCode is applied.
+ * @param cartDiscounts values to be set + */ + + public void setCartDiscounts(final ListDiscountCode can only be applied to Carts that match this predicate.
+ * @param cartPredicate value to be set + */ + + public void setCartPredicate(final String cartPredicate); + + /** + *Indicates if the DiscountCode is active and can be applied to the Cart.
+ * @param isActive value to be set + */ + + public void setIsActive(final Boolean isActive); + + /** + *Number of times the DiscountCode can be applied. DiscountCode application is counted at the time of Order creation or update. However, Order cancellation or deletion does not decrement the count.
+ * @param maxApplications value to be set + */ + + public void setMaxApplications(final Long maxApplications); + + /** + *Number of times the DiscountCode can be applied per Customer (anonymous Carts are not supported). DiscountCode application is counted at the time of Order creation or update. However, Order cancellation or deletion does not decrement the count.
+ * @param maxApplicationsPerCustomer value to be set + */ + + public void setMaxApplicationsPerCustomer(final Long maxApplicationsPerCustomer); + + /** + *Groups to which the DiscountCode belongs.
+ * @param groups values to be set + */ + + @JsonIgnore + public void setGroups(final String... groups); + + /** + *Groups to which the DiscountCode belongs.
+ * @param groups values to be set + */ + + public void setGroups(final ListDate and time (UTC) from which the DiscountCode is effective.
+ * @param validFrom value to be set + */ + + public void setValidFrom(final ZonedDateTime validFrom); + + /** + *Date and time (UTC) until which the DiscountCode is effective.
+ * @param validUntil value to be set + */ + + public void setValidUntil(final ZonedDateTime validUntil); + + /** + *Custom Fields of the DiscountCode.
+ * @param custom value to be set + */ + + public void setCustom(final Custom custom); + + /** + * factory method + * @return instance of DiscountCodeImport + */ + public static DiscountCodeImport of() { + return new DiscountCodeImportImpl(); + } + + /** + * factory method to create a shallow copy DiscountCodeImport + * @param template instance to be copied + * @return copy instance + */ + public static DiscountCodeImport of(final DiscountCodeImport template) { + DiscountCodeImportImpl instance = new DiscountCodeImportImpl(); + instance.setKey(template.getKey()); + instance.setName(template.getName()); + instance.setDescription(template.getDescription()); + instance.setCode(template.getCode()); + instance.setCartDiscounts(template.getCartDiscounts()); + instance.setCartPredicate(template.getCartPredicate()); + instance.setIsActive(template.getIsActive()); + instance.setMaxApplications(template.getMaxApplications()); + instance.setMaxApplicationsPerCustomer(template.getMaxApplicationsPerCustomer()); + instance.setGroups(template.getGroups()); + instance.setValidFrom(template.getValidFrom()); + instance.setValidUntil(template.getValidUntil()); + instance.setCustom(template.getCustom()); + return instance; + } + + /** + * factory method to create a deep copy of DiscountCodeImport + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static DiscountCodeImport deepCopy(@Nullable final DiscountCodeImport template) { + if (template == null) { + return null; + } + DiscountCodeImportImpl instance = new DiscountCodeImportImpl(); + instance.setKey(template.getKey()); + instance.setName(com.commercetools.importapi.models.common.LocalizedString.deepCopy(template.getName())); + instance.setDescription( + com.commercetools.importapi.models.common.LocalizedString.deepCopy(template.getDescription())); + instance.setCode(template.getCode()); + instance.setCartDiscounts(Optional.ofNullable(template.getCartDiscounts()) + .map(t -> t.stream() + .map(com.commercetools.importapi.models.common.CartDiscountKeyReference::deepCopy) + .collect(Collectors.toList())) + .orElse(null)); + instance.setCartPredicate(template.getCartPredicate()); + instance.setIsActive(template.getIsActive()); + instance.setMaxApplications(template.getMaxApplications()); + instance.setMaxApplicationsPerCustomer(template.getMaxApplicationsPerCustomer()); + instance.setGroups(Optional.ofNullable(template.getGroups()).map(ArrayList::new).orElse(null)); + instance.setValidFrom(template.getValidFrom()); + instance.setValidUntil(template.getValidUntil()); + instance.setCustom(com.commercetools.importapi.models.customfields.Custom.deepCopy(template.getCustom())); + return instance; + } + + /** + * builder factory method for DiscountCodeImport + * @return builder + */ + public static DiscountCodeImportBuilder builder() { + return DiscountCodeImportBuilder.of(); + } + + /** + * create builder for DiscountCodeImport instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static DiscountCodeImportBuilder builder(final DiscountCodeImport template) { + return DiscountCodeImportBuilder.of(template); + } + + /** + * accessor map function + * @param
+ * DiscountCodeImport discountCodeImport = DiscountCodeImport.builder()
+ * .key("{key}")
+ * .code("{code}")
+ * .plusCartDiscounts(cartDiscountsBuilder -> cartDiscountsBuilder)
+ * .isActive(true)
+ * .build()
+ *
+ * User-defined unique identifier. If a Discount Code with this key
exists, it will be updated with the imported data.
Maps to DiscountCode.name
.
Maps to DiscountCode.name
.
Maps to DiscountCode.name
.
Maps to DiscountCode.description
.
Maps to DiscountCode.description
.
Maps to DiscountCode.description
.
User-defined unique identifier of the DiscountCode that is used by the customer to apply the discount.
+ * @param code value to be set + * @return Builder + */ + + public DiscountCodeImportBuilder code(final String code) { + this.code = code; + return this; + } + + /** + *Reference to CartDiscounts that can be applied to the Cart once the DiscountCode is applied.
+ * @param cartDiscounts value to be set + * @return Builder + */ + + public DiscountCodeImportBuilder cartDiscounts( + final com.commercetools.importapi.models.common.CartDiscountKeyReference... cartDiscounts) { + this.cartDiscounts = new ArrayList<>(Arrays.asList(cartDiscounts)); + return this; + } + + /** + *Reference to CartDiscounts that can be applied to the Cart once the DiscountCode is applied.
+ * @param cartDiscounts value to be set + * @return Builder + */ + + public DiscountCodeImportBuilder cartDiscounts( + final java.util.ListReference to CartDiscounts that can be applied to the Cart once the DiscountCode is applied.
+ * @param cartDiscounts value to be set + * @return Builder + */ + + public DiscountCodeImportBuilder plusCartDiscounts( + final com.commercetools.importapi.models.common.CartDiscountKeyReference... cartDiscounts) { + if (this.cartDiscounts == null) { + this.cartDiscounts = new ArrayList<>(); + } + this.cartDiscounts.addAll(Arrays.asList(cartDiscounts)); + return this; + } + + /** + *Reference to CartDiscounts that can be applied to the Cart once the DiscountCode is applied.
+ * @param builder function to build the cartDiscounts value + * @return Builder + */ + + public DiscountCodeImportBuilder plusCartDiscounts( + FunctionReference to CartDiscounts that can be applied to the Cart once the DiscountCode is applied.
+ * @param builder function to build the cartDiscounts value + * @return Builder + */ + + public DiscountCodeImportBuilder withCartDiscounts( + FunctionReference to CartDiscounts that can be applied to the Cart once the DiscountCode is applied.
+ * @param builder function to build the cartDiscounts value + * @return Builder + */ + + public DiscountCodeImportBuilder addCartDiscounts( + FunctionReference to CartDiscounts that can be applied to the Cart once the DiscountCode is applied.
+ * @param builder function to build the cartDiscounts value + * @return Builder + */ + + public DiscountCodeImportBuilder setCartDiscounts( + FunctionDiscountCode can only be applied to Carts that match this predicate.
+ * @param cartPredicate value to be set + * @return Builder + */ + + public DiscountCodeImportBuilder cartPredicate(@Nullable final String cartPredicate) { + this.cartPredicate = cartPredicate; + return this; + } + + /** + *Indicates if the DiscountCode is active and can be applied to the Cart.
+ * @param isActive value to be set + * @return Builder + */ + + public DiscountCodeImportBuilder isActive(final Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + *Number of times the DiscountCode can be applied. DiscountCode application is counted at the time of Order creation or update. However, Order cancellation or deletion does not decrement the count.
+ * @param maxApplications value to be set + * @return Builder + */ + + public DiscountCodeImportBuilder maxApplications(@Nullable final Long maxApplications) { + this.maxApplications = maxApplications; + return this; + } + + /** + *Number of times the DiscountCode can be applied per Customer (anonymous Carts are not supported). DiscountCode application is counted at the time of Order creation or update. However, Order cancellation or deletion does not decrement the count.
+ * @param maxApplicationsPerCustomer value to be set + * @return Builder + */ + + public DiscountCodeImportBuilder maxApplicationsPerCustomer(@Nullable final Long maxApplicationsPerCustomer) { + this.maxApplicationsPerCustomer = maxApplicationsPerCustomer; + return this; + } + + /** + *Groups to which the DiscountCode belongs.
+ * @param groups value to be set + * @return Builder + */ + + public DiscountCodeImportBuilder groups(@Nullable final String... groups) { + this.groups = new ArrayList<>(Arrays.asList(groups)); + return this; + } + + /** + *Groups to which the DiscountCode belongs.
+ * @param groups value to be set + * @return Builder + */ + + public DiscountCodeImportBuilder groups(@Nullable final java.util.ListGroups to which the DiscountCode belongs.
+ * @param groups value to be set + * @return Builder + */ + + public DiscountCodeImportBuilder plusGroups(@Nullable final String... groups) { + if (this.groups == null) { + this.groups = new ArrayList<>(); + } + this.groups.addAll(Arrays.asList(groups)); + return this; + } + + /** + *Date and time (UTC) from which the DiscountCode is effective.
+ * @param validFrom value to be set + * @return Builder + */ + + public DiscountCodeImportBuilder validFrom(@Nullable final java.time.ZonedDateTime validFrom) { + this.validFrom = validFrom; + return this; + } + + /** + *Date and time (UTC) until which the DiscountCode is effective.
+ * @param validUntil value to be set + * @return Builder + */ + + public DiscountCodeImportBuilder validUntil(@Nullable final java.time.ZonedDateTime validUntil) { + this.validUntil = validUntil; + return this; + } + + /** + *Custom Fields of the DiscountCode.
+ * @param builder function to build the custom value + * @return Builder + */ + + public DiscountCodeImportBuilder custom( + FunctionCustom Fields of the DiscountCode.
+ * @param builder function to build the custom value + * @return Builder + */ + + public DiscountCodeImportBuilder withCustom( + FunctionCustom Fields of the DiscountCode.
+ * @param custom value to be set + * @return Builder + */ + + public DiscountCodeImportBuilder custom( + @Nullable final com.commercetools.importapi.models.customfields.Custom custom) { + this.custom = custom; + return this; + } + + /** + *User-defined unique identifier. If a Discount Code with this key
exists, it will be updated with the imported data.
Maps to DiscountCode.name
.
Maps to DiscountCode.description
.
User-defined unique identifier of the DiscountCode that is used by the customer to apply the discount.
+ * @return code + */ + + public String getCode() { + return this.code; + } + + /** + *Reference to CartDiscounts that can be applied to the Cart once the DiscountCode is applied.
+ * @return cartDiscounts + */ + + public java.util.ListDiscountCode can only be applied to Carts that match this predicate.
+ * @return cartPredicate + */ + + @Nullable + public String getCartPredicate() { + return this.cartPredicate; + } + + /** + *Indicates if the DiscountCode is active and can be applied to the Cart.
+ * @return isActive + */ + + public Boolean getIsActive() { + return this.isActive; + } + + /** + *Number of times the DiscountCode can be applied. DiscountCode application is counted at the time of Order creation or update. However, Order cancellation or deletion does not decrement the count.
+ * @return maxApplications + */ + + @Nullable + public Long getMaxApplications() { + return this.maxApplications; + } + + /** + *Number of times the DiscountCode can be applied per Customer (anonymous Carts are not supported). DiscountCode application is counted at the time of Order creation or update. However, Order cancellation or deletion does not decrement the count.
+ * @return maxApplicationsPerCustomer + */ + + @Nullable + public Long getMaxApplicationsPerCustomer() { + return this.maxApplicationsPerCustomer; + } + + /** + *Groups to which the DiscountCode belongs.
+ * @return groups + */ + + @Nullable + public java.util.ListDate and time (UTC) from which the DiscountCode is effective.
+ * @return validFrom + */ + + @Nullable + public java.time.ZonedDateTime getValidFrom() { + return this.validFrom; + } + + /** + *Date and time (UTC) until which the DiscountCode is effective.
+ * @return validUntil + */ + + @Nullable + public java.time.ZonedDateTime getValidUntil() { + return this.validUntil; + } + + /** + *Custom Fields of the DiscountCode.
+ * @return custom + */ + + @Nullable + public com.commercetools.importapi.models.customfields.Custom getCustom() { + return this.custom; + } + + /** + * builds DiscountCodeImport with checking for non-null required values + * @return DiscountCodeImport + */ + public DiscountCodeImport build() { + Objects.requireNonNull(key, DiscountCodeImport.class + ": key is missing"); + Objects.requireNonNull(code, DiscountCodeImport.class + ": code is missing"); + Objects.requireNonNull(cartDiscounts, DiscountCodeImport.class + ": cartDiscounts is missing"); + Objects.requireNonNull(isActive, DiscountCodeImport.class + ": isActive is missing"); + return new DiscountCodeImportImpl(key, name, description, code, cartDiscounts, cartPredicate, isActive, + maxApplications, maxApplicationsPerCustomer, groups, validFrom, validUntil, custom); + } + + /** + * builds DiscountCodeImport without checking for non-null required values + * @return DiscountCodeImport + */ + public DiscountCodeImport buildUnchecked() { + return new DiscountCodeImportImpl(key, name, description, code, cartDiscounts, cartPredicate, isActive, + maxApplications, maxApplicationsPerCustomer, groups, validFrom, validUntil, custom); + } + + /** + * factory method for an instance of DiscountCodeImportBuilder + * @return builder + */ + public static DiscountCodeImportBuilder of() { + return new DiscountCodeImportBuilder(); + } + + /** + * create builder for DiscountCodeImport instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static DiscountCodeImportBuilder of(final DiscountCodeImport template) { + DiscountCodeImportBuilder builder = new DiscountCodeImportBuilder(); + builder.key = template.getKey(); + builder.name = template.getName(); + builder.description = template.getDescription(); + builder.code = template.getCode(); + builder.cartDiscounts = template.getCartDiscounts(); + builder.cartPredicate = template.getCartPredicate(); + builder.isActive = template.getIsActive(); + builder.maxApplications = template.getMaxApplications(); + builder.maxApplicationsPerCustomer = template.getMaxApplicationsPerCustomer(); + builder.groups = template.getGroups(); + builder.validFrom = template.getValidFrom(); + builder.validUntil = template.getValidUntil(); + builder.custom = template.getCustom(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/discount_codes/DiscountCodeImportImpl.java b/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/discount_codes/DiscountCodeImportImpl.java new file mode 100644 index 00000000000..79c387cddff --- /dev/null +++ b/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/discount_codes/DiscountCodeImportImpl.java @@ -0,0 +1,329 @@ + +package com.commercetools.importapi.models.discount_codes; + +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; + +/** + *The data representation for a Discount Code to be imported that is persisted as a Discount Code in the Project.
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class DiscountCodeImportImpl implements DiscountCodeImport, ModelBase { + + private String key; + + private com.commercetools.importapi.models.common.LocalizedString name; + + private com.commercetools.importapi.models.common.LocalizedString description; + + private String code; + + private java.util.ListUser-defined unique identifier. If a Discount Code with this key
exists, it will be updated with the imported data.
Maps to DiscountCode.name
.
Maps to DiscountCode.description
.
User-defined unique identifier of the DiscountCode that is used by the customer to apply the discount.
+ */ + + public String getCode() { + return this.code; + } + + /** + *Reference to CartDiscounts that can be applied to the Cart once the DiscountCode is applied.
+ */ + + public java.util.ListDiscountCode can only be applied to Carts that match this predicate.
+ */ + + public String getCartPredicate() { + return this.cartPredicate; + } + + /** + *Indicates if the DiscountCode is active and can be applied to the Cart.
+ */ + + public Boolean getIsActive() { + return this.isActive; + } + + /** + *Number of times the DiscountCode can be applied. DiscountCode application is counted at the time of Order creation or update. However, Order cancellation or deletion does not decrement the count.
+ */ + + public Long getMaxApplications() { + return this.maxApplications; + } + + /** + *Number of times the DiscountCode can be applied per Customer (anonymous Carts are not supported). DiscountCode application is counted at the time of Order creation or update. However, Order cancellation or deletion does not decrement the count.
+ */ + + public Long getMaxApplicationsPerCustomer() { + return this.maxApplicationsPerCustomer; + } + + /** + *Groups to which the DiscountCode belongs.
+ */ + + public java.util.ListDate and time (UTC) from which the DiscountCode is effective.
+ */ + + public java.time.ZonedDateTime getValidFrom() { + return this.validFrom; + } + + /** + *Date and time (UTC) until which the DiscountCode is effective.
+ */ + + public java.time.ZonedDateTime getValidUntil() { + return this.validUntil; + } + + /** + *Custom Fields of the DiscountCode.
+ */ + + public com.commercetools.importapi.models.customfields.Custom getCustom() { + return this.custom; + } + + public void setKey(final String key) { + this.key = key; + } + + public void setName(final com.commercetools.importapi.models.common.LocalizedString name) { + this.name = name; + } + + public void setDescription(final com.commercetools.importapi.models.common.LocalizedString description) { + this.description = description; + } + + public void setCode(final String code) { + this.code = code; + } + + public void setCartDiscounts( + final com.commercetools.importapi.models.common.CartDiscountKeyReference... cartDiscounts) { + this.cartDiscounts = new ArrayList<>(Arrays.asList(cartDiscounts)); + } + + public void setCartDiscounts( + final java.util.ListThe request body to import Discount Codes. Contains data for Discount Codes to be created or updated in a Project.
+ * + *
+ * DiscountCodeImportRequest discountCodeImportRequest = DiscountCodeImportRequest.builder()
+ * .plusResources(resourcesBuilder -> resourcesBuilder)
+ * .build()
+ *
+ * The Discount Code import resources of this request.
+ * @return resources + */ + @NotNull + @Valid + @JsonProperty("resources") + public ListThe Discount Code import resources of this request.
+ * @param resources values to be set + */ + + @JsonIgnore + public void setResources(final DiscountCodeImport... resources); + + /** + *The Discount Code import resources of this request.
+ * @param resources values to be set + */ + + public void setResources(final List
+ * DiscountCodeImportRequest discountCodeImportRequest = DiscountCodeImportRequest.builder()
+ * .plusResources(resourcesBuilder -> resourcesBuilder)
+ * .build()
+ *
+ * The Discount Code import resources of this request.
+ * @param resources value to be set + * @return Builder + */ + + public DiscountCodeImportRequestBuilder resources( + final com.commercetools.importapi.models.discount_codes.DiscountCodeImport... resources) { + this.resources = new ArrayList<>(Arrays.asList(resources)); + return this; + } + + /** + *The Discount Code import resources of this request.
+ * @param resources value to be set + * @return Builder + */ + + public DiscountCodeImportRequestBuilder resources( + final java.util.ListThe Discount Code import resources of this request.
+ * @param resources value to be set + * @return Builder + */ + + public DiscountCodeImportRequestBuilder plusResources( + final com.commercetools.importapi.models.discount_codes.DiscountCodeImport... resources) { + if (this.resources == null) { + this.resources = new ArrayList<>(); + } + this.resources.addAll(Arrays.asList(resources)); + return this; + } + + /** + *The Discount Code import resources of this request.
+ * @param builder function to build the resources value + * @return Builder + */ + + public DiscountCodeImportRequestBuilder plusResources( + FunctionThe Discount Code import resources of this request.
+ * @param builder function to build the resources value + * @return Builder + */ + + public DiscountCodeImportRequestBuilder withResources( + FunctionThe Discount Code import resources of this request.
+ * @param builder function to build the resources value + * @return Builder + */ + + public DiscountCodeImportRequestBuilder addResources( + FunctionThe Discount Code import resources of this request.
+ * @param builder function to build the resources value + * @return Builder + */ + + public DiscountCodeImportRequestBuilder setResources( + FunctionThe Discount Code import resources of this request.
+ * @return resources + */ + + public java.util.ListThe request body to import Discount Codes. Contains data for Discount Codes to be created or updated in a Project.
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class DiscountCodeImportRequestImpl implements DiscountCodeImportRequest, ModelBase { + + private com.commercetools.importapi.models.common.ImportResourceType type; + + private java.util.ListThe resource types that can be imported.
+ */ + + public com.commercetools.importapi.models.common.ImportResourceType getType() { + return this.type; + } + + /** + *The Discount Code import resources of this request.
+ */ + + public java.util.List