diff --git a/changes.md b/changes.md index 281095559da..0ffdef77b3b 100644 --- a/changes.md +++ b/changes.md @@ -1,5 +1,28 @@ **Api changes** +
+Added Property(s) + +- added property `store` to type `StagedQuote` +
+ + +
+Added Resource(s) + +- added resource `/{projectKey}/in-store/key={storeKey}/quote-requests` +- added resource `/{projectKey}/in-store/key={storeKey}/staged-quotes` +- added resource `/{projectKey}/in-store/key={storeKey}/quotes` +- added resource `/{projectKey}/in-store/key={storeKey}/orders/quotes` +- added resource `/{projectKey}/in-store/key={storeKey}/quote-requests/key={key}` +- added resource `/{projectKey}/in-store/key={storeKey}/quote-requests/{ID}` +- added resource `/{projectKey}/in-store/key={storeKey}/staged-quotes/key={key}` +- added resource `/{projectKey}/in-store/key={storeKey}/staged-quotes/{ID}` +- added resource `/{projectKey}/in-store/key={storeKey}/quotes/key={key}` +- added resource `/{projectKey}/in-store/key={storeKey}/quotes/{ID}` +
+ +
Removed Enum(s) @@ -15,6 +38,46 @@
+
+Added Method(s) + +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().quoteRequests().get()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().quoteRequests().head()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().quoteRequests().post()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().stagedQuotes().get()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().stagedQuotes().head()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().stagedQuotes().post()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().quotes().get()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().quotes().head()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().quotes().post()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().orders().orderQuote().post()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().quoteRequests().withKey().get()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().quoteRequests().withKey().head()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().quoteRequests().withKey().post()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().quoteRequests().withKey().delete()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().quoteRequests().withId().get()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().quoteRequests().withId().head()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().quoteRequests().withId().post()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().quoteRequests().withId().delete()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().stagedQuotes().withKey().get()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().stagedQuotes().withKey().head()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().stagedQuotes().withKey().post()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().stagedQuotes().withKey().delete()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().stagedQuotes().withId().get()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().stagedQuotes().withId().head()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().stagedQuotes().withId().post()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().stagedQuotes().withId().delete()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().quotes().withKey().get()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().quotes().withKey().head()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().quotes().withKey().post()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().quotes().withKey().delete()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().quotes().withId().get()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().quotes().withId().head()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().quotes().withId().post()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().quotes().withId().delete()` +
+ +
Removed QueryParameter(s) 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 9baba54220a..ae9efc4660f 100644 --- a/commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls +++ b/commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls @@ -4624,6 +4624,27 @@ type InStore implements CartDiscountQueryInterface & CartQueryInterface & Custom "Queries with specified Product key" productKey: String): ProductTailoring productTailoringList(where: String, sort: [String!], limit: Int, offset: Int): ProductTailoringQueryResult! + quoteRequest( + "Queries with specified ID" + id: String, + + "Queries with specified key" + key: String): QuoteRequest + quoteRequests(where: String, sort: [String!], limit: Int, offset: Int): QuoteRequestQueryResult! + stagedQuote( + "Queries with specified ID" + id: String, + + "Queries with specified key" + key: String): StagedQuote + stagedQuotes(where: String, sort: [String!], limit: Int, offset: Int): StagedQuoteQueryResult! + quote( + "Queries with specified ID" + id: String, + + "Queries with specified key" + key: String): Quote + quotes(where: String, sort: [String!], limit: Int, offset: Int): QuoteQueryResult! } type InStoreMe implements MeQueryInterface & CartQueryInterface & ActiveCartInterface & OrderQueryInterface & ShoppingListQueryInterface { @@ -5867,6 +5888,9 @@ type Mutation { storeKey: KeyReferenceInput): Order createOrderFromQuote(draft: OrderQuoteCommand!, + "The mutation is only performed if the resource is part of the store. Can be used with store-specific OAuth permissions." + storeKey: KeyReferenceInput, + "Create/modify entity as an associate in business-unit." asAssociate: AsAssociateArgument): Order @@ -6091,12 +6115,18 @@ type Mutation { createQuoteRequest(draft: QuoteRequestDraft!, "Create/modify entity as an associate in business-unit." - asAssociate: AsAssociateArgument): QuoteRequest + 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): QuoteRequest updateQuoteRequest(version: Long!, "Create/modify entity as an associate in business-unit." asAssociate: AsAssociateArgument, actions: [QuoteRequestUpdateAction!]!, + "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, @@ -6104,6 +6134,9 @@ type Mutation { key: String): QuoteRequest deleteQuoteRequest(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, @@ -6117,9 +6150,15 @@ type Mutation { "Queries with specified key" key: String): QuoteRequest - createStagedQuote(draft: StagedQuoteDraft!): StagedQuote + createStagedQuote(draft: StagedQuoteDraft!, + + "The mutation is only performed if the resource is part of the store. Can be used with store-specific OAuth permissions." + storeKey: KeyReferenceInput): StagedQuote updateStagedQuote(version: Long!, actions: [StagedQuoteUpdateAction!]!, + "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, @@ -6127,17 +6166,26 @@ type Mutation { key: String): StagedQuote deleteStagedQuote(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, "Queries with specified key" key: String): StagedQuote - createQuote(draft: QuoteDraft!): Quote + createQuote(draft: QuoteDraft!, + + "The mutation is only performed if the resource is part of the store. Can be used with store-specific OAuth permissions." + storeKey: KeyReferenceInput): Quote updateQuote(version: Long!, actions: [QuoteUpdateAction!]!, "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, @@ -6145,6 +6193,9 @@ type Mutation { key: String): Quote deleteQuote(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, @@ -13195,6 +13246,8 @@ type StagedQuote implements Versioned { businessUnit: BusinessUnit businessUnitRef: KeyReference purchaseOrderNumber: String + storeRef: KeyReference + store: Store id: String! version: Long! createdAt: DateTime! diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPost.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPost.java new file mode 100644 index 00000000000..1e353f0b9c1 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPost.java @@ -0,0 +1,150 @@ + +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; + +/** + *

Creating an Order produces the OrderCreated Message.

+ *

Specific Error Codes:

+ * + * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .orders()
+ *            .orderQuote()
+ *            .post(null)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPost extends + TypeBodyApiMethod + implements com.commercetools.api.client.ErrorableTrait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String storeKey; + + private com.commercetools.api.models.order.OrderFromQuoteDraft orderFromQuoteDraft; + + public ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPost(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, com.commercetools.api.models.order.OrderFromQuoteDraft orderFromQuoteDraft) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.orderFromQuoteDraft = orderFromQuoteDraft; + } + + public ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPost(ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPost t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.orderFromQuoteDraft = t.orderFromQuoteDraft; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/orders/quotes", this.projectKey, 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(orderFromQuoteDraft))); + + } + + @Override + public ApiHttpResponse executeBlocking(final ApiHttpClient client, + final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.order.Order.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.order.Order.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getStoreKey() { + return this.storeKey; + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setStoreKey(final String storeKey) { + this.storeKey = storeKey; + } + + public com.commercetools.api.models.order.OrderFromQuoteDraft getBody() { + return orderFromQuoteDraft; + } + + public ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPost withBody( + com.commercetools.api.models.order.OrderFromQuoteDraft orderFromQuoteDraft) { + ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPost t = copy(); + t.orderFromQuoteDraft = orderFromQuoteDraft; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPost that = (ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPost) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(orderFromQuoteDraft, that.orderFromQuoteDraft) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(storeKey).append(orderFromQuoteDraft).toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPost copy() { + return new ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPost(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPostString.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPostString.java new file mode 100644 index 00000000000..30fba0797f8 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPostString.java @@ -0,0 +1,150 @@ + +package com.commercetools.api.client; + +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +import com.fasterxml.jackson.core.type.TypeReference; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + *

Creating an Order produces the OrderCreated Message.

+ *

Specific Error Codes:

+ *
    + *
  • OutOfStock
  • + *
  • PriceChanged
  • + *
  • InvalidItemShippingDetails
  • + *
  • InvalidOperation
  • + *
  • CountryNotConfiguredInStore
  • + *
+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .orders()
+ *            .orderQuote()
+ *            .post("")
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPostString extends + StringBodyApiMethod + implements com.commercetools.api.client.ErrorableTrait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String storeKey; + + private String orderFromQuoteDraft; + + public ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPostString(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String orderFromQuoteDraft) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.orderFromQuoteDraft = orderFromQuoteDraft; + } + + public ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPostString( + ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPostString t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.orderFromQuoteDraft = t.orderFromQuoteDraft; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/orders/quotes", this.projectKey, this.storeKey); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(), + orderFromQuoteDraft.getBytes(StandardCharsets.UTF_8)); + + } + + @Override + public ApiHttpResponse executeBlocking(final ApiHttpClient client, + final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.order.Order.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.order.Order.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getStoreKey() { + return this.storeKey; + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setStoreKey(final String storeKey) { + this.storeKey = storeKey; + } + + public String getBody() { + return orderFromQuoteDraft; + } + + public ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPostString withBody(String orderFromQuoteDraft) { + ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPostString t = copy(); + t.orderFromQuoteDraft = orderFromQuoteDraft; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPostString that = (ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPostString) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(orderFromQuoteDraft, that.orderFromQuoteDraft) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(storeKey).append(orderFromQuoteDraft).toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPostString copy() { + return new ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPostString(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesRequestBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesRequestBuilder.java new file mode 100644 index 00000000000..60ffdd2d669 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesRequestBuilder.java @@ -0,0 +1,39 @@ + +package com.commercetools.api.client; + +import java.util.function.UnaryOperator; + +import io.vrap.rmf.base.client.ApiHttpClient; +import io.vrap.rmf.base.client.utils.Generated; + +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesRequestBuilder { + + private final ApiHttpClient apiHttpClient; + private final String projectKey; + private final String storeKey; + + public ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesRequestBuilder(final ApiHttpClient apiHttpClient, + final String projectKey, final String storeKey) { + this.apiHttpClient = apiHttpClient; + this.projectKey = projectKey; + this.storeKey = storeKey; + } + + public ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPost post( + com.commercetools.api.models.order.OrderFromQuoteDraft orderFromQuoteDraft) { + return new ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPost(apiHttpClient, projectKey, storeKey, + orderFromQuoteDraft); + } + + public ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPostString post(final String orderFromQuoteDraft) { + return new ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPostString(apiHttpClient, projectKey, storeKey, + orderFromQuoteDraft); + } + + public ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesPost post( + UnaryOperator op) { + return post(op.apply(com.commercetools.api.models.order.OrderFromQuoteDraftBuilder.of()).build()); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyOrdersRequestBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyOrdersRequestBuilder.java index 8eec87f7b3f..d11719dcd18 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyOrdersRequestBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyOrdersRequestBuilder.java @@ -44,6 +44,10 @@ public ByProjectKeyInStoreKeyByStoreKeyOrdersPost post( return post(op.apply(com.commercetools.api.models.order.OrderFromCartDraftBuilder.of()).build()); } + public ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesRequestBuilder orderQuote() { + return new ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesRequestBuilder(apiHttpClient, projectKey, storeKey); + } + public ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberRequestBuilder withOrderNumber( String orderNumber) { return new ByProjectKeyInStoreKeyByStoreKeyOrdersOrderNumberByOrderNumberRequestBuilder(apiHttpClient, diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete.java new file mode 100644 index 00000000000..67488d60fdd --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete.java @@ -0,0 +1,409 @@ + +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}")
+ *            .quoteRequests()
+ *            .withId("{ID}")
+ *            .delete()
+ *            .withVersion(version)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete extends + TypeApiMethod + implements + com.commercetools.api.client.DataerasureTrait, + com.commercetools.api.client.VersionedTrait, + com.commercetools.api.client.ConflictingTrait, + com.commercetools.api.client.ExpandableTrait, + com.commercetools.api.client.ErrorableTrait, + com.commercetools.api.client.Deprecatable200Trait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String storeKey; + private String ID; + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String ID) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.ID = ID; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete( + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete 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/quote-requests/%s", this.projectKey, this.storeKey, + 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.quote_request.QuoteRequest.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.quote_request.QuoteRequest.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getStoreKey() { + return this.storeKey; + } + + public String getID() { + return this.ID; + } + + public List getDataErasure() { + return this.getQueryParam("dataErasure"); + } + + public List getVersion() { + return this.getQueryParam("version"); + } + + public List getExpand() { + return this.getQueryParam("expand"); + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setStoreKey(final String storeKey) { + this.storeKey = storeKey; + } + + public void setID(final String ID) { + this.ID = ID; + } + + /** + * set dataErasure with the specified value + * @param dataErasure value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete withDataErasure(final TValue dataErasure) { + return copy().withQueryParam("dataErasure", dataErasure); + } + + /** + * add additional dataErasure query parameter + * @param dataErasure value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete addDataErasure(final TValue dataErasure) { + return copy().addQueryParam("dataErasure", dataErasure); + } + + /** + * set dataErasure with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete withDataErasure(final Supplier supplier) { + return copy().withQueryParam("dataErasure", supplier.get()); + } + + /** + * add additional dataErasure query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete addDataErasure(final Supplier supplier) { + return copy().addQueryParam("dataErasure", supplier.get()); + } + + /** + * set dataErasure with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete withDataErasure( + final Function op) { + return copy().withQueryParam("dataErasure", op.apply(new StringBuilder())); + } + + /** + * add additional dataErasure query parameter + * @param op builder for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete addDataErasure( + final Function op) { + return copy().addQueryParam("dataErasure", op.apply(new StringBuilder())); + } + + /** + * set dataErasure with the specified values + * @param dataErasure values to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete withDataErasure( + final Collection dataErasure) { + return copy().withoutQueryParam("dataErasure") + .addQueryParams(dataErasure.stream() + .map(s -> new ParamEntry<>("dataErasure", s.toString())) + .collect(Collectors.toList())); + } + + /** + * add additional dataErasure query parameters + * @param dataErasure values to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete addDataErasure( + final Collection dataErasure) { + return copy().addQueryParams( + dataErasure.stream().map(s -> new ParamEntry<>("dataErasure", s.toString())).collect(Collectors.toList())); + } + + /** + * set version with the specified value + * @param version value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete withVersion(final TValue version) { + return copy().withQueryParam("version", version); + } + + /** + * add additional version query parameter + * @param version value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete 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; + + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete that = (ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete) 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet.java new file mode 100644 index 00000000000..44ec0ee89b7 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet.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}")
+ *            .quoteRequests()
+ *            .withId("{ID}")
+ *            .get()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String ID) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.ID = ID; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet( + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet 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/quote-requests/%s", this.projectKey, this.storeKey, + 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.quote_request.QuoteRequest.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.quote_request.QuoteRequest.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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet 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; + + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet that = (ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet) 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDHead.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDHead.java new file mode 100644 index 00000000000..0a63db0aa7e --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDHead.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 QuoteRequest exists for a given id. Returns a 200 OK status if the QuoteRequest exists or a 404 Not Found otherwise.

+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .quoteRequests()
+ *            .withId("{ID}")
+ *            .head()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDHead 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDHead(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String ID) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.ID = ID; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDHead( + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDHead 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/quote-requests/%s", this.projectKey, this.storeKey, + 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; + + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDHead that = (ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDHead) 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDHead copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDHead(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost.java new file mode 100644 index 00000000000..f518062ac5b --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost.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}")
+ *            .quoteRequests()
+ *            .withId("{ID}")
+ *            .post(null)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost 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.quote_request.QuoteRequestUpdate quoteRequestUpdate; + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String ID, + com.commercetools.api.models.quote_request.QuoteRequestUpdate quoteRequestUpdate) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.ID = ID; + this.quoteRequestUpdate = quoteRequestUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost( + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.ID = t.ID; + this.quoteRequestUpdate = t.quoteRequestUpdate; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/quote-requests/%s", this.projectKey, this.storeKey, + 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(quoteRequestUpdate))); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.quote_request.QuoteRequest.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.quote_request.QuoteRequest.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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost addExpand(final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public com.commercetools.api.models.quote_request.QuoteRequestUpdate getBody() { + return quoteRequestUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost withBody( + com.commercetools.api.models.quote_request.QuoteRequestUpdate quoteRequestUpdate) { + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost t = copy(); + t.quoteRequestUpdate = quoteRequestUpdate; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost that = (ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(ID, that.ID) + .append(quoteRequestUpdate, that.quoteRequestUpdate) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey) + .append(storeKey) + .append(ID) + .append(quoteRequestUpdate) + .toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString.java new file mode 100644 index 00000000000..49bb9e621b7 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString.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}")
+ *            .quoteRequests()
+ *            .withId("{ID}")
+ *            .post("")
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString 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 quoteRequestUpdate; + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString(final ApiHttpClient apiHttpClient, + String projectKey, String storeKey, String ID, String quoteRequestUpdate) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.ID = ID; + this.quoteRequestUpdate = quoteRequestUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString( + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.ID = t.ID; + this.quoteRequestUpdate = t.quoteRequestUpdate; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/quote-requests/%s", this.projectKey, this.storeKey, + this.ID); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(), + quoteRequestUpdate.getBytes(StandardCharsets.UTF_8)); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.quote_request.QuoteRequest.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.quote_request.QuoteRequest.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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param value type + * @param expand value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString addExpand( + final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public String getBody() { + return quoteRequestUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString withBody(String quoteRequestUpdate) { + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString t = copy(); + t.quoteRequestUpdate = quoteRequestUpdate; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString that = (ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(ID, that.ID) + .append(quoteRequestUpdate, that.quoteRequestUpdate) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey) + .append(storeKey) + .append(ID) + .append(quoteRequestUpdate) + .toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestBuilder.java new file mode 100644 index 00000000000..7f9bbbf8d1e --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestBuilder.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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestBuilder { + + private final ApiHttpClient apiHttpClient; + private final String projectKey; + private final String storeKey; + private final String ID; + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestBuilder(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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet get() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDGet(apiHttpClient, projectKey, storeKey, ID); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDHead head() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDHead(apiHttpClient, projectKey, storeKey, ID); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost post( + com.commercetools.api.models.quote_request.QuoteRequestUpdate quoteRequestUpdate) { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost(apiHttpClient, projectKey, storeKey, ID, + quoteRequestUpdate); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString post(final String quoteRequestUpdate) { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPostString(apiHttpClient, projectKey, storeKey, ID, + quoteRequestUpdate); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDPost post( + UnaryOperator op) { + return post(op.apply(com.commercetools.api.models.quote_request.QuoteRequestUpdateBuilder.of()).build()); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete delete() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete(apiHttpClient, projectKey, storeKey, ID); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDDelete delete(TValue version) { + return delete().withVersion(version); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet.java new file mode 100644 index 00000000000..c144bb5203e --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet.java @@ -0,0 +1,688 @@ + +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}")
+ *            .quoteRequests()
+ *            .get()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet(ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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/quote-requests", this.projectKey, 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.quote_request.QuoteRequestPagedQueryResponse.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.quote_request.QuoteRequestPagedQueryResponse.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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet withSort(final TValue sort) { + return copy().withQueryParam("sort", sort); + } + + /** + * add additional sort query parameter + * @param sort value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet withLimit(final TValue limit) { + return copy().withQueryParam("limit", limit); + } + + /** + * add additional limit query parameter + * @param limit value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet withOffset(final TValue offset) { + return copy().withQueryParam("offset", offset); + } + + /** + * add additional offset query parameter + * @param offset value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet withWithTotal(final TValue withTotal) { + return copy().withQueryParam("withTotal", withTotal); + } + + /** + * add additional withTotal query parameter + * @param withTotal value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet withWhere(final TValue where) { + return copy().withQueryParam("where", where); + } + + /** + * add additional where query parameter + * @param where value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet 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; + + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet that = (ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet) 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead.java new file mode 100644 index 00000000000..2f32ab10a22 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead.java @@ -0,0 +1,209 @@ + +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 QuoteRequest exists for a given Query Predicate. Returns a 200 OK status if any QuoteRequests match the Query Predicate or a 404 Not Found otherwise.

+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .quoteRequests()
+ *            .head()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead(ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead 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/quote-requests", this.projectKey, 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead withWhere(final TValue where) { + return copy().withQueryParam("where", where); + } + + /** + * add additional where query parameter + * @param where value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead 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; + + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead that = (ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead) 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete.java new file mode 100644 index 00000000000..e3a73d16135 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete.java @@ -0,0 +1,414 @@ + +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}")
+ *            .quoteRequests()
+ *            .withKey("{key}")
+ *            .delete()
+ *            .withVersion(version)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete extends + TypeApiMethod + implements + com.commercetools.api.client.DataerasureTrait, + com.commercetools.api.client.VersionedTrait, + com.commercetools.api.client.ConflictingTrait, + com.commercetools.api.client.ExpandableTrait, + com.commercetools.api.client.ErrorableTrait, + com.commercetools.api.client.Deprecatable200Trait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String storeKey; + private String key; + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete(final ApiHttpClient apiHttpClient, + String projectKey, String storeKey, String key) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.key = key; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete( + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete 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/quote-requests/key=%s", this.projectKey, + this.storeKey, 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.quote_request.QuoteRequest.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.quote_request.QuoteRequest.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getStoreKey() { + return this.storeKey; + } + + public String getKey() { + return this.key; + } + + public List getDataErasure() { + return this.getQueryParam("dataErasure"); + } + + public List getVersion() { + return this.getQueryParam("version"); + } + + public List getExpand() { + return this.getQueryParam("expand"); + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setStoreKey(final String storeKey) { + this.storeKey = storeKey; + } + + public void setKey(final String key) { + this.key = key; + } + + /** + * set dataErasure with the specified value + * @param dataErasure value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete withDataErasure( + final TValue dataErasure) { + return copy().withQueryParam("dataErasure", dataErasure); + } + + /** + * add additional dataErasure query parameter + * @param dataErasure value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete addDataErasure( + final TValue dataErasure) { + return copy().addQueryParam("dataErasure", dataErasure); + } + + /** + * set dataErasure with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete withDataErasure( + final Supplier supplier) { + return copy().withQueryParam("dataErasure", supplier.get()); + } + + /** + * add additional dataErasure query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete addDataErasure( + final Supplier supplier) { + return copy().addQueryParam("dataErasure", supplier.get()); + } + + /** + * set dataErasure with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete withDataErasure( + final Function op) { + return copy().withQueryParam("dataErasure", op.apply(new StringBuilder())); + } + + /** + * add additional dataErasure query parameter + * @param op builder for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete addDataErasure( + final Function op) { + return copy().addQueryParam("dataErasure", op.apply(new StringBuilder())); + } + + /** + * set dataErasure with the specified values + * @param dataErasure values to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete withDataErasure( + final Collection dataErasure) { + return copy().withoutQueryParam("dataErasure") + .addQueryParams(dataErasure.stream() + .map(s -> new ParamEntry<>("dataErasure", s.toString())) + .collect(Collectors.toList())); + } + + /** + * add additional dataErasure query parameters + * @param dataErasure values to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete addDataErasure( + final Collection dataErasure) { + return copy().addQueryParams( + dataErasure.stream().map(s -> new ParamEntry<>("dataErasure", s.toString())).collect(Collectors.toList())); + } + + /** + * set version with the specified value + * @param version value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete withVersion(final TValue version) { + return copy().withQueryParam("version", version); + } + + /** + * add additional version query parameter + * @param version value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete 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; + + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete that = (ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete) 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet.java new file mode 100644 index 00000000000..622fad1d37b --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet.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}")
+ *            .quoteRequests()
+ *            .withKey("{key}")
+ *            .get()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet(final ApiHttpClient apiHttpClient, + String projectKey, String storeKey, String key) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.key = key; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet( + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet 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/quote-requests/key=%s", this.projectKey, + this.storeKey, 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.quote_request.QuoteRequest.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.quote_request.QuoteRequest.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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet 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; + + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet that = (ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet) 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyHead.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyHead.java new file mode 100644 index 00000000000..3f38eeb1327 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyHead.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 QuoteRequest exists for a given key. Returns a 200 OK status if the QuoteRequest exists or a 404 Not Found otherwise.

+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .quoteRequests()
+ *            .withKey("{key}")
+ *            .head()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyHead 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyHead(final ApiHttpClient apiHttpClient, + String projectKey, String storeKey, String key) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.key = key; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyHead( + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyHead 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/quote-requests/key=%s", this.projectKey, + this.storeKey, 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; + + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyHead that = (ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyHead) 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyHead copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyHead(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost.java new file mode 100644 index 00000000000..ccbfcba1536 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost.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}")
+ *            .quoteRequests()
+ *            .withKey("{key}")
+ *            .post(null)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost 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.quote_request.QuoteRequestUpdate quoteRequestUpdate; + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost(final ApiHttpClient apiHttpClient, + String projectKey, String storeKey, String key, + com.commercetools.api.models.quote_request.QuoteRequestUpdate quoteRequestUpdate) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.key = key; + this.quoteRequestUpdate = quoteRequestUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost( + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.key = t.key; + this.quoteRequestUpdate = t.quoteRequestUpdate; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/quote-requests/key=%s", this.projectKey, + this.storeKey, 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(quoteRequestUpdate))); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.quote_request.QuoteRequest.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.quote_request.QuoteRequest.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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost addExpand( + final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public com.commercetools.api.models.quote_request.QuoteRequestUpdate getBody() { + return quoteRequestUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost withBody( + com.commercetools.api.models.quote_request.QuoteRequestUpdate quoteRequestUpdate) { + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost t = copy(); + t.quoteRequestUpdate = quoteRequestUpdate; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost that = (ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(key, that.key) + .append(quoteRequestUpdate, that.quoteRequestUpdate) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey) + .append(storeKey) + .append(key) + .append(quoteRequestUpdate) + .toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString.java new file mode 100644 index 00000000000..43c1827751c --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString.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}")
+ *            .quoteRequests()
+ *            .withKey("{key}")
+ *            .post("")
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString 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 quoteRequestUpdate; + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString(final ApiHttpClient apiHttpClient, + String projectKey, String storeKey, String key, String quoteRequestUpdate) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.key = key; + this.quoteRequestUpdate = quoteRequestUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString( + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.key = t.key; + this.quoteRequestUpdate = t.quoteRequestUpdate; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/quote-requests/key=%s", this.projectKey, + this.storeKey, this.key); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(), + quoteRequestUpdate.getBytes(StandardCharsets.UTF_8)); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.quote_request.QuoteRequest.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.quote_request.QuoteRequest.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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param value type + * @param expand value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString addExpand( + final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public String getBody() { + return quoteRequestUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString withBody(String quoteRequestUpdate) { + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString t = copy(); + t.quoteRequestUpdate = quoteRequestUpdate; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString that = (ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(key, that.key) + .append(quoteRequestUpdate, that.quoteRequestUpdate) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey) + .append(storeKey) + .append(key) + .append(quoteRequestUpdate) + .toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestBuilder.java new file mode 100644 index 00000000000..2aa29173f20 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestBuilder.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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestBuilder { + + private final ApiHttpClient apiHttpClient; + private final String projectKey; + private final String storeKey; + private final String key; + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestBuilder(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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet get() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyGet(apiHttpClient, projectKey, storeKey, key); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyHead head() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyHead(apiHttpClient, projectKey, storeKey, key); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost post( + com.commercetools.api.models.quote_request.QuoteRequestUpdate quoteRequestUpdate) { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost(apiHttpClient, projectKey, storeKey, key, + quoteRequestUpdate); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString post(final String quoteRequestUpdate) { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPostString(apiHttpClient, projectKey, storeKey, + key, quoteRequestUpdate); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyPost post( + UnaryOperator op) { + return post(op.apply(com.commercetools.api.models.quote_request.QuoteRequestUpdateBuilder.of()).build()); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete delete() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete(apiHttpClient, projectKey, storeKey, + key); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyDelete delete(TValue version) { + return delete().withVersion(version); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost.java new file mode 100644 index 00000000000..2ec9ceada4d --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost.java @@ -0,0 +1,232 @@ + +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}")
+ *            .quoteRequests()
+ *            .post(null)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost 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.quote_request.QuoteRequestDraft quoteRequestDraft; + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, com.commercetools.api.models.quote_request.QuoteRequestDraft quoteRequestDraft) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.quoteRequestDraft = quoteRequestDraft; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost(ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.quoteRequestDraft = t.quoteRequestDraft; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/quote-requests", this.projectKey, 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(quoteRequestDraft))); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.quote_request.QuoteRequest.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.quote_request.QuoteRequest.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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost addExpand(final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public com.commercetools.api.models.quote_request.QuoteRequestDraft getBody() { + return quoteRequestDraft; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost withBody( + com.commercetools.api.models.quote_request.QuoteRequestDraft quoteRequestDraft) { + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost t = copy(); + t.quoteRequestDraft = quoteRequestDraft; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost that = (ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(quoteRequestDraft, that.quoteRequestDraft) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(storeKey).append(quoteRequestDraft).toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString.java new file mode 100644 index 00000000000..43995005760 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString.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}")
+ *            .quoteRequests()
+ *            .post("")
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString 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 quoteRequestDraft; + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String quoteRequestDraft) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.quoteRequestDraft = quoteRequestDraft; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString( + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.quoteRequestDraft = t.quoteRequestDraft; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/quote-requests", this.projectKey, this.storeKey); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(), + quoteRequestDraft.getBytes(StandardCharsets.UTF_8)); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.quote_request.QuoteRequest.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.quote_request.QuoteRequest.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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param value type + * @param expand value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString addExpand(final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public String getBody() { + return quoteRequestDraft; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString withBody(String quoteRequestDraft) { + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString t = copy(); + t.quoteRequestDraft = quoteRequestDraft; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString that = (ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(quoteRequestDraft, that.quoteRequestDraft) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(storeKey).append(quoteRequestDraft).toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestBuilder.java new file mode 100644 index 00000000000..864bfe24343 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestBuilder.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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestBuilder { + + private final ApiHttpClient apiHttpClient; + private final String projectKey; + private final String storeKey; + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestBuilder(final ApiHttpClient apiHttpClient, + final String projectKey, final String storeKey) { + this.apiHttpClient = apiHttpClient; + this.projectKey = projectKey; + this.storeKey = storeKey; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet get() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsGet(apiHttpClient, projectKey, storeKey); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead head() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsHead(apiHttpClient, projectKey, storeKey); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost post( + com.commercetools.api.models.quote_request.QuoteRequestDraft quoteRequestDraft) { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost(apiHttpClient, projectKey, storeKey, + quoteRequestDraft); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString post(final String quoteRequestDraft) { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPostString(apiHttpClient, projectKey, storeKey, + quoteRequestDraft); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsPost post( + UnaryOperator op) { + return post(op.apply(com.commercetools.api.models.quote_request.QuoteRequestDraftBuilder.of()).build()); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestBuilder withKey(String key) { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyRequestBuilder(apiHttpClient, projectKey, + storeKey, key); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestBuilder withId(String ID) { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDRequestBuilder(apiHttpClient, projectKey, storeKey, + ID); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete.java new file mode 100644 index 00000000000..1fd1950b5cb --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete.java @@ -0,0 +1,402 @@ + +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}")
+ *            .quotes()
+ *            .withId("{ID}")
+ *            .delete()
+ *            .withVersion(version)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete extends + TypeApiMethod + implements com.commercetools.api.client.DataerasureTrait, + com.commercetools.api.client.VersionedTrait, + com.commercetools.api.client.ConflictingTrait, + com.commercetools.api.client.ExpandableTrait, + com.commercetools.api.client.ErrorableTrait, + com.commercetools.api.client.Deprecatable200Trait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String storeKey; + private String ID; + + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String ID) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.ID = ID; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete(ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete 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/quotes/%s", this.projectKey, this.storeKey, 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.quote.Quote.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.quote.Quote.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getStoreKey() { + return this.storeKey; + } + + public String getID() { + return this.ID; + } + + public List getDataErasure() { + return this.getQueryParam("dataErasure"); + } + + public List getVersion() { + return this.getQueryParam("version"); + } + + public List getExpand() { + return this.getQueryParam("expand"); + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setStoreKey(final String storeKey) { + this.storeKey = storeKey; + } + + public void setID(final String ID) { + this.ID = ID; + } + + /** + * set dataErasure with the specified value + * @param dataErasure value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete withDataErasure(final TValue dataErasure) { + return copy().withQueryParam("dataErasure", dataErasure); + } + + /** + * add additional dataErasure query parameter + * @param dataErasure value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete addDataErasure(final TValue dataErasure) { + return copy().addQueryParam("dataErasure", dataErasure); + } + + /** + * set dataErasure with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete withDataErasure(final Supplier supplier) { + return copy().withQueryParam("dataErasure", supplier.get()); + } + + /** + * add additional dataErasure query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete addDataErasure(final Supplier supplier) { + return copy().addQueryParam("dataErasure", supplier.get()); + } + + /** + * set dataErasure with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete withDataErasure( + final Function op) { + return copy().withQueryParam("dataErasure", op.apply(new StringBuilder())); + } + + /** + * add additional dataErasure query parameter + * @param op builder for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete addDataErasure( + final Function op) { + return copy().addQueryParam("dataErasure", op.apply(new StringBuilder())); + } + + /** + * set dataErasure with the specified values + * @param dataErasure values to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete withDataErasure( + final Collection dataErasure) { + return copy().withoutQueryParam("dataErasure") + .addQueryParams(dataErasure.stream() + .map(s -> new ParamEntry<>("dataErasure", s.toString())) + .collect(Collectors.toList())); + } + + /** + * add additional dataErasure query parameters + * @param dataErasure values to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete addDataErasure( + final Collection dataErasure) { + return copy().addQueryParams( + dataErasure.stream().map(s -> new ParamEntry<>("dataErasure", s.toString())).collect(Collectors.toList())); + } + + /** + * set version with the specified value + * @param version value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete withVersion(final TValue version) { + return copy().withQueryParam("version", version); + } + + /** + * add additional version query parameter + * @param version value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete 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; + + ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete that = (ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete) 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet.java new file mode 100644 index 00000000000..33cdff65174 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet.java @@ -0,0 +1,224 @@ + +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}")
+ *            .quotes()
+ *            .withId("{ID}")
+ *            .get()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet + 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String ID) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.ID = ID; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet(ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet 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/quotes/%s", this.projectKey, this.storeKey, 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.quote.Quote.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.quote.Quote.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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet 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; + + ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet that = (ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet) 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesByIDHead.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesByIDHead.java new file mode 100644 index 00000000000..de3a9a0a412 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesByIDHead.java @@ -0,0 +1,136 @@ + +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 Quote exists for a given id. Returns a 200 OK status if the Quote exists or a 404 Not Found otherwise.

+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .quotes()
+ *            .withId("{ID}")
+ *            .head()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuotesByIDHead + 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDHead(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String ID) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.ID = ID; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDHead(ByProjectKeyInStoreKeyByStoreKeyQuotesByIDHead 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/quotes/%s", this.projectKey, this.storeKey, 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; + + ByProjectKeyInStoreKeyByStoreKeyQuotesByIDHead that = (ByProjectKeyInStoreKeyByStoreKeyQuotesByIDHead) 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDHead copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesByIDHead(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost.java new file mode 100644 index 00000000000..fadb1baf88c --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost.java @@ -0,0 +1,248 @@ + +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}")
+ *            .quotes()
+ *            .withId("{ID}")
+ *            .post(null)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost 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.quote.QuoteUpdate quoteUpdate; + + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String ID, com.commercetools.api.models.quote.QuoteUpdate quoteUpdate) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.ID = ID; + this.quoteUpdate = quoteUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost(ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.ID = t.ID; + this.quoteUpdate = t.quoteUpdate; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/quotes/%s", this.projectKey, this.storeKey, 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(quoteUpdate))); + + } + + @Override + public ApiHttpResponse executeBlocking(final ApiHttpClient client, + final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.quote.Quote.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.quote.Quote.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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost addExpand(final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public com.commercetools.api.models.quote.QuoteUpdate getBody() { + return quoteUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost withBody( + com.commercetools.api.models.quote.QuoteUpdate quoteUpdate) { + ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost t = copy(); + t.quoteUpdate = quoteUpdate; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost that = (ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(ID, that.ID) + .append(quoteUpdate, that.quoteUpdate) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey) + .append(storeKey) + .append(ID) + .append(quoteUpdate) + .toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString.java new file mode 100644 index 00000000000..c433fa708b1 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString.java @@ -0,0 +1,250 @@ + +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}")
+ *            .quotes()
+ *            .withId("{ID}")
+ *            .post("")
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString 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 quoteUpdate; + + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String ID, String quoteUpdate) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.ID = ID; + this.quoteUpdate = quoteUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString( + ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.ID = t.ID; + this.quoteUpdate = t.quoteUpdate; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/quotes/%s", this.projectKey, this.storeKey, this.ID); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(), + quoteUpdate.getBytes(StandardCharsets.UTF_8)); + + } + + @Override + public ApiHttpResponse executeBlocking(final ApiHttpClient client, + final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.quote.Quote.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.quote.Quote.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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param value type + * @param expand value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString addExpand(final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public String getBody() { + return quoteUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString withBody(String quoteUpdate) { + ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString t = copy(); + t.quoteUpdate = quoteUpdate; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString that = (ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(ID, that.ID) + .append(quoteUpdate, that.quoteUpdate) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey) + .append(storeKey) + .append(ID) + .append(quoteUpdate) + .toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestBuilder.java new file mode 100644 index 00000000000..899b4d51a1b --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestBuilder.java @@ -0,0 +1,56 @@ + +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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestBuilder { + + private final ApiHttpClient apiHttpClient; + private final String projectKey; + private final String storeKey; + private final String ID; + + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestBuilder(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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet get() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesByIDGet(apiHttpClient, projectKey, storeKey, ID); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDHead head() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesByIDHead(apiHttpClient, projectKey, storeKey, ID); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost post( + com.commercetools.api.models.quote.QuoteUpdate quoteUpdate) { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost(apiHttpClient, projectKey, storeKey, ID, quoteUpdate); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString post(final String quoteUpdate) { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPostString(apiHttpClient, projectKey, storeKey, ID, + quoteUpdate); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDPost post( + UnaryOperator op) { + return post(op.apply(com.commercetools.api.models.quote.QuoteUpdateBuilder.of()).build()); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete delete() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete(apiHttpClient, projectKey, storeKey, ID); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDDelete delete(TValue version) { + return delete().withVersion(version); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesGet.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesGet.java new file mode 100644 index 00000000000..ee63cae7455 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesGet.java @@ -0,0 +1,683 @@ + +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}")
+ *            .quotes()
+ *            .get()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet(ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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/quotes", this.projectKey, 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.quote.QuotePagedQueryResponse.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.quote.QuotePagedQueryResponse.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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet withSort(final TValue sort) { + return copy().withQueryParam("sort", sort); + } + + /** + * add additional sort query parameter + * @param sort value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet withLimit(final TValue limit) { + return copy().withQueryParam("limit", limit); + } + + /** + * add additional limit query parameter + * @param limit value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet withOffset(final TValue offset) { + return copy().withQueryParam("offset", offset); + } + + /** + * add additional offset query parameter + * @param offset value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet withWithTotal(final TValue withTotal) { + return copy().withQueryParam("withTotal", withTotal); + } + + /** + * add additional withTotal query parameter + * @param withTotal value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet withWhere(final TValue where) { + return copy().withQueryParam("where", where); + } + + /** + * add additional where query parameter + * @param where value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet 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; + + ByProjectKeyInStoreKeyByStoreKeyQuotesGet that = (ByProjectKeyInStoreKeyByStoreKeyQuotesGet) 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 ByProjectKeyInStoreKeyByStoreKeyQuotesGet copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesGet(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesHead.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesHead.java new file mode 100644 index 00000000000..9a01819c023 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesHead.java @@ -0,0 +1,208 @@ + +package com.commercetools.api.client; + +import java.net.URI; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import com.fasterxml.jackson.core.type.TypeReference; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + *

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

+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .quotes()
+ *            .head()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuotesHead + 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 ByProjectKeyInStoreKeyByStoreKeyQuotesHead(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesHead(ByProjectKeyInStoreKeyByStoreKeyQuotesHead 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/quotes", this.projectKey, 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 ByProjectKeyInStoreKeyByStoreKeyQuotesHead + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesHead withWhere(final TValue where) { + return copy().withQueryParam("where", where); + } + + /** + * add additional where query parameter + * @param where value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesHead + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesHead 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 ByProjectKeyInStoreKeyByStoreKeyQuotesHead + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesHead 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 ByProjectKeyInStoreKeyByStoreKeyQuotesHead + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesHead 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 ByProjectKeyInStoreKeyByStoreKeyQuotesHead + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesHead 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 ByProjectKeyInStoreKeyByStoreKeyQuotesHead + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesHead 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 ByProjectKeyInStoreKeyByStoreKeyQuotesHead + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesHead 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 ByProjectKeyInStoreKeyByStoreKeyQuotesHead + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesHead 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; + + ByProjectKeyInStoreKeyByStoreKeyQuotesHead that = (ByProjectKeyInStoreKeyByStoreKeyQuotesHead) 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 ByProjectKeyInStoreKeyByStoreKeyQuotesHead copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesHead(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete.java new file mode 100644 index 00000000000..995dc95b982 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete.java @@ -0,0 +1,405 @@ + +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}")
+ *            .quotes()
+ *            .withKey("{key}")
+ *            .delete()
+ *            .withVersion(version)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete extends + TypeApiMethod + implements com.commercetools.api.client.DataerasureTrait, + com.commercetools.api.client.VersionedTrait, + com.commercetools.api.client.ConflictingTrait, + com.commercetools.api.client.ExpandableTrait, + com.commercetools.api.client.ErrorableTrait, + com.commercetools.api.client.Deprecatable200Trait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String storeKey; + private String key; + + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String key) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.key = key; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete( + ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete 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/quotes/key=%s", this.projectKey, this.storeKey, + 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.quote.Quote.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.quote.Quote.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getStoreKey() { + return this.storeKey; + } + + public String getKey() { + return this.key; + } + + public List getDataErasure() { + return this.getQueryParam("dataErasure"); + } + + public List getVersion() { + return this.getQueryParam("version"); + } + + public List getExpand() { + return this.getQueryParam("expand"); + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setStoreKey(final String storeKey) { + this.storeKey = storeKey; + } + + public void setKey(final String key) { + this.key = key; + } + + /** + * set dataErasure with the specified value + * @param dataErasure value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete withDataErasure(final TValue dataErasure) { + return copy().withQueryParam("dataErasure", dataErasure); + } + + /** + * add additional dataErasure query parameter + * @param dataErasure value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete addDataErasure(final TValue dataErasure) { + return copy().addQueryParam("dataErasure", dataErasure); + } + + /** + * set dataErasure with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete withDataErasure(final Supplier supplier) { + return copy().withQueryParam("dataErasure", supplier.get()); + } + + /** + * add additional dataErasure query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete addDataErasure(final Supplier supplier) { + return copy().addQueryParam("dataErasure", supplier.get()); + } + + /** + * set dataErasure with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete withDataErasure( + final Function op) { + return copy().withQueryParam("dataErasure", op.apply(new StringBuilder())); + } + + /** + * add additional dataErasure query parameter + * @param op builder for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete addDataErasure( + final Function op) { + return copy().addQueryParam("dataErasure", op.apply(new StringBuilder())); + } + + /** + * set dataErasure with the specified values + * @param dataErasure values to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete withDataErasure( + final Collection dataErasure) { + return copy().withoutQueryParam("dataErasure") + .addQueryParams(dataErasure.stream() + .map(s -> new ParamEntry<>("dataErasure", s.toString())) + .collect(Collectors.toList())); + } + + /** + * add additional dataErasure query parameters + * @param dataErasure values to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete addDataErasure( + final Collection dataErasure) { + return copy().addQueryParams( + dataErasure.stream().map(s -> new ParamEntry<>("dataErasure", s.toString())).collect(Collectors.toList())); + } + + /** + * set version with the specified value + * @param version value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete withVersion(final TValue version) { + return copy().withQueryParam("version", version); + } + + /** + * add additional version query parameter + * @param version value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete 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; + + ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete that = (ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete) 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet.java new file mode 100644 index 00000000000..1c7e4fee3e4 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet.java @@ -0,0 +1,227 @@ + +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}")
+ *            .quotes()
+ *            .withKey("{key}")
+ *            .get()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String key) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.key = key; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet(ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet 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/quotes/key=%s", this.projectKey, this.storeKey, + 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.quote.Quote.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.quote.Quote.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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet 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; + + ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet that = (ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet) 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyHead.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyHead.java new file mode 100644 index 00000000000..f82eb6fb7b0 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyHead.java @@ -0,0 +1,137 @@ + +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 Quote exists for a given key. Returns a 200 OK status if the Quote exists or a 404 Not Found otherwise.

+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .quotes()
+ *            .withKey("{key}")
+ *            .head()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyHead 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyHead(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String key) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.key = key; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyHead(ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyHead 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/quotes/key=%s", this.projectKey, this.storeKey, + 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; + + ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyHead that = (ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyHead) 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyHead copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyHead(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost.java new file mode 100644 index 00000000000..e99aac08161 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost.java @@ -0,0 +1,251 @@ + +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}")
+ *            .quotes()
+ *            .withKey("{key}")
+ *            .post(null)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost 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.quote.QuoteUpdate quoteUpdate; + + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String key, com.commercetools.api.models.quote.QuoteUpdate quoteUpdate) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.key = key; + this.quoteUpdate = quoteUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost(ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.key = t.key; + this.quoteUpdate = t.quoteUpdate; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/quotes/key=%s", this.projectKey, this.storeKey, + 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(quoteUpdate))); + + } + + @Override + public ApiHttpResponse executeBlocking(final ApiHttpClient client, + final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.quote.Quote.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.quote.Quote.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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost addExpand(final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public com.commercetools.api.models.quote.QuoteUpdate getBody() { + return quoteUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost withBody( + com.commercetools.api.models.quote.QuoteUpdate quoteUpdate) { + ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost t = copy(); + t.quoteUpdate = quoteUpdate; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost that = (ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(key, that.key) + .append(quoteUpdate, that.quoteUpdate) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey) + .append(storeKey) + .append(key) + .append(quoteUpdate) + .toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString.java new file mode 100644 index 00000000000..a153e1d2ba9 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString.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}")
+ *            .quotes()
+ *            .withKey("{key}")
+ *            .post("")
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString 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 quoteUpdate; + + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString(final ApiHttpClient apiHttpClient, + String projectKey, String storeKey, String key, String quoteUpdate) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.key = key; + this.quoteUpdate = quoteUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString( + ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.key = t.key; + this.quoteUpdate = t.quoteUpdate; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/quotes/key=%s", this.projectKey, this.storeKey, + this.key); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(), + quoteUpdate.getBytes(StandardCharsets.UTF_8)); + + } + + @Override + public ApiHttpResponse executeBlocking(final ApiHttpClient client, + final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.quote.Quote.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.quote.Quote.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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param value type + * @param expand value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString addExpand( + final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public String getBody() { + return quoteUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString withBody(String quoteUpdate) { + ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString t = copy(); + t.quoteUpdate = quoteUpdate; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString that = (ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(key, that.key) + .append(quoteUpdate, that.quoteUpdate) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey) + .append(storeKey) + .append(key) + .append(quoteUpdate) + .toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestBuilder.java new file mode 100644 index 00000000000..1dc1521a342 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestBuilder.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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestBuilder { + + private final ApiHttpClient apiHttpClient; + private final String projectKey; + private final String storeKey; + private final String key; + + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestBuilder(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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet get() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyGet(apiHttpClient, projectKey, storeKey, key); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyHead head() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyHead(apiHttpClient, projectKey, storeKey, key); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost post( + com.commercetools.api.models.quote.QuoteUpdate quoteUpdate) { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost(apiHttpClient, projectKey, storeKey, key, + quoteUpdate); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString post(final String quoteUpdate) { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPostString(apiHttpClient, projectKey, storeKey, key, + quoteUpdate); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyPost post( + UnaryOperator op) { + return post(op.apply(com.commercetools.api.models.quote.QuoteUpdateBuilder.of()).build()); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete delete() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete(apiHttpClient, projectKey, storeKey, key); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyDelete delete(TValue version) { + return delete().withVersion(version); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesPost.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesPost.java new file mode 100644 index 00000000000..5b8c2b949d0 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesPost.java @@ -0,0 +1,230 @@ + +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}")
+ *            .quotes()
+ *            .post(null)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuotesPost 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.quote.QuoteDraft quoteDraft; + + public ByProjectKeyInStoreKeyByStoreKeyQuotesPost(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, com.commercetools.api.models.quote.QuoteDraft quoteDraft) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.quoteDraft = quoteDraft; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesPost(ByProjectKeyInStoreKeyByStoreKeyQuotesPost t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.quoteDraft = t.quoteDraft; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/quotes", this.projectKey, 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(quoteDraft))); + + } + + @Override + public ApiHttpResponse executeBlocking(final ApiHttpClient client, + final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.quote.Quote.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.quote.Quote.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 ByProjectKeyInStoreKeyByStoreKeyQuotesPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesPost withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesPost 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 ByProjectKeyInStoreKeyByStoreKeyQuotesPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesPost 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 ByProjectKeyInStoreKeyByStoreKeyQuotesPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesPost 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 ByProjectKeyInStoreKeyByStoreKeyQuotesPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesPost 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 ByProjectKeyInStoreKeyByStoreKeyQuotesPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesPost 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 ByProjectKeyInStoreKeyByStoreKeyQuotesPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesPost 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 ByProjectKeyInStoreKeyByStoreKeyQuotesPost + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesPost addExpand(final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public com.commercetools.api.models.quote.QuoteDraft getBody() { + return quoteDraft; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesPost withBody( + com.commercetools.api.models.quote.QuoteDraft quoteDraft) { + ByProjectKeyInStoreKeyByStoreKeyQuotesPost t = copy(); + t.quoteDraft = quoteDraft; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyQuotesPost that = (ByProjectKeyInStoreKeyByStoreKeyQuotesPost) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(quoteDraft, that.quoteDraft) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(storeKey).append(quoteDraft).toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyQuotesPost copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesPost(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesPostString.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesPostString.java new file mode 100644 index 00000000000..7ff73bf240f --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesPostString.java @@ -0,0 +1,230 @@ + +package com.commercetools.api.client; + +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import com.fasterxml.jackson.core.type.TypeReference; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + * + * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .quotes()
+ *            .post("")
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuotesPostString 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 quoteDraft; + + public ByProjectKeyInStoreKeyByStoreKeyQuotesPostString(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String quoteDraft) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.quoteDraft = quoteDraft; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesPostString(ByProjectKeyInStoreKeyByStoreKeyQuotesPostString t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.quoteDraft = t.quoteDraft; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/quotes", this.projectKey, this.storeKey); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(), + quoteDraft.getBytes(StandardCharsets.UTF_8)); + + } + + @Override + public ApiHttpResponse executeBlocking(final ApiHttpClient client, + final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.quote.Quote.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.quote.Quote.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 ByProjectKeyInStoreKeyByStoreKeyQuotesPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesPostString withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param value type + * @param expand value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyQuotesPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuotesPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuotesPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuotesPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuotesPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuotesPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesPostString 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 ByProjectKeyInStoreKeyByStoreKeyQuotesPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyQuotesPostString addExpand(final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public String getBody() { + return quoteDraft; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesPostString withBody(String quoteDraft) { + ByProjectKeyInStoreKeyByStoreKeyQuotesPostString t = copy(); + t.quoteDraft = quoteDraft; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyQuotesPostString that = (ByProjectKeyInStoreKeyByStoreKeyQuotesPostString) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(quoteDraft, that.quoteDraft) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(storeKey).append(quoteDraft).toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyQuotesPostString copy() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesPostString(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesRequestBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesRequestBuilder.java new file mode 100644 index 00000000000..8e8065095af --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyQuotesRequestBuilder.java @@ -0,0 +1,53 @@ + +package com.commercetools.api.client; + +import java.util.function.UnaryOperator; + +import io.vrap.rmf.base.client.ApiHttpClient; +import io.vrap.rmf.base.client.utils.Generated; + +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyQuotesRequestBuilder { + + private final ApiHttpClient apiHttpClient; + private final String projectKey; + private final String storeKey; + + public ByProjectKeyInStoreKeyByStoreKeyQuotesRequestBuilder(final ApiHttpClient apiHttpClient, + final String projectKey, final String storeKey) { + this.apiHttpClient = apiHttpClient; + this.projectKey = projectKey; + this.storeKey = storeKey; + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesGet get() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesGet(apiHttpClient, projectKey, storeKey); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesHead head() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesHead(apiHttpClient, projectKey, storeKey); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesPost post(com.commercetools.api.models.quote.QuoteDraft quoteDraft) { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesPost(apiHttpClient, projectKey, storeKey, quoteDraft); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesPostString post(final String quoteDraft) { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesPostString(apiHttpClient, projectKey, storeKey, quoteDraft); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesPost post( + UnaryOperator op) { + return post(op.apply(com.commercetools.api.models.quote.QuoteDraftBuilder.of()).build()); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestBuilder withKey(String key) { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyRequestBuilder(apiHttpClient, projectKey, storeKey, + key); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestBuilder withId(String ID) { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesByIDRequestBuilder(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 b23e6f081a7..4ae985ac877 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 @@ -68,4 +68,16 @@ public ByProjectKeyInStoreKeyByStoreKeyProductsRequestBuilder products() { return new ByProjectKeyInStoreKeyByStoreKeyProductsRequestBuilder(apiHttpClient, projectKey, storeKey); } + public ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestBuilder quoteRequests() { + return new ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsRequestBuilder(apiHttpClient, projectKey, storeKey); + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestBuilder stagedQuotes() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestBuilder(apiHttpClient, projectKey, storeKey); + } + + public ByProjectKeyInStoreKeyByStoreKeyQuotesRequestBuilder quotes() { + return new ByProjectKeyInStoreKeyByStoreKeyQuotesRequestBuilder(apiHttpClient, projectKey, storeKey); + } + } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete.java new file mode 100644 index 00000000000..2160b79abf1 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete.java @@ -0,0 +1,408 @@ + +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}")
+ *            .stagedQuotes()
+ *            .withId("{ID}")
+ *            .delete()
+ *            .withVersion(version)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete extends + TypeApiMethod + implements + com.commercetools.api.client.DataerasureTrait, + com.commercetools.api.client.VersionedTrait, + com.commercetools.api.client.ConflictingTrait, + com.commercetools.api.client.ExpandableTrait, + com.commercetools.api.client.ErrorableTrait, + com.commercetools.api.client.Deprecatable200Trait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String storeKey; + private String ID; + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String ID) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.ID = ID; + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete( + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete 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/staged-quotes/%s", this.projectKey, this.storeKey, + 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.staged_quote.StagedQuote.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.staged_quote.StagedQuote.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getStoreKey() { + return this.storeKey; + } + + public String getID() { + return this.ID; + } + + public List getDataErasure() { + return this.getQueryParam("dataErasure"); + } + + public List getVersion() { + return this.getQueryParam("version"); + } + + public List getExpand() { + return this.getQueryParam("expand"); + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setStoreKey(final String storeKey) { + this.storeKey = storeKey; + } + + public void setID(final String ID) { + this.ID = ID; + } + + /** + * set dataErasure with the specified value + * @param dataErasure value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete withDataErasure(final TValue dataErasure) { + return copy().withQueryParam("dataErasure", dataErasure); + } + + /** + * add additional dataErasure query parameter + * @param dataErasure value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete addDataErasure(final TValue dataErasure) { + return copy().addQueryParam("dataErasure", dataErasure); + } + + /** + * set dataErasure with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete withDataErasure(final Supplier supplier) { + return copy().withQueryParam("dataErasure", supplier.get()); + } + + /** + * add additional dataErasure query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete addDataErasure(final Supplier supplier) { + return copy().addQueryParam("dataErasure", supplier.get()); + } + + /** + * set dataErasure with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete withDataErasure( + final Function op) { + return copy().withQueryParam("dataErasure", op.apply(new StringBuilder())); + } + + /** + * add additional dataErasure query parameter + * @param op builder for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete addDataErasure( + final Function op) { + return copy().addQueryParam("dataErasure", op.apply(new StringBuilder())); + } + + /** + * set dataErasure with the specified values + * @param dataErasure values to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete withDataErasure( + final Collection dataErasure) { + return copy().withoutQueryParam("dataErasure") + .addQueryParams(dataErasure.stream() + .map(s -> new ParamEntry<>("dataErasure", s.toString())) + .collect(Collectors.toList())); + } + + /** + * add additional dataErasure query parameters + * @param dataErasure values to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete addDataErasure( + final Collection dataErasure) { + return copy().addQueryParams( + dataErasure.stream().map(s -> new ParamEntry<>("dataErasure", s.toString())).collect(Collectors.toList())); + } + + /** + * set version with the specified value + * @param version value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete withVersion(final TValue version) { + return copy().withQueryParam("version", version); + } + + /** + * add additional version query parameter + * @param version value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete 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; + + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete that = (ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete) 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete copy() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet.java new file mode 100644 index 00000000000..a48055a1044 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet.java @@ -0,0 +1,227 @@ + +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}")
+ *            .stagedQuotes()
+ *            .withId("{ID}")
+ *            .get()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String ID) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.ID = ID; + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet(ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet 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/staged-quotes/%s", this.projectKey, this.storeKey, + 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.staged_quote.StagedQuote.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.staged_quote.StagedQuote.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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet 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; + + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet that = (ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet) 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet copy() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDHead.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDHead.java new file mode 100644 index 00000000000..ba29131b373 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDHead.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 StagedQuote exists for a given id. Returns a 200 OK status if the StagedQuote exists or a 404 Not Found otherwise.

+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .stagedQuotes()
+ *            .withId("{ID}")
+ *            .head()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDHead 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDHead(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String ID) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.ID = ID; + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDHead( + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDHead 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/staged-quotes/%s", this.projectKey, this.storeKey, + 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; + + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDHead that = (ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDHead) 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDHead copy() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDHead(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost.java new file mode 100644 index 00000000000..8dac07e6f22 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost.java @@ -0,0 +1,252 @@ + +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}")
+ *            .stagedQuotes()
+ *            .withId("{ID}")
+ *            .post(null)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost 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.staged_quote.StagedQuoteUpdate stagedQuoteUpdate; + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String ID, com.commercetools.api.models.staged_quote.StagedQuoteUpdate stagedQuoteUpdate) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.ID = ID; + this.stagedQuoteUpdate = stagedQuoteUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost( + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.ID = t.ID; + this.stagedQuoteUpdate = t.stagedQuoteUpdate; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/staged-quotes/%s", this.projectKey, this.storeKey, + 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(stagedQuoteUpdate))); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.staged_quote.StagedQuote.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.staged_quote.StagedQuote.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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost addExpand(final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public com.commercetools.api.models.staged_quote.StagedQuoteUpdate getBody() { + return stagedQuoteUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost withBody( + com.commercetools.api.models.staged_quote.StagedQuoteUpdate stagedQuoteUpdate) { + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost t = copy(); + t.stagedQuoteUpdate = stagedQuoteUpdate; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost that = (ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(ID, that.ID) + .append(stagedQuoteUpdate, that.stagedQuoteUpdate) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey) + .append(storeKey) + .append(ID) + .append(stagedQuoteUpdate) + .toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost copy() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString.java new file mode 100644 index 00000000000..f367577664c --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString.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}")
+ *            .stagedQuotes()
+ *            .withId("{ID}")
+ *            .post("")
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString 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 stagedQuoteUpdate; + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString(final ApiHttpClient apiHttpClient, + String projectKey, String storeKey, String ID, String stagedQuoteUpdate) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.ID = ID; + this.stagedQuoteUpdate = stagedQuoteUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString( + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.ID = t.ID; + this.stagedQuoteUpdate = t.stagedQuoteUpdate; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/staged-quotes/%s", this.projectKey, this.storeKey, + this.ID); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(), + stagedQuoteUpdate.getBytes(StandardCharsets.UTF_8)); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.staged_quote.StagedQuote.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.staged_quote.StagedQuote.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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param value type + * @param expand value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString addExpand( + final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public String getBody() { + return stagedQuoteUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString withBody(String stagedQuoteUpdate) { + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString t = copy(); + t.stagedQuoteUpdate = stagedQuoteUpdate; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString that = (ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(ID, that.ID) + .append(stagedQuoteUpdate, that.stagedQuoteUpdate) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey) + .append(storeKey) + .append(ID) + .append(stagedQuoteUpdate) + .toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString copy() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestBuilder.java new file mode 100644 index 00000000000..8d3dffbeee5 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestBuilder.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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestBuilder { + + private final ApiHttpClient apiHttpClient; + private final String projectKey; + private final String storeKey; + private final String ID; + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestBuilder(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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet get() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDGet(apiHttpClient, projectKey, storeKey, ID); + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDHead head() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDHead(apiHttpClient, projectKey, storeKey, ID); + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost post( + com.commercetools.api.models.staged_quote.StagedQuoteUpdate stagedQuoteUpdate) { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost(apiHttpClient, projectKey, storeKey, ID, + stagedQuoteUpdate); + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString post(final String stagedQuoteUpdate) { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPostString(apiHttpClient, projectKey, storeKey, ID, + stagedQuoteUpdate); + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDPost post( + UnaryOperator op) { + return post(op.apply(com.commercetools.api.models.staged_quote.StagedQuoteUpdateBuilder.of()).build()); + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete delete() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete(apiHttpClient, projectKey, storeKey, ID); + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDDelete delete(TValue version) { + return delete().withVersion(version); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet.java new file mode 100644 index 00000000000..d889e729074 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet.java @@ -0,0 +1,686 @@ + +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}")
+ *            .stagedQuotes()
+ *            .get()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet(ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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/staged-quotes", this.projectKey, 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.staged_quote.StagedQuotePagedQueryResponse.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.staged_quote.StagedQuotePagedQueryResponse.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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet withSort(final TValue sort) { + return copy().withQueryParam("sort", sort); + } + + /** + * add additional sort query parameter + * @param sort value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet withLimit(final TValue limit) { + return copy().withQueryParam("limit", limit); + } + + /** + * add additional limit query parameter + * @param limit value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet withOffset(final TValue offset) { + return copy().withQueryParam("offset", offset); + } + + /** + * add additional offset query parameter + * @param offset value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet withWithTotal(final TValue withTotal) { + return copy().withQueryParam("withTotal", withTotal); + } + + /** + * add additional withTotal query parameter + * @param withTotal value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet withWhere(final TValue where) { + return copy().withQueryParam("where", where); + } + + /** + * add additional where query parameter + * @param where value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet 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; + + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet that = (ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet) 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet copy() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead.java new file mode 100644 index 00000000000..2125bcf5200 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead.java @@ -0,0 +1,208 @@ + +package com.commercetools.api.client; + +import java.net.URI; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import com.fasterxml.jackson.core.type.TypeReference; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + *

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

+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .stagedQuotes()
+ *            .head()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead + 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead(ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead 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/staged-quotes", this.projectKey, 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead withWhere(final TValue where) { + return copy().withQueryParam("where", where); + } + + /** + * add additional where query parameter + * @param where value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead 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; + + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead that = (ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead) 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead copy() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete.java new file mode 100644 index 00000000000..3ba0c750430 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete.java @@ -0,0 +1,413 @@ + +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}")
+ *            .stagedQuotes()
+ *            .withKey("{key}")
+ *            .delete()
+ *            .withVersion(version)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete extends + TypeApiMethod + implements + com.commercetools.api.client.DataerasureTrait, + com.commercetools.api.client.VersionedTrait, + com.commercetools.api.client.ConflictingTrait, + com.commercetools.api.client.ExpandableTrait, + com.commercetools.api.client.ErrorableTrait, + com.commercetools.api.client.Deprecatable200Trait { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + private String storeKey; + private String key; + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete(final ApiHttpClient apiHttpClient, + String projectKey, String storeKey, String key) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.key = key; + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete( + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete 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/staged-quotes/key=%s", this.projectKey, + this.storeKey, 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.staged_quote.StagedQuote.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.staged_quote.StagedQuote.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public String getStoreKey() { + return this.storeKey; + } + + public String getKey() { + return this.key; + } + + public List getDataErasure() { + return this.getQueryParam("dataErasure"); + } + + public List getVersion() { + return this.getQueryParam("version"); + } + + public List getExpand() { + return this.getQueryParam("expand"); + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public void setStoreKey(final String storeKey) { + this.storeKey = storeKey; + } + + public void setKey(final String key) { + this.key = key; + } + + /** + * set dataErasure with the specified value + * @param dataErasure value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete withDataErasure( + final TValue dataErasure) { + return copy().withQueryParam("dataErasure", dataErasure); + } + + /** + * add additional dataErasure query parameter + * @param dataErasure value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete addDataErasure( + final TValue dataErasure) { + return copy().addQueryParam("dataErasure", dataErasure); + } + + /** + * set dataErasure with the specified value + * @param supplier supplier for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete withDataErasure( + final Supplier supplier) { + return copy().withQueryParam("dataErasure", supplier.get()); + } + + /** + * add additional dataErasure query parameter + * @param supplier supplier for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete addDataErasure(final Supplier supplier) { + return copy().addQueryParam("dataErasure", supplier.get()); + } + + /** + * set dataErasure with the specified value + * @param op builder for the value to be set + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete withDataErasure( + final Function op) { + return copy().withQueryParam("dataErasure", op.apply(new StringBuilder())); + } + + /** + * add additional dataErasure query parameter + * @param op builder for the value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete addDataErasure( + final Function op) { + return copy().addQueryParam("dataErasure", op.apply(new StringBuilder())); + } + + /** + * set dataErasure with the specified values + * @param dataErasure values to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete withDataErasure( + final Collection dataErasure) { + return copy().withoutQueryParam("dataErasure") + .addQueryParams(dataErasure.stream() + .map(s -> new ParamEntry<>("dataErasure", s.toString())) + .collect(Collectors.toList())); + } + + /** + * add additional dataErasure query parameters + * @param dataErasure values to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete addDataErasure( + final Collection dataErasure) { + return copy().addQueryParams( + dataErasure.stream().map(s -> new ParamEntry<>("dataErasure", s.toString())).collect(Collectors.toList())); + } + + /** + * set version with the specified value + * @param version value to be set + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete withVersion(final TValue version) { + return copy().withQueryParam("version", version); + } + + /** + * add additional version query parameter + * @param version value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete 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; + + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete that = (ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete) 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete copy() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet.java new file mode 100644 index 00000000000..279da1c3be8 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet.java @@ -0,0 +1,230 @@ + +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}")
+ *            .stagedQuotes()
+ *            .withKey("{key}")
+ *            .get()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String key) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.key = key; + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet( + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet 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/staged-quotes/key=%s", this.projectKey, + this.storeKey, 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.staged_quote.StagedQuote.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.staged_quote.StagedQuote.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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet 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; + + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet that = (ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet) 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet copy() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyHead.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyHead.java new file mode 100644 index 00000000000..bb827821719 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyHead.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 StagedQuote exists for a given key. Returns a 200 OK status if the StagedQuote exists or a 404 Not Found otherwise.

+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKey("{projectKey}")
+ *            .inStoreKeyWithStoreKeyValue("{storeKey}")
+ *            .stagedQuotes()
+ *            .withKey("{key}")
+ *            .head()
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyHead 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyHead(final ApiHttpClient apiHttpClient, + String projectKey, String storeKey, String key) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.key = key; + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyHead( + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyHead 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/staged-quotes/key=%s", this.projectKey, + this.storeKey, 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; + + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyHead that = (ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyHead) 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyHead copy() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyHead(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost.java new file mode 100644 index 00000000000..34ea4495f2f --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost.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}")
+ *            .stagedQuotes()
+ *            .withKey("{key}")
+ *            .post(null)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost 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.staged_quote.StagedQuoteUpdate stagedQuoteUpdate; + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost(final ApiHttpClient apiHttpClient, + String projectKey, String storeKey, String key, + com.commercetools.api.models.staged_quote.StagedQuoteUpdate stagedQuoteUpdate) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.key = key; + this.stagedQuoteUpdate = stagedQuoteUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost( + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.key = t.key; + this.stagedQuoteUpdate = t.stagedQuoteUpdate; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/staged-quotes/key=%s", this.projectKey, + this.storeKey, 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(stagedQuoteUpdate))); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.staged_quote.StagedQuote.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.staged_quote.StagedQuote.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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost addExpand( + final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public com.commercetools.api.models.staged_quote.StagedQuoteUpdate getBody() { + return stagedQuoteUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost withBody( + com.commercetools.api.models.staged_quote.StagedQuoteUpdate stagedQuoteUpdate) { + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost t = copy(); + t.stagedQuoteUpdate = stagedQuoteUpdate; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost that = (ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(key, that.key) + .append(stagedQuoteUpdate, that.stagedQuoteUpdate) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey) + .append(storeKey) + .append(key) + .append(stagedQuoteUpdate) + .toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost copy() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString.java new file mode 100644 index 00000000000..0d00ee9cf0c --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString.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}")
+ *            .stagedQuotes()
+ *            .withKey("{key}")
+ *            .post("")
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString 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 stagedQuoteUpdate; + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString(final ApiHttpClient apiHttpClient, + String projectKey, String storeKey, String key, String stagedQuoteUpdate) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.key = key; + this.stagedQuoteUpdate = stagedQuoteUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString( + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.key = t.key; + this.stagedQuoteUpdate = t.stagedQuoteUpdate; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/staged-quotes/key=%s", this.projectKey, + this.storeKey, this.key); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(), + stagedQuoteUpdate.getBytes(StandardCharsets.UTF_8)); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.staged_quote.StagedQuote.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.staged_quote.StagedQuote.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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param value type + * @param expand value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString addExpand( + final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public String getBody() { + return stagedQuoteUpdate; + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString withBody(String stagedQuoteUpdate) { + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString t = copy(); + t.stagedQuoteUpdate = stagedQuoteUpdate; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString that = (ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(key, that.key) + .append(stagedQuoteUpdate, that.stagedQuoteUpdate) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey) + .append(storeKey) + .append(key) + .append(stagedQuoteUpdate) + .toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString copy() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestBuilder.java new file mode 100644 index 00000000000..69701a3bcf4 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestBuilder.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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestBuilder { + + private final ApiHttpClient apiHttpClient; + private final String projectKey; + private final String storeKey; + private final String key; + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestBuilder(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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet get() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyGet(apiHttpClient, projectKey, storeKey, key); + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyHead head() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyHead(apiHttpClient, projectKey, storeKey, key); + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost post( + com.commercetools.api.models.staged_quote.StagedQuoteUpdate stagedQuoteUpdate) { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost(apiHttpClient, projectKey, storeKey, key, + stagedQuoteUpdate); + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString post(final String stagedQuoteUpdate) { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPostString(apiHttpClient, projectKey, storeKey, + key, stagedQuoteUpdate); + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyPost post( + UnaryOperator op) { + return post(op.apply(com.commercetools.api.models.staged_quote.StagedQuoteUpdateBuilder.of()).build()); + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete delete() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete(apiHttpClient, projectKey, storeKey, key); + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyDelete delete(TValue version) { + return delete().withVersion(version); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost.java new file mode 100644 index 00000000000..7b922e0e7f0 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost.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}")
+ *            .stagedQuotes()
+ *            .post(null)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost 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.staged_quote.StagedQuoteDraft stagedQuoteDraft; + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, com.commercetools.api.models.staged_quote.StagedQuoteDraft stagedQuoteDraft) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.stagedQuoteDraft = stagedQuoteDraft; + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost(ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.stagedQuoteDraft = t.stagedQuoteDraft; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/staged-quotes", this.projectKey, 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(stagedQuoteDraft))); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.staged_quote.StagedQuote.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.staged_quote.StagedQuote.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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param expand value to be added + * @param value type + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost addExpand(final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public com.commercetools.api.models.staged_quote.StagedQuoteDraft getBody() { + return stagedQuoteDraft; + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost withBody( + com.commercetools.api.models.staged_quote.StagedQuoteDraft stagedQuoteDraft) { + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost t = copy(); + t.stagedQuoteDraft = stagedQuoteDraft; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost that = (ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(stagedQuoteDraft, that.stagedQuoteDraft) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(storeKey).append(stagedQuoteDraft).toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost copy() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString.java new file mode 100644 index 00000000000..5d48730f163 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString.java @@ -0,0 +1,232 @@ + +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}")
+ *            .stagedQuotes()
+ *            .post("")
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString 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 stagedQuoteDraft; + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString(final ApiHttpClient apiHttpClient, String projectKey, + String storeKey, String stagedQuoteDraft) { + super(apiHttpClient); + this.projectKey = projectKey; + this.storeKey = storeKey; + this.stagedQuoteDraft = stagedQuoteDraft; + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString( + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString t) { + super(t); + this.projectKey = t.projectKey; + this.storeKey = t.storeKey; + this.stagedQuoteDraft = t.stagedQuoteDraft; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/in-store/key=%s/staged-quotes", this.projectKey, this.storeKey); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(), + stagedQuoteDraft.getBytes(StandardCharsets.UTF_8)); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.api.models.staged_quote.StagedQuote.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.api.models.staged_quote.StagedQuote.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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString withExpand(final TValue expand) { + return copy().withQueryParam("expand", expand); + } + + /** + * add additional expand query parameter + * @param value type + * @param expand value to be added + * @return ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString 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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString + */ + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString addExpand(final Collection expand) { + return copy().addQueryParams( + expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); + } + + public String getBody() { + return stagedQuoteDraft; + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString withBody(String stagedQuoteDraft) { + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString t = copy(); + t.stagedQuoteDraft = stagedQuoteDraft; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString that = (ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(storeKey, that.storeKey) + .append(stagedQuoteDraft, that.stagedQuoteDraft) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(storeKey).append(stagedQuoteDraft).toHashCode(); + } + + @Override + protected ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString copy() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString(this); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestBuilder.java new file mode 100644 index 00000000000..0d8b6694b5b --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestBuilder.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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestBuilder { + + private final ApiHttpClient apiHttpClient; + private final String projectKey; + private final String storeKey; + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesRequestBuilder(final ApiHttpClient apiHttpClient, + final String projectKey, final String storeKey) { + this.apiHttpClient = apiHttpClient; + this.projectKey = projectKey; + this.storeKey = storeKey; + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet get() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesGet(apiHttpClient, projectKey, storeKey); + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead head() { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesHead(apiHttpClient, projectKey, storeKey); + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost post( + com.commercetools.api.models.staged_quote.StagedQuoteDraft stagedQuoteDraft) { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost(apiHttpClient, projectKey, storeKey, + stagedQuoteDraft); + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString post(final String stagedQuoteDraft) { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPostString(apiHttpClient, projectKey, storeKey, + stagedQuoteDraft); + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesPost post( + UnaryOperator op) { + return post(op.apply(com.commercetools.api.models.staged_quote.StagedQuoteDraftBuilder.of()).build()); + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestBuilder withKey(String key) { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyRequestBuilder(apiHttpClient, projectKey, + storeKey, key); + } + + public ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestBuilder withId(String ID) { + return new ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDRequestBuilder(apiHttpClient, projectKey, storeKey, + ID); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/staged_quote/StagedQuote.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/staged_quote/StagedQuote.java index 91a9fac5430..a1d8d77244b 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/staged_quote/StagedQuote.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/staged_quote/StagedQuote.java @@ -16,6 +16,7 @@ import com.commercetools.api.models.customer.CustomerReference; import com.commercetools.api.models.quote_request.QuoteRequestReference; import com.commercetools.api.models.state.StateReference; +import com.commercetools.api.models.store.StoreKeyReference; import com.commercetools.api.models.type.CustomFields; import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.annotation.*; @@ -186,6 +187,14 @@ public interface StagedQuote extends BaseResource, com.commercetools.api.models. @JsonProperty("businessUnit") public BusinessUnitKeyReference getBusinessUnit(); + /** + *

The Store to which the Buyer belongs.

+ * @return store + */ + @Valid + @JsonProperty("store") + public StoreKeyReference getStore(); + /** *

The unique ID of the StagedQuote.

* @param id value to be set @@ -305,6 +314,13 @@ public interface StagedQuote extends BaseResource, com.commercetools.api.models. public void setBusinessUnit(final BusinessUnitKeyReference businessUnit); + /** + *

The Store to which the Buyer belongs.

+ * @param store value to be set + */ + + public void setStore(final StoreKeyReference store); + /** * factory method * @return instance of StagedQuote @@ -337,6 +353,7 @@ public static StagedQuote of(final StagedQuote template) { instance.setState(template.getState()); instance.setPurchaseOrderNumber(template.getPurchaseOrderNumber()); instance.setBusinessUnit(template.getBusinessUnit()); + instance.setStore(template.getStore()); return instance; } @@ -372,6 +389,7 @@ public static StagedQuote deepCopy(@Nullable final StagedQuote template) { instance.setPurchaseOrderNumber(template.getPurchaseOrderNumber()); instance.setBusinessUnit( com.commercetools.api.models.business_unit.BusinessUnitKeyReference.deepCopy(template.getBusinessUnit())); + instance.setStore(com.commercetools.api.models.store.StoreKeyReference.deepCopy(template.getStore())); return instance; } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/staged_quote/StagedQuoteBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/staged_quote/StagedQuoteBuilder.java index a3e470cd3f4..6324951b976 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/staged_quote/StagedQuoteBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/staged_quote/StagedQuoteBuilder.java @@ -74,6 +74,9 @@ public class StagedQuoteBuilder implements Builder { @Nullable private com.commercetools.api.models.business_unit.BusinessUnitKeyReference businessUnit; + @Nullable + private com.commercetools.api.models.store.StoreKeyReference store; + /** *

The unique ID of the StagedQuote.

* @param id value to be set @@ -462,6 +465,41 @@ public StagedQuoteBuilder businessUnit( return this; } + /** + *

The Store to which the Buyer belongs.

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

The Store to which the Buyer belongs.

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

The Store to which the Buyer belongs.

+ * @param store value to be set + * @return Builder + */ + + public StagedQuoteBuilder store(@Nullable final com.commercetools.api.models.store.StoreKeyReference store) { + this.store = store; + return this; + } + /** *

The unique ID of the StagedQuote.

* @return id @@ -625,6 +663,16 @@ public com.commercetools.api.models.business_unit.BusinessUnitKeyReference getBu return this.businessUnit; } + /** + *

The Store to which the Buyer belongs.

+ * @return store + */ + + @Nullable + public com.commercetools.api.models.store.StoreKeyReference getStore() { + return this.store; + } + /** * builds StagedQuote with checking for non-null required values * @return StagedQuote @@ -639,7 +687,7 @@ public StagedQuote build() { Objects.requireNonNull(quotationCart, StagedQuote.class + ": quotationCart is missing"); return new StagedQuoteImpl(id, version, createdAt, lastModifiedAt, key, lastModifiedBy, createdBy, stagedQuoteState, customer, quoteRequest, quotationCart, validTo, sellerComment, custom, state, - purchaseOrderNumber, businessUnit); + purchaseOrderNumber, businessUnit, store); } /** @@ -649,7 +697,7 @@ public StagedQuote build() { public StagedQuote buildUnchecked() { return new StagedQuoteImpl(id, version, createdAt, lastModifiedAt, key, lastModifiedBy, createdBy, stagedQuoteState, customer, quoteRequest, quotationCart, validTo, sellerComment, custom, state, - purchaseOrderNumber, businessUnit); + purchaseOrderNumber, businessUnit, store); } /** @@ -684,6 +732,7 @@ public static StagedQuoteBuilder of(final StagedQuote template) { builder.state = template.getState(); builder.purchaseOrderNumber = template.getPurchaseOrderNumber(); builder.businessUnit = template.getBusinessUnit(); + builder.store = template.getStore(); return builder; } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/staged_quote/StagedQuoteImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/staged_quote/StagedQuoteImpl.java index ac89769eecd..5c785713dc5 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/staged_quote/StagedQuoteImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/staged_quote/StagedQuoteImpl.java @@ -56,6 +56,8 @@ public class StagedQuoteImpl implements StagedQuote, ModelBase { private com.commercetools.api.models.business_unit.BusinessUnitKeyReference businessUnit; + private com.commercetools.api.models.store.StoreKeyReference store; + /** * create instance with all properties */ @@ -75,7 +77,8 @@ public class StagedQuoteImpl implements StagedQuote, ModelBase { @JsonProperty("custom") final com.commercetools.api.models.type.CustomFields custom, @JsonProperty("state") final com.commercetools.api.models.state.StateReference state, @JsonProperty("purchaseOrderNumber") final String purchaseOrderNumber, - @JsonProperty("businessUnit") final com.commercetools.api.models.business_unit.BusinessUnitKeyReference businessUnit) { + @JsonProperty("businessUnit") final com.commercetools.api.models.business_unit.BusinessUnitKeyReference businessUnit, + @JsonProperty("store") final com.commercetools.api.models.store.StoreKeyReference store) { this.id = id; this.version = version; this.createdAt = createdAt; @@ -93,6 +96,7 @@ public class StagedQuoteImpl implements StagedQuote, ModelBase { this.state = state; this.purchaseOrderNumber = purchaseOrderNumber; this.businessUnit = businessUnit; + this.store = store; } /** @@ -237,6 +241,14 @@ public com.commercetools.api.models.business_unit.BusinessUnitKeyReference getBu return this.businessUnit; } + /** + *

The Store to which the Buyer belongs.

+ */ + + public com.commercetools.api.models.store.StoreKeyReference getStore() { + return this.store; + } + public void setId(final String id) { this.id = id; } @@ -306,6 +318,10 @@ public void setBusinessUnit( this.businessUnit = businessUnit; } + public void setStore(final com.commercetools.api.models.store.StoreKeyReference store) { + this.store = store; + } + @Override public boolean equals(Object o) { if (this == o) @@ -333,6 +349,7 @@ public boolean equals(Object o) { .append(state, that.state) .append(purchaseOrderNumber, that.purchaseOrderNumber) .append(businessUnit, that.businessUnit) + .append(store, that.store) .append(id, that.id) .append(version, that.version) .append(createdAt, that.createdAt) @@ -350,6 +367,7 @@ public boolean equals(Object o) { .append(state, that.state) .append(purchaseOrderNumber, that.purchaseOrderNumber) .append(businessUnit, that.businessUnit) + .append(store, that.store) .isEquals(); } @@ -372,6 +390,7 @@ public int hashCode() { .append(state) .append(purchaseOrderNumber) .append(businessUnit) + .append(store) .toHashCode(); } @@ -394,6 +413,7 @@ public String toString() { .append("state", state) .append("purchaseOrderNumber", purchaseOrderNumber) .append("businessUnit", businessUnit) + .append("store", store) .build(); } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/staged_quote/StagedQuoteQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/staged_quote/StagedQuoteQueryBuilderDsl.java index 2b1b979d5de..47a49aac972 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/staged_quote/StagedQuoteQueryBuilderDsl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/staged_quote/StagedQuoteQueryBuilderDsl.java @@ -138,4 +138,12 @@ public CombinationQueryPredicate businessUnit( StagedQuoteQueryBuilderDsl::of); } + public CombinationQueryPredicate store( + Function> fn) { + return new CombinationQueryPredicate<>(ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("store")) + .inner(fn.apply(com.commercetools.api.predicates.query.store.StoreKeyReferenceQueryBuilderDsl.of())), + StagedQuoteQueryBuilderDsl::of); + } + } diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesTest.java new file mode 100644 index 00000000000..a3031b43c54 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesTest.java @@ -0,0 +1,85 @@ + +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 ByProjectKeyInStoreKeyByStoreKeyOrdersQuotesTest { + 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") + .orders() + .orderQuote() + .post(com.commercetools.api.models.order.OrderFromQuoteDraft.of()) + .createHttpRequest(), + "post", "test_projectKey/in-store/key=test_storeKey/orders/quotes", } }; + } + + @DataProvider + public static Object[][] executeMethodParameters() { + return new Object[][] { new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .orders() + .orderQuote() + .post(com.commercetools.api.models.order.OrderFromQuoteDraft.of()), } }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDTest.java new file mode 100644 index 00000000000..3a5dd32ee4a --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDTest.java @@ -0,0 +1,201 @@ + +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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsByIDTest { + 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") + .quoteRequests() + .withId("test_ID") + .get() + .withExpand("expand") + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/quote-requests/test_ID?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withId("test_ID") + .get() + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/quote-requests/test_ID", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withId("test_ID") + .head() + .createHttpRequest(), + "head", "test_projectKey/in-store/key=test_storeKey/quote-requests/test_ID", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withId("test_ID") + .post(com.commercetools.api.models.quote_request.QuoteRequestUpdate.of()) + .withExpand("expand") + .createHttpRequest(), + "post", "test_projectKey/in-store/key=test_storeKey/quote-requests/test_ID?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withId("test_ID") + .post(com.commercetools.api.models.quote_request.QuoteRequestUpdate.of()) + .createHttpRequest(), + "post", "test_projectKey/in-store/key=test_storeKey/quote-requests/test_ID", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withId("test_ID") + .delete() + .withDataErasure(true) + .createHttpRequest(), + "delete", + "test_projectKey/in-store/key=test_storeKey/quote-requests/test_ID?dataErasure=true", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withId("test_ID") + .delete() + .withVersion(2) + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/quote-requests/test_ID?version=2", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withId("test_ID") + .delete() + .withExpand("expand") + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/quote-requests/test_ID?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withId("test_ID") + .delete() + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/quote-requests/test_ID", } }; + } + + @DataProvider + public static Object[][] executeMethodParameters() { + return new Object[][] { + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withId("test_ID") + .get() + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withId("test_ID") + .get(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withId("test_ID") + .head(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withId("test_ID") + .post(com.commercetools.api.models.quote_request.QuoteRequestUpdate.of()) + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withId("test_ID") + .post(com.commercetools.api.models.quote_request.QuoteRequestUpdate.of()), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withId("test_ID") + .delete() + .withDataErasure(true), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withId("test_ID") + .delete() + .withVersion(2), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withId("test_ID") + .delete() + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withId("test_ID") + .delete(), } }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyTest.java new file mode 100644 index 00000000000..ecf47286dba --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyTest.java @@ -0,0 +1,204 @@ + +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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsKeyByKeyTest { + 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") + .quoteRequests() + .withKey("test_key") + .get() + .withExpand("expand") + .createHttpRequest(), + "get", + "test_projectKey/in-store/key=test_storeKey/quote-requests/key=test_key?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withKey("test_key") + .get() + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/quote-requests/key=test_key", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withKey("test_key") + .head() + .createHttpRequest(), + "head", "test_projectKey/in-store/key=test_storeKey/quote-requests/key=test_key", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withKey("test_key") + .post(com.commercetools.api.models.quote_request.QuoteRequestUpdate.of()) + .withExpand("expand") + .createHttpRequest(), + "post", + "test_projectKey/in-store/key=test_storeKey/quote-requests/key=test_key?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withKey("test_key") + .post(com.commercetools.api.models.quote_request.QuoteRequestUpdate.of()) + .createHttpRequest(), + "post", "test_projectKey/in-store/key=test_storeKey/quote-requests/key=test_key", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withKey("test_key") + .delete() + .withDataErasure(true) + .createHttpRequest(), + "delete", + "test_projectKey/in-store/key=test_storeKey/quote-requests/key=test_key?dataErasure=true", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withKey("test_key") + .delete() + .withVersion(2) + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/quote-requests/key=test_key?version=2", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withKey("test_key") + .delete() + .withExpand("expand") + .createHttpRequest(), + "delete", + "test_projectKey/in-store/key=test_storeKey/quote-requests/key=test_key?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withKey("test_key") + .delete() + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/quote-requests/key=test_key", } }; + } + + @DataProvider + public static Object[][] executeMethodParameters() { + return new Object[][] { + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withKey("test_key") + .get() + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withKey("test_key") + .get(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withKey("test_key") + .head(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withKey("test_key") + .post(com.commercetools.api.models.quote_request.QuoteRequestUpdate.of()) + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withKey("test_key") + .post(com.commercetools.api.models.quote_request.QuoteRequestUpdate.of()), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withKey("test_key") + .delete() + .withDataErasure(true), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withKey("test_key") + .delete() + .withVersion(2), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withKey("test_key") + .delete() + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .withKey("test_key") + .delete(), } }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsTest.java new file mode 100644 index 00000000000..a77459dd823 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsTest.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 ByProjectKeyInStoreKeyByStoreKeyQuoteRequestsTest { + 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") + .quoteRequests() + .get() + .withExpand("expand") + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/quote-requests?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .get() + .withSort("sort") + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/quote-requests?sort=sort", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .get() + .withLimit(7) + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/quote-requests?limit=7", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .get() + .withOffset(3) + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/quote-requests?offset=3", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .get() + .withWithTotal(true) + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/quote-requests?withTotal=true", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .get() + .withWhere("where") + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/quote-requests?where=where", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .get() + .withPredicateVar("varName", "var.varName") + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/quote-requests?var.varName=var.varName", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .get() + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/quote-requests", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .head() + .withWhere("where") + .createHttpRequest(), + "head", "test_projectKey/in-store/key=test_storeKey/quote-requests?where=where", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .head() + .createHttpRequest(), + "head", "test_projectKey/in-store/key=test_storeKey/quote-requests", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .post(com.commercetools.api.models.quote_request.QuoteRequestDraft.of()) + .withExpand("expand") + .createHttpRequest(), + "post", "test_projectKey/in-store/key=test_storeKey/quote-requests?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .post(com.commercetools.api.models.quote_request.QuoteRequestDraft.of()) + .createHttpRequest(), + "post", "test_projectKey/in-store/key=test_storeKey/quote-requests", } }; + } + + @DataProvider + public static Object[][] executeMethodParameters() { + return new Object[][] { + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .get() + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .get() + .withSort("sort"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .get() + .withLimit(7), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .get() + .withOffset(3), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .get() + .withWithTotal(true), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .get() + .withWhere("where"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .get() + .withPredicateVar("varName", "var.varName"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .get(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .head() + .withWhere("where"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .head(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .post(com.commercetools.api.models.quote_request.QuoteRequestDraft.of()) + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quoteRequests() + .post(com.commercetools.api.models.quote_request.QuoteRequestDraft.of()), } }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyQuotesByIDTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyQuotesByIDTest.java new file mode 100644 index 00000000000..8e5c5c633d4 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyQuotesByIDTest.java @@ -0,0 +1,200 @@ + +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 ByProjectKeyInStoreKeyByStoreKeyQuotesByIDTest { + 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") + .quotes() + .withId("test_ID") + .get() + .withExpand("expand") + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/quotes/test_ID?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withId("test_ID") + .get() + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/quotes/test_ID", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withId("test_ID") + .head() + .createHttpRequest(), + "head", "test_projectKey/in-store/key=test_storeKey/quotes/test_ID", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withId("test_ID") + .post(com.commercetools.api.models.quote.QuoteUpdate.of()) + .withExpand("expand") + .createHttpRequest(), + "post", "test_projectKey/in-store/key=test_storeKey/quotes/test_ID?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withId("test_ID") + .post(com.commercetools.api.models.quote.QuoteUpdate.of()) + .createHttpRequest(), + "post", "test_projectKey/in-store/key=test_storeKey/quotes/test_ID", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withId("test_ID") + .delete() + .withDataErasure(true) + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/quotes/test_ID?dataErasure=true", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withId("test_ID") + .delete() + .withVersion(2) + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/quotes/test_ID?version=2", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withId("test_ID") + .delete() + .withExpand("expand") + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/quotes/test_ID?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withId("test_ID") + .delete() + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/quotes/test_ID", } }; + } + + @DataProvider + public static Object[][] executeMethodParameters() { + return new Object[][] { + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withId("test_ID") + .get() + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withId("test_ID") + .get(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withId("test_ID") + .head(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withId("test_ID") + .post(com.commercetools.api.models.quote.QuoteUpdate.of()) + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withId("test_ID") + .post(com.commercetools.api.models.quote.QuoteUpdate.of()), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withId("test_ID") + .delete() + .withDataErasure(true), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withId("test_ID") + .delete() + .withVersion(2), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withId("test_ID") + .delete() + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withId("test_ID") + .delete(), } }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyTest.java new file mode 100644 index 00000000000..f6270dbd0f2 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyTest.java @@ -0,0 +1,200 @@ + +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 ByProjectKeyInStoreKeyByStoreKeyQuotesKeyByKeyTest { + 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") + .quotes() + .withKey("test_key") + .get() + .withExpand("expand") + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/quotes/key=test_key?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withKey("test_key") + .get() + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/quotes/key=test_key", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withKey("test_key") + .head() + .createHttpRequest(), + "head", "test_projectKey/in-store/key=test_storeKey/quotes/key=test_key", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withKey("test_key") + .post(com.commercetools.api.models.quote.QuoteUpdate.of()) + .withExpand("expand") + .createHttpRequest(), + "post", "test_projectKey/in-store/key=test_storeKey/quotes/key=test_key?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withKey("test_key") + .post(com.commercetools.api.models.quote.QuoteUpdate.of()) + .createHttpRequest(), + "post", "test_projectKey/in-store/key=test_storeKey/quotes/key=test_key", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withKey("test_key") + .delete() + .withDataErasure(true) + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/quotes/key=test_key?dataErasure=true", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withKey("test_key") + .delete() + .withVersion(2) + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/quotes/key=test_key?version=2", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withKey("test_key") + .delete() + .withExpand("expand") + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/quotes/key=test_key?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withKey("test_key") + .delete() + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/quotes/key=test_key", } }; + } + + @DataProvider + public static Object[][] executeMethodParameters() { + return new Object[][] { + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withKey("test_key") + .get() + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withKey("test_key") + .get(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withKey("test_key") + .head(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withKey("test_key") + .post(com.commercetools.api.models.quote.QuoteUpdate.of()) + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withKey("test_key") + .post(com.commercetools.api.models.quote.QuoteUpdate.of()), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withKey("test_key") + .delete() + .withDataErasure(true), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withKey("test_key") + .delete() + .withVersion(2), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withKey("test_key") + .delete() + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .withKey("test_key") + .delete(), } }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyQuotesTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyQuotesTest.java new file mode 100644 index 00000000000..a4cd1bce6db --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyQuotesTest.java @@ -0,0 +1,217 @@ + +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 ByProjectKeyInStoreKeyByStoreKeyQuotesTest { + 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") + .quotes() + .get() + .withExpand("expand") + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/quotes?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .get() + .withSort("sort") + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/quotes?sort=sort", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .get() + .withLimit(7) + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/quotes?limit=7", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .get() + .withOffset(3) + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/quotes?offset=3", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .get() + .withWithTotal(true) + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/quotes?withTotal=true", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .get() + .withWhere("where") + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/quotes?where=where", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .get() + .withPredicateVar("varName", "var.varName") + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/quotes?var.varName=var.varName", }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .get() + .createHttpRequest(), "get", "test_projectKey/in-store/key=test_storeKey/quotes", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .head() + .withWhere("where") + .createHttpRequest(), + "head", "test_projectKey/in-store/key=test_storeKey/quotes?where=where", }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .head() + .createHttpRequest(), "head", "test_projectKey/in-store/key=test_storeKey/quotes", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .post(com.commercetools.api.models.quote.QuoteDraft.of()) + .withExpand("expand") + .createHttpRequest(), + "post", "test_projectKey/in-store/key=test_storeKey/quotes?expand=expand", }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .post(com.commercetools.api.models.quote.QuoteDraft.of()) + .createHttpRequest(), "post", "test_projectKey/in-store/key=test_storeKey/quotes", } }; + } + + @DataProvider + public static Object[][] executeMethodParameters() { + return new Object[][] { + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .get() + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .get() + .withSort("sort"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .get() + .withLimit(7), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .get() + .withOffset(3), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .get() + .withWithTotal(true), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .get() + .withWhere("where"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .get() + .withPredicateVar("varName", "var.varName"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .get(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .head() + .withWhere("where"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .head(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .post(com.commercetools.api.models.quote.QuoteDraft.of()) + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .quotes() + .post(com.commercetools.api.models.quote.QuoteDraft.of()), } }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDTest.java new file mode 100644 index 00000000000..f091164ec14 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDTest.java @@ -0,0 +1,201 @@ + +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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesByIDTest { + 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") + .stagedQuotes() + .withId("test_ID") + .get() + .withExpand("expand") + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/staged-quotes/test_ID?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withId("test_ID") + .get() + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/staged-quotes/test_ID", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withId("test_ID") + .head() + .createHttpRequest(), + "head", "test_projectKey/in-store/key=test_storeKey/staged-quotes/test_ID", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withId("test_ID") + .post(com.commercetools.api.models.staged_quote.StagedQuoteUpdate.of()) + .withExpand("expand") + .createHttpRequest(), + "post", "test_projectKey/in-store/key=test_storeKey/staged-quotes/test_ID?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withId("test_ID") + .post(com.commercetools.api.models.staged_quote.StagedQuoteUpdate.of()) + .createHttpRequest(), + "post", "test_projectKey/in-store/key=test_storeKey/staged-quotes/test_ID", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withId("test_ID") + .delete() + .withDataErasure(true) + .createHttpRequest(), + "delete", + "test_projectKey/in-store/key=test_storeKey/staged-quotes/test_ID?dataErasure=true", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withId("test_ID") + .delete() + .withVersion(2) + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/staged-quotes/test_ID?version=2", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withId("test_ID") + .delete() + .withExpand("expand") + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/staged-quotes/test_ID?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withId("test_ID") + .delete() + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/staged-quotes/test_ID", } }; + } + + @DataProvider + public static Object[][] executeMethodParameters() { + return new Object[][] { + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withId("test_ID") + .get() + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withId("test_ID") + .get(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withId("test_ID") + .head(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withId("test_ID") + .post(com.commercetools.api.models.staged_quote.StagedQuoteUpdate.of()) + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withId("test_ID") + .post(com.commercetools.api.models.staged_quote.StagedQuoteUpdate.of()), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withId("test_ID") + .delete() + .withDataErasure(true), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withId("test_ID") + .delete() + .withVersion(2), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withId("test_ID") + .delete() + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withId("test_ID") + .delete(), } }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyTest.java new file mode 100644 index 00000000000..1e62afbecf6 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyTest.java @@ -0,0 +1,203 @@ + +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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesKeyByKeyTest { + 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") + .stagedQuotes() + .withKey("test_key") + .get() + .withExpand("expand") + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/staged-quotes/key=test_key?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withKey("test_key") + .get() + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/staged-quotes/key=test_key", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withKey("test_key") + .head() + .createHttpRequest(), + "head", "test_projectKey/in-store/key=test_storeKey/staged-quotes/key=test_key", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withKey("test_key") + .post(com.commercetools.api.models.staged_quote.StagedQuoteUpdate.of()) + .withExpand("expand") + .createHttpRequest(), + "post", + "test_projectKey/in-store/key=test_storeKey/staged-quotes/key=test_key?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withKey("test_key") + .post(com.commercetools.api.models.staged_quote.StagedQuoteUpdate.of()) + .createHttpRequest(), + "post", "test_projectKey/in-store/key=test_storeKey/staged-quotes/key=test_key", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withKey("test_key") + .delete() + .withDataErasure(true) + .createHttpRequest(), + "delete", + "test_projectKey/in-store/key=test_storeKey/staged-quotes/key=test_key?dataErasure=true", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withKey("test_key") + .delete() + .withVersion(2) + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/staged-quotes/key=test_key?version=2", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withKey("test_key") + .delete() + .withExpand("expand") + .createHttpRequest(), + "delete", + "test_projectKey/in-store/key=test_storeKey/staged-quotes/key=test_key?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withKey("test_key") + .delete() + .createHttpRequest(), + "delete", "test_projectKey/in-store/key=test_storeKey/staged-quotes/key=test_key", } }; + } + + @DataProvider + public static Object[][] executeMethodParameters() { + return new Object[][] { + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withKey("test_key") + .get() + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withKey("test_key") + .get(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withKey("test_key") + .head(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withKey("test_key") + .post(com.commercetools.api.models.staged_quote.StagedQuoteUpdate.of()) + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withKey("test_key") + .post(com.commercetools.api.models.staged_quote.StagedQuoteUpdate.of()), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withKey("test_key") + .delete() + .withDataErasure(true), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withKey("test_key") + .delete() + .withVersion(2), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withKey("test_key") + .delete() + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .withKey("test_key") + .delete(), } }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesTest.java new file mode 100644 index 00000000000..814930856ec --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyInStoreKeyByStoreKeyStagedQuotesTest.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 ByProjectKeyInStoreKeyByStoreKeyStagedQuotesTest { + 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") + .stagedQuotes() + .get() + .withExpand("expand") + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/staged-quotes?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .get() + .withSort("sort") + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/staged-quotes?sort=sort", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .get() + .withLimit(7) + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/staged-quotes?limit=7", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .get() + .withOffset(3) + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/staged-quotes?offset=3", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .get() + .withWithTotal(true) + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/staged-quotes?withTotal=true", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .get() + .withWhere("where") + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/staged-quotes?where=where", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .get() + .withPredicateVar("varName", "var.varName") + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/staged-quotes?var.varName=var.varName", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .get() + .createHttpRequest(), + "get", "test_projectKey/in-store/key=test_storeKey/staged-quotes", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .head() + .withWhere("where") + .createHttpRequest(), + "head", "test_projectKey/in-store/key=test_storeKey/staged-quotes?where=where", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .head() + .createHttpRequest(), + "head", "test_projectKey/in-store/key=test_storeKey/staged-quotes", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .post(com.commercetools.api.models.staged_quote.StagedQuoteDraft.of()) + .withExpand("expand") + .createHttpRequest(), + "post", "test_projectKey/in-store/key=test_storeKey/staged-quotes?expand=expand", }, + new Object[] { + apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .post(com.commercetools.api.models.staged_quote.StagedQuoteDraft.of()) + .createHttpRequest(), + "post", "test_projectKey/in-store/key=test_storeKey/staged-quotes", } }; + } + + @DataProvider + public static Object[][] executeMethodParameters() { + return new Object[][] { + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .get() + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .get() + .withSort("sort"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .get() + .withLimit(7), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .get() + .withOffset(3), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .get() + .withWithTotal(true), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .get() + .withWhere("where"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .get() + .withPredicateVar("varName", "var.varName"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .get(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .head() + .withWhere("where"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .head(), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .post(com.commercetools.api.models.staged_quote.StagedQuoteDraft.of()) + .withExpand("expand"), }, + new Object[] { apiRoot.withProjectKey("test_projectKey") + .inStoreKeyWithStoreKeyValue("test_storeKey") + .stagedQuotes() + .post(com.commercetools.api.models.staged_quote.StagedQuoteDraft.of()), } }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/staged_quote/StagedQuoteTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/staged_quote/StagedQuoteTest.java index a8f9a3e2862..33d33d3f6a2 100644 --- a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/staged_quote/StagedQuoteTest.java +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/staged_quote/StagedQuoteTest.java @@ -51,8 +51,9 @@ public static Object[][] objectBuilder() { StagedQuote.builder().state(new com.commercetools.api.models.state.StateReferenceImpl()) }, new Object[] { StagedQuote.builder().purchaseOrderNumber("purchaseOrderNumber") }, new Object[] { StagedQuote.builder() - .businessUnit( - new com.commercetools.api.models.business_unit.BusinessUnitKeyReferenceImpl()) } }; + .businessUnit(new com.commercetools.api.models.business_unit.BusinessUnitKeyReferenceImpl()) }, + new Object[] { + StagedQuote.builder().store(new com.commercetools.api.models.store.StoreKeyReferenceImpl()) } }; } @Test @@ -179,4 +180,12 @@ public void businessUnit() { Assertions.assertThat(value.getBusinessUnit()) .isEqualTo(new com.commercetools.api.models.business_unit.BusinessUnitKeyReferenceImpl()); } + + @Test + public void store() { + StagedQuote value = StagedQuote.of(); + value.setStore(new com.commercetools.api.models.store.StoreKeyReferenceImpl()); + Assertions.assertThat(value.getStore()) + .isEqualTo(new com.commercetools.api.models.store.StoreKeyReferenceImpl()); + } } diff --git a/references.txt b/references.txt index b35ed97fc18..570c2687b83 100644 --- a/references.txt +++ b/references.txt @@ -262,3 +262,4 @@ a1588f9bea129df23185d9d40c70ea96ef1d8b6e a535e06bc2906c4f8b803f5a7686cbb920afd40a 4e0ef097a71501b7c84a50ca321310ab42e27011 c59cca7c5461c092dba5dc5bd547a9d62e404ad5 +dd8eca14a0c47d154e4c705909a3d2696369bfd1