From 9b49f2e4cca9cb49f42c85c588acc3b3b19e3b48 Mon Sep 17 00:00:00 2001 From: "ct-sdks[bot]" <153784748+ct-sdks[bot]@users.noreply.github.com> Date: Fri, 20 Dec 2024 09:37:18 +0000 Subject: [PATCH] build(codegen): updating SDK --- changes.md | 51 +--- .../main/resources/graphql/schema.graphqls | 24 ++ ...ProjectKeyBusinessUnitsRequestBuilder.java | 8 + .../ByProjectKeyBusinessUnitsSearchHead.java | 109 ++++++++ ...yBusinessUnitsSearchIndexingStatusGet.java | 112 ++++++++ ...itsSearchIndexingStatusRequestBuilder.java | 23 ++ .../ByProjectKeyBusinessUnitsSearchPost.java | 130 +++++++++ ...ojectKeyBusinessUnitsSearchPostString.java | 129 +++++++++ ...tKeyBusinessUnitsSearchRequestBuilder.java | 39 +++ .../BusinessUnitIndexingProgress.java | 158 +++++++++++ .../BusinessUnitIndexingProgressBuilder.java | 132 +++++++++ .../BusinessUnitIndexingProgressImpl.java | 117 ++++++++ .../BusinessUnitPagedSearchResponse.java | 191 +++++++++++++ ...usinessUnitPagedSearchResponseBuilder.java | 242 ++++++++++++++++ .../BusinessUnitPagedSearchResponseImpl.java | 141 ++++++++++ ...inessUnitSearchIndexingStatusResponse.java | 197 +++++++++++++ ...itSearchIndexingStatusResponseBuilder.java | 218 +++++++++++++++ ...sUnitSearchIndexingStatusResponseImpl.java | 162 +++++++++++ .../BusinessUnitSearchRequest.java | 187 +++++++++++++ .../BusinessUnitSearchRequestBuilder.java | 263 ++++++++++++++++++ .../BusinessUnitSearchRequestImpl.java | 139 +++++++++ .../BusinessUnitSearchResult.java | 140 ++++++++++ .../BusinessUnitSearchResultBuilder.java | 107 +++++++ .../BusinessUnitSearchResultImpl.java | 98 +++++++ .../project/BusinessUnitIndexingStatus.java | 131 +++++++++ .../project/BusinessUnitSearchStatus.java | 115 ++++++++ ...tChangeBusinessUnitSearchStatusAction.java | 131 +++++++++ ...BusinessUnitSearchStatusActionBuilder.java | 85 ++++++ ...ngeBusinessUnitSearchStatusActionImpl.java | 96 +++++++ .../models/project/ProjectUpdateAction.java | 17 +- .../project/ProjectUpdateActionBuilder.java | 4 + .../project/SearchIndexingConfiguration.java | 18 ++ .../SearchIndexingConfigurationBuilder.java | 57 +++- .../SearchIndexingConfigurationImpl.java | 23 +- ...ssUnitIndexingProgressQueryBuilderDsl.java | 32 +++ ...nitPagedSearchResponseQueryBuilderDsl.java | 47 ++++ ...IndexingStatusResponseQueryBuilderDsl.java | 50 ++++ ...inessUnitSearchRequestQueryBuilderDsl.java | 50 ++++ ...sinessUnitSearchResultQueryBuilderDsl.java | 25 ++ ...UnitSearchStatusActionQueryBuilderDsl.java | 26 ++ .../ProjectUpdateActionQueryBuilderDsl.java | 8 + ...hIndexingConfigurationQueryBuilderDsl.java | 10 + ...BusinessUnitsSearchIndexingStatusTest.java | 81 ++++++ .../ByProjectKeyBusinessUnitsSearchTest.java | 86 ++++++ .../BusinessUnitIndexingProgressTest.java | 52 ++++ .../BusinessUnitPagedSearchResponseTest.java | 67 +++++ ...sUnitSearchIndexingStatusResponseTest.java | 81 ++++++ .../BusinessUnitSearchRequestTest.java | 66 +++++ .../BusinessUnitSearchResultTest.java | 44 +++ ...ngeBusinessUnitSearchStatusActionTest.java | 40 +++ .../SearchIndexingConfigurationTest.java | 12 +- references.txt | 1 + 52 files changed, 4529 insertions(+), 43 deletions(-) create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchHead.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchIndexingStatusGet.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchIndexingStatusRequestBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchPost.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchPostString.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchRequestBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitIndexingProgress.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitIndexingProgressBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitIndexingProgressImpl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitPagedSearchResponse.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitPagedSearchResponseBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitPagedSearchResponseImpl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchIndexingStatusResponse.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchIndexingStatusResponseBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchIndexingStatusResponseImpl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchRequest.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchRequestBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchRequestImpl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchResult.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchResultBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchResultImpl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/BusinessUnitIndexingStatus.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/BusinessUnitSearchStatus.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/ProjectChangeBusinessUnitSearchStatusAction.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/ProjectChangeBusinessUnitSearchStatusActionBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/ProjectChangeBusinessUnitSearchStatusActionImpl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit_search/BusinessUnitIndexingProgressQueryBuilderDsl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit_search/BusinessUnitPagedSearchResponseQueryBuilderDsl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit_search/BusinessUnitSearchIndexingStatusResponseQueryBuilderDsl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit_search/BusinessUnitSearchRequestQueryBuilderDsl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit_search/BusinessUnitSearchResultQueryBuilderDsl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/project/ProjectChangeBusinessUnitSearchStatusActionQueryBuilderDsl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyBusinessUnitsSearchIndexingStatusTest.java create mode 100644 commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyBusinessUnitsSearchTest.java create mode 100644 commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitIndexingProgressTest.java create mode 100644 commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitPagedSearchResponseTest.java create mode 100644 commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchIndexingStatusResponseTest.java create mode 100644 commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchRequestTest.java create mode 100644 commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchResultTest.java create mode 100644 commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/project/ProjectChangeBusinessUnitSearchStatusActionTest.java diff --git a/changes.md b/changes.md index 630717f7ed1..9fa5dc98a07 100644 --- a/changes.md +++ b/changes.md @@ -3,60 +3,37 @@
Added Resource(s) -- added resource `/{projectKey}/channels/key={key}` +- added resource `/{projectKey}/business-units/search` +- added resource `/{projectKey}/business-units/search/indexing-status`
Added Method(s) -- added method `apiRoot.withProjectKey().channels().withKey().get()` -- added method `apiRoot.withProjectKey().channels().withKey().head()` -- added method `apiRoot.withProjectKey().channels().withKey().post()` -- added method `apiRoot.withProjectKey().channels().withKey().delete()` +- added method `apiRoot.withProjectKey().businessUnits().search().post()` +- added method `apiRoot.withProjectKey().businessUnits().search().head()` +- added method `apiRoot.withProjectKey().businessUnits().searchIndexingStatus().get()`
Added Type(s) -- added type `CartDiscountPatternTarget` -- added type `CountOnCustomLineItemUnits` -- added type `CountOnLineItemUnits` -- added type `PatternComponent` -- added type `ShoppingListLineItemAddedMessage` -- added type `ShoppingListLineItemRemovedMessage` -- added type `ShoppingListMessage` -- added type `ShoppingListLineItemAddedMessagePayload` -- added type `ShoppingListLineItemRemovedMessagePayload` -- added type `ShoppingListMessagePayload` -
- - -
-Added Enum(s) - -- added enum `Canceled` to type `ShipmentState` -- added enum `shopping-list` to type `MessageSubscriptionResourceTypeId` +- added type `BusinessUnitIndexingProgress` +- added type `BusinessUnitIndexingStatus` +- added type `BusinessUnitPagedSearchResponse` +- added type `BusinessUnitSearchIndexingStatusResponse` +- added type `BusinessUnitSearchRequest` +- added type `BusinessUnitSearchResult` +- added type `BusinessUnitSearchStatus` +- added type `ProjectChangeBusinessUnitSearchStatusAction`
Added Property(s) -- added property `applicationMode` to type `CartDiscountValueFixed` -- added property `applicationMode` to type `CartDiscountValueFixedDraft` -- added property `custom` to type `CartSetCustomShippingMethodAction` -- added property `custom` to type `StagedOrderSetCustomShippingMethodAction` -- added property `custom` to type `StagedOrderSetShippingAddressAndCustomShippingMethodAction` -
- -**History changes** - -
-Added Type(s) - -- added type `ChangeTargetPatternChangeValue` -- added type `PatternComponent` +- added property `businessUnits` to type `SearchIndexingConfiguration`
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 997e47714c2..921eca3aec1 100644 --- a/commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls +++ b/commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls @@ -1596,6 +1596,19 @@ type BusinessUnitQueryResult { results: [BusinessUnit!]! } +"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta" +type BusinessUnitSearchConfiguration { + status: BusinessUnitSearchStatus! + lastModifiedAt: DateTime! + lastModifiedBy: Initiator +} + +"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta" +enum BusinessUnitSearchStatus { + Activated + Deactivated +} + type BusinessUnitShippingAddressAdded implements MessagePayload { address: Address! type: String! @@ -2626,6 +2639,11 @@ input ChangeProductTailoringAssetOrder { assetOrder: [String!]! } +"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta" +input ChangeProjectSettingsBusinessUnitSearchStatus { + status: BusinessUnitSearchStatus! +} + input ChangeProjectSettingsCartsConfiguration { cartsConfiguration: CartsConfigurationInput! } @@ -9114,6 +9132,9 @@ input ProjectSettingsUpdateAction { "BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta" setMyBusinessUnitAssociateRoleOnCreation: SetProjectSettingsMyBusinessUnitAssociateRoleOnCreation + + "BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta" + changeBusinessUnitSearchStatus: ChangeProjectSettingsBusinessUnitSearchStatus changeProductSearchIndexingEnabled: ChangeProjectSettingsProductSearchIndexingEnabled } @@ -10507,6 +10528,9 @@ type SearchIndexingConfiguration { products: SearchIndexingConfigurationValues orders: OrderSearchConfiguration customers: CustomerSearchConfiguration + + "BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta" + businessUnits: BusinessUnitSearchConfiguration } type SearchIndexingConfigurationValues { diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsRequestBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsRequestBuilder.java index 598345a7c2c..3a6509113f3 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsRequestBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsRequestBuilder.java @@ -48,4 +48,12 @@ public ByProjectKeyBusinessUnitsByIDRequestBuilder withId(String ID) { return new ByProjectKeyBusinessUnitsByIDRequestBuilder(apiHttpClient, projectKey, ID); } + public ByProjectKeyBusinessUnitsSearchRequestBuilder search() { + return new ByProjectKeyBusinessUnitsSearchRequestBuilder(apiHttpClient, projectKey); + } + + public ByProjectKeyBusinessUnitsSearchIndexingStatusRequestBuilder searchIndexingStatus() { + return new ByProjectKeyBusinessUnitsSearchIndexingStatusRequestBuilder(apiHttpClient, projectKey); + } + } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchHead.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchHead.java new file mode 100644 index 00000000000..b8a00463f67 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchHead.java @@ -0,0 +1,109 @@ + +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 whether a search index of Business Units exists for a Project. Returns a 200 OK if an index exists; otherwise, returns a 409 Conflict.

+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .businessUnits()
+ *            .search()
+ *            .head()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyBusinessUnitsSearchHead + extends TypeApiMethod + implements com.commercetools.api.client.ErrorableTrait, + com.commercetools.api.client.Deprecatable200Trait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + + public ByProjectKeyBusinessUnitsSearchHead(final ApiHttpClient apiHttpClient, String projectKey) { + super(apiHttpClient); + this.projectKey = projectKey; + } + + public ByProjectKeyBusinessUnitsSearchHead(ByProjectKeyBusinessUnitsSearchHead t) { + super(t); + this.projectKey = t.projectKey; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/business-units/search", encodePathParam(this.projectKey)); + 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 void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyBusinessUnitsSearchHead that = (ByProjectKeyBusinessUnitsSearchHead) o; + + return new EqualsBuilder().append(projectKey, that.projectKey).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).toHashCode(); + } + + @Override + protected ByProjectKeyBusinessUnitsSearchHead copy() { + return new ByProjectKeyBusinessUnitsSearchHead(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchIndexingStatusGet.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchIndexingStatusGet.java new file mode 100644 index 00000000000..c362c3734c7 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchIndexingStatusGet.java @@ -0,0 +1,112 @@ + +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; + +/** + *

Returns the indexing status of the Business Unit Search for a Project.

+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .businessUnits()
+ *            .searchIndexingStatus()
+ *            .get()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyBusinessUnitsSearchIndexingStatusGet extends + TypeApiMethod + implements com.commercetools.api.client.ErrorableTrait, + com.commercetools.api.client.Deprecatable200Trait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + + public ByProjectKeyBusinessUnitsSearchIndexingStatusGet(final ApiHttpClient apiHttpClient, String projectKey) { + super(apiHttpClient); + this.projectKey = projectKey; + } + + public ByProjectKeyBusinessUnitsSearchIndexingStatusGet(ByProjectKeyBusinessUnitsSearchIndexingStatusGet t) { + super(t); + this.projectKey = t.projectKey; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/business-units/search/indexing-status", + encodePathParam(this.projectKey)); + 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.business_unit_search.BusinessUnitSearchIndexingStatusResponse.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, + com.commercetools.api.models.business_unit_search.BusinessUnitSearchIndexingStatusResponse.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyBusinessUnitsSearchIndexingStatusGet that = (ByProjectKeyBusinessUnitsSearchIndexingStatusGet) o; + + return new EqualsBuilder().append(projectKey, that.projectKey).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).toHashCode(); + } + + @Override + protected ByProjectKeyBusinessUnitsSearchIndexingStatusGet copy() { + return new ByProjectKeyBusinessUnitsSearchIndexingStatusGet(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchIndexingStatusRequestBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchIndexingStatusRequestBuilder.java new file mode 100644 index 00000000000..36642153734 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchIndexingStatusRequestBuilder.java @@ -0,0 +1,23 @@ + +package com.commercetools.api.client; + +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 ByProjectKeyBusinessUnitsSearchIndexingStatusRequestBuilder { + + private final ApiHttpClient apiHttpClient; + private final String projectKey; + + public ByProjectKeyBusinessUnitsSearchIndexingStatusRequestBuilder(final ApiHttpClient apiHttpClient, + final String projectKey) { + this.apiHttpClient = apiHttpClient; + this.projectKey = projectKey; + } + + public ByProjectKeyBusinessUnitsSearchIndexingStatusGet get() { + return new ByProjectKeyBusinessUnitsSearchIndexingStatusGet(apiHttpClient, projectKey); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchPost.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchPost.java new file mode 100644 index 00000000000..840255e684d --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchPost.java @@ -0,0 +1,130 @@ + +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; + +/** + *

If the initial indexing is in progress or the feature is inactive, A SearchNotReady error is returned. If inactive, you can reactivate it.

+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .businessUnits()
+ *            .search()
+ *            .post(null)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyBusinessUnitsSearchPost extends + TypeBodyApiMethod + implements com.commercetools.api.client.ErrorableTrait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + + private com.commercetools.api.models.business_unit_search.BusinessUnitSearchRequest businessUnitSearchRequest; + + public ByProjectKeyBusinessUnitsSearchPost(final ApiHttpClient apiHttpClient, String projectKey, + com.commercetools.api.models.business_unit_search.BusinessUnitSearchRequest businessUnitSearchRequest) { + super(apiHttpClient); + this.projectKey = projectKey; + this.businessUnitSearchRequest = businessUnitSearchRequest; + } + + public ByProjectKeyBusinessUnitsSearchPost(ByProjectKeyBusinessUnitsSearchPost t) { + super(t); + this.projectKey = t.projectKey; + this.businessUnitSearchRequest = t.businessUnitSearchRequest; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/business-units/search", encodePathParam(this.projectKey)); + 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(businessUnitSearchRequest))); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, + com.commercetools.api.models.business_unit_search.BusinessUnitPagedSearchResponse.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.business_unit_search.BusinessUnitPagedSearchResponse.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public com.commercetools.api.models.business_unit_search.BusinessUnitSearchRequest getBody() { + return businessUnitSearchRequest; + } + + public ByProjectKeyBusinessUnitsSearchPost withBody( + com.commercetools.api.models.business_unit_search.BusinessUnitSearchRequest businessUnitSearchRequest) { + ByProjectKeyBusinessUnitsSearchPost t = copy(); + t.businessUnitSearchRequest = businessUnitSearchRequest; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyBusinessUnitsSearchPost that = (ByProjectKeyBusinessUnitsSearchPost) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(businessUnitSearchRequest, that.businessUnitSearchRequest) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(businessUnitSearchRequest).toHashCode(); + } + + @Override + protected ByProjectKeyBusinessUnitsSearchPost copy() { + return new ByProjectKeyBusinessUnitsSearchPost(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchPostString.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchPostString.java new file mode 100644 index 00000000000..9ed09b88964 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchPostString.java @@ -0,0 +1,129 @@ + +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.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; + +/** + *

If the initial indexing is in progress or the feature is inactive, A SearchNotReady error is returned. If inactive, you can reactivate it.

+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .businessUnits()
+ *            .search()
+ *            .post("")
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyBusinessUnitsSearchPostString extends + StringBodyApiMethod + implements com.commercetools.api.client.ErrorableTrait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + + private String businessUnitSearchRequest; + + public ByProjectKeyBusinessUnitsSearchPostString(final ApiHttpClient apiHttpClient, String projectKey, + String businessUnitSearchRequest) { + super(apiHttpClient); + this.projectKey = projectKey; + this.businessUnitSearchRequest = businessUnitSearchRequest; + } + + public ByProjectKeyBusinessUnitsSearchPostString(ByProjectKeyBusinessUnitsSearchPostString t) { + super(t); + this.projectKey = t.projectKey; + this.businessUnitSearchRequest = t.businessUnitSearchRequest; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/business-units/search", this.projectKey); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(), + businessUnitSearchRequest.getBytes(StandardCharsets.UTF_8)); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, + com.commercetools.api.models.business_unit_search.BusinessUnitPagedSearchResponse.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.business_unit_search.BusinessUnitPagedSearchResponse.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public String getBody() { + return businessUnitSearchRequest; + } + + public ByProjectKeyBusinessUnitsSearchPostString withBody(String businessUnitSearchRequest) { + ByProjectKeyBusinessUnitsSearchPostString t = copy(); + t.businessUnitSearchRequest = businessUnitSearchRequest; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyBusinessUnitsSearchPostString that = (ByProjectKeyBusinessUnitsSearchPostString) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(businessUnitSearchRequest, that.businessUnitSearchRequest) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(businessUnitSearchRequest).toHashCode(); + } + + @Override + protected ByProjectKeyBusinessUnitsSearchPostString copy() { + return new ByProjectKeyBusinessUnitsSearchPostString(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchRequestBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchRequestBuilder.java new file mode 100644 index 00000000000..91aed8f6a32 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsSearchRequestBuilder.java @@ -0,0 +1,39 @@ + +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 ByProjectKeyBusinessUnitsSearchRequestBuilder { + + private final ApiHttpClient apiHttpClient; + private final String projectKey; + + public ByProjectKeyBusinessUnitsSearchRequestBuilder(final ApiHttpClient apiHttpClient, final String projectKey) { + this.apiHttpClient = apiHttpClient; + this.projectKey = projectKey; + } + + public ByProjectKeyBusinessUnitsSearchPost post( + com.commercetools.api.models.business_unit_search.BusinessUnitSearchRequest businessUnitSearchRequest) { + return new ByProjectKeyBusinessUnitsSearchPost(apiHttpClient, projectKey, businessUnitSearchRequest); + } + + public ByProjectKeyBusinessUnitsSearchPostString post(final String businessUnitSearchRequest) { + return new ByProjectKeyBusinessUnitsSearchPostString(apiHttpClient, projectKey, businessUnitSearchRequest); + } + + public ByProjectKeyBusinessUnitsSearchPost post( + UnaryOperator op) { + return post( + op.apply(com.commercetools.api.models.business_unit_search.BusinessUnitSearchRequestBuilder.of()).build()); + } + + public ByProjectKeyBusinessUnitsSearchHead head() { + return new ByProjectKeyBusinessUnitsSearchHead(apiHttpClient, projectKey); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitIndexingProgress.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitIndexingProgress.java new file mode 100644 index 00000000000..f6b754e5593 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitIndexingProgress.java @@ -0,0 +1,158 @@ + +package com.commercetools.api.models.business_unit_search; + +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; + +import jakarta.validation.constraints.NotNull; + +/** + * BusinessUnitIndexingProgress + * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     BusinessUnitIndexingProgress businessUnitIndexingProgress = BusinessUnitIndexingProgress.builder()
+ *             .indexed(0.3)
+ *             .failed(0.3)
+ *             .estimatedTotal(0.3)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = BusinessUnitIndexingProgressImpl.class) +public interface BusinessUnitIndexingProgress { + + /** + *

The number of Business Units successfully indexed.

+ * @return indexed + */ + @NotNull + @JsonProperty("indexed") + public Integer getIndexed(); + + /** + *

The number of Business Units that failed to be indexed.

+ * @return failed + */ + @NotNull + @JsonProperty("failed") + public Integer getFailed(); + + /** + *

The estimated total number of Business Units to be indexed.

+ * @return estimatedTotal + */ + @NotNull + @JsonProperty("estimatedTotal") + public Integer getEstimatedTotal(); + + /** + *

The number of Business Units successfully indexed.

+ * @param indexed value to be set + */ + + public void setIndexed(final Integer indexed); + + /** + *

The number of Business Units that failed to be indexed.

+ * @param failed value to be set + */ + + public void setFailed(final Integer failed); + + /** + *

The estimated total number of Business Units to be indexed.

+ * @param estimatedTotal value to be set + */ + + public void setEstimatedTotal(final Integer estimatedTotal); + + /** + * factory method + * @return instance of BusinessUnitIndexingProgress + */ + public static BusinessUnitIndexingProgress of() { + return new BusinessUnitIndexingProgressImpl(); + } + + /** + * factory method to create a shallow copy BusinessUnitIndexingProgress + * @param template instance to be copied + * @return copy instance + */ + public static BusinessUnitIndexingProgress of(final BusinessUnitIndexingProgress template) { + BusinessUnitIndexingProgressImpl instance = new BusinessUnitIndexingProgressImpl(); + instance.setIndexed(template.getIndexed()); + instance.setFailed(template.getFailed()); + instance.setEstimatedTotal(template.getEstimatedTotal()); + return instance; + } + + /** + * factory method to create a deep copy of BusinessUnitIndexingProgress + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static BusinessUnitIndexingProgress deepCopy(@Nullable final BusinessUnitIndexingProgress template) { + if (template == null) { + return null; + } + BusinessUnitIndexingProgressImpl instance = new BusinessUnitIndexingProgressImpl(); + instance.setIndexed(template.getIndexed()); + instance.setFailed(template.getFailed()); + instance.setEstimatedTotal(template.getEstimatedTotal()); + return instance; + } + + /** + * builder factory method for BusinessUnitIndexingProgress + * @return builder + */ + public static BusinessUnitIndexingProgressBuilder builder() { + return BusinessUnitIndexingProgressBuilder.of(); + } + + /** + * create builder for BusinessUnitIndexingProgress instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static BusinessUnitIndexingProgressBuilder builder(final BusinessUnitIndexingProgress template) { + return BusinessUnitIndexingProgressBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withBusinessUnitIndexingProgress(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/business_unit_search/BusinessUnitIndexingProgressBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitIndexingProgressBuilder.java new file mode 100644 index 00000000000..9281eea8d21 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitIndexingProgressBuilder.java @@ -0,0 +1,132 @@ + +package com.commercetools.api.models.business_unit_search; + +import java.util.*; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * BusinessUnitIndexingProgressBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     BusinessUnitIndexingProgress businessUnitIndexingProgress = BusinessUnitIndexingProgress.builder()
+ *             .indexed(0.3)
+ *             .failed(0.3)
+ *             .estimatedTotal(0.3)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class BusinessUnitIndexingProgressBuilder implements Builder { + + private Integer indexed; + + private Integer failed; + + private Integer estimatedTotal; + + /** + *

The number of Business Units successfully indexed.

+ * @param indexed value to be set + * @return Builder + */ + + public BusinessUnitIndexingProgressBuilder indexed(final Integer indexed) { + this.indexed = indexed; + return this; + } + + /** + *

The number of Business Units that failed to be indexed.

+ * @param failed value to be set + * @return Builder + */ + + public BusinessUnitIndexingProgressBuilder failed(final Integer failed) { + this.failed = failed; + return this; + } + + /** + *

The estimated total number of Business Units to be indexed.

+ * @param estimatedTotal value to be set + * @return Builder + */ + + public BusinessUnitIndexingProgressBuilder estimatedTotal(final Integer estimatedTotal) { + this.estimatedTotal = estimatedTotal; + return this; + } + + /** + *

The number of Business Units successfully indexed.

+ * @return indexed + */ + + public Integer getIndexed() { + return this.indexed; + } + + /** + *

The number of Business Units that failed to be indexed.

+ * @return failed + */ + + public Integer getFailed() { + return this.failed; + } + + /** + *

The estimated total number of Business Units to be indexed.

+ * @return estimatedTotal + */ + + public Integer getEstimatedTotal() { + return this.estimatedTotal; + } + + /** + * builds BusinessUnitIndexingProgress with checking for non-null required values + * @return BusinessUnitIndexingProgress + */ + public BusinessUnitIndexingProgress build() { + Objects.requireNonNull(indexed, BusinessUnitIndexingProgress.class + ": indexed is missing"); + Objects.requireNonNull(failed, BusinessUnitIndexingProgress.class + ": failed is missing"); + Objects.requireNonNull(estimatedTotal, BusinessUnitIndexingProgress.class + ": estimatedTotal is missing"); + return new BusinessUnitIndexingProgressImpl(indexed, failed, estimatedTotal); + } + + /** + * builds BusinessUnitIndexingProgress without checking for non-null required values + * @return BusinessUnitIndexingProgress + */ + public BusinessUnitIndexingProgress buildUnchecked() { + return new BusinessUnitIndexingProgressImpl(indexed, failed, estimatedTotal); + } + + /** + * factory method for an instance of BusinessUnitIndexingProgressBuilder + * @return builder + */ + public static BusinessUnitIndexingProgressBuilder of() { + return new BusinessUnitIndexingProgressBuilder(); + } + + /** + * create builder for BusinessUnitIndexingProgress instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static BusinessUnitIndexingProgressBuilder of(final BusinessUnitIndexingProgress template) { + BusinessUnitIndexingProgressBuilder builder = new BusinessUnitIndexingProgressBuilder(); + builder.indexed = template.getIndexed(); + builder.failed = template.getFailed(); + builder.estimatedTotal = template.getEstimatedTotal(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitIndexingProgressImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitIndexingProgressImpl.java new file mode 100644 index 00000000000..fb8ab6fde6b --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitIndexingProgressImpl.java @@ -0,0 +1,117 @@ + +package com.commercetools.api.models.business_unit_search; + +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; + +/** + * BusinessUnitIndexingProgress + */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class BusinessUnitIndexingProgressImpl implements BusinessUnitIndexingProgress, ModelBase { + + private Integer indexed; + + private Integer failed; + + private Integer estimatedTotal; + + /** + * create instance with all properties + */ + @JsonCreator + BusinessUnitIndexingProgressImpl(@JsonProperty("indexed") final Integer indexed, + @JsonProperty("failed") final Integer failed, + @JsonProperty("estimatedTotal") final Integer estimatedTotal) { + this.indexed = indexed; + this.failed = failed; + this.estimatedTotal = estimatedTotal; + } + + /** + * create empty instance + */ + public BusinessUnitIndexingProgressImpl() { + } + + /** + *

The number of Business Units successfully indexed.

+ */ + + public Integer getIndexed() { + return this.indexed; + } + + /** + *

The number of Business Units that failed to be indexed.

+ */ + + public Integer getFailed() { + return this.failed; + } + + /** + *

The estimated total number of Business Units to be indexed.

+ */ + + public Integer getEstimatedTotal() { + return this.estimatedTotal; + } + + public void setIndexed(final Integer indexed) { + this.indexed = indexed; + } + + public void setFailed(final Integer failed) { + this.failed = failed; + } + + public void setEstimatedTotal(final Integer estimatedTotal) { + this.estimatedTotal = estimatedTotal; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + BusinessUnitIndexingProgressImpl that = (BusinessUnitIndexingProgressImpl) o; + + return new EqualsBuilder().append(indexed, that.indexed) + .append(failed, that.failed) + .append(estimatedTotal, that.estimatedTotal) + .append(indexed, that.indexed) + .append(failed, that.failed) + .append(estimatedTotal, that.estimatedTotal) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(indexed).append(failed).append(estimatedTotal).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("indexed", indexed) + .append("failed", failed) + .append("estimatedTotal", estimatedTotal) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitPagedSearchResponse.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitPagedSearchResponse.java new file mode 100644 index 00000000000..0f9b4c511fc --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitPagedSearchResponse.java @@ -0,0 +1,191 @@ + +package com.commercetools.api.models.business_unit_search; + +import java.time.*; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +import javax.annotation.Nullable; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +/** + * BusinessUnitPagedSearchResponse + * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     BusinessUnitPagedSearchResponse businessUnitPagedSearchResponse = BusinessUnitPagedSearchResponse.builder()
+ *             .total(0.3)
+ *             .limit(0.3)
+ *             .offset(0.3)
+ *             .plusResults(resultsBuilder -> resultsBuilder)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = BusinessUnitPagedSearchResponseImpl.class) +public interface BusinessUnitPagedSearchResponse { + + /** + *

Total number of results matching the query.

+ * @return total + */ + @NotNull + @JsonProperty("total") + public Long getTotal(); + + /** + *

Number of results requested.

+ * @return limit + */ + @NotNull + @JsonProperty("limit") + public Integer getLimit(); + + /** + *

Number of elements skipped.

+ * @return offset + */ + @NotNull + @JsonProperty("offset") + public Integer getOffset(); + + /** + *

Search result containing the Business Units matching the search query.

+ * @return results + */ + @NotNull + @Valid + @JsonProperty("results") + public List getResults(); + + /** + *

Total number of results matching the query.

+ * @param total value to be set + */ + + public void setTotal(final Long total); + + /** + *

Number of results requested.

+ * @param limit value to be set + */ + + public void setLimit(final Integer limit); + + /** + *

Number of elements skipped.

+ * @param offset value to be set + */ + + public void setOffset(final Integer offset); + + /** + *

Search result containing the Business Units matching the search query.

+ * @param results values to be set + */ + + @JsonIgnore + public void setResults(final BusinessUnitSearchResult... results); + + /** + *

Search result containing the Business Units matching the search query.

+ * @param results values to be set + */ + + public void setResults(final List results); + + /** + * factory method + * @return instance of BusinessUnitPagedSearchResponse + */ + public static BusinessUnitPagedSearchResponse of() { + return new BusinessUnitPagedSearchResponseImpl(); + } + + /** + * factory method to create a shallow copy BusinessUnitPagedSearchResponse + * @param template instance to be copied + * @return copy instance + */ + public static BusinessUnitPagedSearchResponse of(final BusinessUnitPagedSearchResponse template) { + BusinessUnitPagedSearchResponseImpl instance = new BusinessUnitPagedSearchResponseImpl(); + instance.setTotal(template.getTotal()); + instance.setLimit(template.getLimit()); + instance.setOffset(template.getOffset()); + instance.setResults(template.getResults()); + return instance; + } + + /** + * factory method to create a deep copy of BusinessUnitPagedSearchResponse + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static BusinessUnitPagedSearchResponse deepCopy(@Nullable final BusinessUnitPagedSearchResponse template) { + if (template == null) { + return null; + } + BusinessUnitPagedSearchResponseImpl instance = new BusinessUnitPagedSearchResponseImpl(); + instance.setTotal(template.getTotal()); + instance.setLimit(template.getLimit()); + instance.setOffset(template.getOffset()); + instance.setResults(Optional.ofNullable(template.getResults()) + .map(t -> t.stream() + .map(com.commercetools.api.models.business_unit_search.BusinessUnitSearchResult::deepCopy) + .collect(Collectors.toList())) + .orElse(null)); + return instance; + } + + /** + * builder factory method for BusinessUnitPagedSearchResponse + * @return builder + */ + public static BusinessUnitPagedSearchResponseBuilder builder() { + return BusinessUnitPagedSearchResponseBuilder.of(); + } + + /** + * create builder for BusinessUnitPagedSearchResponse instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static BusinessUnitPagedSearchResponseBuilder builder(final BusinessUnitPagedSearchResponse template) { + return BusinessUnitPagedSearchResponseBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withBusinessUnitPagedSearchResponse(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/business_unit_search/BusinessUnitPagedSearchResponseBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitPagedSearchResponseBuilder.java new file mode 100644 index 00000000000..8396862c65e --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitPagedSearchResponseBuilder.java @@ -0,0 +1,242 @@ + +package com.commercetools.api.models.business_unit_search; + +import java.util.*; +import java.util.function.Function; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * BusinessUnitPagedSearchResponseBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     BusinessUnitPagedSearchResponse businessUnitPagedSearchResponse = BusinessUnitPagedSearchResponse.builder()
+ *             .total(0.3)
+ *             .limit(0.3)
+ *             .offset(0.3)
+ *             .plusResults(resultsBuilder -> resultsBuilder)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class BusinessUnitPagedSearchResponseBuilder implements Builder { + + private Long total; + + private Integer limit; + + private Integer offset; + + private java.util.List results; + + /** + *

Total number of results matching the query.

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

Number of results requested.

+ * @param limit value to be set + * @return Builder + */ + + public BusinessUnitPagedSearchResponseBuilder limit(final Integer limit) { + this.limit = limit; + return this; + } + + /** + *

Number of elements skipped.

+ * @param offset value to be set + * @return Builder + */ + + public BusinessUnitPagedSearchResponseBuilder offset(final Integer offset) { + this.offset = offset; + return this; + } + + /** + *

Search result containing the Business Units matching the search query.

+ * @param results value to be set + * @return Builder + */ + + public BusinessUnitPagedSearchResponseBuilder results( + final com.commercetools.api.models.business_unit_search.BusinessUnitSearchResult... results) { + this.results = new ArrayList<>(Arrays.asList(results)); + return this; + } + + /** + *

Search result containing the Business Units matching the search query.

+ * @param results value to be set + * @return Builder + */ + + public BusinessUnitPagedSearchResponseBuilder results( + final java.util.List results) { + this.results = results; + return this; + } + + /** + *

Search result containing the Business Units matching the search query.

+ * @param results value to be set + * @return Builder + */ + + public BusinessUnitPagedSearchResponseBuilder plusResults( + final com.commercetools.api.models.business_unit_search.BusinessUnitSearchResult... results) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.addAll(Arrays.asList(results)); + return this; + } + + /** + *

Search result containing the Business Units matching the search query.

+ * @param builder function to build the results value + * @return Builder + */ + + public BusinessUnitPagedSearchResponseBuilder plusResults( + Function builder) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add( + builder.apply(com.commercetools.api.models.business_unit_search.BusinessUnitSearchResultBuilder.of()) + .build()); + return this; + } + + /** + *

Search result containing the Business Units matching the search query.

+ * @param builder function to build the results value + * @return Builder + */ + + public BusinessUnitPagedSearchResponseBuilder withResults( + Function builder) { + this.results = new ArrayList<>(); + this.results.add( + builder.apply(com.commercetools.api.models.business_unit_search.BusinessUnitSearchResultBuilder.of()) + .build()); + return this; + } + + /** + *

Search result containing the Business Units matching the search query.

+ * @param builder function to build the results value + * @return Builder + */ + + public BusinessUnitPagedSearchResponseBuilder addResults( + Function builder) { + return plusResults( + builder.apply(com.commercetools.api.models.business_unit_search.BusinessUnitSearchResultBuilder.of())); + } + + /** + *

Search result containing the Business Units matching the search query.

+ * @param builder function to build the results value + * @return Builder + */ + + public BusinessUnitPagedSearchResponseBuilder setResults( + Function builder) { + return results( + builder.apply(com.commercetools.api.models.business_unit_search.BusinessUnitSearchResultBuilder.of())); + } + + /** + *

Total number of results matching the query.

+ * @return total + */ + + public Long getTotal() { + return this.total; + } + + /** + *

Number of results requested.

+ * @return limit + */ + + public Integer getLimit() { + return this.limit; + } + + /** + *

Number of elements skipped.

+ * @return offset + */ + + public Integer getOffset() { + return this.offset; + } + + /** + *

Search result containing the Business Units matching the search query.

+ * @return results + */ + + public java.util.List getResults() { + return this.results; + } + + /** + * builds BusinessUnitPagedSearchResponse with checking for non-null required values + * @return BusinessUnitPagedSearchResponse + */ + public BusinessUnitPagedSearchResponse build() { + Objects.requireNonNull(total, BusinessUnitPagedSearchResponse.class + ": total is missing"); + Objects.requireNonNull(limit, BusinessUnitPagedSearchResponse.class + ": limit is missing"); + Objects.requireNonNull(offset, BusinessUnitPagedSearchResponse.class + ": offset is missing"); + Objects.requireNonNull(results, BusinessUnitPagedSearchResponse.class + ": results is missing"); + return new BusinessUnitPagedSearchResponseImpl(total, limit, offset, results); + } + + /** + * builds BusinessUnitPagedSearchResponse without checking for non-null required values + * @return BusinessUnitPagedSearchResponse + */ + public BusinessUnitPagedSearchResponse buildUnchecked() { + return new BusinessUnitPagedSearchResponseImpl(total, limit, offset, results); + } + + /** + * factory method for an instance of BusinessUnitPagedSearchResponseBuilder + * @return builder + */ + public static BusinessUnitPagedSearchResponseBuilder of() { + return new BusinessUnitPagedSearchResponseBuilder(); + } + + /** + * create builder for BusinessUnitPagedSearchResponse instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static BusinessUnitPagedSearchResponseBuilder of(final BusinessUnitPagedSearchResponse template) { + BusinessUnitPagedSearchResponseBuilder builder = new BusinessUnitPagedSearchResponseBuilder(); + builder.total = template.getTotal(); + builder.limit = template.getLimit(); + builder.offset = template.getOffset(); + builder.results = template.getResults(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitPagedSearchResponseImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitPagedSearchResponseImpl.java new file mode 100644 index 00000000000..0a758abfda6 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitPagedSearchResponseImpl.java @@ -0,0 +1,141 @@ + +package com.commercetools.api.models.business_unit_search; + +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; + +/** + * BusinessUnitPagedSearchResponse + */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class BusinessUnitPagedSearchResponseImpl implements BusinessUnitPagedSearchResponse, ModelBase { + + private Long total; + + private Integer limit; + + private Integer offset; + + private java.util.List results; + + /** + * create instance with all properties + */ + @JsonCreator + BusinessUnitPagedSearchResponseImpl(@JsonProperty("total") final Long total, + @JsonProperty("limit") final Integer limit, @JsonProperty("offset") final Integer offset, + @JsonProperty("results") final java.util.List results) { + this.total = total; + this.limit = limit; + this.offset = offset; + this.results = results; + } + + /** + * create empty instance + */ + public BusinessUnitPagedSearchResponseImpl() { + } + + /** + *

Total number of results matching the query.

+ */ + + public Long getTotal() { + return this.total; + } + + /** + *

Number of results requested.

+ */ + + public Integer getLimit() { + return this.limit; + } + + /** + *

Number of elements skipped.

+ */ + + public Integer getOffset() { + return this.offset; + } + + /** + *

Search result containing the Business Units matching the search query.

+ */ + + public java.util.List getResults() { + return this.results; + } + + public void setTotal(final Long total) { + this.total = total; + } + + public void setLimit(final Integer limit) { + this.limit = limit; + } + + public void setOffset(final Integer offset) { + this.offset = offset; + } + + public void setResults( + final com.commercetools.api.models.business_unit_search.BusinessUnitSearchResult... results) { + this.results = new ArrayList<>(Arrays.asList(results)); + } + + public void setResults( + final java.util.List results) { + this.results = results; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + BusinessUnitPagedSearchResponseImpl that = (BusinessUnitPagedSearchResponseImpl) o; + + return new EqualsBuilder().append(total, that.total) + .append(limit, that.limit) + .append(offset, that.offset) + .append(results, that.results) + .append(total, that.total) + .append(limit, that.limit) + .append(offset, that.offset) + .append(results, that.results) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(total).append(limit).append(offset).append(results).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("total", total) + .append("limit", limit) + .append("offset", offset) + .append("results", results) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchIndexingStatusResponse.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchIndexingStatusResponse.java new file mode 100644 index 00000000000..9b317fbedfa --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchIndexingStatusResponse.java @@ -0,0 +1,197 @@ + +package com.commercetools.api.models.business_unit_search; + +import java.time.*; +import java.time.ZonedDateTime; +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import com.commercetools.api.models.project.BusinessUnitIndexingStatus; +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +/** + * BusinessUnitSearchIndexingStatusResponse + * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     BusinessUnitSearchIndexingStatusResponse businessUnitSearchIndexingStatusResponse = BusinessUnitSearchIndexingStatusResponse.builder()
+ *             .status(BusinessUnitIndexingStatus.SCHEDULED)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = BusinessUnitSearchIndexingStatusResponseImpl.class) +public interface BusinessUnitSearchIndexingStatusResponse { + + /** + *

Current status of indexing the Business Unit Search.

+ * @return status + */ + @NotNull + @JsonProperty("status") + public BusinessUnitIndexingStatus getStatus(); + + /** + *

Progress of indexing. Only available when indexing is in progress.

+ * @return states + */ + @Valid + @JsonProperty("states") + public BusinessUnitIndexingProgress getStates(); + + /** + *

Date and time (UTC) when the last indexing started.

+ * @return startedAt + */ + + @JsonProperty("startedAt") + public ZonedDateTime getStartedAt(); + + /** + *

Time when the status was last modified.

+ * @return lastModifiedAt + */ + + @JsonProperty("lastModifiedAt") + public ZonedDateTime getLastModifiedAt(); + + /** + *

Indicates how many times the system tried to start indexing after failed attempts. The counter is set to null after an indexing finished successfully.

+ * @return retryCount + */ + + @JsonProperty("retryCount") + public Integer getRetryCount(); + + /** + *

Current status of indexing the Business Unit Search.

+ * @param status value to be set + */ + + public void setStatus(final BusinessUnitIndexingStatus status); + + /** + *

Progress of indexing. Only available when indexing is in progress.

+ * @param states value to be set + */ + + public void setStates(final BusinessUnitIndexingProgress states); + + /** + *

Date and time (UTC) when the last indexing started.

+ * @param startedAt value to be set + */ + + public void setStartedAt(final ZonedDateTime startedAt); + + /** + *

Time when the status was last modified.

+ * @param lastModifiedAt value to be set + */ + + public void setLastModifiedAt(final ZonedDateTime lastModifiedAt); + + /** + *

Indicates how many times the system tried to start indexing after failed attempts. The counter is set to null after an indexing finished successfully.

+ * @param retryCount value to be set + */ + + public void setRetryCount(final Integer retryCount); + + /** + * factory method + * @return instance of BusinessUnitSearchIndexingStatusResponse + */ + public static BusinessUnitSearchIndexingStatusResponse of() { + return new BusinessUnitSearchIndexingStatusResponseImpl(); + } + + /** + * factory method to create a shallow copy BusinessUnitSearchIndexingStatusResponse + * @param template instance to be copied + * @return copy instance + */ + public static BusinessUnitSearchIndexingStatusResponse of(final BusinessUnitSearchIndexingStatusResponse template) { + BusinessUnitSearchIndexingStatusResponseImpl instance = new BusinessUnitSearchIndexingStatusResponseImpl(); + instance.setStatus(template.getStatus()); + instance.setStates(template.getStates()); + instance.setStartedAt(template.getStartedAt()); + instance.setLastModifiedAt(template.getLastModifiedAt()); + instance.setRetryCount(template.getRetryCount()); + return instance; + } + + /** + * factory method to create a deep copy of BusinessUnitSearchIndexingStatusResponse + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static BusinessUnitSearchIndexingStatusResponse deepCopy( + @Nullable final BusinessUnitSearchIndexingStatusResponse template) { + if (template == null) { + return null; + } + BusinessUnitSearchIndexingStatusResponseImpl instance = new BusinessUnitSearchIndexingStatusResponseImpl(); + instance.setStatus(template.getStatus()); + instance.setStates(com.commercetools.api.models.business_unit_search.BusinessUnitIndexingProgress + .deepCopy(template.getStates())); + instance.setStartedAt(template.getStartedAt()); + instance.setLastModifiedAt(template.getLastModifiedAt()); + instance.setRetryCount(template.getRetryCount()); + return instance; + } + + /** + * builder factory method for BusinessUnitSearchIndexingStatusResponse + * @return builder + */ + public static BusinessUnitSearchIndexingStatusResponseBuilder builder() { + return BusinessUnitSearchIndexingStatusResponseBuilder.of(); + } + + /** + * create builder for BusinessUnitSearchIndexingStatusResponse instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static BusinessUnitSearchIndexingStatusResponseBuilder builder( + final BusinessUnitSearchIndexingStatusResponse template) { + return BusinessUnitSearchIndexingStatusResponseBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withBusinessUnitSearchIndexingStatusResponse( + 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/business_unit_search/BusinessUnitSearchIndexingStatusResponseBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchIndexingStatusResponseBuilder.java new file mode 100644 index 00000000000..0b9a08dae22 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchIndexingStatusResponseBuilder.java @@ -0,0 +1,218 @@ + +package com.commercetools.api.models.business_unit_search; + +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; + +/** + * BusinessUnitSearchIndexingStatusResponseBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     BusinessUnitSearchIndexingStatusResponse businessUnitSearchIndexingStatusResponse = BusinessUnitSearchIndexingStatusResponse.builder()
+ *             .status(BusinessUnitIndexingStatus.SCHEDULED)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class BusinessUnitSearchIndexingStatusResponseBuilder + implements Builder { + + private com.commercetools.api.models.project.BusinessUnitIndexingStatus status; + + @Nullable + private com.commercetools.api.models.business_unit_search.BusinessUnitIndexingProgress states; + + @Nullable + private java.time.ZonedDateTime startedAt; + + @Nullable + private java.time.ZonedDateTime lastModifiedAt; + + @Nullable + private Integer retryCount; + + /** + *

Current status of indexing the Business Unit Search.

+ * @param status value to be set + * @return Builder + */ + + public BusinessUnitSearchIndexingStatusResponseBuilder status( + final com.commercetools.api.models.project.BusinessUnitIndexingStatus status) { + this.status = status; + return this; + } + + /** + *

Progress of indexing. Only available when indexing is in progress.

+ * @param builder function to build the states value + * @return Builder + */ + + public BusinessUnitSearchIndexingStatusResponseBuilder states( + Function builder) { + this.states = builder + .apply(com.commercetools.api.models.business_unit_search.BusinessUnitIndexingProgressBuilder.of()) + .build(); + return this; + } + + /** + *

Progress of indexing. Only available when indexing is in progress.

+ * @param builder function to build the states value + * @return Builder + */ + + public BusinessUnitSearchIndexingStatusResponseBuilder withStates( + Function builder) { + this.states = builder + .apply(com.commercetools.api.models.business_unit_search.BusinessUnitIndexingProgressBuilder.of()); + return this; + } + + /** + *

Progress of indexing. Only available when indexing is in progress.

+ * @param states value to be set + * @return Builder + */ + + public BusinessUnitSearchIndexingStatusResponseBuilder states( + @Nullable final com.commercetools.api.models.business_unit_search.BusinessUnitIndexingProgress states) { + this.states = states; + return this; + } + + /** + *

Date and time (UTC) when the last indexing started.

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

Time when the status was last modified.

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

Indicates how many times the system tried to start indexing after failed attempts. The counter is set to null after an indexing finished successfully.

+ * @param retryCount value to be set + * @return Builder + */ + + public BusinessUnitSearchIndexingStatusResponseBuilder retryCount(@Nullable final Integer retryCount) { + this.retryCount = retryCount; + return this; + } + + /** + *

Current status of indexing the Business Unit Search.

+ * @return status + */ + + public com.commercetools.api.models.project.BusinessUnitIndexingStatus getStatus() { + return this.status; + } + + /** + *

Progress of indexing. Only available when indexing is in progress.

+ * @return states + */ + + @Nullable + public com.commercetools.api.models.business_unit_search.BusinessUnitIndexingProgress getStates() { + return this.states; + } + + /** + *

Date and time (UTC) when the last indexing started.

+ * @return startedAt + */ + + @Nullable + public java.time.ZonedDateTime getStartedAt() { + return this.startedAt; + } + + /** + *

Time when the status was last modified.

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

Indicates how many times the system tried to start indexing after failed attempts. The counter is set to null after an indexing finished successfully.

+ * @return retryCount + */ + + @Nullable + public Integer getRetryCount() { + return this.retryCount; + } + + /** + * builds BusinessUnitSearchIndexingStatusResponse with checking for non-null required values + * @return BusinessUnitSearchIndexingStatusResponse + */ + public BusinessUnitSearchIndexingStatusResponse build() { + Objects.requireNonNull(status, BusinessUnitSearchIndexingStatusResponse.class + ": status is missing"); + return new BusinessUnitSearchIndexingStatusResponseImpl(status, states, startedAt, lastModifiedAt, retryCount); + } + + /** + * builds BusinessUnitSearchIndexingStatusResponse without checking for non-null required values + * @return BusinessUnitSearchIndexingStatusResponse + */ + public BusinessUnitSearchIndexingStatusResponse buildUnchecked() { + return new BusinessUnitSearchIndexingStatusResponseImpl(status, states, startedAt, lastModifiedAt, retryCount); + } + + /** + * factory method for an instance of BusinessUnitSearchIndexingStatusResponseBuilder + * @return builder + */ + public static BusinessUnitSearchIndexingStatusResponseBuilder of() { + return new BusinessUnitSearchIndexingStatusResponseBuilder(); + } + + /** + * create builder for BusinessUnitSearchIndexingStatusResponse instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static BusinessUnitSearchIndexingStatusResponseBuilder of( + final BusinessUnitSearchIndexingStatusResponse template) { + BusinessUnitSearchIndexingStatusResponseBuilder builder = new BusinessUnitSearchIndexingStatusResponseBuilder(); + builder.status = template.getStatus(); + builder.states = template.getStates(); + builder.startedAt = template.getStartedAt(); + builder.lastModifiedAt = template.getLastModifiedAt(); + builder.retryCount = template.getRetryCount(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchIndexingStatusResponseImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchIndexingStatusResponseImpl.java new file mode 100644 index 00000000000..e235338f527 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchIndexingStatusResponseImpl.java @@ -0,0 +1,162 @@ + +package com.commercetools.api.models.business_unit_search; + +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; + +/** + * BusinessUnitSearchIndexingStatusResponse + */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class BusinessUnitSearchIndexingStatusResponseImpl + implements BusinessUnitSearchIndexingStatusResponse, ModelBase { + + private com.commercetools.api.models.project.BusinessUnitIndexingStatus status; + + private com.commercetools.api.models.business_unit_search.BusinessUnitIndexingProgress states; + + private java.time.ZonedDateTime startedAt; + + private java.time.ZonedDateTime lastModifiedAt; + + private Integer retryCount; + + /** + * create instance with all properties + */ + @JsonCreator + BusinessUnitSearchIndexingStatusResponseImpl( + @JsonProperty("status") final com.commercetools.api.models.project.BusinessUnitIndexingStatus status, + @JsonProperty("states") final com.commercetools.api.models.business_unit_search.BusinessUnitIndexingProgress states, + @JsonProperty("startedAt") final java.time.ZonedDateTime startedAt, + @JsonProperty("lastModifiedAt") final java.time.ZonedDateTime lastModifiedAt, + @JsonProperty("retryCount") final Integer retryCount) { + this.status = status; + this.states = states; + this.startedAt = startedAt; + this.lastModifiedAt = lastModifiedAt; + this.retryCount = retryCount; + } + + /** + * create empty instance + */ + public BusinessUnitSearchIndexingStatusResponseImpl() { + } + + /** + *

Current status of indexing the Business Unit Search.

+ */ + + public com.commercetools.api.models.project.BusinessUnitIndexingStatus getStatus() { + return this.status; + } + + /** + *

Progress of indexing. Only available when indexing is in progress.

+ */ + + public com.commercetools.api.models.business_unit_search.BusinessUnitIndexingProgress getStates() { + return this.states; + } + + /** + *

Date and time (UTC) when the last indexing started.

+ */ + + public java.time.ZonedDateTime getStartedAt() { + return this.startedAt; + } + + /** + *

Time when the status was last modified.

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

Indicates how many times the system tried to start indexing after failed attempts. The counter is set to null after an indexing finished successfully.

+ */ + + public Integer getRetryCount() { + return this.retryCount; + } + + public void setStatus(final com.commercetools.api.models.project.BusinessUnitIndexingStatus status) { + this.status = status; + } + + public void setStates(final com.commercetools.api.models.business_unit_search.BusinessUnitIndexingProgress states) { + this.states = states; + } + + public void setStartedAt(final java.time.ZonedDateTime startedAt) { + this.startedAt = startedAt; + } + + public void setLastModifiedAt(final java.time.ZonedDateTime lastModifiedAt) { + this.lastModifiedAt = lastModifiedAt; + } + + public void setRetryCount(final Integer retryCount) { + this.retryCount = retryCount; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + BusinessUnitSearchIndexingStatusResponseImpl that = (BusinessUnitSearchIndexingStatusResponseImpl) o; + + return new EqualsBuilder().append(status, that.status) + .append(states, that.states) + .append(startedAt, that.startedAt) + .append(lastModifiedAt, that.lastModifiedAt) + .append(retryCount, that.retryCount) + .append(status, that.status) + .append(states, that.states) + .append(startedAt, that.startedAt) + .append(lastModifiedAt, that.lastModifiedAt) + .append(retryCount, that.retryCount) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(status) + .append(states) + .append(startedAt) + .append(lastModifiedAt) + .append(retryCount) + .toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("status", status) + .append("states", states) + .append("startedAt", startedAt) + .append("lastModifiedAt", lastModifiedAt) + .append("retryCount", retryCount) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchRequest.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchRequest.java new file mode 100644 index 00000000000..22d2b1e740e --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchRequest.java @@ -0,0 +1,187 @@ + +package com.commercetools.api.models.business_unit_search; + +import java.time.*; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +import javax.annotation.Nullable; + +import com.commercetools.api.models.search.SearchQuery; +import com.commercetools.api.models.search.SearchSorting; +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +import jakarta.validation.Valid; + +/** + * BusinessUnitSearchRequest + * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     BusinessUnitSearchRequest businessUnitSearchRequest = BusinessUnitSearchRequest.builder()
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = BusinessUnitSearchRequestImpl.class) +public interface BusinessUnitSearchRequest { + + /** + *

The Business Unit Search query.

+ * @return query + */ + @Valid + @JsonProperty("query") + public SearchQuery getQuery(); + + /** + *

Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order.

+ * @return sort + */ + @Valid + @JsonProperty("sort") + public List getSort(); + + /** + *

The maximum number of search results to be returned.

+ * @return limit + */ + + @JsonProperty("limit") + public Integer getLimit(); + + /** + *

The number of search results to be skipped in the response for pagination.

+ * @return offset + */ + + @JsonProperty("offset") + public Integer getOffset(); + + /** + *

The Business Unit Search query.

+ * @param query value to be set + */ + + public void setQuery(final SearchQuery query); + + /** + *

Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order.

+ * @param sort values to be set + */ + + @JsonIgnore + public void setSort(final SearchSorting... sort); + + /** + *

Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order.

+ * @param sort values to be set + */ + + public void setSort(final List sort); + + /** + *

The maximum number of search results to be returned.

+ * @param limit value to be set + */ + + public void setLimit(final Integer limit); + + /** + *

The number of search results to be skipped in the response for pagination.

+ * @param offset value to be set + */ + + public void setOffset(final Integer offset); + + /** + * factory method + * @return instance of BusinessUnitSearchRequest + */ + public static BusinessUnitSearchRequest of() { + return new BusinessUnitSearchRequestImpl(); + } + + /** + * factory method to create a shallow copy BusinessUnitSearchRequest + * @param template instance to be copied + * @return copy instance + */ + public static BusinessUnitSearchRequest of(final BusinessUnitSearchRequest template) { + BusinessUnitSearchRequestImpl instance = new BusinessUnitSearchRequestImpl(); + instance.setQuery(template.getQuery()); + instance.setSort(template.getSort()); + instance.setLimit(template.getLimit()); + instance.setOffset(template.getOffset()); + return instance; + } + + /** + * factory method to create a deep copy of BusinessUnitSearchRequest + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static BusinessUnitSearchRequest deepCopy(@Nullable final BusinessUnitSearchRequest template) { + if (template == null) { + return null; + } + BusinessUnitSearchRequestImpl instance = new BusinessUnitSearchRequestImpl(); + instance.setQuery(com.commercetools.api.models.search.SearchQuery.deepCopy(template.getQuery())); + instance.setSort(Optional.ofNullable(template.getSort()) + .map(t -> t.stream() + .map(com.commercetools.api.models.search.SearchSorting::deepCopy) + .collect(Collectors.toList())) + .orElse(null)); + instance.setLimit(template.getLimit()); + instance.setOffset(template.getOffset()); + return instance; + } + + /** + * builder factory method for BusinessUnitSearchRequest + * @return builder + */ + public static BusinessUnitSearchRequestBuilder builder() { + return BusinessUnitSearchRequestBuilder.of(); + } + + /** + * create builder for BusinessUnitSearchRequest instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static BusinessUnitSearchRequestBuilder builder(final BusinessUnitSearchRequest template) { + return BusinessUnitSearchRequestBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withBusinessUnitSearchRequest(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/business_unit_search/BusinessUnitSearchRequestBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchRequestBuilder.java new file mode 100644 index 00000000000..c9633a2da11 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchRequestBuilder.java @@ -0,0 +1,263 @@ + +package com.commercetools.api.models.business_unit_search; + +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; + +/** + * BusinessUnitSearchRequestBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     BusinessUnitSearchRequest businessUnitSearchRequest = BusinessUnitSearchRequest.builder()
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class BusinessUnitSearchRequestBuilder implements Builder { + + @Nullable + private com.commercetools.api.models.search.SearchQuery query; + + @Nullable + private java.util.List sort; + + @Nullable + private Integer limit; + + @Nullable + private Integer offset; + + /** + *

The Business Unit Search query.

+ * @param builder function to build the query value + * @return Builder + */ + + public BusinessUnitSearchRequestBuilder query( + Function builder) { + this.query = builder.apply(com.commercetools.api.models.search.SearchQueryBuilder.of()).build(); + return this; + } + + /** + *

The Business Unit Search query.

+ * @param builder function to build the query value + * @return Builder + */ + + public BusinessUnitSearchRequestBuilder withQuery( + Function builder) { + this.query = builder.apply(com.commercetools.api.models.search.SearchQueryBuilder.of()); + return this; + } + + /** + *

The Business Unit Search query.

+ * @param query value to be set + * @return Builder + */ + + public BusinessUnitSearchRequestBuilder query( + @Nullable final com.commercetools.api.models.search.SearchQuery query) { + this.query = query; + return this; + } + + /** + *

Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order.

+ * @param sort value to be set + * @return Builder + */ + + public BusinessUnitSearchRequestBuilder sort( + @Nullable final com.commercetools.api.models.search.SearchSorting... sort) { + this.sort = new ArrayList<>(Arrays.asList(sort)); + return this; + } + + /** + *

Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order.

+ * @param sort value to be set + * @return Builder + */ + + public BusinessUnitSearchRequestBuilder sort( + @Nullable final java.util.List sort) { + this.sort = sort; + return this; + } + + /** + *

Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order.

+ * @param sort value to be set + * @return Builder + */ + + public BusinessUnitSearchRequestBuilder plusSort( + @Nullable final com.commercetools.api.models.search.SearchSorting... sort) { + if (this.sort == null) { + this.sort = new ArrayList<>(); + } + this.sort.addAll(Arrays.asList(sort)); + return this; + } + + /** + *

Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order.

+ * @param builder function to build the sort value + * @return Builder + */ + + public BusinessUnitSearchRequestBuilder plusSort( + Function builder) { + if (this.sort == null) { + this.sort = new ArrayList<>(); + } + this.sort.add(builder.apply(com.commercetools.api.models.search.SearchSortingBuilder.of()).build()); + return this; + } + + /** + *

Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order.

+ * @param builder function to build the sort value + * @return Builder + */ + + public BusinessUnitSearchRequestBuilder withSort( + Function builder) { + this.sort = new ArrayList<>(); + this.sort.add(builder.apply(com.commercetools.api.models.search.SearchSortingBuilder.of()).build()); + return this; + } + + /** + *

Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order.

+ * @param builder function to build the sort value + * @return Builder + */ + + public BusinessUnitSearchRequestBuilder addSort( + Function builder) { + return plusSort(builder.apply(com.commercetools.api.models.search.SearchSortingBuilder.of())); + } + + /** + *

Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order.

+ * @param builder function to build the sort value + * @return Builder + */ + + public BusinessUnitSearchRequestBuilder setSort( + Function builder) { + return sort(builder.apply(com.commercetools.api.models.search.SearchSortingBuilder.of())); + } + + /** + *

The maximum number of search results to be returned.

+ * @param limit value to be set + * @return Builder + */ + + public BusinessUnitSearchRequestBuilder limit(@Nullable final Integer limit) { + this.limit = limit; + return this; + } + + /** + *

The number of search results to be skipped in the response for pagination.

+ * @param offset value to be set + * @return Builder + */ + + public BusinessUnitSearchRequestBuilder offset(@Nullable final Integer offset) { + this.offset = offset; + return this; + } + + /** + *

The Business Unit Search query.

+ * @return query + */ + + @Nullable + public com.commercetools.api.models.search.SearchQuery getQuery() { + return this.query; + } + + /** + *

Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order.

+ * @return sort + */ + + @Nullable + public java.util.List getSort() { + return this.sort; + } + + /** + *

The maximum number of search results to be returned.

+ * @return limit + */ + + @Nullable + public Integer getLimit() { + return this.limit; + } + + /** + *

The number of search results to be skipped in the response for pagination.

+ * @return offset + */ + + @Nullable + public Integer getOffset() { + return this.offset; + } + + /** + * builds BusinessUnitSearchRequest with checking for non-null required values + * @return BusinessUnitSearchRequest + */ + public BusinessUnitSearchRequest build() { + return new BusinessUnitSearchRequestImpl(query, sort, limit, offset); + } + + /** + * builds BusinessUnitSearchRequest without checking for non-null required values + * @return BusinessUnitSearchRequest + */ + public BusinessUnitSearchRequest buildUnchecked() { + return new BusinessUnitSearchRequestImpl(query, sort, limit, offset); + } + + /** + * factory method for an instance of BusinessUnitSearchRequestBuilder + * @return builder + */ + public static BusinessUnitSearchRequestBuilder of() { + return new BusinessUnitSearchRequestBuilder(); + } + + /** + * create builder for BusinessUnitSearchRequest instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static BusinessUnitSearchRequestBuilder of(final BusinessUnitSearchRequest template) { + BusinessUnitSearchRequestBuilder builder = new BusinessUnitSearchRequestBuilder(); + builder.query = template.getQuery(); + builder.sort = template.getSort(); + builder.limit = template.getLimit(); + builder.offset = template.getOffset(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchRequestImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchRequestImpl.java new file mode 100644 index 00000000000..ef9c91c90a3 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchRequestImpl.java @@ -0,0 +1,139 @@ + +package com.commercetools.api.models.business_unit_search; + +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; + +/** + * BusinessUnitSearchRequest + */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class BusinessUnitSearchRequestImpl implements BusinessUnitSearchRequest, ModelBase { + + private com.commercetools.api.models.search.SearchQuery query; + + private java.util.List sort; + + private Integer limit; + + private Integer offset; + + /** + * create instance with all properties + */ + @JsonCreator + BusinessUnitSearchRequestImpl(@JsonProperty("query") final com.commercetools.api.models.search.SearchQuery query, + @JsonProperty("sort") final java.util.List sort, + @JsonProperty("limit") final Integer limit, @JsonProperty("offset") final Integer offset) { + this.query = query; + this.sort = sort; + this.limit = limit; + this.offset = offset; + } + + /** + * create empty instance + */ + public BusinessUnitSearchRequestImpl() { + } + + /** + *

The Business Unit Search query.

+ */ + + public com.commercetools.api.models.search.SearchQuery getQuery() { + return this.query; + } + + /** + *

Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order.

+ */ + + public java.util.List getSort() { + return this.sort; + } + + /** + *

The maximum number of search results to be returned.

+ */ + + public Integer getLimit() { + return this.limit; + } + + /** + *

The number of search results to be skipped in the response for pagination.

+ */ + + public Integer getOffset() { + return this.offset; + } + + public void setQuery(final com.commercetools.api.models.search.SearchQuery query) { + this.query = query; + } + + public void setSort(final com.commercetools.api.models.search.SearchSorting... sort) { + this.sort = new ArrayList<>(Arrays.asList(sort)); + } + + public void setSort(final java.util.List sort) { + this.sort = sort; + } + + public void setLimit(final Integer limit) { + this.limit = limit; + } + + public void setOffset(final Integer offset) { + this.offset = offset; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + BusinessUnitSearchRequestImpl that = (BusinessUnitSearchRequestImpl) o; + + return new EqualsBuilder().append(query, that.query) + .append(sort, that.sort) + .append(limit, that.limit) + .append(offset, that.offset) + .append(query, that.query) + .append(sort, that.sort) + .append(limit, that.limit) + .append(offset, that.offset) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(query).append(sort).append(limit).append(offset).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("query", query) + .append("sort", sort) + .append("limit", limit) + .append("offset", offset) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchResult.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchResult.java new file mode 100644 index 00000000000..98851d9f9ce --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchResult.java @@ -0,0 +1,140 @@ + +package com.commercetools.api.models.business_unit_search; + +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; + +import jakarta.validation.constraints.NotNull; + +/** + * BusinessUnitSearchResult + * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     BusinessUnitSearchResult businessUnitSearchResult = BusinessUnitSearchResult.builder()
+ *             .id("{id}")
+ *             .relevance(0.3)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = BusinessUnitSearchResultImpl.class) +public interface BusinessUnitSearchResult { + + /** + *

id of the BusinessUnit matching the search query.

+ * @return id + */ + @NotNull + @JsonProperty("id") + public String getId(); + + /** + *

How closely this customer matches the search query.

+ * @return relevance + */ + @NotNull + @JsonProperty("relevance") + public Double getRelevance(); + + /** + *

id of the BusinessUnit matching the search query.

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

How closely this customer matches the search query.

+ * @param relevance value to be set + */ + + public void setRelevance(final Double relevance); + + /** + * factory method + * @return instance of BusinessUnitSearchResult + */ + public static BusinessUnitSearchResult of() { + return new BusinessUnitSearchResultImpl(); + } + + /** + * factory method to create a shallow copy BusinessUnitSearchResult + * @param template instance to be copied + * @return copy instance + */ + public static BusinessUnitSearchResult of(final BusinessUnitSearchResult template) { + BusinessUnitSearchResultImpl instance = new BusinessUnitSearchResultImpl(); + instance.setId(template.getId()); + instance.setRelevance(template.getRelevance()); + return instance; + } + + /** + * factory method to create a deep copy of BusinessUnitSearchResult + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static BusinessUnitSearchResult deepCopy(@Nullable final BusinessUnitSearchResult template) { + if (template == null) { + return null; + } + BusinessUnitSearchResultImpl instance = new BusinessUnitSearchResultImpl(); + instance.setId(template.getId()); + instance.setRelevance(template.getRelevance()); + return instance; + } + + /** + * builder factory method for BusinessUnitSearchResult + * @return builder + */ + public static BusinessUnitSearchResultBuilder builder() { + return BusinessUnitSearchResultBuilder.of(); + } + + /** + * create builder for BusinessUnitSearchResult instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static BusinessUnitSearchResultBuilder builder(final BusinessUnitSearchResult template) { + return BusinessUnitSearchResultBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withBusinessUnitSearchResult(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/business_unit_search/BusinessUnitSearchResultBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchResultBuilder.java new file mode 100644 index 00000000000..24f1dade860 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchResultBuilder.java @@ -0,0 +1,107 @@ + +package com.commercetools.api.models.business_unit_search; + +import java.util.*; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * BusinessUnitSearchResultBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     BusinessUnitSearchResult businessUnitSearchResult = BusinessUnitSearchResult.builder()
+ *             .id("{id}")
+ *             .relevance(0.3)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class BusinessUnitSearchResultBuilder implements Builder { + + private String id; + + private Double relevance; + + /** + *

id of the BusinessUnit matching the search query.

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

How closely this customer matches the search query.

+ * @param relevance value to be set + * @return Builder + */ + + public BusinessUnitSearchResultBuilder relevance(final Double relevance) { + this.relevance = relevance; + return this; + } + + /** + *

id of the BusinessUnit matching the search query.

+ * @return id + */ + + public String getId() { + return this.id; + } + + /** + *

How closely this customer matches the search query.

+ * @return relevance + */ + + public Double getRelevance() { + return this.relevance; + } + + /** + * builds BusinessUnitSearchResult with checking for non-null required values + * @return BusinessUnitSearchResult + */ + public BusinessUnitSearchResult build() { + Objects.requireNonNull(id, BusinessUnitSearchResult.class + ": id is missing"); + Objects.requireNonNull(relevance, BusinessUnitSearchResult.class + ": relevance is missing"); + return new BusinessUnitSearchResultImpl(id, relevance); + } + + /** + * builds BusinessUnitSearchResult without checking for non-null required values + * @return BusinessUnitSearchResult + */ + public BusinessUnitSearchResult buildUnchecked() { + return new BusinessUnitSearchResultImpl(id, relevance); + } + + /** + * factory method for an instance of BusinessUnitSearchResultBuilder + * @return builder + */ + public static BusinessUnitSearchResultBuilder of() { + return new BusinessUnitSearchResultBuilder(); + } + + /** + * create builder for BusinessUnitSearchResult instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static BusinessUnitSearchResultBuilder of(final BusinessUnitSearchResult template) { + BusinessUnitSearchResultBuilder builder = new BusinessUnitSearchResultBuilder(); + builder.id = template.getId(); + builder.relevance = template.getRelevance(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchResultImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchResultImpl.java new file mode 100644 index 00000000000..79141a1be0a --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchResultImpl.java @@ -0,0 +1,98 @@ + +package com.commercetools.api.models.business_unit_search; + +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; + +/** + * BusinessUnitSearchResult + */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class BusinessUnitSearchResultImpl implements BusinessUnitSearchResult, ModelBase { + + private String id; + + private Double relevance; + + /** + * create instance with all properties + */ + @JsonCreator + BusinessUnitSearchResultImpl(@JsonProperty("id") final String id, + @JsonProperty("relevance") final Double relevance) { + this.id = id; + this.relevance = relevance; + } + + /** + * create empty instance + */ + public BusinessUnitSearchResultImpl() { + } + + /** + *

id of the BusinessUnit matching the search query.

+ */ + + public String getId() { + return this.id; + } + + /** + *

How closely this customer matches the search query.

+ */ + + public Double getRelevance() { + return this.relevance; + } + + public void setId(final String id) { + this.id = id; + } + + public void setRelevance(final Double relevance) { + this.relevance = relevance; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + BusinessUnitSearchResultImpl that = (BusinessUnitSearchResultImpl) o; + + return new EqualsBuilder().append(id, that.id) + .append(relevance, that.relevance) + .append(id, that.id) + .append(relevance, that.relevance) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(id).append(relevance).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("id", id) + .append("relevance", relevance) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/BusinessUnitIndexingStatus.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/BusinessUnitIndexingStatus.java new file mode 100644 index 00000000000..4ff4e739a77 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/BusinessUnitIndexingStatus.java @@ -0,0 +1,131 @@ + +package com.commercetools.api.models.project; + +import java.util.Arrays; +import java.util.Optional; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +import io.vrap.rmf.base.client.JsonEnum; +import io.vrap.rmf.base.client.utils.Generated; + +/** + *

The current indexing status of Business Unit Search.

+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public interface BusinessUnitIndexingStatus extends JsonEnum { + + /** +

Indexing is scheduled.

*/ + BusinessUnitIndexingStatus SCHEDULED = BusinessUnitIndexingStatusEnum.SCHEDULED; + /** +

Indexing is in progress.

*/ + BusinessUnitIndexingStatus INDEXING = BusinessUnitIndexingStatusEnum.INDEXING; + /** +

Indexing is complete and the Search Business Units endpoint returns up-to-date results.

*/ + BusinessUnitIndexingStatus READY = BusinessUnitIndexingStatusEnum.READY; + /** +

Indexing failed due to an internal error.

*/ + BusinessUnitIndexingStatus FAILED = BusinessUnitIndexingStatusEnum.FAILED; + + /** + * possible values of BusinessUnitIndexingStatus + */ + enum BusinessUnitIndexingStatusEnum implements BusinessUnitIndexingStatus { + /** + * Scheduled + */ + SCHEDULED("Scheduled"), + + /** + * Indexing + */ + INDEXING("Indexing"), + + /** + * Ready + */ + READY("Ready"), + + /** + * Failed + */ + FAILED("Failed"); + private final String jsonName; + + private BusinessUnitIndexingStatusEnum(final String jsonName) { + this.jsonName = jsonName; + } + + public String getJsonName() { + return jsonName; + } + + public String toString() { + return jsonName; + } + } + + /** + * the JSON value + * @return json value + */ + @JsonValue + String getJsonName(); + + /** + * the enum value + * @return name + */ + String name(); + + /** + * convert value to string + * @return string representation + */ + String toString(); + + /** + * factory method for a enum value of BusinessUnitIndexingStatus + * if no enum has been found an anonymous instance will be created + * @param value the enum value to be wrapped + * @return enum instance + */ + @JsonCreator + public static BusinessUnitIndexingStatus findEnum(String value) { + return findEnumViaJsonName(value).orElse(new BusinessUnitIndexingStatus() { + @Override + public String getJsonName() { + return value; + } + + @Override + public String name() { + return value.toUpperCase(); + } + + public String toString() { + return value; + } + }); + } + + /** + * method to find enum using the JSON value + * @param jsonName the json value to be wrapped + * @return optional of enum instance + */ + public static Optional findEnumViaJsonName(String jsonName) { + return Arrays.stream(values()).filter(t -> t.getJsonName().equals(jsonName)).findFirst(); + } + + /** + * possible enum values + * @return array of possible enum values + */ + public static BusinessUnitIndexingStatus[] values() { + return BusinessUnitIndexingStatusEnum.values(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/BusinessUnitSearchStatus.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/BusinessUnitSearchStatus.java new file mode 100644 index 00000000000..2dfce59c0bb --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/BusinessUnitSearchStatus.java @@ -0,0 +1,115 @@ + +package com.commercetools.api.models.project; + +import java.util.Arrays; +import java.util.Optional; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +import io.vrap.rmf.base.client.JsonEnum; +import io.vrap.rmf.base.client.utils.Generated; + +/** + *

Specifies the status of the Business Unit Search index. You can change the status using the Change Business Unit Search Status update action.

+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public interface BusinessUnitSearchStatus extends JsonEnum { + + /** +

indicates that the Business Unit Search feature is fully operational.

*/ + BusinessUnitSearchStatus ACTIVATED = BusinessUnitSearchStatusEnum.ACTIVATED; + /** +

indicates that the Business Unit Search feature is currently not active.

*/ + BusinessUnitSearchStatus DEACTIVATED = BusinessUnitSearchStatusEnum.DEACTIVATED; + + /** + * possible values of BusinessUnitSearchStatus + */ + enum BusinessUnitSearchStatusEnum implements BusinessUnitSearchStatus { + /** + * Activated + */ + ACTIVATED("Activated"), + + /** + * Deactivated + */ + DEACTIVATED("Deactivated"); + private final String jsonName; + + private BusinessUnitSearchStatusEnum(final String jsonName) { + this.jsonName = jsonName; + } + + public String getJsonName() { + return jsonName; + } + + public String toString() { + return jsonName; + } + } + + /** + * the JSON value + * @return json value + */ + @JsonValue + String getJsonName(); + + /** + * the enum value + * @return name + */ + String name(); + + /** + * convert value to string + * @return string representation + */ + String toString(); + + /** + * factory method for a enum value of BusinessUnitSearchStatus + * if no enum has been found an anonymous instance will be created + * @param value the enum value to be wrapped + * @return enum instance + */ + @JsonCreator + public static BusinessUnitSearchStatus findEnum(String value) { + return findEnumViaJsonName(value).orElse(new BusinessUnitSearchStatus() { + @Override + public String getJsonName() { + return value; + } + + @Override + public String name() { + return value.toUpperCase(); + } + + public String toString() { + return value; + } + }); + } + + /** + * method to find enum using the JSON value + * @param jsonName the json value to be wrapped + * @return optional of enum instance + */ + public static Optional findEnumViaJsonName(String jsonName) { + return Arrays.stream(values()).filter(t -> t.getJsonName().equals(jsonName)).findFirst(); + } + + /** + * possible enum values + * @return array of possible enum values + */ + public static BusinessUnitSearchStatus[] values() { + return BusinessUnitSearchStatusEnum.values(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/ProjectChangeBusinessUnitSearchStatusAction.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/ProjectChangeBusinessUnitSearchStatusAction.java new file mode 100644 index 00000000000..120643707c0 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/ProjectChangeBusinessUnitSearchStatusAction.java @@ -0,0 +1,131 @@ + +package com.commercetools.api.models.project; + +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; + +import jakarta.validation.constraints.NotNull; + +/** + * ProjectChangeBusinessUnitSearchStatusAction + * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     ProjectChangeBusinessUnitSearchStatusAction projectChangeBusinessUnitSearchStatusAction = ProjectChangeBusinessUnitSearchStatusAction.builder()
+ *             .status(BusinessUnitSearchStatus.ACTIVATED)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = ProjectChangeBusinessUnitSearchStatusActionImpl.class) +public interface ProjectChangeBusinessUnitSearchStatusAction extends ProjectUpdateAction { + + /** + * discriminator value for ProjectChangeBusinessUnitSearchStatusAction + */ + String CHANGE_BUSINESS_UNIT_SEARCH_STATUS = "changeBusinessUnitSearchStatus"; + + /** + *

Activates or deactivates the Search Business Units feature. Activation will trigger building a search index for the Business Units in the Project.

+ * @return status + */ + @NotNull + @JsonProperty("status") + public BusinessUnitSearchStatus getStatus(); + + /** + *

Activates or deactivates the Search Business Units feature. Activation will trigger building a search index for the Business Units in the Project.

+ * @param status value to be set + */ + + public void setStatus(final BusinessUnitSearchStatus status); + + /** + * factory method + * @return instance of ProjectChangeBusinessUnitSearchStatusAction + */ + public static ProjectChangeBusinessUnitSearchStatusAction of() { + return new ProjectChangeBusinessUnitSearchStatusActionImpl(); + } + + /** + * factory method to create a shallow copy ProjectChangeBusinessUnitSearchStatusAction + * @param template instance to be copied + * @return copy instance + */ + public static ProjectChangeBusinessUnitSearchStatusAction of( + final ProjectChangeBusinessUnitSearchStatusAction template) { + ProjectChangeBusinessUnitSearchStatusActionImpl instance = new ProjectChangeBusinessUnitSearchStatusActionImpl(); + instance.setStatus(template.getStatus()); + return instance; + } + + /** + * factory method to create a deep copy of ProjectChangeBusinessUnitSearchStatusAction + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static ProjectChangeBusinessUnitSearchStatusAction deepCopy( + @Nullable final ProjectChangeBusinessUnitSearchStatusAction template) { + if (template == null) { + return null; + } + ProjectChangeBusinessUnitSearchStatusActionImpl instance = new ProjectChangeBusinessUnitSearchStatusActionImpl(); + instance.setStatus(template.getStatus()); + return instance; + } + + /** + * builder factory method for ProjectChangeBusinessUnitSearchStatusAction + * @return builder + */ + public static ProjectChangeBusinessUnitSearchStatusActionBuilder builder() { + return ProjectChangeBusinessUnitSearchStatusActionBuilder.of(); + } + + /** + * create builder for ProjectChangeBusinessUnitSearchStatusAction instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static ProjectChangeBusinessUnitSearchStatusActionBuilder builder( + final ProjectChangeBusinessUnitSearchStatusAction template) { + return ProjectChangeBusinessUnitSearchStatusActionBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withProjectChangeBusinessUnitSearchStatusAction( + 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/project/ProjectChangeBusinessUnitSearchStatusActionBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/ProjectChangeBusinessUnitSearchStatusActionBuilder.java new file mode 100644 index 00000000000..9d56cb0da64 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/ProjectChangeBusinessUnitSearchStatusActionBuilder.java @@ -0,0 +1,85 @@ + +package com.commercetools.api.models.project; + +import java.util.*; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * ProjectChangeBusinessUnitSearchStatusActionBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     ProjectChangeBusinessUnitSearchStatusAction projectChangeBusinessUnitSearchStatusAction = ProjectChangeBusinessUnitSearchStatusAction.builder()
+ *             .status(BusinessUnitSearchStatus.ACTIVATED)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ProjectChangeBusinessUnitSearchStatusActionBuilder + implements Builder { + + private com.commercetools.api.models.project.BusinessUnitSearchStatus status; + + /** + *

Activates or deactivates the Search Business Units feature. Activation will trigger building a search index for the Business Units in the Project.

+ * @param status value to be set + * @return Builder + */ + + public ProjectChangeBusinessUnitSearchStatusActionBuilder status( + final com.commercetools.api.models.project.BusinessUnitSearchStatus status) { + this.status = status; + return this; + } + + /** + *

Activates or deactivates the Search Business Units feature. Activation will trigger building a search index for the Business Units in the Project.

+ * @return status + */ + + public com.commercetools.api.models.project.BusinessUnitSearchStatus getStatus() { + return this.status; + } + + /** + * builds ProjectChangeBusinessUnitSearchStatusAction with checking for non-null required values + * @return ProjectChangeBusinessUnitSearchStatusAction + */ + public ProjectChangeBusinessUnitSearchStatusAction build() { + Objects.requireNonNull(status, ProjectChangeBusinessUnitSearchStatusAction.class + ": status is missing"); + return new ProjectChangeBusinessUnitSearchStatusActionImpl(status); + } + + /** + * builds ProjectChangeBusinessUnitSearchStatusAction without checking for non-null required values + * @return ProjectChangeBusinessUnitSearchStatusAction + */ + public ProjectChangeBusinessUnitSearchStatusAction buildUnchecked() { + return new ProjectChangeBusinessUnitSearchStatusActionImpl(status); + } + + /** + * factory method for an instance of ProjectChangeBusinessUnitSearchStatusActionBuilder + * @return builder + */ + public static ProjectChangeBusinessUnitSearchStatusActionBuilder of() { + return new ProjectChangeBusinessUnitSearchStatusActionBuilder(); + } + + /** + * create builder for ProjectChangeBusinessUnitSearchStatusAction instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static ProjectChangeBusinessUnitSearchStatusActionBuilder of( + final ProjectChangeBusinessUnitSearchStatusAction template) { + ProjectChangeBusinessUnitSearchStatusActionBuilder builder = new ProjectChangeBusinessUnitSearchStatusActionBuilder(); + builder.status = template.getStatus(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/ProjectChangeBusinessUnitSearchStatusActionImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/ProjectChangeBusinessUnitSearchStatusActionImpl.java new file mode 100644 index 00000000000..0446f6741c4 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/ProjectChangeBusinessUnitSearchStatusActionImpl.java @@ -0,0 +1,96 @@ + +package com.commercetools.api.models.project; + +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; + +/** + * ProjectChangeBusinessUnitSearchStatusAction + */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ProjectChangeBusinessUnitSearchStatusActionImpl + implements ProjectChangeBusinessUnitSearchStatusAction, ModelBase { + + private String action; + + private com.commercetools.api.models.project.BusinessUnitSearchStatus status; + + /** + * create instance with all properties + */ + @JsonCreator + ProjectChangeBusinessUnitSearchStatusActionImpl( + @JsonProperty("status") final com.commercetools.api.models.project.BusinessUnitSearchStatus status) { + this.status = status; + this.action = CHANGE_BUSINESS_UNIT_SEARCH_STATUS; + } + + /** + * create empty instance + */ + public ProjectChangeBusinessUnitSearchStatusActionImpl() { + this.action = CHANGE_BUSINESS_UNIT_SEARCH_STATUS; + } + + /** + * + */ + + public String getAction() { + return this.action; + } + + /** + *

Activates or deactivates the Search Business Units feature. Activation will trigger building a search index for the Business Units in the Project.

+ */ + + public com.commercetools.api.models.project.BusinessUnitSearchStatus getStatus() { + return this.status; + } + + public void setStatus(final com.commercetools.api.models.project.BusinessUnitSearchStatus status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ProjectChangeBusinessUnitSearchStatusActionImpl that = (ProjectChangeBusinessUnitSearchStatusActionImpl) o; + + return new EqualsBuilder().append(action, that.action) + .append(status, that.status) + .append(action, that.action) + .append(status, that.status) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(action).append(status).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("action", action) + .append("status", status) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/ProjectUpdateAction.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/ProjectUpdateAction.java index c4ca967541d..cb18d94c326 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/ProjectUpdateAction.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/ProjectUpdateAction.java @@ -21,13 +21,14 @@ * Example to create a subtype instance using the builder pattern *
*

- *     ProjectUpdateAction projectUpdateAction = ProjectUpdateAction.changeMyBusinessUnitStatusOnCreationBuilder()
- *             status(BusinessUnitConfigurationStatus.ACTIVE)
+ *     ProjectUpdateAction projectUpdateAction = ProjectUpdateAction.changeBusinessUnitSearchStatusBuilder()
+ *             status(BusinessUnitSearchStatus.ACTIVATED)
  *             .build()
  * 
*
*/ @JsonSubTypes({ + @JsonSubTypes.Type(value = com.commercetools.api.models.project.ProjectChangeBusinessUnitSearchStatusActionImpl.class, name = ProjectChangeBusinessUnitSearchStatusAction.CHANGE_BUSINESS_UNIT_SEARCH_STATUS), @JsonSubTypes.Type(value = com.commercetools.api.models.project.ProjectChangeBusinessUnitStatusOnCreationActionImpl.class, name = ProjectChangeBusinessUnitStatusOnCreationAction.CHANGE_MY_BUSINESS_UNIT_STATUS_ON_CREATION), @JsonSubTypes.Type(value = com.commercetools.api.models.project.ProjectChangeCartsConfigurationActionImpl.class, name = ProjectChangeCartsConfigurationAction.CHANGE_CARTS_CONFIGURATION), @JsonSubTypes.Type(value = com.commercetools.api.models.project.ProjectChangeCountriesActionImpl.class, name = ProjectChangeCountriesAction.CHANGE_COUNTRIES), @@ -66,6 +67,10 @@ public static ProjectUpdateAction deepCopy(@Nullable final ProjectUpdateAction t if (template == null) { return null; } + if (template instanceof com.commercetools.api.models.project.ProjectChangeBusinessUnitSearchStatusAction) { + return com.commercetools.api.models.project.ProjectChangeBusinessUnitSearchStatusAction.deepCopy( + (com.commercetools.api.models.project.ProjectChangeBusinessUnitSearchStatusAction) template); + } if (template instanceof com.commercetools.api.models.project.ProjectChangeBusinessUnitStatusOnCreationAction) { return com.commercetools.api.models.project.ProjectChangeBusinessUnitStatusOnCreationAction.deepCopy( (com.commercetools.api.models.project.ProjectChangeBusinessUnitStatusOnCreationAction) template); @@ -130,6 +135,14 @@ public static ProjectUpdateAction deepCopy(@Nullable final ProjectUpdateAction t return instance; } + /** + * builder for changeBusinessUnitSearchStatus subtype + * @return builder + */ + public static com.commercetools.api.models.project.ProjectChangeBusinessUnitSearchStatusActionBuilder changeBusinessUnitSearchStatusBuilder() { + return com.commercetools.api.models.project.ProjectChangeBusinessUnitSearchStatusActionBuilder.of(); + } + /** * builder for changeMyBusinessUnitStatusOnCreation subtype * @return builder diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/ProjectUpdateActionBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/ProjectUpdateActionBuilder.java index 77ec6db845b..9cfad068e57 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/ProjectUpdateActionBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/ProjectUpdateActionBuilder.java @@ -11,6 +11,10 @@ @Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") public class ProjectUpdateActionBuilder { + public com.commercetools.api.models.project.ProjectChangeBusinessUnitSearchStatusActionBuilder changeBusinessUnitSearchStatusBuilder() { + return com.commercetools.api.models.project.ProjectChangeBusinessUnitSearchStatusActionBuilder.of(); + } + public com.commercetools.api.models.project.ProjectChangeBusinessUnitStatusOnCreationActionBuilder changeMyBusinessUnitStatusOnCreationBuilder() { return com.commercetools.api.models.project.ProjectChangeBusinessUnitStatusOnCreationActionBuilder.of(); } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/SearchIndexingConfiguration.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/SearchIndexingConfiguration.java index 9111be8fecc..2307cbbd040 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/SearchIndexingConfiguration.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/SearchIndexingConfiguration.java @@ -62,6 +62,14 @@ public interface SearchIndexingConfiguration { @JsonProperty("customers") public SearchIndexingConfigurationValues getCustomers(); + /** + *

Configuration for the Business Unit Search feature.

+ * @return businessUnits + */ + @Valid + @JsonProperty("businessUnits") + public SearchIndexingConfigurationValues getBusinessUnits(); + /** *

Configuration for the Product Projection Search and Product Suggestions endpoints.

* @param products value to be set @@ -90,6 +98,13 @@ public interface SearchIndexingConfiguration { public void setCustomers(final SearchIndexingConfigurationValues customers); + /** + *

Configuration for the Business Unit Search feature.

+ * @param businessUnits value to be set + */ + + public void setBusinessUnits(final SearchIndexingConfigurationValues businessUnits); + /** * factory method * @return instance of SearchIndexingConfiguration @@ -109,6 +124,7 @@ public static SearchIndexingConfiguration of(final SearchIndexingConfiguration t instance.setProductsSearch(template.getProductsSearch()); instance.setOrders(template.getOrders()); instance.setCustomers(template.getCustomers()); + instance.setBusinessUnits(template.getBusinessUnits()); return instance; } @@ -131,6 +147,8 @@ public static SearchIndexingConfiguration deepCopy(@Nullable final SearchIndexin com.commercetools.api.models.project.SearchIndexingConfigurationValues.deepCopy(template.getOrders())); instance.setCustomers( com.commercetools.api.models.project.SearchIndexingConfigurationValues.deepCopy(template.getCustomers())); + instance.setBusinessUnits(com.commercetools.api.models.project.SearchIndexingConfigurationValues + .deepCopy(template.getBusinessUnits())); return instance; } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/SearchIndexingConfigurationBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/SearchIndexingConfigurationBuilder.java index b1564bf7d4e..2d236ed5faf 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/SearchIndexingConfigurationBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/SearchIndexingConfigurationBuilder.java @@ -35,6 +35,9 @@ public class SearchIndexingConfigurationBuilder implements BuilderConfiguration for the Product Projection Search and Product Suggestions endpoints.

* @param builder function to build the products value @@ -189,6 +192,45 @@ public SearchIndexingConfigurationBuilder customers( return this; } + /** + *

Configuration for the Business Unit Search feature.

+ * @param builder function to build the businessUnits value + * @return Builder + */ + + public SearchIndexingConfigurationBuilder businessUnits( + Function builder) { + this.businessUnits = builder + .apply(com.commercetools.api.models.project.SearchIndexingConfigurationValuesBuilder.of()) + .build(); + return this; + } + + /** + *

Configuration for the Business Unit Search feature.

+ * @param builder function to build the businessUnits value + * @return Builder + */ + + public SearchIndexingConfigurationBuilder withBusinessUnits( + Function builder) { + this.businessUnits = builder + .apply(com.commercetools.api.models.project.SearchIndexingConfigurationValuesBuilder.of()); + return this; + } + + /** + *

Configuration for the Business Unit Search feature.

+ * @param businessUnits value to be set + * @return Builder + */ + + public SearchIndexingConfigurationBuilder businessUnits( + @Nullable final com.commercetools.api.models.project.SearchIndexingConfigurationValues businessUnits) { + this.businessUnits = businessUnits; + return this; + } + /** *

Configuration for the Product Projection Search and Product Suggestions endpoints.

* @return products @@ -229,12 +271,22 @@ public com.commercetools.api.models.project.SearchIndexingConfigurationValues ge return this.customers; } + /** + *

Configuration for the Business Unit Search feature.

+ * @return businessUnits + */ + + @Nullable + public com.commercetools.api.models.project.SearchIndexingConfigurationValues getBusinessUnits() { + return this.businessUnits; + } + /** * builds SearchIndexingConfiguration with checking for non-null required values * @return SearchIndexingConfiguration */ public SearchIndexingConfiguration build() { - return new SearchIndexingConfigurationImpl(products, productsSearch, orders, customers); + return new SearchIndexingConfigurationImpl(products, productsSearch, orders, customers, businessUnits); } /** @@ -242,7 +294,7 @@ public SearchIndexingConfiguration build() { * @return SearchIndexingConfiguration */ public SearchIndexingConfiguration buildUnchecked() { - return new SearchIndexingConfigurationImpl(products, productsSearch, orders, customers); + return new SearchIndexingConfigurationImpl(products, productsSearch, orders, customers, businessUnits); } /** @@ -264,6 +316,7 @@ public static SearchIndexingConfigurationBuilder of(final SearchIndexingConfigur builder.productsSearch = template.getProductsSearch(); builder.orders = template.getOrders(); builder.customers = template.getCustomers(); + builder.businessUnits = template.getBusinessUnits(); return builder; } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/SearchIndexingConfigurationImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/SearchIndexingConfigurationImpl.java index 6d12b103a1b..c00cd972cae 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/SearchIndexingConfigurationImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/project/SearchIndexingConfigurationImpl.java @@ -30,6 +30,8 @@ public class SearchIndexingConfigurationImpl implements SearchIndexingConfigurat private com.commercetools.api.models.project.SearchIndexingConfigurationValues customers; + private com.commercetools.api.models.project.SearchIndexingConfigurationValues businessUnits; + /** * create instance with all properties */ @@ -38,11 +40,13 @@ public class SearchIndexingConfigurationImpl implements SearchIndexingConfigurat @JsonProperty("products") final com.commercetools.api.models.project.SearchIndexingConfigurationValues products, @JsonProperty("productsSearch") final com.commercetools.api.models.project.SearchIndexingConfigurationValues productsSearch, @JsonProperty("orders") final com.commercetools.api.models.project.SearchIndexingConfigurationValues orders, - @JsonProperty("customers") final com.commercetools.api.models.project.SearchIndexingConfigurationValues customers) { + @JsonProperty("customers") final com.commercetools.api.models.project.SearchIndexingConfigurationValues customers, + @JsonProperty("businessUnits") final com.commercetools.api.models.project.SearchIndexingConfigurationValues businessUnits) { this.products = products; this.productsSearch = productsSearch; this.orders = orders; this.customers = customers; + this.businessUnits = businessUnits; } /** @@ -83,6 +87,14 @@ public com.commercetools.api.models.project.SearchIndexingConfigurationValues ge return this.customers; } + /** + *

Configuration for the Business Unit Search feature.

+ */ + + public com.commercetools.api.models.project.SearchIndexingConfigurationValues getBusinessUnits() { + return this.businessUnits; + } + public void setProducts(final com.commercetools.api.models.project.SearchIndexingConfigurationValues products) { this.products = products; } @@ -100,6 +112,11 @@ public void setCustomers(final com.commercetools.api.models.project.SearchIndexi this.customers = customers; } + public void setBusinessUnits( + final com.commercetools.api.models.project.SearchIndexingConfigurationValues businessUnits) { + this.businessUnits = businessUnits; + } + @Override public boolean equals(Object o) { if (this == o) @@ -114,10 +131,12 @@ public boolean equals(Object o) { .append(productsSearch, that.productsSearch) .append(orders, that.orders) .append(customers, that.customers) + .append(businessUnits, that.businessUnits) .append(products, that.products) .append(productsSearch, that.productsSearch) .append(orders, that.orders) .append(customers, that.customers) + .append(businessUnits, that.businessUnits) .isEquals(); } @@ -127,6 +146,7 @@ public int hashCode() { .append(productsSearch) .append(orders) .append(customers) + .append(businessUnits) .toHashCode(); } @@ -136,6 +156,7 @@ public String toString() { .append("productsSearch", productsSearch) .append("orders", orders) .append("customers", customers) + .append("businessUnits", businessUnits) .build(); } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit_search/BusinessUnitIndexingProgressQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit_search/BusinessUnitIndexingProgressQueryBuilderDsl.java new file mode 100644 index 00000000000..ae3a64987db --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit_search/BusinessUnitIndexingProgressQueryBuilderDsl.java @@ -0,0 +1,32 @@ + +package com.commercetools.api.predicates.query.business_unit_search; + +import com.commercetools.api.predicates.query.*; + +public class BusinessUnitIndexingProgressQueryBuilderDsl { + public BusinessUnitIndexingProgressQueryBuilderDsl() { + } + + public static BusinessUnitIndexingProgressQueryBuilderDsl of() { + return new BusinessUnitIndexingProgressQueryBuilderDsl(); + } + + public LongComparisonPredicateBuilder indexed() { + return new LongComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("indexed")), + p -> new CombinationQueryPredicate<>(p, BusinessUnitIndexingProgressQueryBuilderDsl::of)); + } + + public LongComparisonPredicateBuilder failed() { + return new LongComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("failed")), + p -> new CombinationQueryPredicate<>(p, BusinessUnitIndexingProgressQueryBuilderDsl::of)); + } + + public LongComparisonPredicateBuilder estimatedTotal() { + return new LongComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("estimatedTotal")), + p -> new CombinationQueryPredicate<>(p, BusinessUnitIndexingProgressQueryBuilderDsl::of)); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit_search/BusinessUnitPagedSearchResponseQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit_search/BusinessUnitPagedSearchResponseQueryBuilderDsl.java new file mode 100644 index 00000000000..b0c7501a667 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit_search/BusinessUnitPagedSearchResponseQueryBuilderDsl.java @@ -0,0 +1,47 @@ + +package com.commercetools.api.predicates.query.business_unit_search; + +import java.util.function.Function; + +import com.commercetools.api.predicates.query.*; + +public class BusinessUnitPagedSearchResponseQueryBuilderDsl { + public BusinessUnitPagedSearchResponseQueryBuilderDsl() { + } + + public static BusinessUnitPagedSearchResponseQueryBuilderDsl of() { + return new BusinessUnitPagedSearchResponseQueryBuilderDsl(); + } + + public LongComparisonPredicateBuilder total() { + return new LongComparisonPredicateBuilder<>(BinaryQueryPredicate.of().left(new ConstantQueryPredicate("total")), + p -> new CombinationQueryPredicate<>(p, BusinessUnitPagedSearchResponseQueryBuilderDsl::of)); + } + + public LongComparisonPredicateBuilder limit() { + return new LongComparisonPredicateBuilder<>(BinaryQueryPredicate.of().left(new ConstantQueryPredicate("limit")), + p -> new CombinationQueryPredicate<>(p, BusinessUnitPagedSearchResponseQueryBuilderDsl::of)); + } + + public LongComparisonPredicateBuilder offset() { + return new LongComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("offset")), + p -> new CombinationQueryPredicate<>(p, BusinessUnitPagedSearchResponseQueryBuilderDsl::of)); + } + + public CombinationQueryPredicate results( + Function> fn) { + return new CombinationQueryPredicate<>(ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("results")) + .inner(fn.apply( + com.commercetools.api.predicates.query.business_unit_search.BusinessUnitSearchResultQueryBuilderDsl + .of())), + BusinessUnitPagedSearchResponseQueryBuilderDsl::of); + } + + public CollectionPredicateBuilder results() { + return new CollectionPredicateBuilder<>(BinaryQueryPredicate.of().left(new ConstantQueryPredicate("results")), + p -> new CombinationQueryPredicate<>(p, BusinessUnitPagedSearchResponseQueryBuilderDsl::of)); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit_search/BusinessUnitSearchIndexingStatusResponseQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit_search/BusinessUnitSearchIndexingStatusResponseQueryBuilderDsl.java new file mode 100644 index 00000000000..894443dd5c5 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit_search/BusinessUnitSearchIndexingStatusResponseQueryBuilderDsl.java @@ -0,0 +1,50 @@ + +package com.commercetools.api.predicates.query.business_unit_search; + +import java.util.function.Function; + +import com.commercetools.api.predicates.query.*; + +public class BusinessUnitSearchIndexingStatusResponseQueryBuilderDsl { + public BusinessUnitSearchIndexingStatusResponseQueryBuilderDsl() { + } + + public static BusinessUnitSearchIndexingStatusResponseQueryBuilderDsl of() { + return new BusinessUnitSearchIndexingStatusResponseQueryBuilderDsl(); + } + + public StringComparisonPredicateBuilder status() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("status")), + p -> new CombinationQueryPredicate<>(p, BusinessUnitSearchIndexingStatusResponseQueryBuilderDsl::of)); + } + + public CombinationQueryPredicate states( + Function> fn) { + return new CombinationQueryPredicate<>(ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("states")) + .inner(fn.apply( + com.commercetools.api.predicates.query.business_unit_search.BusinessUnitIndexingProgressQueryBuilderDsl + .of())), + BusinessUnitSearchIndexingStatusResponseQueryBuilderDsl::of); + } + + public DateTimeComparisonPredicateBuilder startedAt() { + return new DateTimeComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("startedAt")), + p -> new CombinationQueryPredicate<>(p, BusinessUnitSearchIndexingStatusResponseQueryBuilderDsl::of)); + } + + public DateTimeComparisonPredicateBuilder lastModifiedAt() { + return new DateTimeComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("lastModifiedAt")), + p -> new CombinationQueryPredicate<>(p, BusinessUnitSearchIndexingStatusResponseQueryBuilderDsl::of)); + } + + public LongComparisonPredicateBuilder retryCount() { + return new LongComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("retryCount")), + p -> new CombinationQueryPredicate<>(p, BusinessUnitSearchIndexingStatusResponseQueryBuilderDsl::of)); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit_search/BusinessUnitSearchRequestQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit_search/BusinessUnitSearchRequestQueryBuilderDsl.java new file mode 100644 index 00000000000..a9cdae4d89f --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit_search/BusinessUnitSearchRequestQueryBuilderDsl.java @@ -0,0 +1,50 @@ + +package com.commercetools.api.predicates.query.business_unit_search; + +import java.util.function.Function; + +import com.commercetools.api.predicates.query.*; + +public class BusinessUnitSearchRequestQueryBuilderDsl { + public BusinessUnitSearchRequestQueryBuilderDsl() { + } + + public static BusinessUnitSearchRequestQueryBuilderDsl of() { + return new BusinessUnitSearchRequestQueryBuilderDsl(); + } + + public CombinationQueryPredicate query( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("query")) + .inner(fn.apply(com.commercetools.api.predicates.query.search.SearchQueryQueryBuilderDsl.of())), + BusinessUnitSearchRequestQueryBuilderDsl::of); + } + + public CombinationQueryPredicate sort( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("sort")) + .inner(fn.apply(com.commercetools.api.predicates.query.search.SearchSortingQueryBuilderDsl.of())), + BusinessUnitSearchRequestQueryBuilderDsl::of); + } + + public CollectionPredicateBuilder sort() { + return new CollectionPredicateBuilder<>(BinaryQueryPredicate.of().left(new ConstantQueryPredicate("sort")), + p -> new CombinationQueryPredicate<>(p, BusinessUnitSearchRequestQueryBuilderDsl::of)); + } + + public LongComparisonPredicateBuilder limit() { + return new LongComparisonPredicateBuilder<>(BinaryQueryPredicate.of().left(new ConstantQueryPredicate("limit")), + p -> new CombinationQueryPredicate<>(p, BusinessUnitSearchRequestQueryBuilderDsl::of)); + } + + public LongComparisonPredicateBuilder offset() { + return new LongComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("offset")), + p -> new CombinationQueryPredicate<>(p, BusinessUnitSearchRequestQueryBuilderDsl::of)); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit_search/BusinessUnitSearchResultQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit_search/BusinessUnitSearchResultQueryBuilderDsl.java new file mode 100644 index 00000000000..b06407e92b8 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit_search/BusinessUnitSearchResultQueryBuilderDsl.java @@ -0,0 +1,25 @@ + +package com.commercetools.api.predicates.query.business_unit_search; + +import com.commercetools.api.predicates.query.*; + +public class BusinessUnitSearchResultQueryBuilderDsl { + public BusinessUnitSearchResultQueryBuilderDsl() { + } + + public static BusinessUnitSearchResultQueryBuilderDsl of() { + return new BusinessUnitSearchResultQueryBuilderDsl(); + } + + public StringComparisonPredicateBuilder id() { + return new StringComparisonPredicateBuilder<>(BinaryQueryPredicate.of().left(new ConstantQueryPredicate("id")), + p -> new CombinationQueryPredicate<>(p, BusinessUnitSearchResultQueryBuilderDsl::of)); + } + + public DoubleComparisonPredicateBuilder relevance() { + return new DoubleComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("relevance")), + p -> new CombinationQueryPredicate<>(p, BusinessUnitSearchResultQueryBuilderDsl::of)); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/project/ProjectChangeBusinessUnitSearchStatusActionQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/project/ProjectChangeBusinessUnitSearchStatusActionQueryBuilderDsl.java new file mode 100644 index 00000000000..78ba1a213fe --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/project/ProjectChangeBusinessUnitSearchStatusActionQueryBuilderDsl.java @@ -0,0 +1,26 @@ + +package com.commercetools.api.predicates.query.project; + +import com.commercetools.api.predicates.query.*; + +public class ProjectChangeBusinessUnitSearchStatusActionQueryBuilderDsl { + public ProjectChangeBusinessUnitSearchStatusActionQueryBuilderDsl() { + } + + public static ProjectChangeBusinessUnitSearchStatusActionQueryBuilderDsl of() { + return new ProjectChangeBusinessUnitSearchStatusActionQueryBuilderDsl(); + } + + public StringComparisonPredicateBuilder action() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("action")), + p -> new CombinationQueryPredicate<>(p, ProjectChangeBusinessUnitSearchStatusActionQueryBuilderDsl::of)); + } + + public StringComparisonPredicateBuilder status() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("status")), + p -> new CombinationQueryPredicate<>(p, ProjectChangeBusinessUnitSearchStatusActionQueryBuilderDsl::of)); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/project/ProjectUpdateActionQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/project/ProjectUpdateActionQueryBuilderDsl.java index 4ddd787870c..244f2adc25c 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/project/ProjectUpdateActionQueryBuilderDsl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/project/ProjectUpdateActionQueryBuilderDsl.java @@ -19,6 +19,14 @@ public StringComparisonPredicateBuilder acti p -> new CombinationQueryPredicate<>(p, ProjectUpdateActionQueryBuilderDsl::of)); } + public CombinationQueryPredicate asChangeBusinessUnitSearchStatus( + Function> fn) { + return new CombinationQueryPredicate<>(fn.apply( + com.commercetools.api.predicates.query.project.ProjectChangeBusinessUnitSearchStatusActionQueryBuilderDsl + .of()), + ProjectUpdateActionQueryBuilderDsl::of); + } + public CombinationQueryPredicate asChangeMyBusinessUnitStatusOnCreation( 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/project/SearchIndexingConfigurationQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/project/SearchIndexingConfigurationQueryBuilderDsl.java index ad24c28c4c8..32fc1f90e7e 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/project/SearchIndexingConfigurationQueryBuilderDsl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/project/SearchIndexingConfigurationQueryBuilderDsl.java @@ -53,4 +53,14 @@ public CombinationQueryPredicate cus SearchIndexingConfigurationQueryBuilderDsl::of); } + public CombinationQueryPredicate businessUnits( + Function> fn) { + return new CombinationQueryPredicate<>(ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("businessUnits")) + .inner(fn.apply( + com.commercetools.api.predicates.query.project.SearchIndexingConfigurationValuesQueryBuilderDsl + .of())), + SearchIndexingConfigurationQueryBuilderDsl::of); + } + } diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyBusinessUnitsSearchIndexingStatusTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyBusinessUnitsSearchIndexingStatusTest.java new file mode 100644 index 00000000000..5e23a6afa28 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyBusinessUnitsSearchIndexingStatusTest.java @@ -0,0 +1,81 @@ + +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 ByProjectKeyBusinessUnitsSearchIndexingStatusTest { + 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") + .businessUnits() + .searchIndexingStatus() + .get() + .createHttpRequest(), + "get", "test_projectKey/business-units/search/indexing-status", } }; + } + + @DataProvider + public static Object[][] executeMethodParameters() { + return new Object[][] { new Object[] { + apiRoot.withProjectKey("test_projectKey").businessUnits().searchIndexingStatus().get(), } }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyBusinessUnitsSearchTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyBusinessUnitsSearchTest.java new file mode 100644 index 00000000000..9e0b3c59f26 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyBusinessUnitsSearchTest.java @@ -0,0 +1,86 @@ + +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 ByProjectKeyBusinessUnitsSearchTest { + 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") + .businessUnits() + .search() + .post(com.commercetools.api.models.business_unit_search.BusinessUnitSearchRequest.of()) + .createHttpRequest(), "post", "test_projectKey/business-units/search", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey").businessUnits().search().head().createHttpRequest(), + "head", "test_projectKey/business-units/search", } }; + } + + @DataProvider + public static Object[][] executeMethodParameters() { + return new Object[][] { + new Object[] { apiRoot.withProjectKey("test_projectKey") + .businessUnits() + .search() + .post(com.commercetools.api.models.business_unit_search.BusinessUnitSearchRequest.of()), }, + new Object[] { apiRoot.withProjectKey("test_projectKey").businessUnits().search().head(), } }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitIndexingProgressTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitIndexingProgressTest.java new file mode 100644 index 00000000000..696ae138bbb --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitIndexingProgressTest.java @@ -0,0 +1,52 @@ + +package com.commercetools.api.models.business_unit_search; + +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 BusinessUnitIndexingProgressTest { + + @TestTemplate + @UseDataProvider("objectBuilder") + public void buildUnchecked(BusinessUnitIndexingProgressBuilder builder) { + BusinessUnitIndexingProgress businessUnitIndexingProgress = builder.buildUnchecked(); + Assertions.assertThat(businessUnitIndexingProgress).isInstanceOf(BusinessUnitIndexingProgress.class); + } + + @DataProvider + public static Object[][] objectBuilder() { + return new Object[][] { new Object[] { BusinessUnitIndexingProgress.builder().indexed(4) }, + new Object[] { BusinessUnitIndexingProgress.builder().failed(9) }, + new Object[] { BusinessUnitIndexingProgress.builder().estimatedTotal(9) } }; + } + + @Test + public void indexed() { + BusinessUnitIndexingProgress value = BusinessUnitIndexingProgress.of(); + value.setIndexed(4); + Assertions.assertThat(value.getIndexed()).isEqualTo(4); + } + + @Test + public void failed() { + BusinessUnitIndexingProgress value = BusinessUnitIndexingProgress.of(); + value.setFailed(9); + Assertions.assertThat(value.getFailed()).isEqualTo(9); + } + + @Test + public void estimatedTotal() { + BusinessUnitIndexingProgress value = BusinessUnitIndexingProgress.of(); + value.setEstimatedTotal(9); + Assertions.assertThat(value.getEstimatedTotal()).isEqualTo(9); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitPagedSearchResponseTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitPagedSearchResponseTest.java new file mode 100644 index 00000000000..61163641c2d --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitPagedSearchResponseTest.java @@ -0,0 +1,67 @@ + +package com.commercetools.api.models.business_unit_search; + +import java.util.Collections; + +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 BusinessUnitPagedSearchResponseTest { + + @TestTemplate + @UseDataProvider("objectBuilder") + public void buildUnchecked(BusinessUnitPagedSearchResponseBuilder builder) { + BusinessUnitPagedSearchResponse businessUnitPagedSearchResponse = builder.buildUnchecked(); + Assertions.assertThat(businessUnitPagedSearchResponse).isInstanceOf(BusinessUnitPagedSearchResponse.class); + } + + @DataProvider + public static Object[][] objectBuilder() { + return new Object[][] { new Object[] { BusinessUnitPagedSearchResponse.builder().total(1L) }, + new Object[] { BusinessUnitPagedSearchResponse.builder().limit(7) }, + new Object[] { BusinessUnitPagedSearchResponse.builder().offset(3) }, + new Object[] { BusinessUnitPagedSearchResponse.builder() + .results(Collections.singletonList( + new com.commercetools.api.models.business_unit_search.BusinessUnitSearchResultImpl())) } }; + } + + @Test + public void total() { + BusinessUnitPagedSearchResponse value = BusinessUnitPagedSearchResponse.of(); + value.setTotal(1L); + Assertions.assertThat(value.getTotal()).isEqualTo(1L); + } + + @Test + public void limit() { + BusinessUnitPagedSearchResponse value = BusinessUnitPagedSearchResponse.of(); + value.setLimit(7); + Assertions.assertThat(value.getLimit()).isEqualTo(7); + } + + @Test + public void offset() { + BusinessUnitPagedSearchResponse value = BusinessUnitPagedSearchResponse.of(); + value.setOffset(3); + Assertions.assertThat(value.getOffset()).isEqualTo(3); + } + + @Test + public void results() { + BusinessUnitPagedSearchResponse value = BusinessUnitPagedSearchResponse.of(); + value.setResults(Collections + .singletonList(new com.commercetools.api.models.business_unit_search.BusinessUnitSearchResultImpl())); + Assertions.assertThat(value.getResults()) + .isEqualTo(Collections.singletonList( + new com.commercetools.api.models.business_unit_search.BusinessUnitSearchResultImpl())); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchIndexingStatusResponseTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchIndexingStatusResponseTest.java new file mode 100644 index 00000000000..77980b268e2 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchIndexingStatusResponseTest.java @@ -0,0 +1,81 @@ + +package com.commercetools.api.models.business_unit_search; + +import java.time.ZonedDateTime; + +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 BusinessUnitSearchIndexingStatusResponseTest { + + @TestTemplate + @UseDataProvider("objectBuilder") + public void buildUnchecked(BusinessUnitSearchIndexingStatusResponseBuilder builder) { + BusinessUnitSearchIndexingStatusResponse businessUnitSearchIndexingStatusResponse = builder.buildUnchecked(); + Assertions.assertThat(businessUnitSearchIndexingStatusResponse) + .isInstanceOf(BusinessUnitSearchIndexingStatusResponse.class); + } + + @DataProvider + public static Object[][] objectBuilder() { + return new Object[][] { + new Object[] { + BusinessUnitSearchIndexingStatusResponse.builder() + .status(com.commercetools.api.models.project.BusinessUnitIndexingStatus + .findEnum("Scheduled")) }, + new Object[] { BusinessUnitSearchIndexingStatusResponse.builder() + .states( + new com.commercetools.api.models.business_unit_search.BusinessUnitIndexingProgressImpl()) }, + new Object[] { BusinessUnitSearchIndexingStatusResponse.builder() + .startedAt(ZonedDateTime.parse("2023-06-01T12:00Z")) }, + new Object[] { BusinessUnitSearchIndexingStatusResponse.builder() + .lastModifiedAt(ZonedDateTime.parse("2023-06-01T12:00Z")) }, + new Object[] { BusinessUnitSearchIndexingStatusResponse.builder().retryCount(7) } }; + } + + @Test + public void status() { + BusinessUnitSearchIndexingStatusResponse value = BusinessUnitSearchIndexingStatusResponse.of(); + value.setStatus(com.commercetools.api.models.project.BusinessUnitIndexingStatus.findEnum("Scheduled")); + Assertions.assertThat(value.getStatus()) + .isEqualTo(com.commercetools.api.models.project.BusinessUnitIndexingStatus.findEnum("Scheduled")); + } + + @Test + public void states() { + BusinessUnitSearchIndexingStatusResponse value = BusinessUnitSearchIndexingStatusResponse.of(); + value.setStates(new com.commercetools.api.models.business_unit_search.BusinessUnitIndexingProgressImpl()); + Assertions.assertThat(value.getStates()) + .isEqualTo(new com.commercetools.api.models.business_unit_search.BusinessUnitIndexingProgressImpl()); + } + + @Test + public void startedAt() { + BusinessUnitSearchIndexingStatusResponse value = BusinessUnitSearchIndexingStatusResponse.of(); + value.setStartedAt(ZonedDateTime.parse("2023-06-01T12:00Z")); + Assertions.assertThat(value.getStartedAt()).isEqualTo(ZonedDateTime.parse("2023-06-01T12:00Z")); + } + + @Test + public void lastModifiedAt() { + BusinessUnitSearchIndexingStatusResponse value = BusinessUnitSearchIndexingStatusResponse.of(); + value.setLastModifiedAt(ZonedDateTime.parse("2023-06-01T12:00Z")); + Assertions.assertThat(value.getLastModifiedAt()).isEqualTo(ZonedDateTime.parse("2023-06-01T12:00Z")); + } + + @Test + public void retryCount() { + BusinessUnitSearchIndexingStatusResponse value = BusinessUnitSearchIndexingStatusResponse.of(); + value.setRetryCount(7); + Assertions.assertThat(value.getRetryCount()).isEqualTo(7); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchRequestTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchRequestTest.java new file mode 100644 index 00000000000..977c4cb7541 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchRequestTest.java @@ -0,0 +1,66 @@ + +package com.commercetools.api.models.business_unit_search; + +import java.util.Collections; + +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 BusinessUnitSearchRequestTest { + + @TestTemplate + @UseDataProvider("objectBuilder") + public void buildUnchecked(BusinessUnitSearchRequestBuilder builder) { + BusinessUnitSearchRequest businessUnitSearchRequest = builder.buildUnchecked(); + Assertions.assertThat(businessUnitSearchRequest).isInstanceOf(BusinessUnitSearchRequest.class); + } + + @DataProvider + public static Object[][] objectBuilder() { + return new Object[][] { + new Object[] { BusinessUnitSearchRequest.builder() + .query(new com.commercetools.api.models.search.SearchQueryImpl()) }, + new Object[] { BusinessUnitSearchRequest.builder() + .sort(Collections.singletonList(new com.commercetools.api.models.search.SearchSortingImpl())) }, + new Object[] { BusinessUnitSearchRequest.builder().limit(7) }, + new Object[] { BusinessUnitSearchRequest.builder().offset(3) } }; + } + + @Test + public void query() { + BusinessUnitSearchRequest value = BusinessUnitSearchRequest.of(); + value.setQuery(new com.commercetools.api.models.search.SearchQueryImpl()); + Assertions.assertThat(value.getQuery()).isEqualTo(new com.commercetools.api.models.search.SearchQueryImpl()); + } + + @Test + public void sort() { + BusinessUnitSearchRequest value = BusinessUnitSearchRequest.of(); + value.setSort(Collections.singletonList(new com.commercetools.api.models.search.SearchSortingImpl())); + Assertions.assertThat(value.getSort()) + .isEqualTo(Collections.singletonList(new com.commercetools.api.models.search.SearchSortingImpl())); + } + + @Test + public void limit() { + BusinessUnitSearchRequest value = BusinessUnitSearchRequest.of(); + value.setLimit(7); + Assertions.assertThat(value.getLimit()).isEqualTo(7); + } + + @Test + public void offset() { + BusinessUnitSearchRequest value = BusinessUnitSearchRequest.of(); + value.setOffset(3); + Assertions.assertThat(value.getOffset()).isEqualTo(3); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchResultTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchResultTest.java new file mode 100644 index 00000000000..eaaa6d2caad --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/business_unit_search/BusinessUnitSearchResultTest.java @@ -0,0 +1,44 @@ + +package com.commercetools.api.models.business_unit_search; + +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 BusinessUnitSearchResultTest { + + @TestTemplate + @UseDataProvider("objectBuilder") + public void buildUnchecked(BusinessUnitSearchResultBuilder builder) { + BusinessUnitSearchResult businessUnitSearchResult = builder.buildUnchecked(); + Assertions.assertThat(businessUnitSearchResult).isInstanceOf(BusinessUnitSearchResult.class); + } + + @DataProvider + public static Object[][] objectBuilder() { + return new Object[][] { new Object[] { BusinessUnitSearchResult.builder().id("id") }, + new Object[] { BusinessUnitSearchResult.builder().relevance(0.5586561) } }; + } + + @Test + public void id() { + BusinessUnitSearchResult value = BusinessUnitSearchResult.of(); + value.setId("id"); + Assertions.assertThat(value.getId()).isEqualTo("id"); + } + + @Test + public void relevance() { + BusinessUnitSearchResult value = BusinessUnitSearchResult.of(); + value.setRelevance(0.5586561); + Assertions.assertThat(value.getRelevance()).isEqualTo(0.5586561); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/project/ProjectChangeBusinessUnitSearchStatusActionTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/project/ProjectChangeBusinessUnitSearchStatusActionTest.java new file mode 100644 index 00000000000..64bfe94db30 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/project/ProjectChangeBusinessUnitSearchStatusActionTest.java @@ -0,0 +1,40 @@ + +package com.commercetools.api.models.project; + +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 ProjectChangeBusinessUnitSearchStatusActionTest { + + @TestTemplate + @UseDataProvider("objectBuilder") + public void buildUnchecked(ProjectChangeBusinessUnitSearchStatusActionBuilder builder) { + ProjectChangeBusinessUnitSearchStatusAction projectChangeBusinessUnitSearchStatusAction = builder + .buildUnchecked(); + Assertions.assertThat(projectChangeBusinessUnitSearchStatusAction) + .isInstanceOf(ProjectChangeBusinessUnitSearchStatusAction.class); + } + + @DataProvider + public static Object[][] objectBuilder() { + return new Object[][] { new Object[] { ProjectChangeBusinessUnitSearchStatusAction.builder() + .status(com.commercetools.api.models.project.BusinessUnitSearchStatus.findEnum("Activated")) } }; + } + + @Test + public void status() { + ProjectChangeBusinessUnitSearchStatusAction value = ProjectChangeBusinessUnitSearchStatusAction.of(); + value.setStatus(com.commercetools.api.models.project.BusinessUnitSearchStatus.findEnum("Activated")); + Assertions.assertThat(value.getStatus()) + .isEqualTo(com.commercetools.api.models.project.BusinessUnitSearchStatus.findEnum("Activated")); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/project/SearchIndexingConfigurationTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/project/SearchIndexingConfigurationTest.java index f47d695c3df..b728fe6c530 100644 --- a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/project/SearchIndexingConfigurationTest.java +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/project/SearchIndexingConfigurationTest.java @@ -33,7 +33,9 @@ public static Object[][] objectBuilder() { new Object[] { SearchIndexingConfiguration.builder() .orders(new com.commercetools.api.models.project.SearchIndexingConfigurationValuesImpl()) }, new Object[] { SearchIndexingConfiguration.builder() - .customers( + .customers(new com.commercetools.api.models.project.SearchIndexingConfigurationValuesImpl()) }, + new Object[] { SearchIndexingConfiguration.builder() + .businessUnits( new com.commercetools.api.models.project.SearchIndexingConfigurationValuesImpl()) } }; } @@ -68,4 +70,12 @@ public void customers() { Assertions.assertThat(value.getCustomers()) .isEqualTo(new com.commercetools.api.models.project.SearchIndexingConfigurationValuesImpl()); } + + @Test + public void businessUnits() { + SearchIndexingConfiguration value = SearchIndexingConfiguration.of(); + value.setBusinessUnits(new com.commercetools.api.models.project.SearchIndexingConfigurationValuesImpl()); + Assertions.assertThat(value.getBusinessUnits()) + .isEqualTo(new com.commercetools.api.models.project.SearchIndexingConfigurationValuesImpl()); + } } diff --git a/references.txt b/references.txt index 8baf171044d..befcc103291 100644 --- a/references.txt +++ b/references.txt @@ -348,3 +348,4 @@ f4f3c42381257c319000e05bd5b61074d18b0a5f 62496134db5ebaf04225ce024b1f5ed3f2c79557 55ee33c4d18af345c4e89be226286c56c187a878 d0ab34123535479eb53d2400ca18fdfab0f9bf4c +e5666d7956fd6de53e41f965b052896d2a2ddd9b