getTaxLines() {
+ return taxLines;
+ }
+
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ShopifySubscriptionVersionItem shopifySubscriptionVersionItem = (ShopifySubscriptionVersionItem) o;
+ return Objects.equals(this.priceIncludingTax, shopifySubscriptionVersionItem.priceIncludingTax) &&
+ Objects.equals(this.priceStrategy, shopifySubscriptionVersionItem.priceStrategy) &&
+ Objects.equals(this.product, shopifySubscriptionVersionItem.product) &&
+ Objects.equals(this.quantity, shopifySubscriptionVersionItem.quantity) &&
+ Objects.equals(this.taxLines, shopifySubscriptionVersionItem.taxLines);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(priceIncludingTax, priceStrategy, product, quantity, taxLines);
+ }
+
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ShopifySubscriptionVersionItem {\n");
+
+ sb.append(" priceIncludingTax: ").append(toIndentedString(priceIncludingTax)).append("\n");
+ sb.append(" priceStrategy: ").append(toIndentedString(priceStrategy)).append("\n");
+ sb.append(" product: ").append(toIndentedString(product)).append("\n");
+ sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n");
+ sb.append(" taxLines: ").append(toIndentedString(taxLines)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/src/main/java/com/postfinancecheckout/sdk/model/ShopifySubscriptionVersionItemPriceStrategy.java b/src/main/java/com/postfinancecheckout/sdk/model/ShopifySubscriptionVersionItemPriceStrategy.java
new file mode 100644
index 0000000..2ef39c5
--- /dev/null
+++ b/src/main/java/com/postfinancecheckout/sdk/model/ShopifySubscriptionVersionItemPriceStrategy.java
@@ -0,0 +1,66 @@
+/**
+* PostFinance Checkout SDK
+*
+* This library allows to interact with the PostFinance Checkout payment service.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+
+package com.postfinancecheckout.sdk.model;
+
+import java.util.Objects;
+import java.util.Arrays;
+import io.swagger.annotations.ApiModel;
+import java.util.*;
+import java.time.OffsetDateTime;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ *
+ */
+public enum ShopifySubscriptionVersionItemPriceStrategy {
+
+ INITIALLY_CALCULATED("INITIALLY_CALCULATED"),
+
+ RECALCULATE("RECALCULATE");
+
+ private String value;
+
+ ShopifySubscriptionVersionItemPriceStrategy(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ @JsonCreator
+ public static ShopifySubscriptionVersionItemPriceStrategy fromValue(String text) {
+ for (ShopifySubscriptionVersionItemPriceStrategy b : ShopifySubscriptionVersionItemPriceStrategy.values()) {
+ if (String.valueOf(b.value).equals(text)) {
+ return b;
+ }
+ }
+ return null;
+ }
+}
+
diff --git a/src/main/java/com/postfinancecheckout/sdk/model/ShopifySubscriptionVersionState.java b/src/main/java/com/postfinancecheckout/sdk/model/ShopifySubscriptionVersionState.java
new file mode 100644
index 0000000..f978bbf
--- /dev/null
+++ b/src/main/java/com/postfinancecheckout/sdk/model/ShopifySubscriptionVersionState.java
@@ -0,0 +1,68 @@
+/**
+* PostFinance Checkout SDK
+*
+* This library allows to interact with the PostFinance Checkout payment service.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+
+package com.postfinancecheckout.sdk.model;
+
+import java.util.Objects;
+import java.util.Arrays;
+import io.swagger.annotations.ApiModel;
+import java.util.*;
+import java.time.OffsetDateTime;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ *
+ */
+public enum ShopifySubscriptionVersionState {
+
+ CREATE("CREATE"),
+
+ ACTIVE("ACTIVE"),
+
+ DISCHARGED("DISCHARGED");
+
+ private String value;
+
+ ShopifySubscriptionVersionState(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ @JsonCreator
+ public static ShopifySubscriptionVersionState fromValue(String text) {
+ for (ShopifySubscriptionVersionState b : ShopifySubscriptionVersionState.values()) {
+ if (String.valueOf(b.value).equals(text)) {
+ return b;
+ }
+ }
+ return null;
+ }
+}
+
diff --git a/src/main/java/com/postfinancecheckout/sdk/model/ShopifySubscriptionWeekday.java b/src/main/java/com/postfinancecheckout/sdk/model/ShopifySubscriptionWeekday.java
new file mode 100644
index 0000000..0337259
--- /dev/null
+++ b/src/main/java/com/postfinancecheckout/sdk/model/ShopifySubscriptionWeekday.java
@@ -0,0 +1,76 @@
+/**
+* PostFinance Checkout SDK
+*
+* This library allows to interact with the PostFinance Checkout payment service.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+
+package com.postfinancecheckout.sdk.model;
+
+import java.util.Objects;
+import java.util.Arrays;
+import io.swagger.annotations.ApiModel;
+import java.util.*;
+import java.time.OffsetDateTime;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ *
+ */
+public enum ShopifySubscriptionWeekday {
+
+ MONDAY("MONDAY"),
+
+ TUESDAY("TUESDAY"),
+
+ WEDNESDAY("WEDNESDAY"),
+
+ THURSDAY("THURSDAY"),
+
+ FRIDAY("FRIDAY"),
+
+ SATURDAY("SATURDAY"),
+
+ SUNDAY("SUNDAY");
+
+ private String value;
+
+ ShopifySubscriptionWeekday(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ @JsonCreator
+ public static ShopifySubscriptionWeekday fromValue(String text) {
+ for (ShopifySubscriptionWeekday b : ShopifySubscriptionWeekday.values()) {
+ if (String.valueOf(b.value).equals(text)) {
+ return b;
+ }
+ }
+ return null;
+ }
+}
+
diff --git a/src/main/java/com/postfinancecheckout/sdk/model/ShopifyTaxLine.java b/src/main/java/com/postfinancecheckout/sdk/model/ShopifyTaxLine.java
new file mode 100644
index 0000000..3146db6
--- /dev/null
+++ b/src/main/java/com/postfinancecheckout/sdk/model/ShopifyTaxLine.java
@@ -0,0 +1,160 @@
+/**
+* PostFinance Checkout SDK
+*
+* This library allows to interact with the PostFinance Checkout payment service.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+
+package com.postfinancecheckout.sdk.model;
+
+import java.util.Objects;
+import java.util.Arrays;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.math.BigDecimal;
+import java.util.*;
+import java.time.OffsetDateTime;
+
+/**
+ *
+ */
+@ApiModel(description = "")
+
+public class ShopifyTaxLine {
+
+ @JsonProperty("fractionRate")
+ protected BigDecimal fractionRate = null;
+
+
+ @JsonProperty("id")
+ protected Long id = null;
+
+
+ @JsonProperty("rate")
+ protected BigDecimal rate = null;
+
+
+ @JsonProperty("title")
+ protected String title = null;
+
+
+ @JsonProperty("version")
+ protected Integer version = null;
+
+
+
+ /**
+ *
+ * @return fractionRate
+ **/
+ @ApiModelProperty(value = "")
+ public BigDecimal getFractionRate() {
+ return fractionRate;
+ }
+
+
+ /**
+ * The ID is the primary key of the entity. The ID identifies the entity uniquely.
+ * @return id
+ **/
+ @ApiModelProperty(value = "The ID is the primary key of the entity. The ID identifies the entity uniquely.")
+ public Long getId() {
+ return id;
+ }
+
+
+ /**
+ *
+ * @return rate
+ **/
+ @ApiModelProperty(value = "")
+ public BigDecimal getRate() {
+ return rate;
+ }
+
+
+ /**
+ *
+ * @return title
+ **/
+ @ApiModelProperty(value = "")
+ public String getTitle() {
+ return title;
+ }
+
+
+ /**
+ * The version number indicates the version of the entity. The version is incremented whenever the entity is changed.
+ * @return version
+ **/
+ @ApiModelProperty(value = "The version number indicates the version of the entity. The version is incremented whenever the entity is changed.")
+ public Integer getVersion() {
+ return version;
+ }
+
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ShopifyTaxLine shopifyTaxLine = (ShopifyTaxLine) o;
+ return Objects.equals(this.fractionRate, shopifyTaxLine.fractionRate) &&
+ Objects.equals(this.id, shopifyTaxLine.id) &&
+ Objects.equals(this.rate, shopifyTaxLine.rate) &&
+ Objects.equals(this.title, shopifyTaxLine.title) &&
+ Objects.equals(this.version, shopifyTaxLine.version);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(fractionRate, id, rate, title, version);
+ }
+
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ShopifyTaxLine {\n");
+
+ sb.append(" fractionRate: ").append(toIndentedString(fractionRate)).append("\n");
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" rate: ").append(toIndentedString(rate)).append("\n");
+ sb.append(" title: ").append(toIndentedString(title)).append("\n");
+ sb.append(" version: ").append(toIndentedString(version)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/src/main/java/com/postfinancecheckout/sdk/model/TerminalReceiptFetchRequest.java b/src/main/java/com/postfinancecheckout/sdk/model/TerminalReceiptFetchRequest.java
new file mode 100644
index 0000000..e41f396
--- /dev/null
+++ b/src/main/java/com/postfinancecheckout/sdk/model/TerminalReceiptFetchRequest.java
@@ -0,0 +1,155 @@
+/**
+* PostFinance Checkout SDK
+*
+* This library allows to interact with the PostFinance Checkout payment service.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+
+package com.postfinancecheckout.sdk.model;
+
+import java.util.Objects;
+import java.util.Arrays;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.postfinancecheckout.sdk.model.TerminalReceiptFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.*;
+import java.time.OffsetDateTime;
+
+/**
+ * The receipt fetch request allows to retrieve the receipt documents for a terminal transaction.
+ */
+@ApiModel(description = "The receipt fetch request allows to retrieve the receipt documents for a terminal transaction.")
+
+public class TerminalReceiptFetchRequest {
+
+ @JsonProperty("format")
+ protected TerminalReceiptFormat format = null;
+
+
+ @JsonProperty("transaction")
+ protected Long transaction = null;
+
+
+ @JsonProperty("width")
+ protected Integer width = null;
+
+
+
+ public TerminalReceiptFetchRequest format(TerminalReceiptFormat format) {
+ this.format = format;
+ return this;
+ }
+
+ /**
+ * The format determines in what format the receipts will be returned in.
+ * @return format
+ **/
+ @ApiModelProperty(required = true, value = "The format determines in what format the receipts will be returned in.")
+ public TerminalReceiptFormat getFormat() {
+ return format;
+ }
+
+ public void setFormat(TerminalReceiptFormat format) {
+ this.format = format;
+ }
+
+
+ public TerminalReceiptFetchRequest transaction(Long transaction) {
+ this.transaction = transaction;
+ return this;
+ }
+
+ /**
+ * Provide here the ID of the transaction for which the receipts should be fetched.
+ * @return transaction
+ **/
+ @ApiModelProperty(required = true, value = "Provide here the ID of the transaction for which the receipts should be fetched.")
+ public Long getTransaction() {
+ return transaction;
+ }
+
+ public void setTransaction(Long transaction) {
+ this.transaction = transaction;
+ }
+
+
+ public TerminalReceiptFetchRequest width(Integer width) {
+ this.width = width;
+ return this;
+ }
+
+ /**
+ * The width controls how width the document will be rendered. In case of the PDF format the width is in mm. In case of the text format the width is in the number of chars per line.
+ * @return width
+ **/
+ @ApiModelProperty(value = "The width controls how width the document will be rendered. In case of the PDF format the width is in mm. In case of the text format the width is in the number of chars per line.")
+ public Integer getWidth() {
+ return width;
+ }
+
+ public void setWidth(Integer width) {
+ this.width = width;
+ }
+
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ TerminalReceiptFetchRequest terminalReceiptFetchRequest = (TerminalReceiptFetchRequest) o;
+ return Objects.equals(this.format, terminalReceiptFetchRequest.format) &&
+ Objects.equals(this.transaction, terminalReceiptFetchRequest.transaction) &&
+ Objects.equals(this.width, terminalReceiptFetchRequest.width);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(format, transaction, width);
+ }
+
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class TerminalReceiptFetchRequest {\n");
+
+ sb.append(" format: ").append(toIndentedString(format)).append("\n");
+ sb.append(" transaction: ").append(toIndentedString(transaction)).append("\n");
+ sb.append(" width: ").append(toIndentedString(width)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/src/main/java/com/postfinancecheckout/sdk/model/TerminalReceiptFormat.java b/src/main/java/com/postfinancecheckout/sdk/model/TerminalReceiptFormat.java
new file mode 100644
index 0000000..4469dda
--- /dev/null
+++ b/src/main/java/com/postfinancecheckout/sdk/model/TerminalReceiptFormat.java
@@ -0,0 +1,66 @@
+/**
+* PostFinance Checkout SDK
+*
+* This library allows to interact with the PostFinance Checkout payment service.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+
+package com.postfinancecheckout.sdk.model;
+
+import java.util.Objects;
+import java.util.Arrays;
+import io.swagger.annotations.ApiModel;
+import java.util.*;
+import java.time.OffsetDateTime;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ *
+ */
+public enum TerminalReceiptFormat {
+
+ PDF("PDF"),
+
+ TXT("TXT");
+
+ private String value;
+
+ TerminalReceiptFormat(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ @JsonCreator
+ public static TerminalReceiptFormat fromValue(String text) {
+ for (TerminalReceiptFormat b : TerminalReceiptFormat.values()) {
+ if (String.valueOf(b.value).equals(text)) {
+ return b;
+ }
+ }
+ return null;
+ }
+}
+
diff --git a/src/main/java/com/postfinancecheckout/sdk/service/PaymentTerminalService.java b/src/main/java/com/postfinancecheckout/sdk/service/PaymentTerminalService.java
new file mode 100644
index 0000000..487f99d
--- /dev/null
+++ b/src/main/java/com/postfinancecheckout/sdk/service/PaymentTerminalService.java
@@ -0,0 +1,473 @@
+package com.postfinancecheckout.sdk.service;
+
+import com.postfinancecheckout.sdk.ApiClient;
+
+import com.postfinancecheckout.sdk.model.ClientError;
+import com.postfinancecheckout.sdk.model.EntityQuery;
+import com.postfinancecheckout.sdk.model.EntityQueryFilter;
+import com.postfinancecheckout.sdk.model.PaymentTerminal;
+import com.postfinancecheckout.sdk.model.ServerError;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.google.api.client.http.*;
+import com.google.api.client.json.Json;
+
+import javax.ws.rs.core.UriBuilder;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.List;
+import java.util.ArrayList;
+
+
+public class PaymentTerminalService {
+ private ApiClient apiClient;
+
+ public PaymentTerminalService(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Count
+ * Counts the number of items in the database as restricted by the given filter.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param filter The filter which restricts the entities which are used to calculate the count.
+ * @return Long
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Count Documentation
+
+ **/
+ public Long count(Long spaceId, EntityQueryFilter filter) throws IOException {
+ HttpResponse response = countForHttpResponse(spaceId, filter);
+ String returnType = "Long";
+ if(returnType.equals("String")){
+ return (Long) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (Long)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ /**
+ * Count
+ * Counts the number of items in the database as restricted by the given filter.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
+ * @return Long
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Count Documentation
+
+ **/
+ public Long count(EntityQueryFilter filter, Long spaceId, Map params) throws IOException {
+ HttpResponse response = countForHttpResponse(filter, spaceId, params);
+ String returnType = "Long";
+ if(returnType.equals("String")){
+ return (Long) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (Long)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ public HttpResponse countForHttpResponse(Long spaceId, EntityQueryFilter filter) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling count");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/payment-terminal/count");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(filter);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse countForHttpResponse(Long spaceId, java.io.InputStream filter, String mediaType) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling count");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/payment-terminal/count");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = filter == null ?
+ apiClient.new JacksonJsonHttpContent(null) :
+ new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, filter);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse countForHttpResponse(EntityQueryFilter filter, Long spaceId, Map params) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling count");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/payment-terminal/count");
+
+ // Copy the params argument if present, to allow passing in immutable maps
+ Map allParams = params == null ? new HashMap() : new HashMap(params);
+ // Add the required query param 'spaceId' to the map of query params
+ allParams.put("spaceId", spaceId);
+
+ for (Map.Entry entryMap: allParams.entrySet()) {
+ String key = entryMap.getKey();
+ Object value = entryMap.getValue();
+
+ if (key != null && value != null) {
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(filter);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ /**
+ * Read
+ * Reads the entity with the given 'id' and returns it.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param id The id of the payment terminal which should be returned.
+ * @return PaymentTerminal
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Read Documentation
+
+ **/
+ public PaymentTerminal read(Long spaceId, Long id) throws IOException {
+ HttpResponse response = readForHttpResponse(spaceId, id);
+ String returnType = "PaymentTerminal";
+ if(returnType.equals("String")){
+ return (PaymentTerminal) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (PaymentTerminal)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ /**
+ * Read
+ * Reads the entity with the given 'id' and returns it.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param id The id of the payment terminal which should be returned.
+ * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
+ * @return PaymentTerminal
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Read Documentation
+
+ **/
+ public PaymentTerminal read(Long spaceId, Long id, Map params) throws IOException {
+ HttpResponse response = readForHttpResponse(spaceId, id, params);
+ String returnType = "PaymentTerminal";
+ if(returnType.equals("String")){
+ return (PaymentTerminal) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (PaymentTerminal)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ public HttpResponse readForHttpResponse(Long spaceId, Long id) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling read");
+ }// verify the required parameter 'id' is set
+ if (id == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'id' when calling read");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/payment-terminal/read");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ } if (id != null) {
+ String key = "id";
+ Object value = id;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = null;
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content);
+ httpRequest.getHeaders().setContentType("*/*");
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse readForHttpResponse(Long spaceId, Long id, Map params) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling read");
+ }// verify the required parameter 'id' is set
+ if (id == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'id' when calling read");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/payment-terminal/read");
+
+ // Copy the params argument if present, to allow passing in immutable maps
+ Map allParams = params == null ? new HashMap() : new HashMap(params);
+ // Add the required query param 'spaceId' to the map of query params
+ allParams.put("spaceId", spaceId);
+ // Add the required query param 'id' to the map of query params
+ allParams.put("id", id);
+
+ for (Map.Entry entryMap: allParams.entrySet()) {
+ String key = entryMap.getKey();
+ Object value = entryMap.getValue();
+
+ if (key != null && value != null) {
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = null;
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content);
+ httpRequest.getHeaders().setContentType("*/*");
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ /**
+ * Search
+ * Searches for the entities as specified by the given query.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param query The query restricts the payment terminals which are returned by the search.
+ * @return List<PaymentTerminal>
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Search Documentation
+
+ **/
+ public List search(Long spaceId, EntityQuery query) throws IOException {
+ HttpResponse response = searchForHttpResponse(spaceId, query);
+ String returnType = "List<PaymentTerminal>";
+ if(returnType.equals("String")){
+ return (List) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference>() {};
+ return (List)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ /**
+ * Search
+ * Searches for the entities as specified by the given query.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param query The query restricts the payment terminals which are returned by the search.
+ * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
+ * @return List<PaymentTerminal>
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Search Documentation
+
+ **/
+ public List search(Long spaceId, EntityQuery query, Map params) throws IOException {
+ HttpResponse response = searchForHttpResponse(spaceId, query, params);
+ String returnType = "List<PaymentTerminal>";
+ if(returnType.equals("String")){
+ return (List) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference>() {};
+ return (List)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ public HttpResponse searchForHttpResponse(Long spaceId, EntityQuery query) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling search");
+ }// verify the required parameter 'query' is set
+ if (query == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'query' when calling search");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/payment-terminal/search");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(query);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse searchForHttpResponse(Long spaceId, java.io.InputStream query, String mediaType) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling search");
+ }// verify the required parameter 'query' is set
+ if (query == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'query' when calling search");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/payment-terminal/search");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = query == null ?
+ apiClient.new JacksonJsonHttpContent(null) :
+ new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, query);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse searchForHttpResponse(Long spaceId, EntityQuery query, Map params) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling search");
+ }// verify the required parameter 'query' is set
+ if (query == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'query' when calling search");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/payment-terminal/search");
+
+ // Copy the params argument if present, to allow passing in immutable maps
+ Map allParams = params == null ? new HashMap() : new HashMap(params);
+ // Add the required query param 'spaceId' to the map of query params
+ allParams.put("spaceId", spaceId);
+
+ for (Map.Entry entryMap: allParams.entrySet()) {
+ String key = entryMap.getKey();
+ Object value = entryMap.getValue();
+
+ if (key != null && value != null) {
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(query);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+}
diff --git a/src/main/java/com/postfinancecheckout/sdk/service/PaymentTerminalTillService.java b/src/main/java/com/postfinancecheckout/sdk/service/PaymentTerminalTillService.java
new file mode 100644
index 0000000..7c54d35
--- /dev/null
+++ b/src/main/java/com/postfinancecheckout/sdk/service/PaymentTerminalTillService.java
@@ -0,0 +1,375 @@
+package com.postfinancecheckout.sdk.service;
+
+import com.postfinancecheckout.sdk.ApiClient;
+
+import com.postfinancecheckout.sdk.model.ClientError;
+import com.postfinancecheckout.sdk.model.ServerError;
+import com.postfinancecheckout.sdk.model.Transaction;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.google.api.client.http.*;
+import com.google.api.client.json.Json;
+
+import javax.ws.rs.core.UriBuilder;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.List;
+import java.util.ArrayList;
+
+
+public class PaymentTerminalTillService {
+ private ApiClient apiClient;
+
+ public PaymentTerminalTillService(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Perform Payment Terminal Transaction
+ * Starts a payment terminal transaction and waits for its completion. If the call returns with a long polling timeout status, you may try again. The processing of the transaction will be picked up where it was left off.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
409 - This status code indicates that there was a conflict with the current version of the data in the database and the provided data in the request.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ *
543 - This status code indicates that the long polling request timed out.
+ * @param spaceId
+ * @param transactionId The ID of the transaction which is used to process with the terminal.
+ * @param terminalId The ID of the terminal which should be used to process the transaction.
+ * @param language The language in which the messages should be rendered in.
+ * @return Transaction
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Perform Payment Terminal Transaction Documentation
+
+ **/
+ public Transaction performTransaction(Long spaceId, Long transactionId, Long terminalId, String language) throws IOException {
+ HttpResponse response = performTransactionForHttpResponse(spaceId, transactionId, terminalId, language);
+ String returnType = "Transaction";
+ if(returnType.equals("String")){
+ return (Transaction) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (Transaction)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ /**
+ * Perform Payment Terminal Transaction
+ * Starts a payment terminal transaction and waits for its completion. If the call returns with a long polling timeout status, you may try again. The processing of the transaction will be picked up where it was left off.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
409 - This status code indicates that there was a conflict with the current version of the data in the database and the provided data in the request.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ *
543 - This status code indicates that the long polling request timed out.
+ * @param spaceId
+ * @param transactionId The ID of the transaction which is used to process with the terminal.
+ * @param terminalId The ID of the terminal which should be used to process the transaction.
+ * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
+ * @return Transaction
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Perform Payment Terminal Transaction Documentation
+
+ **/
+ public Transaction performTransaction(Long spaceId, Long transactionId, Long terminalId, Map params) throws IOException {
+ HttpResponse response = performTransactionForHttpResponse(spaceId, transactionId, terminalId, params);
+ String returnType = "Transaction";
+ if(returnType.equals("String")){
+ return (Transaction) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (Transaction)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ public HttpResponse performTransactionForHttpResponse(Long spaceId, Long transactionId, Long terminalId, String language) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling performTransaction");
+ }// verify the required parameter 'transactionId' is set
+ if (transactionId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'transactionId' when calling performTransaction");
+ }// verify the required parameter 'terminalId' is set
+ if (terminalId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'terminalId' when calling performTransaction");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/payment-terminal-till/perform-transaction");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ } if (transactionId != null) {
+ String key = "transactionId";
+ Object value = transactionId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ } if (terminalId != null) {
+ String key = "terminalId";
+ Object value = terminalId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ } if (language != null) {
+ String key = "language";
+ Object value = language;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = null;
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content);
+ httpRequest.getHeaders().setContentType("application/json;charset=utf-8");
+ httpRequest.setReadTimeout(90 * 1000);
+
+ return httpRequest.execute();
+ }
+
+ public HttpResponse performTransactionForHttpResponse(Long spaceId, Long transactionId, Long terminalId, Map params) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling performTransaction");
+ }// verify the required parameter 'transactionId' is set
+ if (transactionId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'transactionId' when calling performTransaction");
+ }// verify the required parameter 'terminalId' is set
+ if (terminalId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'terminalId' when calling performTransaction");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/payment-terminal-till/perform-transaction");
+
+ // Copy the params argument if present, to allow passing in immutable maps
+ Map allParams = params == null ? new HashMap() : new HashMap(params);
+ // Add the required query param 'spaceId' to the map of query params
+ allParams.put("spaceId", spaceId);
+ // Add the required query param 'transactionId' to the map of query params
+ allParams.put("transactionId", transactionId);
+ // Add the required query param 'terminalId' to the map of query params
+ allParams.put("terminalId", terminalId);
+
+ for (Map.Entry entryMap: allParams.entrySet()) {
+ String key = entryMap.getKey();
+ Object value = entryMap.getValue();
+
+ if (key != null && value != null) {
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = null;
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content);
+ httpRequest.getHeaders().setContentType("application/json;charset=utf-8");
+ httpRequest.setReadTimeout(90 * 1000);
+
+ return httpRequest.execute();
+ }
+
+ /**
+ * Perform Payment Terminal Transaction (using TID)
+ * Starts a payment terminal transaction and waits for its completion. If the call returns with a long polling timeout status, you may try again. The processing of the transaction will be picked up where it was left off.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
409 - This status code indicates that there was a conflict with the current version of the data in the database and the provided data in the request.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ *
543 - This status code indicates that the long polling request timed out.
+ * @param spaceId
+ * @param transactionId The ID of the transaction which is used to process with the terminal.
+ * @param terminalIdentifier The identifier (aka TID) of the terminal which should be used to process the transaction.
+ * @param language The language in which the messages should be rendered in.
+ * @return Transaction
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Perform Payment Terminal Transaction (using TID) Documentation
+
+ **/
+ public Transaction performTransactionByIdentifier(Long spaceId, Long transactionId, String terminalIdentifier, String language) throws IOException {
+ HttpResponse response = performTransactionByIdentifierForHttpResponse(spaceId, transactionId, terminalIdentifier, language);
+ String returnType = "Transaction";
+ if(returnType.equals("String")){
+ return (Transaction) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (Transaction)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ /**
+ * Perform Payment Terminal Transaction (using TID)
+ * Starts a payment terminal transaction and waits for its completion. If the call returns with a long polling timeout status, you may try again. The processing of the transaction will be picked up where it was left off.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
409 - This status code indicates that there was a conflict with the current version of the data in the database and the provided data in the request.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ *
543 - This status code indicates that the long polling request timed out.
+ * @param spaceId
+ * @param transactionId The ID of the transaction which is used to process with the terminal.
+ * @param terminalIdentifier The identifier (aka TID) of the terminal which should be used to process the transaction.
+ * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
+ * @return Transaction
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Perform Payment Terminal Transaction (using TID) Documentation
+
+ **/
+ public Transaction performTransactionByIdentifier(Long spaceId, Long transactionId, String terminalIdentifier, Map params) throws IOException {
+ HttpResponse response = performTransactionByIdentifierForHttpResponse(spaceId, transactionId, terminalIdentifier, params);
+ String returnType = "Transaction";
+ if(returnType.equals("String")){
+ return (Transaction) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (Transaction)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ public HttpResponse performTransactionByIdentifierForHttpResponse(Long spaceId, Long transactionId, String terminalIdentifier, String language) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling performTransactionByIdentifier");
+ }// verify the required parameter 'transactionId' is set
+ if (transactionId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'transactionId' when calling performTransactionByIdentifier");
+ }// verify the required parameter 'terminalIdentifier' is set
+ if (terminalIdentifier == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'terminalIdentifier' when calling performTransactionByIdentifier");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/payment-terminal-till/perform-transaction-by-identifier");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ } if (transactionId != null) {
+ String key = "transactionId";
+ Object value = transactionId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ } if (terminalIdentifier != null) {
+ String key = "terminalIdentifier";
+ Object value = terminalIdentifier;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ } if (language != null) {
+ String key = "language";
+ Object value = language;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = null;
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content);
+ httpRequest.getHeaders().setContentType("application/json;charset=utf-8");
+ httpRequest.setReadTimeout(90 * 1000);
+
+ return httpRequest.execute();
+ }
+
+ public HttpResponse performTransactionByIdentifierForHttpResponse(Long spaceId, Long transactionId, String terminalIdentifier, Map params) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling performTransactionByIdentifier");
+ }// verify the required parameter 'transactionId' is set
+ if (transactionId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'transactionId' when calling performTransactionByIdentifier");
+ }// verify the required parameter 'terminalIdentifier' is set
+ if (terminalIdentifier == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'terminalIdentifier' when calling performTransactionByIdentifier");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/payment-terminal-till/perform-transaction-by-identifier");
+
+ // Copy the params argument if present, to allow passing in immutable maps
+ Map allParams = params == null ? new HashMap() : new HashMap(params);
+ // Add the required query param 'spaceId' to the map of query params
+ allParams.put("spaceId", spaceId);
+ // Add the required query param 'transactionId' to the map of query params
+ allParams.put("transactionId", transactionId);
+ // Add the required query param 'terminalIdentifier' to the map of query params
+ allParams.put("terminalIdentifier", terminalIdentifier);
+
+ for (Map.Entry entryMap: allParams.entrySet()) {
+ String key = entryMap.getKey();
+ Object value = entryMap.getValue();
+
+ if (key != null && value != null) {
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = null;
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content);
+ httpRequest.getHeaders().setContentType("application/json;charset=utf-8");
+ httpRequest.setReadTimeout(90 * 1000);
+
+ return httpRequest.execute();
+ }
+
+}
diff --git a/src/main/java/com/postfinancecheckout/sdk/service/ShopifyRecurringOrderService.java b/src/main/java/com/postfinancecheckout/sdk/service/ShopifyRecurringOrderService.java
new file mode 100644
index 0000000..c619b83
--- /dev/null
+++ b/src/main/java/com/postfinancecheckout/sdk/service/ShopifyRecurringOrderService.java
@@ -0,0 +1,613 @@
+package com.postfinancecheckout.sdk.service;
+
+import com.postfinancecheckout.sdk.ApiClient;
+
+import com.postfinancecheckout.sdk.model.ClientError;
+import com.postfinancecheckout.sdk.model.EntityQuery;
+import com.postfinancecheckout.sdk.model.EntityQueryFilter;
+import com.postfinancecheckout.sdk.model.ServerError;
+import com.postfinancecheckout.sdk.model.ShopifyRecurringOrder;
+import com.postfinancecheckout.sdk.model.ShopifyRecurringOrderUpdateRequest;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.google.api.client.http.*;
+import com.google.api.client.json.Json;
+
+import javax.ws.rs.core.UriBuilder;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.List;
+import java.util.ArrayList;
+
+
+public class ShopifyRecurringOrderService {
+ private ApiClient apiClient;
+
+ public ShopifyRecurringOrderService(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Count
+ * Counts the number of items in the database as restricted by the given filter.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param filter The filter which restricts the entities which are used to calculate the count.
+ * @return Long
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Count Documentation
+
+ **/
+ public Long count(Long spaceId, EntityQueryFilter filter) throws IOException {
+ HttpResponse response = countForHttpResponse(spaceId, filter);
+ String returnType = "Long";
+ if(returnType.equals("String")){
+ return (Long) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (Long)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ /**
+ * Count
+ * Counts the number of items in the database as restricted by the given filter.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
+ * @return Long
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Count Documentation
+
+ **/
+ public Long count(EntityQueryFilter filter, Long spaceId, Map params) throws IOException {
+ HttpResponse response = countForHttpResponse(filter, spaceId, params);
+ String returnType = "Long";
+ if(returnType.equals("String")){
+ return (Long) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (Long)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ public HttpResponse countForHttpResponse(Long spaceId, EntityQueryFilter filter) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling count");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-recurring-order/count");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(filter);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse countForHttpResponse(Long spaceId, java.io.InputStream filter, String mediaType) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling count");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-recurring-order/count");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = filter == null ?
+ apiClient.new JacksonJsonHttpContent(null) :
+ new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, filter);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse countForHttpResponse(EntityQueryFilter filter, Long spaceId, Map params) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling count");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-recurring-order/count");
+
+ // Copy the params argument if present, to allow passing in immutable maps
+ Map allParams = params == null ? new HashMap() : new HashMap(params);
+ // Add the required query param 'spaceId' to the map of query params
+ allParams.put("spaceId", spaceId);
+
+ for (Map.Entry entryMap: allParams.entrySet()) {
+ String key = entryMap.getKey();
+ Object value = entryMap.getValue();
+
+ if (key != null && value != null) {
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(filter);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ /**
+ * Read
+ * Reads the entity with the given 'id' and returns it.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param id The id of the Shopify recurring order which should be returned.
+ * @return ShopifyRecurringOrder
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Read Documentation
+
+ **/
+ public ShopifyRecurringOrder read(Long spaceId, Long id) throws IOException {
+ HttpResponse response = readForHttpResponse(spaceId, id);
+ String returnType = "ShopifyRecurringOrder";
+ if(returnType.equals("String")){
+ return (ShopifyRecurringOrder) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (ShopifyRecurringOrder)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ /**
+ * Read
+ * Reads the entity with the given 'id' and returns it.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param id The id of the Shopify recurring order which should be returned.
+ * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
+ * @return ShopifyRecurringOrder
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Read Documentation
+
+ **/
+ public ShopifyRecurringOrder read(Long spaceId, Long id, Map params) throws IOException {
+ HttpResponse response = readForHttpResponse(spaceId, id, params);
+ String returnType = "ShopifyRecurringOrder";
+ if(returnType.equals("String")){
+ return (ShopifyRecurringOrder) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (ShopifyRecurringOrder)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ public HttpResponse readForHttpResponse(Long spaceId, Long id) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling read");
+ }// verify the required parameter 'id' is set
+ if (id == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'id' when calling read");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-recurring-order/read");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ } if (id != null) {
+ String key = "id";
+ Object value = id;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = null;
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content);
+ httpRequest.getHeaders().setContentType("*/*");
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse readForHttpResponse(Long spaceId, Long id, Map params) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling read");
+ }// verify the required parameter 'id' is set
+ if (id == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'id' when calling read");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-recurring-order/read");
+
+ // Copy the params argument if present, to allow passing in immutable maps
+ Map allParams = params == null ? new HashMap() : new HashMap(params);
+ // Add the required query param 'spaceId' to the map of query params
+ allParams.put("spaceId", spaceId);
+ // Add the required query param 'id' to the map of query params
+ allParams.put("id", id);
+
+ for (Map.Entry entryMap: allParams.entrySet()) {
+ String key = entryMap.getKey();
+ Object value = entryMap.getValue();
+
+ if (key != null && value != null) {
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = null;
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content);
+ httpRequest.getHeaders().setContentType("*/*");
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ /**
+ * Search
+ * Searches for the entities as specified by the given query.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param query The query restricts the Shopify recurring orders which are returned by the search.
+ * @return List<ShopifyRecurringOrder>
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Search Documentation
+
+ **/
+ public List search(Long spaceId, EntityQuery query) throws IOException {
+ HttpResponse response = searchForHttpResponse(spaceId, query);
+ String returnType = "List<ShopifyRecurringOrder>";
+ if(returnType.equals("String")){
+ return (List) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference>() {};
+ return (List)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ /**
+ * Search
+ * Searches for the entities as specified by the given query.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param query The query restricts the Shopify recurring orders which are returned by the search.
+ * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
+ * @return List<ShopifyRecurringOrder>
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Search Documentation
+
+ **/
+ public List search(Long spaceId, EntityQuery query, Map params) throws IOException {
+ HttpResponse response = searchForHttpResponse(spaceId, query, params);
+ String returnType = "List<ShopifyRecurringOrder>";
+ if(returnType.equals("String")){
+ return (List) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference>() {};
+ return (List)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ public HttpResponse searchForHttpResponse(Long spaceId, EntityQuery query) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling search");
+ }// verify the required parameter 'query' is set
+ if (query == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'query' when calling search");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-recurring-order/search");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(query);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse searchForHttpResponse(Long spaceId, java.io.InputStream query, String mediaType) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling search");
+ }// verify the required parameter 'query' is set
+ if (query == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'query' when calling search");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-recurring-order/search");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = query == null ?
+ apiClient.new JacksonJsonHttpContent(null) :
+ new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, query);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse searchForHttpResponse(Long spaceId, EntityQuery query, Map params) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling search");
+ }// verify the required parameter 'query' is set
+ if (query == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'query' when calling search");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-recurring-order/search");
+
+ // Copy the params argument if present, to allow passing in immutable maps
+ Map allParams = params == null ? new HashMap() : new HashMap(params);
+ // Add the required query param 'spaceId' to the map of query params
+ allParams.put("spaceId", spaceId);
+
+ for (Map.Entry entryMap: allParams.entrySet()) {
+ String key = entryMap.getKey();
+ Object value = entryMap.getValue();
+
+ if (key != null && value != null) {
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(query);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ /**
+ * Update
+ * This operation allows to update a Shopify recurring order.
+ * 442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param updateRequest
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Update Documentation
+
+ **/
+ public void update(Long spaceId, ShopifyRecurringOrderUpdateRequest updateRequest) throws IOException {
+ updateForHttpResponse(spaceId, updateRequest);
+ }
+
+ /**
+ * Update
+ * This operation allows to update a Shopify recurring order.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param updateRequest
+ * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Update Documentation
+
+ **/
+ public void update(Long spaceId, ShopifyRecurringOrderUpdateRequest updateRequest, Map params) throws IOException {
+ updateForHttpResponse(spaceId, updateRequest, params);
+ }
+
+ public HttpResponse updateForHttpResponse(Long spaceId, ShopifyRecurringOrderUpdateRequest updateRequest) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling update");
+ }// verify the required parameter 'updateRequest' is set
+ if (updateRequest == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'updateRequest' when calling update");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-recurring-order/update");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(updateRequest);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse updateForHttpResponse(Long spaceId, java.io.InputStream updateRequest, String mediaType) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling update");
+ }// verify the required parameter 'updateRequest' is set
+ if (updateRequest == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'updateRequest' when calling update");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-recurring-order/update");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = updateRequest == null ?
+ apiClient.new JacksonJsonHttpContent(null) :
+ new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, updateRequest);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse updateForHttpResponse(Long spaceId, ShopifyRecurringOrderUpdateRequest updateRequest, Map params) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling update");
+ }// verify the required parameter 'updateRequest' is set
+ if (updateRequest == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'updateRequest' when calling update");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-recurring-order/update");
+
+ // Copy the params argument if present, to allow passing in immutable maps
+ Map allParams = params == null ? new HashMap() : new HashMap(params);
+ // Add the required query param 'spaceId' to the map of query params
+ allParams.put("spaceId", spaceId);
+
+ for (Map.Entry entryMap: allParams.entrySet()) {
+ String key = entryMap.getKey();
+ Object value = entryMap.getValue();
+
+ if (key != null && value != null) {
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(updateRequest);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+}
diff --git a/src/main/java/com/postfinancecheckout/sdk/service/ShopifySubscriberService.java b/src/main/java/com/postfinancecheckout/sdk/service/ShopifySubscriberService.java
new file mode 100644
index 0000000..146ea92
--- /dev/null
+++ b/src/main/java/com/postfinancecheckout/sdk/service/ShopifySubscriberService.java
@@ -0,0 +1,631 @@
+package com.postfinancecheckout.sdk.service;
+
+import com.postfinancecheckout.sdk.ApiClient;
+
+import com.postfinancecheckout.sdk.model.ClientError;
+import com.postfinancecheckout.sdk.model.EntityQuery;
+import com.postfinancecheckout.sdk.model.EntityQueryFilter;
+import com.postfinancecheckout.sdk.model.ServerError;
+import com.postfinancecheckout.sdk.model.ShopifySubscriber;
+import com.postfinancecheckout.sdk.model.ShopifySubscriberActive;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.google.api.client.http.*;
+import com.google.api.client.json.Json;
+
+import javax.ws.rs.core.UriBuilder;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.List;
+import java.util.ArrayList;
+
+
+public class ShopifySubscriberService {
+ private ApiClient apiClient;
+
+ public ShopifySubscriberService(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Count
+ * Counts the number of items in the database as restricted by the given filter.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param filter The filter which restricts the entities which are used to calculate the count.
+ * @return Long
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Count Documentation
+
+ **/
+ public Long count(Long spaceId, EntityQueryFilter filter) throws IOException {
+ HttpResponse response = countForHttpResponse(spaceId, filter);
+ String returnType = "Long";
+ if(returnType.equals("String")){
+ return (Long) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (Long)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ /**
+ * Count
+ * Counts the number of items in the database as restricted by the given filter.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
+ * @return Long
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Count Documentation
+
+ **/
+ public Long count(EntityQueryFilter filter, Long spaceId, Map params) throws IOException {
+ HttpResponse response = countForHttpResponse(filter, spaceId, params);
+ String returnType = "Long";
+ if(returnType.equals("String")){
+ return (Long) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (Long)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ public HttpResponse countForHttpResponse(Long spaceId, EntityQueryFilter filter) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling count");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscriber/count");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(filter);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse countForHttpResponse(Long spaceId, java.io.InputStream filter, String mediaType) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling count");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscriber/count");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = filter == null ?
+ apiClient.new JacksonJsonHttpContent(null) :
+ new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, filter);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse countForHttpResponse(EntityQueryFilter filter, Long spaceId, Map params) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling count");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscriber/count");
+
+ // Copy the params argument if present, to allow passing in immutable maps
+ Map allParams = params == null ? new HashMap() : new HashMap(params);
+ // Add the required query param 'spaceId' to the map of query params
+ allParams.put("spaceId", spaceId);
+
+ for (Map.Entry entryMap: allParams.entrySet()) {
+ String key = entryMap.getKey();
+ Object value = entryMap.getValue();
+
+ if (key != null && value != null) {
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(filter);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ /**
+ * Read
+ * Reads the entity with the given 'id' and returns it.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param id The id of the Shopify subscriber which should be returned.
+ * @return ShopifySubscriber
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Read Documentation
+
+ **/
+ public ShopifySubscriber read(Long spaceId, Long id) throws IOException {
+ HttpResponse response = readForHttpResponse(spaceId, id);
+ String returnType = "ShopifySubscriber";
+ if(returnType.equals("String")){
+ return (ShopifySubscriber) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (ShopifySubscriber)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ /**
+ * Read
+ * Reads the entity with the given 'id' and returns it.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param id The id of the Shopify subscriber which should be returned.
+ * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
+ * @return ShopifySubscriber
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Read Documentation
+
+ **/
+ public ShopifySubscriber read(Long spaceId, Long id, Map params) throws IOException {
+ HttpResponse response = readForHttpResponse(spaceId, id, params);
+ String returnType = "ShopifySubscriber";
+ if(returnType.equals("String")){
+ return (ShopifySubscriber) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (ShopifySubscriber)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ public HttpResponse readForHttpResponse(Long spaceId, Long id) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling read");
+ }// verify the required parameter 'id' is set
+ if (id == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'id' when calling read");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscriber/read");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ } if (id != null) {
+ String key = "id";
+ Object value = id;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = null;
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content);
+ httpRequest.getHeaders().setContentType("*/*");
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse readForHttpResponse(Long spaceId, Long id, Map params) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling read");
+ }// verify the required parameter 'id' is set
+ if (id == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'id' when calling read");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscriber/read");
+
+ // Copy the params argument if present, to allow passing in immutable maps
+ Map allParams = params == null ? new HashMap() : new HashMap(params);
+ // Add the required query param 'spaceId' to the map of query params
+ allParams.put("spaceId", spaceId);
+ // Add the required query param 'id' to the map of query params
+ allParams.put("id", id);
+
+ for (Map.Entry entryMap: allParams.entrySet()) {
+ String key = entryMap.getKey();
+ Object value = entryMap.getValue();
+
+ if (key != null && value != null) {
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = null;
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content);
+ httpRequest.getHeaders().setContentType("*/*");
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ /**
+ * Search
+ * Searches for the entities as specified by the given query.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param query The query restricts the Shopify subscribers which are returned by the search.
+ * @return List<ShopifySubscriber>
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Search Documentation
+
+ **/
+ public List search(Long spaceId, EntityQuery query) throws IOException {
+ HttpResponse response = searchForHttpResponse(spaceId, query);
+ String returnType = "List<ShopifySubscriber>";
+ if(returnType.equals("String")){
+ return (List) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference>() {};
+ return (List)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ /**
+ * Search
+ * Searches for the entities as specified by the given query.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param query The query restricts the Shopify subscribers which are returned by the search.
+ * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
+ * @return List<ShopifySubscriber>
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Search Documentation
+
+ **/
+ public List search(Long spaceId, EntityQuery query, Map params) throws IOException {
+ HttpResponse response = searchForHttpResponse(spaceId, query, params);
+ String returnType = "List<ShopifySubscriber>";
+ if(returnType.equals("String")){
+ return (List) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference>() {};
+ return (List)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ public HttpResponse searchForHttpResponse(Long spaceId, EntityQuery query) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling search");
+ }// verify the required parameter 'query' is set
+ if (query == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'query' when calling search");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscriber/search");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(query);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse searchForHttpResponse(Long spaceId, java.io.InputStream query, String mediaType) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling search");
+ }// verify the required parameter 'query' is set
+ if (query == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'query' when calling search");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscriber/search");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = query == null ?
+ apiClient.new JacksonJsonHttpContent(null) :
+ new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, query);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse searchForHttpResponse(Long spaceId, EntityQuery query, Map params) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling search");
+ }// verify the required parameter 'query' is set
+ if (query == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'query' when calling search");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscriber/search");
+
+ // Copy the params argument if present, to allow passing in immutable maps
+ Map allParams = params == null ? new HashMap() : new HashMap(params);
+ // Add the required query param 'spaceId' to the map of query params
+ allParams.put("spaceId", spaceId);
+
+ for (Map.Entry entryMap: allParams.entrySet()) {
+ String key = entryMap.getKey();
+ Object value = entryMap.getValue();
+
+ if (key != null && value != null) {
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(query);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ /**
+ * Update
+ * This updates the entity with the given properties. Only those properties which should be updated can be provided. The 'id' and 'version' are required to identify the entity.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
409 - This status code indicates that there was a conflict with the current version of the data in the database and the provided data in the request.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param query The Shopify subscriber object with all the properties which should be updated. The id and the version are required properties.
+ * @return ShopifySubscriber
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Update Documentation
+
+ **/
+ public ShopifySubscriber update(Long spaceId, ShopifySubscriberActive query) throws IOException {
+ HttpResponse response = updateForHttpResponse(spaceId, query);
+ String returnType = "ShopifySubscriber";
+ if(returnType.equals("String")){
+ return (ShopifySubscriber) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (ShopifySubscriber)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ /**
+ * Update
+ * This updates the entity with the given properties. Only those properties which should be updated can be provided. The 'id' and 'version' are required to identify the entity.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
409 - This status code indicates that there was a conflict with the current version of the data in the database and the provided data in the request.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param query The Shopify subscriber object with all the properties which should be updated. The id and the version are required properties.
+ * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
+ * @return ShopifySubscriber
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Update Documentation
+
+ **/
+ public ShopifySubscriber update(Long spaceId, ShopifySubscriberActive query, Map params) throws IOException {
+ HttpResponse response = updateForHttpResponse(spaceId, query, params);
+ String returnType = "ShopifySubscriber";
+ if(returnType.equals("String")){
+ return (ShopifySubscriber) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (ShopifySubscriber)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ public HttpResponse updateForHttpResponse(Long spaceId, ShopifySubscriberActive query) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling update");
+ }// verify the required parameter 'query' is set
+ if (query == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'query' when calling update");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscriber/update");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(query);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse updateForHttpResponse(Long spaceId, java.io.InputStream query, String mediaType) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling update");
+ }// verify the required parameter 'query' is set
+ if (query == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'query' when calling update");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscriber/update");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = query == null ?
+ apiClient.new JacksonJsonHttpContent(null) :
+ new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, query);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse updateForHttpResponse(Long spaceId, ShopifySubscriberActive query, Map params) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling update");
+ }// verify the required parameter 'query' is set
+ if (query == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'query' when calling update");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscriber/update");
+
+ // Copy the params argument if present, to allow passing in immutable maps
+ Map allParams = params == null ? new HashMap() : new HashMap(params);
+ // Add the required query param 'spaceId' to the map of query params
+ allParams.put("spaceId", spaceId);
+
+ for (Map.Entry entryMap: allParams.entrySet()) {
+ String key = entryMap.getKey();
+ Object value = entryMap.getValue();
+
+ if (key != null && value != null) {
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(query);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+}
diff --git a/src/main/java/com/postfinancecheckout/sdk/service/ShopifySubscriptionProductService.java b/src/main/java/com/postfinancecheckout/sdk/service/ShopifySubscriptionProductService.java
new file mode 100644
index 0000000..f8cf1fe
--- /dev/null
+++ b/src/main/java/com/postfinancecheckout/sdk/service/ShopifySubscriptionProductService.java
@@ -0,0 +1,787 @@
+package com.postfinancecheckout.sdk.service;
+
+import com.postfinancecheckout.sdk.ApiClient;
+
+import com.postfinancecheckout.sdk.model.ClientError;
+import com.postfinancecheckout.sdk.model.EntityQuery;
+import com.postfinancecheckout.sdk.model.EntityQueryFilter;
+import com.postfinancecheckout.sdk.model.ServerError;
+import com.postfinancecheckout.sdk.model.ShopifySubscriptionProduct;
+import com.postfinancecheckout.sdk.model.ShopifySubscriptionProductCreate;
+import com.postfinancecheckout.sdk.model.ShopifySubscriptionProductUpdate;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.google.api.client.http.*;
+import com.google.api.client.json.Json;
+
+import javax.ws.rs.core.UriBuilder;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.List;
+import java.util.ArrayList;
+
+
+public class ShopifySubscriptionProductService {
+ private ApiClient apiClient;
+
+ public ShopifySubscriptionProductService(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Count
+ * Counts the number of items in the database as restricted by the given filter.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param filter The filter which restricts the entities which are used to calculate the count.
+ * @return Long
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Count Documentation
+
+ **/
+ public Long count(Long spaceId, EntityQueryFilter filter) throws IOException {
+ HttpResponse response = countForHttpResponse(spaceId, filter);
+ String returnType = "Long";
+ if(returnType.equals("String")){
+ return (Long) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (Long)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ /**
+ * Count
+ * Counts the number of items in the database as restricted by the given filter.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
+ * @return Long
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Count Documentation
+
+ **/
+ public Long count(EntityQueryFilter filter, Long spaceId, Map params) throws IOException {
+ HttpResponse response = countForHttpResponse(filter, spaceId, params);
+ String returnType = "Long";
+ if(returnType.equals("String")){
+ return (Long) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (Long)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ public HttpResponse countForHttpResponse(Long spaceId, EntityQueryFilter filter) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling count");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscription-product/count");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(filter);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse countForHttpResponse(Long spaceId, java.io.InputStream filter, String mediaType) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling count");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscription-product/count");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = filter == null ?
+ apiClient.new JacksonJsonHttpContent(null) :
+ new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, filter);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse countForHttpResponse(EntityQueryFilter filter, Long spaceId, Map params) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling count");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscription-product/count");
+
+ // Copy the params argument if present, to allow passing in immutable maps
+ Map allParams = params == null ? new HashMap() : new HashMap(params);
+ // Add the required query param 'spaceId' to the map of query params
+ allParams.put("spaceId", spaceId);
+
+ for (Map.Entry entryMap: allParams.entrySet()) {
+ String key = entryMap.getKey();
+ Object value = entryMap.getValue();
+
+ if (key != null && value != null) {
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(filter);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ /**
+ * Create
+ * Creates the entity with the given properties.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param entity The Shopify subscription product object with the properties which should be created.
+ * @return ShopifySubscriptionProduct
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Create Documentation
+
+ **/
+ public ShopifySubscriptionProduct create(Long spaceId, ShopifySubscriptionProductCreate entity) throws IOException {
+ HttpResponse response = createForHttpResponse(spaceId, entity);
+ String returnType = "ShopifySubscriptionProduct";
+ if(returnType.equals("String")){
+ return (ShopifySubscriptionProduct) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (ShopifySubscriptionProduct)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ /**
+ * Create
+ * Creates the entity with the given properties.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param entity The Shopify subscription product object with the properties which should be created.
+ * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
+ * @return ShopifySubscriptionProduct
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Create Documentation
+
+ **/
+ public ShopifySubscriptionProduct create(Long spaceId, ShopifySubscriptionProductCreate entity, Map params) throws IOException {
+ HttpResponse response = createForHttpResponse(spaceId, entity, params);
+ String returnType = "ShopifySubscriptionProduct";
+ if(returnType.equals("String")){
+ return (ShopifySubscriptionProduct) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (ShopifySubscriptionProduct)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ public HttpResponse createForHttpResponse(Long spaceId, ShopifySubscriptionProductCreate entity) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling create");
+ }// verify the required parameter 'entity' is set
+ if (entity == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'entity' when calling create");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscription-product/create");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(entity);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse createForHttpResponse(Long spaceId, java.io.InputStream entity, String mediaType) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling create");
+ }// verify the required parameter 'entity' is set
+ if (entity == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'entity' when calling create");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscription-product/create");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = entity == null ?
+ apiClient.new JacksonJsonHttpContent(null) :
+ new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, entity);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse createForHttpResponse(Long spaceId, ShopifySubscriptionProductCreate entity, Map params) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling create");
+ }// verify the required parameter 'entity' is set
+ if (entity == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'entity' when calling create");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscription-product/create");
+
+ // Copy the params argument if present, to allow passing in immutable maps
+ Map allParams = params == null ? new HashMap() : new HashMap(params);
+ // Add the required query param 'spaceId' to the map of query params
+ allParams.put("spaceId", spaceId);
+
+ for (Map.Entry entryMap: allParams.entrySet()) {
+ String key = entryMap.getKey();
+ Object value = entryMap.getValue();
+
+ if (key != null && value != null) {
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(entity);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ /**
+ * Read
+ * Reads the entity with the given 'id' and returns it.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param id The id of the Shopify subscription product which should be returned.
+ * @return ShopifySubscriptionProduct
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Read Documentation
+
+ **/
+ public ShopifySubscriptionProduct read(Long spaceId, Long id) throws IOException {
+ HttpResponse response = readForHttpResponse(spaceId, id);
+ String returnType = "ShopifySubscriptionProduct";
+ if(returnType.equals("String")){
+ return (ShopifySubscriptionProduct) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (ShopifySubscriptionProduct)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ /**
+ * Read
+ * Reads the entity with the given 'id' and returns it.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param id The id of the Shopify subscription product which should be returned.
+ * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
+ * @return ShopifySubscriptionProduct
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Read Documentation
+
+ **/
+ public ShopifySubscriptionProduct read(Long spaceId, Long id, Map params) throws IOException {
+ HttpResponse response = readForHttpResponse(spaceId, id, params);
+ String returnType = "ShopifySubscriptionProduct";
+ if(returnType.equals("String")){
+ return (ShopifySubscriptionProduct) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (ShopifySubscriptionProduct)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ public HttpResponse readForHttpResponse(Long spaceId, Long id) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling read");
+ }// verify the required parameter 'id' is set
+ if (id == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'id' when calling read");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscription-product/read");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ } if (id != null) {
+ String key = "id";
+ Object value = id;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = null;
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content);
+ httpRequest.getHeaders().setContentType("*/*");
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse readForHttpResponse(Long spaceId, Long id, Map params) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling read");
+ }// verify the required parameter 'id' is set
+ if (id == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'id' when calling read");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscription-product/read");
+
+ // Copy the params argument if present, to allow passing in immutable maps
+ Map allParams = params == null ? new HashMap() : new HashMap(params);
+ // Add the required query param 'spaceId' to the map of query params
+ allParams.put("spaceId", spaceId);
+ // Add the required query param 'id' to the map of query params
+ allParams.put("id", id);
+
+ for (Map.Entry entryMap: allParams.entrySet()) {
+ String key = entryMap.getKey();
+ Object value = entryMap.getValue();
+
+ if (key != null && value != null) {
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = null;
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content);
+ httpRequest.getHeaders().setContentType("*/*");
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ /**
+ * Search
+ * Searches for the entities as specified by the given query.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param query The query restricts the Shopify subscription products which are returned by the search.
+ * @return List<ShopifySubscriptionProduct>
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Search Documentation
+
+ **/
+ public List search(Long spaceId, EntityQuery query) throws IOException {
+ HttpResponse response = searchForHttpResponse(spaceId, query);
+ String returnType = "List<ShopifySubscriptionProduct>";
+ if(returnType.equals("String")){
+ return (List) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference>() {};
+ return (List)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ /**
+ * Search
+ * Searches for the entities as specified by the given query.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param query The query restricts the Shopify subscription products which are returned by the search.
+ * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
+ * @return List<ShopifySubscriptionProduct>
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Search Documentation
+
+ **/
+ public List search(Long spaceId, EntityQuery query, Map params) throws IOException {
+ HttpResponse response = searchForHttpResponse(spaceId, query, params);
+ String returnType = "List<ShopifySubscriptionProduct>";
+ if(returnType.equals("String")){
+ return (List) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference>() {};
+ return (List)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ public HttpResponse searchForHttpResponse(Long spaceId, EntityQuery query) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling search");
+ }// verify the required parameter 'query' is set
+ if (query == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'query' when calling search");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscription-product/search");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(query);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse searchForHttpResponse(Long spaceId, java.io.InputStream query, String mediaType) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling search");
+ }// verify the required parameter 'query' is set
+ if (query == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'query' when calling search");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscription-product/search");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = query == null ?
+ apiClient.new JacksonJsonHttpContent(null) :
+ new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, query);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse searchForHttpResponse(Long spaceId, EntityQuery query, Map params) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling search");
+ }// verify the required parameter 'query' is set
+ if (query == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'query' when calling search");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscription-product/search");
+
+ // Copy the params argument if present, to allow passing in immutable maps
+ Map allParams = params == null ? new HashMap() : new HashMap(params);
+ // Add the required query param 'spaceId' to the map of query params
+ allParams.put("spaceId", spaceId);
+
+ for (Map.Entry entryMap: allParams.entrySet()) {
+ String key = entryMap.getKey();
+ Object value = entryMap.getValue();
+
+ if (key != null && value != null) {
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(query);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ /**
+ * Update
+ * This updates the entity with the given properties. Only those properties which should be updated can be provided. The 'id' and 'version' are required to identify the entity.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
409 - This status code indicates that there was a conflict with the current version of the data in the database and the provided data in the request.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param entity The Shopify subscription product object with all the properties which should be updated. The id and the version are required properties.
+ * @return ShopifySubscriptionProduct
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Update Documentation
+
+ **/
+ public ShopifySubscriptionProduct update(Long spaceId, ShopifySubscriptionProductUpdate entity) throws IOException {
+ HttpResponse response = updateForHttpResponse(spaceId, entity);
+ String returnType = "ShopifySubscriptionProduct";
+ if(returnType.equals("String")){
+ return (ShopifySubscriptionProduct) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (ShopifySubscriptionProduct)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ /**
+ * Update
+ * This updates the entity with the given properties. Only those properties which should be updated can be provided. The 'id' and 'version' are required to identify the entity.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
409 - This status code indicates that there was a conflict with the current version of the data in the database and the provided data in the request.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param entity The Shopify subscription product object with all the properties which should be updated. The id and the version are required properties.
+ * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
+ * @return ShopifySubscriptionProduct
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Update Documentation
+
+ **/
+ public ShopifySubscriptionProduct update(Long spaceId, ShopifySubscriptionProductUpdate entity, Map params) throws IOException {
+ HttpResponse response = updateForHttpResponse(spaceId, entity, params);
+ String returnType = "ShopifySubscriptionProduct";
+ if(returnType.equals("String")){
+ return (ShopifySubscriptionProduct) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (ShopifySubscriptionProduct)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ public HttpResponse updateForHttpResponse(Long spaceId, ShopifySubscriptionProductUpdate entity) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling update");
+ }// verify the required parameter 'entity' is set
+ if (entity == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'entity' when calling update");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscription-product/update");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(entity);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse updateForHttpResponse(Long spaceId, java.io.InputStream entity, String mediaType) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling update");
+ }// verify the required parameter 'entity' is set
+ if (entity == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'entity' when calling update");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscription-product/update");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = entity == null ?
+ apiClient.new JacksonJsonHttpContent(null) :
+ new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, entity);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse updateForHttpResponse(Long spaceId, ShopifySubscriptionProductUpdate entity, Map params) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling update");
+ }// verify the required parameter 'entity' is set
+ if (entity == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'entity' when calling update");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscription-product/update");
+
+ // Copy the params argument if present, to allow passing in immutable maps
+ Map allParams = params == null ? new HashMap() : new HashMap(params);
+ // Add the required query param 'spaceId' to the map of query params
+ allParams.put("spaceId", spaceId);
+
+ for (Map.Entry entryMap: allParams.entrySet()) {
+ String key = entryMap.getKey();
+ Object value = entryMap.getValue();
+
+ if (key != null && value != null) {
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(entity);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+}
diff --git a/src/main/java/com/postfinancecheckout/sdk/service/ShopifySubscriptionService.java b/src/main/java/com/postfinancecheckout/sdk/service/ShopifySubscriptionService.java
new file mode 100644
index 0000000..9111527
--- /dev/null
+++ b/src/main/java/com/postfinancecheckout/sdk/service/ShopifySubscriptionService.java
@@ -0,0 +1,1080 @@
+package com.postfinancecheckout.sdk.service;
+
+import com.postfinancecheckout.sdk.ApiClient;
+
+import com.postfinancecheckout.sdk.model.ClientError;
+import com.postfinancecheckout.sdk.model.EntityQuery;
+import com.postfinancecheckout.sdk.model.EntityQueryFilter;
+import com.postfinancecheckout.sdk.model.ServerError;
+import com.postfinancecheckout.sdk.model.ShopifySubscription;
+import com.postfinancecheckout.sdk.model.ShopifySubscriptionCreationRequest;
+import com.postfinancecheckout.sdk.model.ShopifySubscriptionUpdateAddressesRequest;
+import com.postfinancecheckout.sdk.model.ShopifySubscriptionUpdateRequest;
+import com.postfinancecheckout.sdk.model.ShopifySubscriptionVersion;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.google.api.client.http.*;
+import com.google.api.client.json.Json;
+
+import javax.ws.rs.core.UriBuilder;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.List;
+import java.util.ArrayList;
+
+
+public class ShopifySubscriptionService {
+ private ApiClient apiClient;
+
+ public ShopifySubscriptionService(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Count
+ * Counts the number of items in the database as restricted by the given filter.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param filter The filter which restricts the entities which are used to calculate the count.
+ * @return Long
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Count Documentation
+
+ **/
+ public Long count(Long spaceId, EntityQueryFilter filter) throws IOException {
+ HttpResponse response = countForHttpResponse(spaceId, filter);
+ String returnType = "Long";
+ if(returnType.equals("String")){
+ return (Long) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (Long)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ /**
+ * Count
+ * Counts the number of items in the database as restricted by the given filter.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
+ * @return Long
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Count Documentation
+
+ **/
+ public Long count(EntityQueryFilter filter, Long spaceId, Map params) throws IOException {
+ HttpResponse response = countForHttpResponse(filter, spaceId, params);
+ String returnType = "Long";
+ if(returnType.equals("String")){
+ return (Long) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (Long)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ public HttpResponse countForHttpResponse(Long spaceId, EntityQueryFilter filter) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling count");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscription/count");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(filter);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse countForHttpResponse(Long spaceId, java.io.InputStream filter, String mediaType) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling count");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscription/count");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = filter == null ?
+ apiClient.new JacksonJsonHttpContent(null) :
+ new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, filter);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse countForHttpResponse(EntityQueryFilter filter, Long spaceId, Map params) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling count");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscription/count");
+
+ // Copy the params argument if present, to allow passing in immutable maps
+ Map allParams = params == null ? new HashMap() : new HashMap(params);
+ // Add the required query param 'spaceId' to the map of query params
+ allParams.put("spaceId", spaceId);
+
+ for (Map.Entry entryMap: allParams.entrySet()) {
+ String key = entryMap.getKey();
+ Object value = entryMap.getValue();
+
+ if (key != null && value != null) {
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(filter);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ /**
+ * Create
+ * This operation allows to create a Shopify subscription.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param creationRequest
+ * @return ShopifySubscriptionVersion
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Create Documentation
+
+ **/
+ public ShopifySubscriptionVersion create(Long spaceId, ShopifySubscriptionCreationRequest creationRequest) throws IOException {
+ HttpResponse response = createForHttpResponse(spaceId, creationRequest);
+ String returnType = "ShopifySubscriptionVersion";
+ if(returnType.equals("String")){
+ return (ShopifySubscriptionVersion) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (ShopifySubscriptionVersion)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ /**
+ * Create
+ * This operation allows to create a Shopify subscription.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param creationRequest
+ * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
+ * @return ShopifySubscriptionVersion
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Create Documentation
+
+ **/
+ public ShopifySubscriptionVersion create(Long spaceId, ShopifySubscriptionCreationRequest creationRequest, Map params) throws IOException {
+ HttpResponse response = createForHttpResponse(spaceId, creationRequest, params);
+ String returnType = "ShopifySubscriptionVersion";
+ if(returnType.equals("String")){
+ return (ShopifySubscriptionVersion) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (ShopifySubscriptionVersion)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ public HttpResponse createForHttpResponse(Long spaceId, ShopifySubscriptionCreationRequest creationRequest) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling create");
+ }// verify the required parameter 'creationRequest' is set
+ if (creationRequest == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'creationRequest' when calling create");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscription/create");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(creationRequest);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse createForHttpResponse(Long spaceId, java.io.InputStream creationRequest, String mediaType) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling create");
+ }// verify the required parameter 'creationRequest' is set
+ if (creationRequest == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'creationRequest' when calling create");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscription/create");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = creationRequest == null ?
+ apiClient.new JacksonJsonHttpContent(null) :
+ new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, creationRequest);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse createForHttpResponse(Long spaceId, ShopifySubscriptionCreationRequest creationRequest, Map params) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling create");
+ }// verify the required parameter 'creationRequest' is set
+ if (creationRequest == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'creationRequest' when calling create");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscription/create");
+
+ // Copy the params argument if present, to allow passing in immutable maps
+ Map allParams = params == null ? new HashMap() : new HashMap(params);
+ // Add the required query param 'spaceId' to the map of query params
+ allParams.put("spaceId", spaceId);
+
+ for (Map.Entry entryMap: allParams.entrySet()) {
+ String key = entryMap.getKey();
+ Object value = entryMap.getValue();
+
+ if (key != null && value != null) {
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = apiClient.new JacksonJsonHttpContent(creationRequest);
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content);
+
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ /**
+ * Read
+ * Reads the entity with the given 'id' and returns it.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param id The id of the Shopify subscription which should be returned.
+ * @return ShopifySubscription
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Read Documentation
+
+ **/
+ public ShopifySubscription read(Long spaceId, Long id) throws IOException {
+ HttpResponse response = readForHttpResponse(spaceId, id);
+ String returnType = "ShopifySubscription";
+ if(returnType.equals("String")){
+ return (ShopifySubscription) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (ShopifySubscription)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ /**
+ * Read
+ * Reads the entity with the given 'id' and returns it.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param id The id of the Shopify subscription which should be returned.
+ * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
+ * @return ShopifySubscription
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Read Documentation
+
+ **/
+ public ShopifySubscription read(Long spaceId, Long id, Map params) throws IOException {
+ HttpResponse response = readForHttpResponse(spaceId, id, params);
+ String returnType = "ShopifySubscription";
+ if(returnType.equals("String")){
+ return (ShopifySubscription) (Object) response.parseAsString();
+ }
+ TypeReference typeRef = new TypeReference() {};
+ return (ShopifySubscription)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ }
+
+ public HttpResponse readForHttpResponse(Long spaceId, Long id) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling read");
+ }// verify the required parameter 'id' is set
+ if (id == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'id' when calling read");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscription/read");
+ if (spaceId != null) {
+ String key = "spaceId";
+ Object value = spaceId;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ } if (id != null) {
+ String key = "id";
+ Object value = id;
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = null;
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content);
+ httpRequest.getHeaders().setContentType("*/*");
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ public HttpResponse readForHttpResponse(Long spaceId, Long id, Map params) throws IOException {
+ // verify the required parameter 'spaceId' is set
+ if (spaceId == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling read");
+ }// verify the required parameter 'id' is set
+ if (id == null) {
+ throw new IllegalArgumentException("Missing the required parameter 'id' when calling read");
+ }
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/shopify-subscription/read");
+
+ // Copy the params argument if present, to allow passing in immutable maps
+ Map allParams = params == null ? new HashMap() : new HashMap(params);
+ // Add the required query param 'spaceId' to the map of query params
+ allParams.put("spaceId", spaceId);
+ // Add the required query param 'id' to the map of query params
+ allParams.put("id", id);
+
+ for (Map.Entry entryMap: allParams.entrySet()) {
+ String key = entryMap.getKey();
+ Object value = entryMap.getValue();
+
+ if (key != null && value != null) {
+ if (value instanceof Collection) {
+ uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ }
+
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+
+ HttpContent content = null;
+ HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content);
+ httpRequest.getHeaders().setContentType("*/*");
+
+ httpRequest.setReadTimeout(ApiClient.READ_TIMEOUT);
+ return httpRequest.execute();
+ }
+
+ /**
+ * Search
+ * Searches for the entities as specified by the given query.
+ * 200 - This status code indicates that a client request was successfully received, understood, and accepted.
+ *
442 - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
+ *
542 - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
+ * @param spaceId
+ * @param query The query restricts the Shopify subscriptions which are returned by the search.
+ * @return List<ShopifySubscription>
+ * @throws IOException if an error occurs while attempting to invoke the API
+ * For more information visit this link.
+ * @see Search Documentation
+
+ **/
+ public List search(Long spaceId, EntityQuery query) throws IOException {
+ HttpResponse response = searchForHttpResponse(spaceId, query);
+ String returnType = "List<ShopifySubscription>";
+ if(returnType.equals("String")){
+ return (List