diff --git a/changes.md b/changes.md index c2f8369d30..9d3fadfc94 100644 --- a/changes.md +++ b/changes.md @@ -1,3 +1,39 @@ +**Api changes** + +
+Added Resource(s) + +- added resource `/{projectKey}/in-store/key={storeKey}/business-units` +- added resource `/{projectKey}/in-store/key={storeKey}/business-units/key={key}` +- added resource `/{projectKey}/in-store/key={storeKey}/business-units/{ID}` +
+ + +
+Added Method(s) + +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().businessUnits().get()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().businessUnits().head()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().businessUnits().post()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().businessUnits().withKey().get()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().businessUnits().withKey().head()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().businessUnits().withKey().post()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().businessUnits().withKey().delete()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().businessUnits().withId().get()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().businessUnits().withId().head()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().businessUnits().withId().post()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().businessUnits().withId().delete()` +
+ + +
+Added Property(s) + +- added property `inheritedStores` to type `BusinessUnit` +- added property `inheritedStores` to type `Company` +- added property `inheritedStores` to type `Division` +
+ **History changes**
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 f2436bbaed..b2d4880bd4 100644 --- a/commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls +++ b/commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls @@ -4845,6 +4845,13 @@ type InStore implements CartDiscountQueryInterface & CartQueryInterface & Custom "Queries with specified key" key: String): Quote quotes(where: String, sort: [String!], limit: Int, offset: Int): QuoteQueryResult! + businessUnit( + "Queries with specified ID" + id: String, + + "Queries with specified key" + key: String): BusinessUnit + businessUnits(where: String, sort: [String!], limit: Int, offset: Int): BusinessUnitQueryResult! } type InStoreMe implements MeQueryInterface & CartQueryInterface & ActiveCartInterface & OrderQueryInterface & ShoppingListQueryInterface { @@ -6449,12 +6456,18 @@ type Mutation { createBusinessUnit(draft: BusinessUnitDraft!, "Create/modify entity as an associate in business-unit." - asAssociate: AsAssociateArgument): BusinessUnit + asAssociate: AsAssociateArgument, + + "The mutation is only performed if the resource is part of the store. Can be used with store-specific OAuth permissions." + storeKey: KeyReferenceInput): BusinessUnit updateBusinessUnit(version: Long!, actions: [BusinessUnitUpdateAction!]!, "Create/modify entity as an associate in business-unit." asAssociate: AsAssociateArgument, + "The mutation is only performed if the resource is part of the store. Can be used with store-specific OAuth permissions." + storeKey: KeyReferenceInput, + "Queries with specified ID" id: String, @@ -6462,6 +6475,9 @@ type Mutation { key: String): BusinessUnit deleteBusinessUnit(version: Long!, personalDataErasure: Boolean = false, + "The mutation is only performed if the resource is part of the store. Can be used with store-specific OAuth permissions." + storeKey: KeyReferenceInput, + "Queries with specified ID" id: String, diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete.java new file mode 100644 index 0000000000..0debdc375b --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete.java @@ -0,0 +1,319 @@ + +package com.commercetools.api.client; + +import java.net.URI; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import com.fasterxml.jackson.core.type.TypeReference; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + * + * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .businessUnits()
+ *            .withId("{ID}")
+ *            .delete()
+ *            .withVersion(version)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete extends + TypeApiMethod + implements com.commercetools.api.client.VersionedTrait, + com.commercetools.api.client.ConflictingTrait, + com.commercetools.api.client.ExpandableTrait, + com.commercetools.api.client.ErrorableTrait, + com.commercetools.api.client.Deprecatable200Trait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String storeKey; + private String ID; + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String ID) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.ID = ID; + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete( + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.ID = t.ID; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/business-units/%s", encodePathParam(this.projectKey), + encodePathParam(this.storeKey), encodePathParam(this.ID)); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.DELETE, URI.create(httpRequestPath), getHeaders(), null); + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.business_unit.BusinessUnit.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.business_unit.BusinessUnit.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getStoreKey() { + return this.storeKey; + } + + public String getID() { + return this.ID; + } + + public List getVersion() { + return this.getQueryParam("version"); + } + + public List getExpand() { + return this.getQueryParam("expand"); + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setStoreKey(final String storeKey) { + this.storeKey = storeKey; + } + + public void setID(final String ID) { + this.ID = ID; + } + + /** + * set version with the specified value + * @param version value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete withVersion(final TValue version) { + return copy().withQueryParam("version", version); + } + + /** + * add additional version query parameter + * @param version value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete addVersion(final TValue version) { + return copy().addQueryParam("version", version); + } + + /** + * set version with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete withVersion(final Supplier supplier) { + return copy().withQueryParam("version", supplier.get()); + } + + /** + * add additional version query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete addVersion(final Supplier supplier) { + return copy().addQueryParam("version", supplier.get()); + } + + /** + * set version with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete withVersion( + final Function op) { + return copy().withQueryParam("version", op.apply(new StringBuilder())); + } + + /** + * add additional version query parameter + * @param op builder for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete addVersion( + final Function op) { + return copy().addQueryParam("version", op.apply(new StringBuilder())); + } + + /** + * set version with the specified values + * @param version values to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete withVersion( + final Collection version) { + return copy().withoutQueryParam("version") + .addQueryParams( + version.stream().map(s -> new ParamEntry<>("version", s.toString())).collect(Collectors.toList())); + } + + /** + * add additional version query parameters + * @param version values to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete addVersion( + final Collection version) { + return copy().addQueryParams( + version.stream().map(s -> new ParamEntry<>("version", s.toString())).collect(Collectors.toList())); + } + + /** + * set expand with the specified value + * @param expand value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete addExpand(final TValue expand) { + return copy().addQueryParam("expand", expand); + } + + /** + * set expand with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete withExpand(final Supplier supplier) { + return copy().withQueryParam("expand", supplier.get()); + } + + /** + * add additional expand query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete addExpand(final Supplier supplier) { + return copy().addQueryParam("expand", supplier.get()); + } + + /** + * set expand with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete withExpand( + final Function op) { + return copy().withQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * add additional expand query parameter + * @param op builder for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete addExpand( + final Function op) { + return copy().addQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * set expand with the specified values + * @param expand values to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete withExpand( + final Collection expand) { + return copy().withoutQueryParam("expand") + .addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + /** + * add additional expand query parameters + * @param expand values to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete addExpand(final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete that = (ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(ID, that.ID) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(storeKey).append(ID).toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete copy() { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet.java new file mode 100644 index 0000000000..673d3511fb --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet.java @@ -0,0 +1,228 @@ + +package com.commercetools.api.client; + +import java.net.URI; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import com.fasterxml.jackson.core.type.TypeReference; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + * + * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .businessUnits()
+ *            .withId("{ID}")
+ *            .get()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet extends + TypeApiMethod + implements com.commercetools.api.client.ExpandableTrait, + com.commercetools.api.client.ErrorableTrait, + com.commercetools.api.client.Deprecatable200Trait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String storeKey; + private String ID; + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String ID) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.ID = ID; + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet( + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.ID = t.ID; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/business-units/%s", encodePathParam(this.projectKey), + encodePathParam(this.storeKey), encodePathParam(this.ID)); + 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.BusinessUnit.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.business_unit.BusinessUnit.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getStoreKey() { + return this.storeKey; + } + + public String getID() { + return this.ID; + } + + public List getExpand() { + return this.getQueryParam("expand"); + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setStoreKey(final String storeKey) { + this.storeKey = storeKey; + } + + public void setID(final String ID) { + this.ID = ID; + } + + /** + * set expand with the specified value + * @param expand value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet addExpand(final TValue expand) { + return copy().addQueryParam("expand", expand); + } + + /** + * set expand with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet withExpand(final Supplier supplier) { + return copy().withQueryParam("expand", supplier.get()); + } + + /** + * add additional expand query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet addExpand(final Supplier supplier) { + return copy().addQueryParam("expand", supplier.get()); + } + + /** + * set expand with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet withExpand( + final Function op) { + return copy().withQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * add additional expand query parameter + * @param op builder for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet addExpand( + final Function op) { + return copy().addQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * set expand with the specified values + * @param expand values to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet withExpand(final Collection expand) { + return copy().withoutQueryParam("expand") + .addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + /** + * add additional expand query parameters + * @param expand values to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet addExpand(final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet that = (ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(ID, that.ID) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(storeKey).append(ID).toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet copy() { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDHead.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDHead.java new file mode 100644 index 0000000000..26fce5d337 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDHead.java @@ -0,0 +1,138 @@ + +package com.commercetools.api.client; + +import java.net.URI; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +import com.fasterxml.jackson.core.type.TypeReference; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + *

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

+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .businessUnits()
+ *            .withId("{ID}")
+ *            .head()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDHead extends + TypeApiMethod + implements com.commercetools.api.client.ErrorableTrait, + com.commercetools.api.client.Deprecatable200Trait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String storeKey; + private String ID; + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDHead(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String ID) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.ID = ID; + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDHead( + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDHead t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.ID = t.ID; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/business-units/%s", encodePathParam(this.projectKey), + encodePathParam(this.storeKey), encodePathParam(this.ID)); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.HEAD, URI.create(httpRequestPath), getHeaders(), null); + } + + @Override + public ApiHttpResponse executeBlocking(final ApiHttpClient client, + final Duration timeout) { + return executeBlocking(client, timeout, com.fasterxml.jackson.databind.JsonNode.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.fasterxml.jackson.databind.JsonNode.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getStoreKey() { + return this.storeKey; + } + + public String getID() { + return this.ID; + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setStoreKey(final String storeKey) { + this.storeKey = storeKey; + } + + public void setID(final String ID) { + this.ID = ID; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDHead that = (ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDHead) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(ID, that.ID) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(storeKey).append(ID).toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDHead copy() { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDHead(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost.java new file mode 100644 index 0000000000..15a21a7ba7 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost.java @@ -0,0 +1,253 @@ + +package com.commercetools.api.client; + +import java.net.URI; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import com.fasterxml.jackson.core.type.TypeReference; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + * + * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .businessUnits()
+ *            .withId("{ID}")
+ *            .post(null)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost extends + TypeBodyApiMethod + implements com.commercetools.api.client.ConflictingTrait, + com.commercetools.api.client.ExpandableTrait, + com.commercetools.api.client.Deprecatable200Trait, + com.commercetools.api.client.ErrorableTrait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String storeKey; + private String ID; + + private com.commercetools.api.models.business_unit.BusinessUnitUpdate businessUnitUpdate; + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String ID, + com.commercetools.api.models.business_unit.BusinessUnitUpdate businessUnitUpdate) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.ID = ID; + this.businessUnitUpdate = businessUnitUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost( + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.ID = t.ID; + this.businessUnitUpdate = t.businessUnitUpdate; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/business-units/%s", encodePathParam(this.projectKey), + encodePathParam(this.storeKey), encodePathParam(this.ID)); + 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(businessUnitUpdate))); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.business_unit.BusinessUnit.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.business_unit.BusinessUnit.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getStoreKey() { + return this.storeKey; + } + + public String getID() { + return this.ID; + } + + public List getExpand() { + return this.getQueryParam("expand"); + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setStoreKey(final String storeKey) { + this.storeKey = storeKey; + } + + public void setID(final String ID) { + this.ID = ID; + } + + /** + * set expand with the specified value + * @param expand value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost addExpand(final TValue expand) { + return copy().addQueryParam("expand", expand); + } + + /** + * set expand with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost withExpand(final Supplier supplier) { + return copy().withQueryParam("expand", supplier.get()); + } + + /** + * add additional expand query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost addExpand(final Supplier supplier) { + return copy().addQueryParam("expand", supplier.get()); + } + + /** + * set expand with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost withExpand( + final Function op) { + return copy().withQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * add additional expand query parameter + * @param op builder for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost addExpand( + final Function op) { + return copy().addQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * set expand with the specified values + * @param expand values to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost withExpand(final Collection expand) { + return copy().withoutQueryParam("expand") + .addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + /** + * add additional expand query parameters + * @param expand values to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost addExpand(final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public com.commercetools.api.models.business_unit.BusinessUnitUpdate getBody() { + return businessUnitUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost withBody( + com.commercetools.api.models.business_unit.BusinessUnitUpdate businessUnitUpdate) { + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost t = copy(); + t.businessUnitUpdate = businessUnitUpdate; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost that = (ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(ID, that.ID) + .append(businessUnitUpdate, that.businessUnitUpdate) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey) + .append(storeKey) + .append(ID) + .append(businessUnitUpdate) + .toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost copy() { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString.java new file mode 100644 index 0000000000..0cca14c264 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString.java @@ -0,0 +1,254 @@ + +package com.commercetools.api.client; + +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import com.fasterxml.jackson.core.type.TypeReference; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + * + * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .businessUnits()
+ *            .withId("{ID}")
+ *            .post("")
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString extends + StringBodyApiMethod + implements + com.commercetools.api.client.ConflictingTrait, + com.commercetools.api.client.ExpandableTrait, + com.commercetools.api.client.Deprecatable200Trait, + com.commercetools.api.client.ErrorableTrait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String storeKey; + private String ID; + + private String businessUnitUpdate; + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString(final ApiHttpClient apiHttpClient, + String projectKey, String storeKey, String ID, String businessUnitUpdate) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.ID = ID; + this.businessUnitUpdate = businessUnitUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString( + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.ID = t.ID; + this.businessUnitUpdate = t.businessUnitUpdate; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/business-units/%s", this.projectKey, this.storeKey, + this.ID); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(), + businessUnitUpdate.getBytes(StandardCharsets.UTF_8)); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.business_unit.BusinessUnit.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.business_unit.BusinessUnit.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getStoreKey() { + return this.storeKey; + } + + public String getID() { + return this.ID; + } + + public List getExpand() { + return this.getQueryParam("expand"); + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setStoreKey(final String storeKey) { + this.storeKey = storeKey; + } + + public void setID(final String ID) { + this.ID = ID; + } + + /** + * set expand with the specified value + * @param value type + * @param expand value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param value type + * @param expand value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString addExpand(final TValue expand) { + return copy().addQueryParam("expand", expand); + } + + /** + * set expand with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString withExpand(final Supplier supplier) { + return copy().withQueryParam("expand", supplier.get()); + } + + /** + * add additional expand query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString addExpand(final Supplier supplier) { + return copy().addQueryParam("expand", supplier.get()); + } + + /** + * set expand with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString withExpand( + final Function op) { + return copy().withQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * add additional expand query parameter + * @param op builder for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString addExpand( + final Function op) { + return copy().addQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * set expand with the specified values + * @param value type + * @param expand values to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString withExpand( + final Collection expand) { + return copy().withoutQueryParam("expand") + .addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + /** + * add additional expand query parameters + * @param value type + * @param expand values to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString addExpand( + final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public String getBody() { + return businessUnitUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString withBody(String businessUnitUpdate) { + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString t = copy(); + t.businessUnitUpdate = businessUnitUpdate; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString that = (ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(ID, that.ID) + .append(businessUnitUpdate, that.businessUnitUpdate) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey) + .append(storeKey) + .append(ID) + .append(businessUnitUpdate) + .toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString copy() { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDRequestBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDRequestBuilder.java new file mode 100644 index 0000000000..ae8d822118 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDRequestBuilder.java @@ -0,0 +1,57 @@ + +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 ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDRequestBuilder { + + private final ApiHttpClient apiHttpClient; + private final String projectKey; + private final String storeKey; + private final String ID; + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDRequestBuilder(final ApiHttpClient apiHttpClient, + final String projectKey, final String storeKey, final String ID) { + this.apiHttpClient = apiHttpClient; + this.projectKey = projectKey; + this.storeKey = storeKey; + this.ID = ID; + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet get() { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDGet(apiHttpClient, projectKey, storeKey, ID); + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDHead head() { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDHead(apiHttpClient, projectKey, storeKey, ID); + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost post( + com.commercetools.api.models.business_unit.BusinessUnitUpdate businessUnitUpdate) { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost(apiHttpClient, projectKey, storeKey, ID, + businessUnitUpdate); + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString post(final String businessUnitUpdate) { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPostString(apiHttpClient, projectKey, storeKey, ID, + businessUnitUpdate); + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDPost post( + UnaryOperator op) { + return post(op.apply(com.commercetools.api.models.business_unit.BusinessUnitUpdateBuilder.of()).build()); + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete delete() { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete(apiHttpClient, projectKey, storeKey, ID); + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDDelete delete(TValue version) { + return delete().withVersion(version); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet.java new file mode 100644 index 0000000000..5e81e1c548 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet.java @@ -0,0 +1,689 @@ + +package com.commercetools.api.client; + +import java.net.URI; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import com.fasterxml.jackson.core.type.TypeReference; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + * + * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .businessUnits()
+ *            .get()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet extends + TypeApiMethod + implements com.commercetools.api.client.ExpandableTrait, + com.commercetools.api.client.SortableTrait, + com.commercetools.api.client.PagingTrait, + com.commercetools.api.client.QueryTrait, + com.commercetools.api.client.ErrorableTrait, + com.commercetools.api.client.Deprecatable200Trait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String storeKey; + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet(ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/business-units", encodePathParam(this.projectKey), + encodePathParam(this.storeKey)); + 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.BusinessUnitPagedQueryResponse.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.business_unit.BusinessUnitPagedQueryResponse.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getStoreKey() { + return this.storeKey; + } + + public List getExpand() { + return this.getQueryParam("expand"); + } + + public List getSort() { + return this.getQueryParam("sort"); + } + + public List getLimit() { + return this.getQueryParam("limit"); + } + + public List getOffset() { + return this.getQueryParam("offset"); + } + + public List getWithTotal() { + return this.getQueryParam("withTotal"); + } + + public List getWhere() { + return this.getQueryParam("where"); + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setStoreKey(final String storeKey) { + this.storeKey = storeKey; + } + + /** + * set expand with the specified value + * @param expand value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addExpand(final TValue expand) { + return copy().addQueryParam("expand", expand); + } + + /** + * set expand with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withExpand(final Supplier supplier) { + return copy().withQueryParam("expand", supplier.get()); + } + + /** + * add additional expand query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addExpand(final Supplier supplier) { + return copy().addQueryParam("expand", supplier.get()); + } + + /** + * set expand with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withExpand( + final Function op) { + return copy().withQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * add additional expand query parameter + * @param op builder for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addExpand(final Function op) { + return copy().addQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * set expand with the specified values + * @param expand values to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withExpand(final Collection expand) { + return copy().withoutQueryParam("expand") + .addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + /** + * add additional expand query parameters + * @param expand values to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addExpand(final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + /** + * set sort with the specified value + * @param sort value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withSort(final TValue sort) { + return copy().withQueryParam("sort", sort); + } + + /** + * add additional sort query parameter + * @param sort value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addSort(final TValue sort) { + return copy().addQueryParam("sort", sort); + } + + /** + * set sort with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withSort(final Supplier supplier) { + return copy().withQueryParam("sort", supplier.get()); + } + + /** + * add additional sort query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addSort(final Supplier supplier) { + return copy().addQueryParam("sort", supplier.get()); + } + + /** + * set sort with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withSort(final Function op) { + return copy().withQueryParam("sort", op.apply(new StringBuilder())); + } + + /** + * add additional sort query parameter + * @param op builder for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addSort(final Function op) { + return copy().addQueryParam("sort", op.apply(new StringBuilder())); + } + + /** + * set sort with the specified values + * @param sort values to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withSort(final Collection sort) { + return copy().withoutQueryParam("sort") + .addQueryParams( + sort.stream().map(s -> new ParamEntry<>("sort", s.toString())).collect(Collectors.toList())); + } + + /** + * add additional sort query parameters + * @param sort values to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addSort(final Collection sort) { + return copy().addQueryParams( + sort.stream().map(s -> new ParamEntry<>("sort", s.toString())).collect(Collectors.toList())); + } + + /** + * set limit with the specified value + * @param limit value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withLimit(final TValue limit) { + return copy().withQueryParam("limit", limit); + } + + /** + * add additional limit query parameter + * @param limit value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addLimit(final TValue limit) { + return copy().addQueryParam("limit", limit); + } + + /** + * set limit with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withLimit(final Supplier supplier) { + return copy().withQueryParam("limit", supplier.get()); + } + + /** + * add additional limit query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addLimit(final Supplier supplier) { + return copy().addQueryParam("limit", supplier.get()); + } + + /** + * set limit with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withLimit(final Function op) { + return copy().withQueryParam("limit", op.apply(new StringBuilder())); + } + + /** + * add additional limit query parameter + * @param op builder for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addLimit(final Function op) { + return copy().addQueryParam("limit", op.apply(new StringBuilder())); + } + + /** + * set limit with the specified values + * @param limit values to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withLimit(final Collection limit) { + return copy().withoutQueryParam("limit") + .addQueryParams( + limit.stream().map(s -> new ParamEntry<>("limit", s.toString())).collect(Collectors.toList())); + } + + /** + * add additional limit query parameters + * @param limit values to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addLimit(final Collection limit) { + return copy().addQueryParams( + limit.stream().map(s -> new ParamEntry<>("limit", s.toString())).collect(Collectors.toList())); + } + + /** + * set offset with the specified value + * @param offset value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withOffset(final TValue offset) { + return copy().withQueryParam("offset", offset); + } + + /** + * add additional offset query parameter + * @param offset value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addOffset(final TValue offset) { + return copy().addQueryParam("offset", offset); + } + + /** + * set offset with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withOffset(final Supplier supplier) { + return copy().withQueryParam("offset", supplier.get()); + } + + /** + * add additional offset query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addOffset(final Supplier supplier) { + return copy().addQueryParam("offset", supplier.get()); + } + + /** + * set offset with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withOffset( + final Function op) { + return copy().withQueryParam("offset", op.apply(new StringBuilder())); + } + + /** + * add additional offset query parameter + * @param op builder for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addOffset(final Function op) { + return copy().addQueryParam("offset", op.apply(new StringBuilder())); + } + + /** + * set offset with the specified values + * @param offset values to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withOffset(final Collection offset) { + return copy().withoutQueryParam("offset") + .addQueryParams( + offset.stream().map(s -> new ParamEntry<>("offset", s.toString())).collect(Collectors.toList())); + } + + /** + * add additional offset query parameters + * @param offset values to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addOffset(final Collection offset) { + return copy().addQueryParams( + offset.stream().map(s -> new ParamEntry<>("offset", s.toString())).collect(Collectors.toList())); + } + + /** + * set withTotal with the specified value + * @param withTotal value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withWithTotal(final TValue withTotal) { + return copy().withQueryParam("withTotal", withTotal); + } + + /** + * add additional withTotal query parameter + * @param withTotal value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addWithTotal(final TValue withTotal) { + return copy().addQueryParam("withTotal", withTotal); + } + + /** + * set withTotal with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withWithTotal(final Supplier supplier) { + return copy().withQueryParam("withTotal", supplier.get()); + } + + /** + * add additional withTotal query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addWithTotal(final Supplier supplier) { + return copy().addQueryParam("withTotal", supplier.get()); + } + + /** + * set withTotal with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withWithTotal( + final Function op) { + return copy().withQueryParam("withTotal", op.apply(new StringBuilder())); + } + + /** + * add additional withTotal query parameter + * @param op builder for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addWithTotal( + final Function op) { + return copy().addQueryParam("withTotal", op.apply(new StringBuilder())); + } + + /** + * set withTotal with the specified values + * @param withTotal values to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withWithTotal(final Collection withTotal) { + return copy().withoutQueryParam("withTotal") + .addQueryParams(withTotal.stream() + .map(s -> new ParamEntry<>("withTotal", s.toString())) + .collect(Collectors.toList())); + } + + /** + * add additional withTotal query parameters + * @param withTotal values to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addWithTotal(final Collection withTotal) { + return copy().addQueryParams( + withTotal.stream().map(s -> new ParamEntry<>("withTotal", s.toString())).collect(Collectors.toList())); + } + + /** + * set where with the specified value + * @param where value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withWhere(final TValue where) { + return copy().withQueryParam("where", where); + } + + /** + * add additional where query parameter + * @param where value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addWhere(final TValue where) { + return copy().addQueryParam("where", where); + } + + /** + * set where with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withWhere(final Supplier supplier) { + return copy().withQueryParam("where", supplier.get()); + } + + /** + * add additional where query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addWhere(final Supplier supplier) { + return copy().addQueryParam("where", supplier.get()); + } + + /** + * set where with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withWhere(final Function op) { + return copy().withQueryParam("where", op.apply(new StringBuilder())); + } + + /** + * add additional where query parameter + * @param op builder for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addWhere(final Function op) { + return copy().addQueryParam("where", op.apply(new StringBuilder())); + } + + /** + * set where with the specified values + * @param where values to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withWhere(final Collection where) { + return copy().withoutQueryParam("where") + .addQueryParams( + where.stream().map(s -> new ParamEntry<>("where", s.toString())).collect(Collectors.toList())); + } + + /** + * add additional where query parameters + * @param where values to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addWhere(final Collection where) { + return copy().addQueryParams( + where.stream().map(s -> new ParamEntry<>("where", s.toString())).collect(Collectors.toList())); + } + + /** + * set predicateVar with the specificied value + * @param value type + * @param varName parameter name + * @param predicateVar parameter value + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withPredicateVar(final String varName, + final TValue predicateVar) { + return copy().withQueryParam(String.format("var.%s", varName), predicateVar); + } + + /** + * add additional predicateVar query parameter + * @param value type + * @param varName parameter name + * @param predicateVar parameter value + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addPredicateVar(final String varName, + final TValue predicateVar) { + return copy().addQueryParam(String.format("var.%s", varName), predicateVar); + } + + /** + * set predicateVar with the specificied values + * @param value type + * @param varName parameter name + * @param predicateVar parameter values + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet withPredicateVar(final String varName, + final Collection predicateVar) { + final String placeholderName = String.format("var.%s", varName); + return copy().withoutQueryParam(placeholderName) + .addQueryParams(predicateVar.stream() + .map(s -> new ParamEntry<>(placeholderName, s.toString())) + .collect(Collectors.toList())); + } + + /** + * add additional predicateVar query parameters + * @param value type + * @param varName parameter name + * @param predicateVar parameter values + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet addPredicateVar(final String varName, + final Collection predicateVar) { + final String placeholderName = String.format("var.%s", varName); + return copy().addQueryParams(predicateVar.stream() + .map(s -> new ParamEntry<>(placeholderName, s.toString())) + .collect(Collectors.toList())); + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet that = (ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet) o; + + return new EqualsBuilder().append(projectKey, that.projectKey).append(storeKey, that.storeKey).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(storeKey).toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet copy() { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsHead.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsHead.java new file mode 100644 index 0000000000..f60d6e49e8 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsHead.java @@ -0,0 +1,210 @@ + +package com.commercetools.api.client; + +import java.net.URI; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import com.fasterxml.jackson.core.type.TypeReference; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + *

Checks if a BusinessUnit exists for a given Query Predicate. Returns a 200 OK status if any BusinessUnits match the Query Predicate or a 404 Not Found otherwise.

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

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

+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .businessUnits()
+ *            .withKey("{key}")
+ *            .head()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyHead extends + TypeApiMethod + implements + com.commercetools.api.client.ErrorableTrait, + com.commercetools.api.client.Deprecatable200Trait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String storeKey; + private String key; + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyHead(final ApiHttpClient apiHttpClient, + String projectKey, String storeKey, String key) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.key = key; + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyHead( + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyHead t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.key = t.key; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/business-units/key=%s", + encodePathParam(this.projectKey), encodePathParam(this.storeKey), encodePathParam(this.key)); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.HEAD, URI.create(httpRequestPath), getHeaders(), null); + } + + @Override + public ApiHttpResponse executeBlocking(final ApiHttpClient client, + final Duration timeout) { + return executeBlocking(client, timeout, com.fasterxml.jackson.databind.JsonNode.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.fasterxml.jackson.databind.JsonNode.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getStoreKey() { + return this.storeKey; + } + + public String getKey() { + return this.key; + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setStoreKey(final String storeKey) { + this.storeKey = storeKey; + } + + public void setKey(final String key) { + this.key = key; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyHead that = (ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyHead) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(key, that.key) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(storeKey).append(key).toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyHead copy() { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyHead(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost.java new file mode 100644 index 0000000000..e37eb3e8a2 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost.java @@ -0,0 +1,256 @@ + +package com.commercetools.api.client; + +import java.net.URI; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import com.fasterxml.jackson.core.type.TypeReference; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + * + * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .businessUnits()
+ *            .withKey("{key}")
+ *            .post(null)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost extends + TypeBodyApiMethod + implements + com.commercetools.api.client.ConflictingTrait, + com.commercetools.api.client.ExpandableTrait, + com.commercetools.api.client.Deprecatable200Trait, + com.commercetools.api.client.ErrorableTrait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String storeKey; + private String key; + + private com.commercetools.api.models.business_unit.BusinessUnitUpdate businessUnitUpdate; + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost(final ApiHttpClient apiHttpClient, + String projectKey, String storeKey, String key, + com.commercetools.api.models.business_unit.BusinessUnitUpdate businessUnitUpdate) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.key = key; + this.businessUnitUpdate = businessUnitUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost( + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.key = t.key; + this.businessUnitUpdate = t.businessUnitUpdate; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/business-units/key=%s", + encodePathParam(this.projectKey), encodePathParam(this.storeKey), encodePathParam(this.key)); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(), + io.vrap.rmf.base.client.utils.json.JsonUtils + .executing(() -> apiHttpClient().getSerializerService().toJsonByteArray(businessUnitUpdate))); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.business_unit.BusinessUnit.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.business_unit.BusinessUnit.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getStoreKey() { + return this.storeKey; + } + + public String getKey() { + return this.key; + } + + public List getExpand() { + return this.getQueryParam("expand"); + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setStoreKey(final String storeKey) { + this.storeKey = storeKey; + } + + public void setKey(final String key) { + this.key = key; + } + + /** + * set expand with the specified value + * @param expand value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost addExpand(final TValue expand) { + return copy().addQueryParam("expand", expand); + } + + /** + * set expand with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost withExpand(final Supplier supplier) { + return copy().withQueryParam("expand", supplier.get()); + } + + /** + * add additional expand query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost addExpand(final Supplier supplier) { + return copy().addQueryParam("expand", supplier.get()); + } + + /** + * set expand with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost withExpand( + final Function op) { + return copy().withQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * add additional expand query parameter + * @param op builder for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost addExpand( + final Function op) { + return copy().addQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * set expand with the specified values + * @param expand values to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost withExpand( + final Collection expand) { + return copy().withoutQueryParam("expand") + .addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + /** + * add additional expand query parameters + * @param expand values to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost addExpand( + final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public com.commercetools.api.models.business_unit.BusinessUnitUpdate getBody() { + return businessUnitUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost withBody( + com.commercetools.api.models.business_unit.BusinessUnitUpdate businessUnitUpdate) { + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost t = copy(); + t.businessUnitUpdate = businessUnitUpdate; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost that = (ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(key, that.key) + .append(businessUnitUpdate, that.businessUnitUpdate) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey) + .append(storeKey) + .append(key) + .append(businessUnitUpdate) + .toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost copy() { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString.java new file mode 100644 index 0000000000..017f5c0c1e --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString.java @@ -0,0 +1,254 @@ + +package com.commercetools.api.client; + +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import com.fasterxml.jackson.core.type.TypeReference; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + * + * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .businessUnits()
+ *            .withKey("{key}")
+ *            .post("")
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString extends + StringBodyApiMethod + implements + com.commercetools.api.client.ConflictingTrait, + com.commercetools.api.client.ExpandableTrait, + com.commercetools.api.client.Deprecatable200Trait, + com.commercetools.api.client.ErrorableTrait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String storeKey; + private String key; + + private String businessUnitUpdate; + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString(final ApiHttpClient apiHttpClient, + String projectKey, String storeKey, String key, String businessUnitUpdate) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.key = key; + this.businessUnitUpdate = businessUnitUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString( + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.key = t.key; + this.businessUnitUpdate = t.businessUnitUpdate; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/business-units/key=%s", this.projectKey, + this.storeKey, this.key); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(), + businessUnitUpdate.getBytes(StandardCharsets.UTF_8)); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.business_unit.BusinessUnit.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.business_unit.BusinessUnit.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getStoreKey() { + return this.storeKey; + } + + public String getKey() { + return this.key; + } + + public List getExpand() { + return this.getQueryParam("expand"); + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setStoreKey(final String storeKey) { + this.storeKey = storeKey; + } + + public void setKey(final String key) { + this.key = key; + } + + /** + * set expand with the specified value + * @param value type + * @param expand value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param value type + * @param expand value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString addExpand(final TValue expand) { + return copy().addQueryParam("expand", expand); + } + + /** + * set expand with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString withExpand(final Supplier supplier) { + return copy().withQueryParam("expand", supplier.get()); + } + + /** + * add additional expand query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString addExpand(final Supplier supplier) { + return copy().addQueryParam("expand", supplier.get()); + } + + /** + * set expand with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString withExpand( + final Function op) { + return copy().withQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * add additional expand query parameter + * @param op builder for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString addExpand( + final Function op) { + return copy().addQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * set expand with the specified values + * @param value type + * @param expand values to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString withExpand( + final Collection expand) { + return copy().withoutQueryParam("expand") + .addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + /** + * add additional expand query parameters + * @param value type + * @param expand values to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString addExpand( + final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public String getBody() { + return businessUnitUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString withBody(String businessUnitUpdate) { + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString t = copy(); + t.businessUnitUpdate = businessUnitUpdate; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString that = (ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(key, that.key) + .append(businessUnitUpdate, that.businessUnitUpdate) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey) + .append(storeKey) + .append(key) + .append(businessUnitUpdate) + .toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString copy() { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyRequestBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyRequestBuilder.java new file mode 100644 index 0000000000..818c4a16f9 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyRequestBuilder.java @@ -0,0 +1,58 @@ + +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 ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyRequestBuilder { + + private final ApiHttpClient apiHttpClient; + private final String projectKey; + private final String storeKey; + private final String key; + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyRequestBuilder(final ApiHttpClient apiHttpClient, + final String projectKey, final String storeKey, final String key) { + this.apiHttpClient = apiHttpClient; + this.projectKey = projectKey; + this.storeKey = storeKey; + this.key = key; + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyGet get() { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyGet(apiHttpClient, projectKey, storeKey, key); + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyHead head() { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyHead(apiHttpClient, projectKey, storeKey, key); + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost post( + com.commercetools.api.models.business_unit.BusinessUnitUpdate businessUnitUpdate) { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost(apiHttpClient, projectKey, storeKey, key, + businessUnitUpdate); + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString post(final String businessUnitUpdate) { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPostString(apiHttpClient, projectKey, storeKey, + key, businessUnitUpdate); + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyPost post( + UnaryOperator op) { + return post(op.apply(com.commercetools.api.models.business_unit.BusinessUnitUpdateBuilder.of()).build()); + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyDelete delete() { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyDelete(apiHttpClient, projectKey, storeKey, + key); + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyDelete delete(TValue version) { + return delete().withVersion(version); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost.java new file mode 100644 index 0000000000..7080b22f69 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost.java @@ -0,0 +1,233 @@ + +package com.commercetools.api.client; + +import java.net.URI; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import com.fasterxml.jackson.core.type.TypeReference; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + * + * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .businessUnits()
+ *            .post(null)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost extends + TypeBodyApiMethod + implements com.commercetools.api.client.ExpandableTrait, + com.commercetools.api.client.Deprecatable201Trait, + com.commercetools.api.client.ErrorableTrait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String storeKey; + + private com.commercetools.api.models.business_unit.BusinessUnitDraft businessUnitDraft; + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, com.commercetools.api.models.business_unit.BusinessUnitDraft businessUnitDraft) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.businessUnitDraft = businessUnitDraft; + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost(ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.businessUnitDraft = t.businessUnitDraft; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/business-units", encodePathParam(this.projectKey), + encodePathParam(this.storeKey)); + 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(businessUnitDraft))); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.business_unit.BusinessUnit.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.business_unit.BusinessUnit.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getStoreKey() { + return this.storeKey; + } + + public List getExpand() { + return this.getQueryParam("expand"); + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setStoreKey(final String storeKey) { + this.storeKey = storeKey; + } + + /** + * set expand with the specified value + * @param expand value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost addExpand(final TValue expand) { + return copy().addQueryParam("expand", expand); + } + + /** + * set expand with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost withExpand(final Supplier supplier) { + return copy().withQueryParam("expand", supplier.get()); + } + + /** + * add additional expand query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost addExpand(final Supplier supplier) { + return copy().addQueryParam("expand", supplier.get()); + } + + /** + * set expand with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost withExpand( + final Function op) { + return copy().withQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * add additional expand query parameter + * @param op builder for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost addExpand( + final Function op) { + return copy().addQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * set expand with the specified values + * @param expand values to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost withExpand(final Collection expand) { + return copy().withoutQueryParam("expand") + .addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + /** + * add additional expand query parameters + * @param expand values to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost addExpand(final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public com.commercetools.api.models.business_unit.BusinessUnitDraft getBody() { + return businessUnitDraft; + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost withBody( + com.commercetools.api.models.business_unit.BusinessUnitDraft businessUnitDraft) { + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost t = copy(); + t.businessUnitDraft = businessUnitDraft; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost that = (ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(businessUnitDraft, that.businessUnitDraft) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(storeKey).append(businessUnitDraft).toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost copy() { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString.java new file mode 100644 index 0000000000..e0b7bd43a4 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString.java @@ -0,0 +1,234 @@ + +package com.commercetools.api.client; + +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import com.fasterxml.jackson.core.type.TypeReference; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + * + * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .businessUnits()
+ *            .post("")
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString extends + StringBodyApiMethod + implements + com.commercetools.api.client.ExpandableTrait, + com.commercetools.api.client.Deprecatable201Trait, + com.commercetools.api.client.ErrorableTrait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String storeKey; + + private String businessUnitDraft; + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String businessUnitDraft) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.businessUnitDraft = businessUnitDraft; + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString( + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.businessUnitDraft = t.businessUnitDraft; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/business-units", this.projectKey, this.storeKey); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(), + businessUnitDraft.getBytes(StandardCharsets.UTF_8)); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.business_unit.BusinessUnit.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.business_unit.BusinessUnit.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getStoreKey() { + return this.storeKey; + } + + public List getExpand() { + return this.getQueryParam("expand"); + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setStoreKey(final String storeKey) { + this.storeKey = storeKey; + } + + /** + * set expand with the specified value + * @param value type + * @param expand value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param value type + * @param expand value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString addExpand(final TValue expand) { + return copy().addQueryParam("expand", expand); + } + + /** + * set expand with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString withExpand(final Supplier supplier) { + return copy().withQueryParam("expand", supplier.get()); + } + + /** + * add additional expand query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString addExpand(final Supplier supplier) { + return copy().addQueryParam("expand", supplier.get()); + } + + /** + * set expand with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString withExpand( + final Function op) { + return copy().withQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * add additional expand query parameter + * @param op builder for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString addExpand( + final Function op) { + return copy().addQueryParam("expand", op.apply(new StringBuilder())); + } + + /** + * set expand with the specified values + * @param value type + * @param expand values to be set + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString withExpand( + final Collection expand) { + return copy().withoutQueryParam("expand") + .addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + /** + * add additional expand query parameters + * @param value type + * @param expand values to be added + * @return ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString addExpand(final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public String getBody() { + return businessUnitDraft; + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString withBody(String businessUnitDraft) { + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString t = copy(); + t.businessUnitDraft = businessUnitDraft; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString that = (ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(businessUnitDraft, that.businessUnitDraft) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(storeKey).append(businessUnitDraft).toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString copy() { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsRequestBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsRequestBuilder.java new file mode 100644 index 0000000000..a0b549538a --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsRequestBuilder.java @@ -0,0 +1,58 @@ + +package com.commercetools.api.client; + +import java.util.function.Function; + +import io.vrap.rmf.base.client.ApiHttpClient; +import io.vrap.rmf.base.client.Builder; +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 ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsRequestBuilder { + + private final ApiHttpClient apiHttpClient; + private final String projectKey; + private final String storeKey; + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsRequestBuilder(final ApiHttpClient apiHttpClient, + final String projectKey, final String storeKey) { + this.apiHttpClient = apiHttpClient; + this.projectKey = projectKey; + this.storeKey = storeKey; + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet get() { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsGet(apiHttpClient, projectKey, storeKey); + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsHead head() { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsHead(apiHttpClient, projectKey, storeKey); + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost post( + com.commercetools.api.models.business_unit.BusinessUnitDraft businessUnitDraft) { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost(apiHttpClient, projectKey, storeKey, + businessUnitDraft); + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString post(final String businessUnitDraft) { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPostString(apiHttpClient, projectKey, storeKey, + businessUnitDraft); + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsPost post( + Function> op) { + return post(op.apply(com.commercetools.api.models.business_unit.BusinessUnitDraftBuilder.of()).build()); + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyRequestBuilder withKey(String key) { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyRequestBuilder(apiHttpClient, projectKey, + storeKey, key); + } + + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDRequestBuilder withId(String ID) { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDRequestBuilder(apiHttpClient, projectKey, storeKey, + ID); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyRequestBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyRequestBuilder.java index 4ae985ac87..86467ab7a9 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyRequestBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyRequestBuilder.java @@ -80,4 +80,8 @@ public ByProjectKeyInStoreKeyByStoreKeyQuotesRequestBuilder quotes() { return new ByProjectKeyInStoreKeyByStoreKeyQuotesRequestBuilder(apiHttpClient, projectKey, storeKey); } + public ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsRequestBuilder businessUnits() { + return new ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsRequestBuilder(apiHttpClient, projectKey, storeKey); + } + } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/BusinessUnit.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/BusinessUnit.java index f8fc945765..e1c8cb38d6 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/BusinessUnit.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/BusinessUnit.java @@ -130,6 +130,14 @@ public interface BusinessUnit extends BaseResource, com.commercetools.api.models @JsonProperty("stores") public List getStores(); + /** + *

Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the storeMode is set to FromParent.

+ * @return inheritedStores + */ + @Valid + @JsonProperty("inheritedStores") + public List getInheritedStores(); + /** *

Defines whether the Stores of the Business Unit are set directly on the Business Unit or are inherited from a parent.

* @return storeMode @@ -336,6 +344,21 @@ public interface BusinessUnit extends BaseResource, com.commercetools.api.models public void setStores(final List stores); + /** + *

Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the storeMode is set to FromParent.

+ * @param inheritedStores values to be set + */ + + @JsonIgnore + public void setInheritedStores(final StoreKeyReference... inheritedStores); + + /** + *

Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the storeMode is set to FromParent.

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

Defines whether the Stores of the Business Unit are set directly on the Business Unit or are inherited from a parent.

* @param storeMode value to be set @@ -514,6 +537,11 @@ public static BusinessUnit deepCopy(@Nullable final BusinessUnit template) { .map(com.commercetools.api.models.store.StoreKeyReference::deepCopy) .collect(Collectors.toList())) .orElse(null)); + instance.setInheritedStores(Optional.ofNullable(template.getInheritedStores()) + .map(t -> t.stream() + .map(com.commercetools.api.models.store.StoreKeyReference::deepCopy) + .collect(Collectors.toList())) + .orElse(null)); instance.setStoreMode(template.getStoreMode()); instance.setName(template.getName()); instance.setContactEmail(template.getContactEmail()); diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/BusinessUnitImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/BusinessUnitImpl.java index a80b8869be..4a62390b98 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/BusinessUnitImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/BusinessUnitImpl.java @@ -40,6 +40,8 @@ public class BusinessUnitImpl implements BusinessUnit, ModelBase { private java.util.List stores; + private java.util.List inheritedStores; + private com.commercetools.api.models.business_unit.BusinessUnitStoreMode storeMode; private com.commercetools.api.models.business_unit.BusinessUnitType unitType; @@ -84,6 +86,7 @@ public class BusinessUnitImpl implements BusinessUnit, ModelBase { @JsonProperty("key") final String key, @JsonProperty("status") final com.commercetools.api.models.business_unit.BusinessUnitStatus status, @JsonProperty("stores") final java.util.List stores, + @JsonProperty("inheritedStores") final java.util.List inheritedStores, @JsonProperty("storeMode") final com.commercetools.api.models.business_unit.BusinessUnitStoreMode storeMode, @JsonProperty("unitType") final com.commercetools.api.models.business_unit.BusinessUnitType unitType, @JsonProperty("name") final String name, @JsonProperty("contactEmail") final String contactEmail, @@ -108,6 +111,7 @@ public class BusinessUnitImpl implements BusinessUnit, ModelBase { this.key = key; this.status = status; this.stores = stores; + this.inheritedStores = inheritedStores; this.storeMode = storeMode; this.unitType = unitType; this.name = name; @@ -206,6 +210,14 @@ public java.util.List getS return this.stores; } + /** + *

Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the storeMode is set to FromParent.

+ */ + + public java.util.List getInheritedStores() { + return this.inheritedStores; + } + /** *

Defines whether the Stores of the Business Unit are set directly on the Business Unit or are inherited from a parent.

*/ @@ -374,6 +386,15 @@ public void setStores(final java.util.List(Arrays.asList(inheritedStores)); + } + + public void setInheritedStores( + final java.util.List inheritedStores) { + this.inheritedStores = inheritedStores; + } + public void setStoreMode(final com.commercetools.api.models.business_unit.BusinessUnitStoreMode storeMode) { this.storeMode = storeMode; } @@ -478,6 +499,7 @@ public boolean equals(Object o) { .append(key, that.key) .append(status, that.status) .append(stores, that.stores) + .append(inheritedStores, that.inheritedStores) .append(storeMode, that.storeMode) .append(unitType, that.unitType) .append(name, that.name) @@ -503,6 +525,7 @@ public boolean equals(Object o) { .append(key, that.key) .append(status, that.status) .append(stores, that.stores) + .append(inheritedStores, that.inheritedStores) .append(storeMode, that.storeMode) .append(unitType, that.unitType) .append(name, that.name) @@ -533,6 +556,7 @@ public int hashCode() { .append(key) .append(status) .append(stores) + .append(inheritedStores) .append(storeMode) .append(unitType) .append(name) @@ -563,6 +587,7 @@ public String toString() { .append("key", key) .append("status", status) .append("stores", stores) + .append("inheritedStores", inheritedStores) .append("storeMode", storeMode) .append("unitType", unitType) .append("name", name) diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/Company.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/Company.java index 79c69588d9..c114d3bfbb 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/Company.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/Company.java @@ -118,6 +118,7 @@ public static Company of(final Company template) { instance.setKey(template.getKey()); instance.setStatus(template.getStatus()); instance.setStores(template.getStores()); + instance.setInheritedStores(template.getInheritedStores()); instance.setStoreMode(template.getStoreMode()); instance.setName(template.getName()); instance.setContactEmail(template.getContactEmail()); @@ -161,6 +162,11 @@ public static Company deepCopy(@Nullable final Company template) { .map(com.commercetools.api.models.store.StoreKeyReference::deepCopy) .collect(Collectors.toList())) .orElse(null)); + instance.setInheritedStores(Optional.ofNullable(template.getInheritedStores()) + .map(t -> t.stream() + .map(com.commercetools.api.models.store.StoreKeyReference::deepCopy) + .collect(Collectors.toList())) + .orElse(null)); instance.setStoreMode(template.getStoreMode()); instance.setName(template.getName()); instance.setContactEmail(template.getContactEmail()); diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/CompanyBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/CompanyBuilder.java index 251053d299..c61c008185 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/CompanyBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/CompanyBuilder.java @@ -57,6 +57,9 @@ public class CompanyBuilder implements Builder { @Nullable private java.util.List stores; + @Nullable + private java.util.List inheritedStores; + private com.commercetools.api.models.business_unit.BusinessUnitStoreMode storeMode; private String name; @@ -333,6 +336,97 @@ public CompanyBuilder setStores( return stores(builder.apply(com.commercetools.api.models.store.StoreKeyReferenceBuilder.of())); } + /** + *

Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the storeMode is set to FromParent.

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

Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the storeMode is set to FromParent.

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

Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the storeMode is set to FromParent.

+ * @param inheritedStores value to be set + * @return Builder + */ + + public CompanyBuilder plusInheritedStores( + @Nullable final com.commercetools.api.models.store.StoreKeyReference... inheritedStores) { + if (this.inheritedStores == null) { + this.inheritedStores = new ArrayList<>(); + } + this.inheritedStores.addAll(Arrays.asList(inheritedStores)); + return this; + } + + /** + *

Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the storeMode is set to FromParent.

+ * @param builder function to build the inheritedStores value + * @return Builder + */ + + public CompanyBuilder plusInheritedStores( + Function builder) { + if (this.inheritedStores == null) { + this.inheritedStores = new ArrayList<>(); + } + this.inheritedStores + .add(builder.apply(com.commercetools.api.models.store.StoreKeyReferenceBuilder.of()).build()); + return this; + } + + /** + *

Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the storeMode is set to FromParent.

+ * @param builder function to build the inheritedStores value + * @return Builder + */ + + public CompanyBuilder withInheritedStores( + Function builder) { + this.inheritedStores = new ArrayList<>(); + this.inheritedStores + .add(builder.apply(com.commercetools.api.models.store.StoreKeyReferenceBuilder.of()).build()); + return this; + } + + /** + *

Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the storeMode is set to FromParent.

+ * @param builder function to build the inheritedStores value + * @return Builder + */ + + public CompanyBuilder addInheritedStores( + Function builder) { + return plusInheritedStores(builder.apply(com.commercetools.api.models.store.StoreKeyReferenceBuilder.of())); + } + + /** + *

Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the storeMode is set to FromParent.

+ * @param builder function to build the inheritedStores value + * @return Builder + */ + + public CompanyBuilder setInheritedStores( + Function builder) { + return inheritedStores(builder.apply(com.commercetools.api.models.store.StoreKeyReferenceBuilder.of())); + } + /** *

The value of this field is always Explicit because a Company cannot have a parent Business Unit that Stores can be inherited from.

* @param storeMode value to be set @@ -948,6 +1042,16 @@ public java.util.List getS return this.stores; } + /** + *

Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the storeMode is set to FromParent.

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

The value of this field is always Explicit because a Company cannot have a parent Business Unit that Stores can be inherited from.

* @return storeMode @@ -1110,9 +1214,9 @@ public Company build() { Objects.requireNonNull(topLevelUnit, Company.class + ": topLevelUnit is missing"); Objects.requireNonNull(approvalRuleMode, Company.class + ": approvalRuleMode is missing"); return new CompanyImpl(id, version, createdAt, lastModifiedAt, lastModifiedBy, createdBy, key, status, stores, - storeMode, name, contactEmail, custom, addresses, shippingAddressIds, defaultShippingAddressId, - billingAddressIds, defaultBillingAddressId, associateMode, associates, inheritedAssociates, parentUnit, - topLevelUnit, approvalRuleMode); + inheritedStores, storeMode, name, contactEmail, custom, addresses, shippingAddressIds, + defaultShippingAddressId, billingAddressIds, defaultBillingAddressId, associateMode, associates, + inheritedAssociates, parentUnit, topLevelUnit, approvalRuleMode); } /** @@ -1121,9 +1225,9 @@ public Company build() { */ public Company buildUnchecked() { return new CompanyImpl(id, version, createdAt, lastModifiedAt, lastModifiedBy, createdBy, key, status, stores, - storeMode, name, contactEmail, custom, addresses, shippingAddressIds, defaultShippingAddressId, - billingAddressIds, defaultBillingAddressId, associateMode, associates, inheritedAssociates, parentUnit, - topLevelUnit, approvalRuleMode); + inheritedStores, storeMode, name, contactEmail, custom, addresses, shippingAddressIds, + defaultShippingAddressId, billingAddressIds, defaultBillingAddressId, associateMode, associates, + inheritedAssociates, parentUnit, topLevelUnit, approvalRuleMode); } /** @@ -1150,6 +1254,7 @@ public static CompanyBuilder of(final Company template) { builder.key = template.getKey(); builder.status = template.getStatus(); builder.stores = template.getStores(); + builder.inheritedStores = template.getInheritedStores(); builder.storeMode = template.getStoreMode(); builder.name = template.getName(); builder.contactEmail = template.getContactEmail(); diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/CompanyImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/CompanyImpl.java index 0a73c9a459..4f643aa9e4 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/CompanyImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/CompanyImpl.java @@ -40,6 +40,8 @@ public class CompanyImpl implements Company, ModelBase { private java.util.List stores; + private java.util.List inheritedStores; + private com.commercetools.api.models.business_unit.BusinessUnitStoreMode storeMode; private com.commercetools.api.models.business_unit.BusinessUnitType unitType; @@ -84,6 +86,7 @@ public class CompanyImpl implements Company, ModelBase { @JsonProperty("key") final String key, @JsonProperty("status") final com.commercetools.api.models.business_unit.BusinessUnitStatus status, @JsonProperty("stores") final java.util.List stores, + @JsonProperty("inheritedStores") final java.util.List inheritedStores, @JsonProperty("storeMode") final com.commercetools.api.models.business_unit.BusinessUnitStoreMode storeMode, @JsonProperty("name") final String name, @JsonProperty("contactEmail") final String contactEmail, @JsonProperty("custom") final com.commercetools.api.models.type.CustomFields custom, @@ -107,6 +110,7 @@ public class CompanyImpl implements Company, ModelBase { this.key = key; this.status = status; this.stores = stores; + this.inheritedStores = inheritedStores; this.storeMode = storeMode; this.name = name; this.contactEmail = contactEmail; @@ -206,6 +210,14 @@ public java.util.List getS return this.stores; } + /** + *

Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the storeMode is set to FromParent.

+ */ + + public java.util.List getInheritedStores() { + return this.inheritedStores; + } + /** *

The value of this field is always Explicit because a Company cannot have a parent Business Unit that Stores can be inherited from.

*/ @@ -374,6 +386,15 @@ public void setStores(final java.util.List(Arrays.asList(inheritedStores)); + } + + public void setInheritedStores( + final java.util.List inheritedStores) { + this.inheritedStores = inheritedStores; + } + public void setStoreMode(final com.commercetools.api.models.business_unit.BusinessUnitStoreMode storeMode) { this.storeMode = storeMode; } @@ -478,6 +499,7 @@ public boolean equals(Object o) { .append(key, that.key) .append(status, that.status) .append(stores, that.stores) + .append(inheritedStores, that.inheritedStores) .append(storeMode, that.storeMode) .append(unitType, that.unitType) .append(name, that.name) @@ -503,6 +525,7 @@ public boolean equals(Object o) { .append(key, that.key) .append(status, that.status) .append(stores, that.stores) + .append(inheritedStores, that.inheritedStores) .append(storeMode, that.storeMode) .append(unitType, that.unitType) .append(name, that.name) @@ -533,6 +556,7 @@ public int hashCode() { .append(key) .append(status) .append(stores) + .append(inheritedStores) .append(storeMode) .append(unitType) .append(name) @@ -563,6 +587,7 @@ public String toString() { .append("key", key) .append("status", status) .append("stores", stores) + .append("inheritedStores", inheritedStores) .append("storeMode", storeMode) .append("unitType", unitType) .append("name", name) diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/Division.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/Division.java index 4a3d55f8aa..c6e20dcebd 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/Division.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/Division.java @@ -136,6 +136,7 @@ public static Division of(final Division template) { instance.setKey(template.getKey()); instance.setStatus(template.getStatus()); instance.setStores(template.getStores()); + instance.setInheritedStores(template.getInheritedStores()); instance.setStoreMode(template.getStoreMode()); instance.setName(template.getName()); instance.setContactEmail(template.getContactEmail()); @@ -179,6 +180,11 @@ public static Division deepCopy(@Nullable final Division template) { .map(com.commercetools.api.models.store.StoreKeyReference::deepCopy) .collect(Collectors.toList())) .orElse(null)); + instance.setInheritedStores(Optional.ofNullable(template.getInheritedStores()) + .map(t -> t.stream() + .map(com.commercetools.api.models.store.StoreKeyReference::deepCopy) + .collect(Collectors.toList())) + .orElse(null)); instance.setStoreMode(template.getStoreMode()); instance.setName(template.getName()); instance.setContactEmail(template.getContactEmail()); diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/DivisionBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/DivisionBuilder.java index 7e9b059223..b7423e5b13 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/DivisionBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/DivisionBuilder.java @@ -58,6 +58,9 @@ public class DivisionBuilder implements Builder { @Nullable private java.util.List stores; + @Nullable + private java.util.List inheritedStores; + private com.commercetools.api.models.business_unit.BusinessUnitStoreMode storeMode; private String name; @@ -333,6 +336,97 @@ public DivisionBuilder setStores( return stores(builder.apply(com.commercetools.api.models.store.StoreKeyReferenceBuilder.of())); } + /** + *

Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the storeMode is set to FromParent.

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

Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the storeMode is set to FromParent.

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

Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the storeMode is set to FromParent.

+ * @param inheritedStores value to be set + * @return Builder + */ + + public DivisionBuilder plusInheritedStores( + @Nullable final com.commercetools.api.models.store.StoreKeyReference... inheritedStores) { + if (this.inheritedStores == null) { + this.inheritedStores = new ArrayList<>(); + } + this.inheritedStores.addAll(Arrays.asList(inheritedStores)); + return this; + } + + /** + *

Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the storeMode is set to FromParent.

+ * @param builder function to build the inheritedStores value + * @return Builder + */ + + public DivisionBuilder plusInheritedStores( + Function builder) { + if (this.inheritedStores == null) { + this.inheritedStores = new ArrayList<>(); + } + this.inheritedStores + .add(builder.apply(com.commercetools.api.models.store.StoreKeyReferenceBuilder.of()).build()); + return this; + } + + /** + *

Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the storeMode is set to FromParent.

+ * @param builder function to build the inheritedStores value + * @return Builder + */ + + public DivisionBuilder withInheritedStores( + Function builder) { + this.inheritedStores = new ArrayList<>(); + this.inheritedStores + .add(builder.apply(com.commercetools.api.models.store.StoreKeyReferenceBuilder.of()).build()); + return this; + } + + /** + *

Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the storeMode is set to FromParent.

+ * @param builder function to build the inheritedStores value + * @return Builder + */ + + public DivisionBuilder addInheritedStores( + Function builder) { + return plusInheritedStores(builder.apply(com.commercetools.api.models.store.StoreKeyReferenceBuilder.of())); + } + + /** + *

Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the storeMode is set to FromParent.

+ * @param builder function to build the inheritedStores value + * @return Builder + */ + + public DivisionBuilder setInheritedStores( + Function builder) { + return inheritedStores(builder.apply(com.commercetools.api.models.store.StoreKeyReferenceBuilder.of())); + } + /** *

Defines whether the Stores of the Division are set explicitly or inherited from a parent Business Unit.

* @param storeMode value to be set @@ -948,6 +1042,16 @@ public java.util.List getS return this.stores; } + /** + *

Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the storeMode is set to FromParent.

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

Defines whether the Stores of the Division are set explicitly or inherited from a parent Business Unit.

* @return storeMode @@ -1110,9 +1214,9 @@ public Division build() { Objects.requireNonNull(topLevelUnit, Division.class + ": topLevelUnit is missing"); Objects.requireNonNull(approvalRuleMode, Division.class + ": approvalRuleMode is missing"); return new DivisionImpl(id, version, createdAt, lastModifiedAt, lastModifiedBy, createdBy, key, status, stores, - storeMode, name, contactEmail, custom, addresses, shippingAddressIds, defaultShippingAddressId, - billingAddressIds, defaultBillingAddressId, associateMode, associates, inheritedAssociates, parentUnit, - topLevelUnit, approvalRuleMode); + inheritedStores, storeMode, name, contactEmail, custom, addresses, shippingAddressIds, + defaultShippingAddressId, billingAddressIds, defaultBillingAddressId, associateMode, associates, + inheritedAssociates, parentUnit, topLevelUnit, approvalRuleMode); } /** @@ -1121,9 +1225,9 @@ public Division build() { */ public Division buildUnchecked() { return new DivisionImpl(id, version, createdAt, lastModifiedAt, lastModifiedBy, createdBy, key, status, stores, - storeMode, name, contactEmail, custom, addresses, shippingAddressIds, defaultShippingAddressId, - billingAddressIds, defaultBillingAddressId, associateMode, associates, inheritedAssociates, parentUnit, - topLevelUnit, approvalRuleMode); + inheritedStores, storeMode, name, contactEmail, custom, addresses, shippingAddressIds, + defaultShippingAddressId, billingAddressIds, defaultBillingAddressId, associateMode, associates, + inheritedAssociates, parentUnit, topLevelUnit, approvalRuleMode); } /** @@ -1150,6 +1254,7 @@ public static DivisionBuilder of(final Division template) { builder.key = template.getKey(); builder.status = template.getStatus(); builder.stores = template.getStores(); + builder.inheritedStores = template.getInheritedStores(); builder.storeMode = template.getStoreMode(); builder.name = template.getName(); builder.contactEmail = template.getContactEmail(); diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/DivisionImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/DivisionImpl.java index c189c0ad69..174e4b7ba4 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/DivisionImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/DivisionImpl.java @@ -40,6 +40,8 @@ public class DivisionImpl implements Division, ModelBase { private java.util.List stores; + private java.util.List inheritedStores; + private com.commercetools.api.models.business_unit.BusinessUnitStoreMode storeMode; private com.commercetools.api.models.business_unit.BusinessUnitType unitType; @@ -84,6 +86,7 @@ public class DivisionImpl implements Division, ModelBase { @JsonProperty("key") final String key, @JsonProperty("status") final com.commercetools.api.models.business_unit.BusinessUnitStatus status, @JsonProperty("stores") final java.util.List stores, + @JsonProperty("inheritedStores") final java.util.List inheritedStores, @JsonProperty("storeMode") final com.commercetools.api.models.business_unit.BusinessUnitStoreMode storeMode, @JsonProperty("name") final String name, @JsonProperty("contactEmail") final String contactEmail, @JsonProperty("custom") final com.commercetools.api.models.type.CustomFields custom, @@ -107,6 +110,7 @@ public class DivisionImpl implements Division, ModelBase { this.key = key; this.status = status; this.stores = stores; + this.inheritedStores = inheritedStores; this.storeMode = storeMode; this.name = name; this.contactEmail = contactEmail; @@ -206,6 +210,14 @@ public java.util.List getS return this.stores; } + /** + *

Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the storeMode is set to FromParent.

+ */ + + public java.util.List getInheritedStores() { + return this.inheritedStores; + } + /** *

Defines whether the Stores of the Division are set explicitly or inherited from a parent Business Unit.

*/ @@ -374,6 +386,15 @@ public void setStores(final java.util.List(Arrays.asList(inheritedStores)); + } + + public void setInheritedStores( + final java.util.List inheritedStores) { + this.inheritedStores = inheritedStores; + } + public void setStoreMode(final com.commercetools.api.models.business_unit.BusinessUnitStoreMode storeMode) { this.storeMode = storeMode; } @@ -478,6 +499,7 @@ public boolean equals(Object o) { .append(key, that.key) .append(status, that.status) .append(stores, that.stores) + .append(inheritedStores, that.inheritedStores) .append(storeMode, that.storeMode) .append(unitType, that.unitType) .append(name, that.name) @@ -503,6 +525,7 @@ public boolean equals(Object o) { .append(key, that.key) .append(status, that.status) .append(stores, that.stores) + .append(inheritedStores, that.inheritedStores) .append(storeMode, that.storeMode) .append(unitType, that.unitType) .append(name, that.name) @@ -533,6 +556,7 @@ public int hashCode() { .append(key) .append(status) .append(stores) + .append(inheritedStores) .append(storeMode) .append(unitType) .append(name) @@ -563,6 +587,7 @@ public String toString() { .append("key", key) .append("status", status) .append("stores", stores) + .append("inheritedStores", inheritedStores) .append("storeMode", storeMode) .append("unitType", unitType) .append("name", name) diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit/BusinessUnitQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit/BusinessUnitQueryBuilderDsl.java index 918b6a3f35..51c2099813 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit/BusinessUnitQueryBuilderDsl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit/BusinessUnitQueryBuilderDsl.java @@ -78,6 +78,20 @@ public CollectionPredicateBuilder stores() { p -> new CombinationQueryPredicate<>(p, BusinessUnitQueryBuilderDsl::of)); } + public CombinationQueryPredicate inheritedStores( + Function> fn) { + return new CombinationQueryPredicate<>(ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("inheritedStores")) + .inner(fn.apply(com.commercetools.api.predicates.query.store.StoreKeyReferenceQueryBuilderDsl.of())), + BusinessUnitQueryBuilderDsl::of); + } + + public CollectionPredicateBuilder inheritedStores() { + return new CollectionPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("inheritedStores")), + p -> new CombinationQueryPredicate<>(p, BusinessUnitQueryBuilderDsl::of)); + } + public StringComparisonPredicateBuilder storeMode() { return new StringComparisonPredicateBuilder<>( BinaryQueryPredicate.of().left(new ConstantQueryPredicate("storeMode")), diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit/CompanyQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit/CompanyQueryBuilderDsl.java index 30e81ee49b..5e0ee1031b 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit/CompanyQueryBuilderDsl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit/CompanyQueryBuilderDsl.java @@ -78,6 +78,20 @@ public CollectionPredicateBuilder stores() { p -> new CombinationQueryPredicate<>(p, CompanyQueryBuilderDsl::of)); } + public CombinationQueryPredicate inheritedStores( + Function> fn) { + return new CombinationQueryPredicate<>(ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("inheritedStores")) + .inner(fn.apply(com.commercetools.api.predicates.query.store.StoreKeyReferenceQueryBuilderDsl.of())), + CompanyQueryBuilderDsl::of); + } + + public CollectionPredicateBuilder inheritedStores() { + return new CollectionPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("inheritedStores")), + p -> new CombinationQueryPredicate<>(p, CompanyQueryBuilderDsl::of)); + } + public StringComparisonPredicateBuilder storeMode() { return new StringComparisonPredicateBuilder<>( BinaryQueryPredicate.of().left(new ConstantQueryPredicate("storeMode")), diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit/DivisionQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit/DivisionQueryBuilderDsl.java index d8255b454f..9927957aaf 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit/DivisionQueryBuilderDsl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/business_unit/DivisionQueryBuilderDsl.java @@ -78,6 +78,20 @@ public CollectionPredicateBuilder stores() { p -> new CombinationQueryPredicate<>(p, DivisionQueryBuilderDsl::of)); } + public CombinationQueryPredicate inheritedStores( + Function> fn) { + return new CombinationQueryPredicate<>(ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("inheritedStores")) + .inner(fn.apply(com.commercetools.api.predicates.query.store.StoreKeyReferenceQueryBuilderDsl.of())), + DivisionQueryBuilderDsl::of); + } + + public CollectionPredicateBuilder inheritedStores() { + return new CollectionPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("inheritedStores")), + p -> new CombinationQueryPredicate<>(p, DivisionQueryBuilderDsl::of)); + } + public StringComparisonPredicateBuilder storeMode() { return new StringComparisonPredicateBuilder<>( BinaryQueryPredicate.of().left(new ConstantQueryPredicate("storeMode")), diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDTest.java new file mode 100644 index 0000000000..59ba804374 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDTest.java @@ -0,0 +1,185 @@ + +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 ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsByIDTest { + 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") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withId("test_ID") + .get() + .withExpand("expand") + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/business-units/test_ID?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withId("test_ID") + .get() + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/business-units/test_ID", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withId("test_ID") + .head() + .createHttpRequest(), + "head", "test_projectKey/in-store/key=test_storeKey/business-units/test_ID", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withId("test_ID") + .post(com.commercetools.api.models.business_unit.BusinessUnitUpdate.of()) + .withExpand("expand") + .createHttpRequest(), + "post", "test_projectKey/in-store/key=test_storeKey/business-units/test_ID?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withId("test_ID") + .post(com.commercetools.api.models.business_unit.BusinessUnitUpdate.of()) + .createHttpRequest(), + "post", "test_projectKey/in-store/key=test_storeKey/business-units/test_ID", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withId("test_ID") + .delete() + .withVersion(2) + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/business-units/test_ID?version=2", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withId("test_ID") + .delete() + .withExpand("expand") + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/business-units/test_ID?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withId("test_ID") + .delete() + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/business-units/test_ID", } }; + } + + @DataProvider + public static Object[][] executeMethodParameters() { + return new Object[][] { + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withId("test_ID") + .get() + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withId("test_ID") + .get(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withId("test_ID") + .head(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withId("test_ID") + .post(com.commercetools.api.models.business_unit.BusinessUnitUpdate.of()) + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withId("test_ID") + .post(com.commercetools.api.models.business_unit.BusinessUnitUpdate.of()), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withId("test_ID") + .delete() + .withVersion(2), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withId("test_ID") + .delete() + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withId("test_ID") + .delete(), } }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyTest.java new file mode 100644 index 0000000000..8a191f4449 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyTest.java @@ -0,0 +1,188 @@ + +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 ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsKeyByKeyTest { + 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") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withKey("test_key") + .get() + .withExpand("expand") + .createHttpRequest(), + "get", + "test_projectKey/in-store/key=test_storeKey/business-units/key=test_key?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withKey("test_key") + .get() + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/business-units/key=test_key", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withKey("test_key") + .head() + .createHttpRequest(), + "head", "test_projectKey/in-store/key=test_storeKey/business-units/key=test_key", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withKey("test_key") + .post(com.commercetools.api.models.business_unit.BusinessUnitUpdate.of()) + .withExpand("expand") + .createHttpRequest(), + "post", + "test_projectKey/in-store/key=test_storeKey/business-units/key=test_key?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withKey("test_key") + .post(com.commercetools.api.models.business_unit.BusinessUnitUpdate.of()) + .createHttpRequest(), + "post", "test_projectKey/in-store/key=test_storeKey/business-units/key=test_key", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withKey("test_key") + .delete() + .withVersion(2) + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/business-units/key=test_key?version=2", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withKey("test_key") + .delete() + .withExpand("expand") + .createHttpRequest(), + "delete", + "test_projectKey/in-store/key=test_storeKey/business-units/key=test_key?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withKey("test_key") + .delete() + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/business-units/key=test_key", } }; + } + + @DataProvider + public static Object[][] executeMethodParameters() { + return new Object[][] { + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withKey("test_key") + .get() + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withKey("test_key") + .get(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withKey("test_key") + .head(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withKey("test_key") + .post(com.commercetools.api.models.business_unit.BusinessUnitUpdate.of()) + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withKey("test_key") + .post(com.commercetools.api.models.business_unit.BusinessUnitUpdate.of()), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withKey("test_key") + .delete() + .withVersion(2), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withKey("test_key") + .delete() + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .withKey("test_key") + .delete(), } }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsTest.java new file mode 100644 index 0000000000..312808ffe0 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsTest.java @@ -0,0 +1,223 @@ + +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 ByProjectKeyInStoreKeyByStoreKeyBusinessUnitsTest { + 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") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .get() + .withExpand("expand") + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/business-units?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .get() + .withSort("sort") + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/business-units?sort=sort", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .get() + .withLimit(7) + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/business-units?limit=7", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .get() + .withOffset(3) + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/business-units?offset=3", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .get() + .withWithTotal(true) + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/business-units?withTotal=true", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .get() + .withWhere("where") + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/business-units?where=where", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .get() + .withPredicateVar("varName", "var.varName") + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/business-units?var.varName=var.varName", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .get() + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/business-units", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .head() + .withWhere("where") + .createHttpRequest(), + "head", "test_projectKey/in-store/key=test_storeKey/business-units?where=where", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .head() + .createHttpRequest(), + "head", "test_projectKey/in-store/key=test_storeKey/business-units", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .post(com.commercetools.api.models.business_unit.CompanyDraft.of()) + .withExpand("expand") + .createHttpRequest(), + "post", "test_projectKey/in-store/key=test_storeKey/business-units?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .post(com.commercetools.api.models.business_unit.CompanyDraft.of()) + .createHttpRequest(), + "post", "test_projectKey/in-store/key=test_storeKey/business-units", } }; + } + + @DataProvider + public static Object[][] executeMethodParameters() { + return new Object[][] { + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .get() + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .get() + .withSort("sort"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .get() + .withLimit(7), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .get() + .withOffset(3), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .get() + .withWithTotal(true), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .get() + .withWhere("where"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .get() + .withPredicateVar("varName", "var.varName"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .get(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .head() + .withWhere("where"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .head(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .post(com.commercetools.api.models.business_unit.CompanyDraft.of()) + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .businessUnits() + .post(com.commercetools.api.models.business_unit.CompanyDraft.of()), } }; + } +} diff --git a/references.txt b/references.txt index 6753345723..6019e027de 100644 --- a/references.txt +++ b/references.txt @@ -357,3 +357,4 @@ b7b82f5a701908239fcf39781bcbfa80823c9fa0 cc1732f88ea3dc336358ff9f39cda9d5271cf7c2 d042ef009240bb55e9b5b18003aba682ec9baa98 7d500b75265e9fdc6c5a47acb4e1df29523f707c +e3d5bc9cb69146c5d1dd755ed5e8cf2f54566b3a