(){}));
+ }
+
+ /**
+ * Returns an instance of one of these types:
+ *
+ * - {@code io.codat.bank_feeds.models.components.SourceAccountV2BatchCreateResponse}
+ * - {@code io.codat.bank_feeds.models.components.SourceAccountBatchCreateResponse}
+ * - {@code io.codat.bank_feeds.models.components.SourceAccountBatchErrorResponse}
+ *
+ *
+ * Use {@code instanceof} to determine what type is returned. For example:
+ *
+ *
+ * if (obj.value() instanceof String) {
+ * String answer = (String) obj.value();
+ * System.out.println("answer=" + answer);
+ * }
+ *
+ *
+ * @return value of oneOf type
+ **/
+ public java.lang.Object value() {
+ return value.value();
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CreateBatchSourceAccount1 other = (CreateBatchSourceAccount1) o;
+ return Objects.deepEquals(this.value.value(), other.value.value());
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(value.value());
+ }
+
+ @SuppressWarnings("serial")
+ public static final class _Deserializer extends OneOfDeserializer {
+
+ public _Deserializer() {
+ super(CreateBatchSourceAccount1.class, false,
+ TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT),
+ TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT),
+ TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT));
+ }
+ }
+
+ @Override
+ public String toString() {
+ return Utils.toString(CreateBatchSourceAccount1.class,
+ "value", value);
+ }
+
+}
diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequest.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequest.java
new file mode 100644
index 00000000..073efa8d
--- /dev/null
+++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequest.java
@@ -0,0 +1,192 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package io.codat.bank_feeds.models.operations;
+
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.codat.bank_feeds.utils.SpeakeasyMetadata;
+import io.codat.bank_feeds.utils.Utils;
+import java.lang.Override;
+import java.lang.String;
+import java.lang.SuppressWarnings;
+import java.util.Objects;
+import java.util.Optional;
+
+
+public class CreateBatchSourceAccountRequest {
+
+ @SpeakeasyMetadata("request:mediaType=application/json")
+ private Optional extends CreateBatchSourceAccountRequestBody> requestBody;
+
+ /**
+ * Unique identifier for a company.
+ */
+ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId")
+ private String companyId;
+
+ /**
+ * Unique identifier for a connection.
+ */
+ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=connectionId")
+ private String connectionId;
+
+ @JsonCreator
+ public CreateBatchSourceAccountRequest(
+ Optional extends CreateBatchSourceAccountRequestBody> requestBody,
+ String companyId,
+ String connectionId) {
+ Utils.checkNotNull(requestBody, "requestBody");
+ Utils.checkNotNull(companyId, "companyId");
+ Utils.checkNotNull(connectionId, "connectionId");
+ this.requestBody = requestBody;
+ this.companyId = companyId;
+ this.connectionId = connectionId;
+ }
+
+ public CreateBatchSourceAccountRequest(
+ String companyId,
+ String connectionId) {
+ this(Optional.empty(), companyId, connectionId);
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Optional requestBody() {
+ return (Optional) requestBody;
+ }
+
+ /**
+ * Unique identifier for a company.
+ */
+ @JsonIgnore
+ public String companyId() {
+ return companyId;
+ }
+
+ /**
+ * Unique identifier for a connection.
+ */
+ @JsonIgnore
+ public String connectionId() {
+ return connectionId;
+ }
+
+ public final static Builder builder() {
+ return new Builder();
+ }
+
+ public CreateBatchSourceAccountRequest withRequestBody(CreateBatchSourceAccountRequestBody requestBody) {
+ Utils.checkNotNull(requestBody, "requestBody");
+ this.requestBody = Optional.ofNullable(requestBody);
+ return this;
+ }
+
+ public CreateBatchSourceAccountRequest withRequestBody(Optional extends CreateBatchSourceAccountRequestBody> requestBody) {
+ Utils.checkNotNull(requestBody, "requestBody");
+ this.requestBody = requestBody;
+ return this;
+ }
+
+ /**
+ * Unique identifier for a company.
+ */
+ public CreateBatchSourceAccountRequest withCompanyId(String companyId) {
+ Utils.checkNotNull(companyId, "companyId");
+ this.companyId = companyId;
+ return this;
+ }
+
+ /**
+ * Unique identifier for a connection.
+ */
+ public CreateBatchSourceAccountRequest withConnectionId(String connectionId) {
+ Utils.checkNotNull(connectionId, "connectionId");
+ this.connectionId = connectionId;
+ return this;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CreateBatchSourceAccountRequest other = (CreateBatchSourceAccountRequest) o;
+ return
+ Objects.deepEquals(this.requestBody, other.requestBody) &&
+ Objects.deepEquals(this.companyId, other.companyId) &&
+ Objects.deepEquals(this.connectionId, other.connectionId);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ requestBody,
+ companyId,
+ connectionId);
+ }
+
+ @Override
+ public String toString() {
+ return Utils.toString(CreateBatchSourceAccountRequest.class,
+ "requestBody", requestBody,
+ "companyId", companyId,
+ "connectionId", connectionId);
+ }
+
+ public final static class Builder {
+
+ private Optional extends CreateBatchSourceAccountRequestBody> requestBody = Optional.empty();
+
+ private String companyId;
+
+ private String connectionId;
+
+ private Builder() {
+ // force use of static builder() method
+ }
+
+ public Builder requestBody(CreateBatchSourceAccountRequestBody requestBody) {
+ Utils.checkNotNull(requestBody, "requestBody");
+ this.requestBody = Optional.ofNullable(requestBody);
+ return this;
+ }
+
+ public Builder requestBody(Optional extends CreateBatchSourceAccountRequestBody> requestBody) {
+ Utils.checkNotNull(requestBody, "requestBody");
+ this.requestBody = requestBody;
+ return this;
+ }
+
+ /**
+ * Unique identifier for a company.
+ */
+ public Builder companyId(String companyId) {
+ Utils.checkNotNull(companyId, "companyId");
+ this.companyId = companyId;
+ return this;
+ }
+
+ /**
+ * Unique identifier for a connection.
+ */
+ public Builder connectionId(String connectionId) {
+ Utils.checkNotNull(connectionId, "connectionId");
+ this.connectionId = connectionId;
+ return this;
+ }
+
+ public CreateBatchSourceAccountRequest build() {
+ return new CreateBatchSourceAccountRequest(
+ requestBody,
+ companyId,
+ connectionId);
+ }
+ }
+}
+
diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequestBody.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequestBody.java
new file mode 100644
index 00000000..8834751a
--- /dev/null
+++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequestBody.java
@@ -0,0 +1,100 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package io.codat.bank_feeds.models.operations;
+
+
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import io.codat.bank_feeds.models.components.SourceAccount;
+import io.codat.bank_feeds.models.components.SourceAccountV2;
+import io.codat.bank_feeds.utils.OneOfDeserializer;
+import io.codat.bank_feeds.utils.TypedObject;
+import io.codat.bank_feeds.utils.Utils.JsonShape;
+import io.codat.bank_feeds.utils.Utils.TypeReferenceWithShape;
+import io.codat.bank_feeds.utils.Utils;
+import java.lang.Override;
+import java.lang.String;
+import java.lang.SuppressWarnings;
+import java.util.List;
+import java.util.Objects;
+
+
+@JsonDeserialize(using = CreateBatchSourceAccountRequestBody._Deserializer.class)
+public class CreateBatchSourceAccountRequestBody {
+
+ @JsonValue
+ private TypedObject value;
+
+ private CreateBatchSourceAccountRequestBody(TypedObject value) {
+ this.value = value;
+ }
+
+ public static CreateBatchSourceAccountRequestBody ofSourceAccountV2(List value) {
+ Utils.checkNotNull(value, "value");
+ return new CreateBatchSourceAccountRequestBody(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference>(){}));
+ }
+
+ public static CreateBatchSourceAccountRequestBody ofSourceAccount(List value) {
+ Utils.checkNotNull(value, "value");
+ return new CreateBatchSourceAccountRequestBody(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference>(){}));
+ }
+
+ /**
+ * Returns an instance of one of these types:
+ *
+ * - {@code java.util.List}
+ * - {@code java.util.List}
+ *
+ *
+ * Use {@code instanceof} to determine what type is returned. For example:
+ *
+ *
+ * if (obj.value() instanceof String) {
+ * String answer = (String) obj.value();
+ * System.out.println("answer=" + answer);
+ * }
+ *
+ *
+ * @return value of oneOf type
+ **/
+ public java.lang.Object value() {
+ return value.value();
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CreateBatchSourceAccountRequestBody other = (CreateBatchSourceAccountRequestBody) o;
+ return Objects.deepEquals(this.value.value(), other.value.value());
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(value.value());
+ }
+
+ @SuppressWarnings("serial")
+ public static final class _Deserializer extends OneOfDeserializer {
+
+ public _Deserializer() {
+ super(CreateBatchSourceAccountRequestBody.class, false,
+ TypeReferenceWithShape.of(new TypeReference>() {}, JsonShape.DEFAULT),
+ TypeReferenceWithShape.of(new TypeReference>() {}, JsonShape.DEFAULT));
+ }
+ }
+
+ @Override
+ public String toString() {
+ return Utils.toString(CreateBatchSourceAccountRequestBody.class,
+ "value", value);
+ }
+
+}
diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequestBuilder.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequestBuilder.java
new file mode 100644
index 00000000..1266a63d
--- /dev/null
+++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequestBuilder.java
@@ -0,0 +1,48 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package io.codat.bank_feeds.models.operations;
+
+import io.codat.bank_feeds.utils.Options;
+import io.codat.bank_feeds.utils.RetryConfig;
+import io.codat.bank_feeds.utils.Utils;
+import java.util.Optional;
+
+public class CreateBatchSourceAccountRequestBuilder {
+
+ private CreateBatchSourceAccountRequest request;
+ private Optional retryConfig = Optional.empty();
+ private final SDKMethodInterfaces.MethodCallCreateBatchSourceAccount sdk;
+
+ public CreateBatchSourceAccountRequestBuilder(SDKMethodInterfaces.MethodCallCreateBatchSourceAccount sdk) {
+ this.sdk = sdk;
+ }
+
+ public CreateBatchSourceAccountRequestBuilder request(CreateBatchSourceAccountRequest request) {
+ Utils.checkNotNull(request, "request");
+ this.request = request;
+ return this;
+ }
+
+ public CreateBatchSourceAccountRequestBuilder retryConfig(RetryConfig retryConfig) {
+ Utils.checkNotNull(retryConfig, "retryConfig");
+ this.retryConfig = Optional.of(retryConfig);
+ return this;
+ }
+
+ public CreateBatchSourceAccountRequestBuilder retryConfig(Optional retryConfig) {
+ Utils.checkNotNull(retryConfig, "retryConfig");
+ this.retryConfig = retryConfig;
+ return this;
+ }
+
+ public CreateBatchSourceAccountResponse call() throws Exception {
+ Optional options = Optional.of(Options.builder()
+ .retryConfig(retryConfig)
+ .build());
+ return sdk.createBatch(
+ request,
+ options);
+ }
+}
diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountResponse.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountResponse.java
new file mode 100644
index 00000000..ac6c9520
--- /dev/null
+++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountResponse.java
@@ -0,0 +1,310 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package io.codat.bank_feeds.models.operations;
+
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.codat.bank_feeds.utils.Response;
+import io.codat.bank_feeds.utils.Utils;
+import java.io.InputStream;
+import java.lang.Integer;
+import java.lang.Override;
+import java.lang.String;
+import java.lang.SuppressWarnings;
+import java.net.http.HttpResponse;
+import java.util.Objects;
+import java.util.Optional;
+
+
+public class CreateBatchSourceAccountResponse implements Response {
+
+ /**
+ * Success
+ */
+ private Optional extends CreateBatchSourceAccountResponseBody> twoHundredApplicationJsonOneOf;
+
+ /**
+ * Multi-Status
+ */
+ private Optional extends CreateBatchSourceAccountSourceAccountsResponseBody> twoHundredAndSevenApplicationJsonOneOf;
+
+ /**
+ * HTTP response content type for this operation
+ */
+ private String contentType;
+
+ /**
+ * HTTP response status code for this operation
+ */
+ private int statusCode;
+
+ /**
+ * Raw HTTP response; suitable for custom response parsing
+ */
+ private HttpResponse rawResponse;
+
+ @JsonCreator
+ public CreateBatchSourceAccountResponse(
+ Optional extends CreateBatchSourceAccountResponseBody> twoHundredApplicationJsonOneOf,
+ Optional extends CreateBatchSourceAccountSourceAccountsResponseBody> twoHundredAndSevenApplicationJsonOneOf,
+ String contentType,
+ int statusCode,
+ HttpResponse rawResponse) {
+ Utils.checkNotNull(twoHundredApplicationJsonOneOf, "twoHundredApplicationJsonOneOf");
+ Utils.checkNotNull(twoHundredAndSevenApplicationJsonOneOf, "twoHundredAndSevenApplicationJsonOneOf");
+ Utils.checkNotNull(contentType, "contentType");
+ Utils.checkNotNull(statusCode, "statusCode");
+ Utils.checkNotNull(rawResponse, "rawResponse");
+ this.twoHundredApplicationJsonOneOf = twoHundredApplicationJsonOneOf;
+ this.twoHundredAndSevenApplicationJsonOneOf = twoHundredAndSevenApplicationJsonOneOf;
+ this.contentType = contentType;
+ this.statusCode = statusCode;
+ this.rawResponse = rawResponse;
+ }
+
+ public CreateBatchSourceAccountResponse(
+ String contentType,
+ int statusCode,
+ HttpResponse rawResponse) {
+ this(Optional.empty(), Optional.empty(), contentType, statusCode, rawResponse);
+ }
+
+ /**
+ * Success
+ */
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Optional twoHundredApplicationJsonOneOf() {
+ return (Optional) twoHundredApplicationJsonOneOf;
+ }
+
+ /**
+ * Multi-Status
+ */
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Optional twoHundredAndSevenApplicationJsonOneOf() {
+ return (Optional) twoHundredAndSevenApplicationJsonOneOf;
+ }
+
+ /**
+ * HTTP response content type for this operation
+ */
+ @JsonIgnore
+ public String contentType() {
+ return contentType;
+ }
+
+ /**
+ * HTTP response status code for this operation
+ */
+ @JsonIgnore
+ public int statusCode() {
+ return statusCode;
+ }
+
+ /**
+ * Raw HTTP response; suitable for custom response parsing
+ */
+ @JsonIgnore
+ public HttpResponse rawResponse() {
+ return rawResponse;
+ }
+
+ public final static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * Success
+ */
+ public CreateBatchSourceAccountResponse withTwoHundredApplicationJsonOneOf(CreateBatchSourceAccountResponseBody twoHundredApplicationJsonOneOf) {
+ Utils.checkNotNull(twoHundredApplicationJsonOneOf, "twoHundredApplicationJsonOneOf");
+ this.twoHundredApplicationJsonOneOf = Optional.ofNullable(twoHundredApplicationJsonOneOf);
+ return this;
+ }
+
+ /**
+ * Success
+ */
+ public CreateBatchSourceAccountResponse withTwoHundredApplicationJsonOneOf(Optional extends CreateBatchSourceAccountResponseBody> twoHundredApplicationJsonOneOf) {
+ Utils.checkNotNull(twoHundredApplicationJsonOneOf, "twoHundredApplicationJsonOneOf");
+ this.twoHundredApplicationJsonOneOf = twoHundredApplicationJsonOneOf;
+ return this;
+ }
+
+ /**
+ * Multi-Status
+ */
+ public CreateBatchSourceAccountResponse withTwoHundredAndSevenApplicationJsonOneOf(CreateBatchSourceAccountSourceAccountsResponseBody twoHundredAndSevenApplicationJsonOneOf) {
+ Utils.checkNotNull(twoHundredAndSevenApplicationJsonOneOf, "twoHundredAndSevenApplicationJsonOneOf");
+ this.twoHundredAndSevenApplicationJsonOneOf = Optional.ofNullable(twoHundredAndSevenApplicationJsonOneOf);
+ return this;
+ }
+
+ /**
+ * Multi-Status
+ */
+ public CreateBatchSourceAccountResponse withTwoHundredAndSevenApplicationJsonOneOf(Optional extends CreateBatchSourceAccountSourceAccountsResponseBody> twoHundredAndSevenApplicationJsonOneOf) {
+ Utils.checkNotNull(twoHundredAndSevenApplicationJsonOneOf, "twoHundredAndSevenApplicationJsonOneOf");
+ this.twoHundredAndSevenApplicationJsonOneOf = twoHundredAndSevenApplicationJsonOneOf;
+ return this;
+ }
+
+ /**
+ * HTTP response content type for this operation
+ */
+ public CreateBatchSourceAccountResponse withContentType(String contentType) {
+ Utils.checkNotNull(contentType, "contentType");
+ this.contentType = contentType;
+ return this;
+ }
+
+ /**
+ * HTTP response status code for this operation
+ */
+ public CreateBatchSourceAccountResponse withStatusCode(int statusCode) {
+ Utils.checkNotNull(statusCode, "statusCode");
+ this.statusCode = statusCode;
+ return this;
+ }
+
+ /**
+ * Raw HTTP response; suitable for custom response parsing
+ */
+ public CreateBatchSourceAccountResponse withRawResponse(HttpResponse rawResponse) {
+ Utils.checkNotNull(rawResponse, "rawResponse");
+ this.rawResponse = rawResponse;
+ return this;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CreateBatchSourceAccountResponse other = (CreateBatchSourceAccountResponse) o;
+ return
+ Objects.deepEquals(this.twoHundredApplicationJsonOneOf, other.twoHundredApplicationJsonOneOf) &&
+ Objects.deepEquals(this.twoHundredAndSevenApplicationJsonOneOf, other.twoHundredAndSevenApplicationJsonOneOf) &&
+ Objects.deepEquals(this.contentType, other.contentType) &&
+ Objects.deepEquals(this.statusCode, other.statusCode) &&
+ Objects.deepEquals(this.rawResponse, other.rawResponse);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ twoHundredApplicationJsonOneOf,
+ twoHundredAndSevenApplicationJsonOneOf,
+ contentType,
+ statusCode,
+ rawResponse);
+ }
+
+ @Override
+ public String toString() {
+ return Utils.toString(CreateBatchSourceAccountResponse.class,
+ "twoHundredApplicationJsonOneOf", twoHundredApplicationJsonOneOf,
+ "twoHundredAndSevenApplicationJsonOneOf", twoHundredAndSevenApplicationJsonOneOf,
+ "contentType", contentType,
+ "statusCode", statusCode,
+ "rawResponse", rawResponse);
+ }
+
+ public final static class Builder {
+
+ private Optional extends CreateBatchSourceAccountResponseBody> twoHundredApplicationJsonOneOf = Optional.empty();
+
+ private Optional extends CreateBatchSourceAccountSourceAccountsResponseBody> twoHundredAndSevenApplicationJsonOneOf = Optional.empty();
+
+ private String contentType;
+
+ private Integer statusCode;
+
+ private HttpResponse rawResponse;
+
+ private Builder() {
+ // force use of static builder() method
+ }
+
+ /**
+ * Success
+ */
+ public Builder twoHundredApplicationJsonOneOf(CreateBatchSourceAccountResponseBody twoHundredApplicationJsonOneOf) {
+ Utils.checkNotNull(twoHundredApplicationJsonOneOf, "twoHundredApplicationJsonOneOf");
+ this.twoHundredApplicationJsonOneOf = Optional.ofNullable(twoHundredApplicationJsonOneOf);
+ return this;
+ }
+
+ /**
+ * Success
+ */
+ public Builder twoHundredApplicationJsonOneOf(Optional extends CreateBatchSourceAccountResponseBody> twoHundredApplicationJsonOneOf) {
+ Utils.checkNotNull(twoHundredApplicationJsonOneOf, "twoHundredApplicationJsonOneOf");
+ this.twoHundredApplicationJsonOneOf = twoHundredApplicationJsonOneOf;
+ return this;
+ }
+
+ /**
+ * Multi-Status
+ */
+ public Builder twoHundredAndSevenApplicationJsonOneOf(CreateBatchSourceAccountSourceAccountsResponseBody twoHundredAndSevenApplicationJsonOneOf) {
+ Utils.checkNotNull(twoHundredAndSevenApplicationJsonOneOf, "twoHundredAndSevenApplicationJsonOneOf");
+ this.twoHundredAndSevenApplicationJsonOneOf = Optional.ofNullable(twoHundredAndSevenApplicationJsonOneOf);
+ return this;
+ }
+
+ /**
+ * Multi-Status
+ */
+ public Builder twoHundredAndSevenApplicationJsonOneOf(Optional extends CreateBatchSourceAccountSourceAccountsResponseBody> twoHundredAndSevenApplicationJsonOneOf) {
+ Utils.checkNotNull(twoHundredAndSevenApplicationJsonOneOf, "twoHundredAndSevenApplicationJsonOneOf");
+ this.twoHundredAndSevenApplicationJsonOneOf = twoHundredAndSevenApplicationJsonOneOf;
+ return this;
+ }
+
+ /**
+ * HTTP response content type for this operation
+ */
+ public Builder contentType(String contentType) {
+ Utils.checkNotNull(contentType, "contentType");
+ this.contentType = contentType;
+ return this;
+ }
+
+ /**
+ * HTTP response status code for this operation
+ */
+ public Builder statusCode(int statusCode) {
+ Utils.checkNotNull(statusCode, "statusCode");
+ this.statusCode = statusCode;
+ return this;
+ }
+
+ /**
+ * Raw HTTP response; suitable for custom response parsing
+ */
+ public Builder rawResponse(HttpResponse rawResponse) {
+ Utils.checkNotNull(rawResponse, "rawResponse");
+ this.rawResponse = rawResponse;
+ return this;
+ }
+
+ public CreateBatchSourceAccountResponse build() {
+ return new CreateBatchSourceAccountResponse(
+ twoHundredApplicationJsonOneOf,
+ twoHundredAndSevenApplicationJsonOneOf,
+ contentType,
+ statusCode,
+ rawResponse);
+ }
+ }
+}
+
diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountResponseBody.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountResponseBody.java
new file mode 100644
index 00000000..1d273ff9
--- /dev/null
+++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountResponseBody.java
@@ -0,0 +1,94 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package io.codat.bank_feeds.models.operations;
+
+
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import io.codat.bank_feeds.utils.OneOfDeserializer;
+import io.codat.bank_feeds.utils.TypedObject;
+import io.codat.bank_feeds.utils.Utils.JsonShape;
+import io.codat.bank_feeds.utils.Utils.TypeReferenceWithShape;
+import io.codat.bank_feeds.utils.Utils;
+import java.lang.Override;
+import java.lang.String;
+import java.lang.SuppressWarnings;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * CreateBatchSourceAccountResponseBody - Success
+ */
+
+@JsonDeserialize(using = CreateBatchSourceAccountResponseBody._Deserializer.class)
+public class CreateBatchSourceAccountResponseBody {
+
+ @JsonValue
+ private TypedObject value;
+
+ private CreateBatchSourceAccountResponseBody(TypedObject value) {
+ this.value = value;
+ }
+
+ public static CreateBatchSourceAccountResponseBody of(List value) {
+ Utils.checkNotNull(value, "value");
+ return new CreateBatchSourceAccountResponseBody(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference>(){}));
+ }
+
+ /**
+ * Returns an instance of one of these types:
+ *
+ * - {@code java.util.List}
+ *
+ *
+ * Use {@code instanceof} to determine what type is returned. For example:
+ *
+ *
+ * if (obj.value() instanceof String) {
+ * String answer = (String) obj.value();
+ * System.out.println("answer=" + answer);
+ * }
+ *
+ *
+ * @return value of oneOf type
+ **/
+ public java.lang.Object value() {
+ return value.value();
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CreateBatchSourceAccountResponseBody other = (CreateBatchSourceAccountResponseBody) o;
+ return Objects.deepEquals(this.value.value(), other.value.value());
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(value.value());
+ }
+
+ @SuppressWarnings("serial")
+ public static final class _Deserializer extends OneOfDeserializer {
+
+ public _Deserializer() {
+ super(CreateBatchSourceAccountResponseBody.class, false,
+ TypeReferenceWithShape.of(new TypeReference>() {}, JsonShape.DEFAULT));
+ }
+ }
+
+ @Override
+ public String toString() {
+ return Utils.toString(CreateBatchSourceAccountResponseBody.class,
+ "value", value);
+ }
+
+}
diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountSourceAccountsResponseBody.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountSourceAccountsResponseBody.java
new file mode 100644
index 00000000..cf8d8174
--- /dev/null
+++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountSourceAccountsResponseBody.java
@@ -0,0 +1,94 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package io.codat.bank_feeds.models.operations;
+
+
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import io.codat.bank_feeds.utils.OneOfDeserializer;
+import io.codat.bank_feeds.utils.TypedObject;
+import io.codat.bank_feeds.utils.Utils.JsonShape;
+import io.codat.bank_feeds.utils.Utils.TypeReferenceWithShape;
+import io.codat.bank_feeds.utils.Utils;
+import java.lang.Override;
+import java.lang.String;
+import java.lang.SuppressWarnings;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * CreateBatchSourceAccountSourceAccountsResponseBody - Multi-Status
+ */
+
+@JsonDeserialize(using = CreateBatchSourceAccountSourceAccountsResponseBody._Deserializer.class)
+public class CreateBatchSourceAccountSourceAccountsResponseBody {
+
+ @JsonValue
+ private TypedObject value;
+
+ private CreateBatchSourceAccountSourceAccountsResponseBody(TypedObject value) {
+ this.value = value;
+ }
+
+ public static CreateBatchSourceAccountSourceAccountsResponseBody of(List value) {
+ Utils.checkNotNull(value, "value");
+ return new CreateBatchSourceAccountSourceAccountsResponseBody(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference>(){}));
+ }
+
+ /**
+ * Returns an instance of one of these types:
+ *
+ * - {@code java.util.List}
+ *
+ *
+ * Use {@code instanceof} to determine what type is returned. For example:
+ *
+ *
+ * if (obj.value() instanceof String) {
+ * String answer = (String) obj.value();
+ * System.out.println("answer=" + answer);
+ * }
+ *
+ *
+ * @return value of oneOf type
+ **/
+ public java.lang.Object value() {
+ return value.value();
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CreateBatchSourceAccountSourceAccountsResponseBody other = (CreateBatchSourceAccountSourceAccountsResponseBody) o;
+ return Objects.deepEquals(this.value.value(), other.value.value());
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(value.value());
+ }
+
+ @SuppressWarnings("serial")
+ public static final class _Deserializer extends OneOfDeserializer {
+
+ public _Deserializer() {
+ super(CreateBatchSourceAccountSourceAccountsResponseBody.class, false,
+ TypeReferenceWithShape.of(new TypeReference>() {}, JsonShape.DEFAULT));
+ }
+ }
+
+ @Override
+ public String toString() {
+ return Utils.toString(CreateBatchSourceAccountSourceAccountsResponseBody.class,
+ "value", value);
+ }
+
+}
diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenRequest.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenRequest.java
new file mode 100644
index 00000000..cd262458
--- /dev/null
+++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenRequest.java
@@ -0,0 +1,101 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package io.codat.bank_feeds.models.operations;
+
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.codat.bank_feeds.utils.SpeakeasyMetadata;
+import io.codat.bank_feeds.utils.Utils;
+import java.lang.Override;
+import java.lang.String;
+import java.util.Objects;
+
+
+public class GetCompanyAccessTokenRequest {
+
+ /**
+ * Unique identifier for a company.
+ */
+ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId")
+ private String companyId;
+
+ @JsonCreator
+ public GetCompanyAccessTokenRequest(
+ String companyId) {
+ Utils.checkNotNull(companyId, "companyId");
+ this.companyId = companyId;
+ }
+
+ /**
+ * Unique identifier for a company.
+ */
+ @JsonIgnore
+ public String companyId() {
+ return companyId;
+ }
+
+ public final static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * Unique identifier for a company.
+ */
+ public GetCompanyAccessTokenRequest withCompanyId(String companyId) {
+ Utils.checkNotNull(companyId, "companyId");
+ this.companyId = companyId;
+ return this;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ GetCompanyAccessTokenRequest other = (GetCompanyAccessTokenRequest) o;
+ return
+ Objects.deepEquals(this.companyId, other.companyId);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ companyId);
+ }
+
+ @Override
+ public String toString() {
+ return Utils.toString(GetCompanyAccessTokenRequest.class,
+ "companyId", companyId);
+ }
+
+ public final static class Builder {
+
+ private String companyId;
+
+ private Builder() {
+ // force use of static builder() method
+ }
+
+ /**
+ * Unique identifier for a company.
+ */
+ public Builder companyId(String companyId) {
+ Utils.checkNotNull(companyId, "companyId");
+ this.companyId = companyId;
+ return this;
+ }
+
+ public GetCompanyAccessTokenRequest build() {
+ return new GetCompanyAccessTokenRequest(
+ companyId);
+ }
+ }
+}
+
diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenRequestBuilder.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenRequestBuilder.java
new file mode 100644
index 00000000..0107e9b4
--- /dev/null
+++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenRequestBuilder.java
@@ -0,0 +1,48 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package io.codat.bank_feeds.models.operations;
+
+import io.codat.bank_feeds.utils.Options;
+import io.codat.bank_feeds.utils.RetryConfig;
+import io.codat.bank_feeds.utils.Utils;
+import java.util.Optional;
+
+public class GetCompanyAccessTokenRequestBuilder {
+
+ private GetCompanyAccessTokenRequest request;
+ private Optional retryConfig = Optional.empty();
+ private final SDKMethodInterfaces.MethodCallGetCompanyAccessToken sdk;
+
+ public GetCompanyAccessTokenRequestBuilder(SDKMethodInterfaces.MethodCallGetCompanyAccessToken sdk) {
+ this.sdk = sdk;
+ }
+
+ public GetCompanyAccessTokenRequestBuilder request(GetCompanyAccessTokenRequest request) {
+ Utils.checkNotNull(request, "request");
+ this.request = request;
+ return this;
+ }
+
+ public GetCompanyAccessTokenRequestBuilder retryConfig(RetryConfig retryConfig) {
+ Utils.checkNotNull(retryConfig, "retryConfig");
+ this.retryConfig = Optional.of(retryConfig);
+ return this;
+ }
+
+ public GetCompanyAccessTokenRequestBuilder retryConfig(Optional retryConfig) {
+ Utils.checkNotNull(retryConfig, "retryConfig");
+ this.retryConfig = retryConfig;
+ return this;
+ }
+
+ public GetCompanyAccessTokenResponse call() throws Exception {
+ Optional options = Optional.of(Options.builder()
+ .retryConfig(retryConfig)
+ .build());
+ return sdk.getAccessToken(
+ request,
+ options);
+ }
+}
diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenResponse.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenResponse.java
new file mode 100644
index 00000000..cea5fd14
--- /dev/null
+++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenResponse.java
@@ -0,0 +1,252 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package io.codat.bank_feeds.models.operations;
+
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.codat.bank_feeds.models.components.CompanyAccessToken;
+import io.codat.bank_feeds.utils.Response;
+import io.codat.bank_feeds.utils.Utils;
+import java.io.InputStream;
+import java.lang.Integer;
+import java.lang.Override;
+import java.lang.String;
+import java.lang.SuppressWarnings;
+import java.net.http.HttpResponse;
+import java.util.Objects;
+import java.util.Optional;
+
+
+public class GetCompanyAccessTokenResponse implements Response {
+
+ /**
+ * OK
+ */
+ private Optional extends CompanyAccessToken> companyAccessToken;
+
+ /**
+ * HTTP response content type for this operation
+ */
+ private String contentType;
+
+ /**
+ * HTTP response status code for this operation
+ */
+ private int statusCode;
+
+ /**
+ * Raw HTTP response; suitable for custom response parsing
+ */
+ private HttpResponse rawResponse;
+
+ @JsonCreator
+ public GetCompanyAccessTokenResponse(
+ Optional extends CompanyAccessToken> companyAccessToken,
+ String contentType,
+ int statusCode,
+ HttpResponse rawResponse) {
+ Utils.checkNotNull(companyAccessToken, "companyAccessToken");
+ Utils.checkNotNull(contentType, "contentType");
+ Utils.checkNotNull(statusCode, "statusCode");
+ Utils.checkNotNull(rawResponse, "rawResponse");
+ this.companyAccessToken = companyAccessToken;
+ this.contentType = contentType;
+ this.statusCode = statusCode;
+ this.rawResponse = rawResponse;
+ }
+
+ public GetCompanyAccessTokenResponse(
+ String contentType,
+ int statusCode,
+ HttpResponse rawResponse) {
+ this(Optional.empty(), contentType, statusCode, rawResponse);
+ }
+
+ /**
+ * OK
+ */
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Optional companyAccessToken() {
+ return (Optional) companyAccessToken;
+ }
+
+ /**
+ * HTTP response content type for this operation
+ */
+ @JsonIgnore
+ public String contentType() {
+ return contentType;
+ }
+
+ /**
+ * HTTP response status code for this operation
+ */
+ @JsonIgnore
+ public int statusCode() {
+ return statusCode;
+ }
+
+ /**
+ * Raw HTTP response; suitable for custom response parsing
+ */
+ @JsonIgnore
+ public HttpResponse rawResponse() {
+ return rawResponse;
+ }
+
+ public final static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * OK
+ */
+ public GetCompanyAccessTokenResponse withCompanyAccessToken(CompanyAccessToken companyAccessToken) {
+ Utils.checkNotNull(companyAccessToken, "companyAccessToken");
+ this.companyAccessToken = Optional.ofNullable(companyAccessToken);
+ return this;
+ }
+
+ /**
+ * OK
+ */
+ public GetCompanyAccessTokenResponse withCompanyAccessToken(Optional extends CompanyAccessToken> companyAccessToken) {
+ Utils.checkNotNull(companyAccessToken, "companyAccessToken");
+ this.companyAccessToken = companyAccessToken;
+ return this;
+ }
+
+ /**
+ * HTTP response content type for this operation
+ */
+ public GetCompanyAccessTokenResponse withContentType(String contentType) {
+ Utils.checkNotNull(contentType, "contentType");
+ this.contentType = contentType;
+ return this;
+ }
+
+ /**
+ * HTTP response status code for this operation
+ */
+ public GetCompanyAccessTokenResponse withStatusCode(int statusCode) {
+ Utils.checkNotNull(statusCode, "statusCode");
+ this.statusCode = statusCode;
+ return this;
+ }
+
+ /**
+ * Raw HTTP response; suitable for custom response parsing
+ */
+ public GetCompanyAccessTokenResponse withRawResponse(HttpResponse rawResponse) {
+ Utils.checkNotNull(rawResponse, "rawResponse");
+ this.rawResponse = rawResponse;
+ return this;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ GetCompanyAccessTokenResponse other = (GetCompanyAccessTokenResponse) o;
+ return
+ Objects.deepEquals(this.companyAccessToken, other.companyAccessToken) &&
+ Objects.deepEquals(this.contentType, other.contentType) &&
+ Objects.deepEquals(this.statusCode, other.statusCode) &&
+ Objects.deepEquals(this.rawResponse, other.rawResponse);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ companyAccessToken,
+ contentType,
+ statusCode,
+ rawResponse);
+ }
+
+ @Override
+ public String toString() {
+ return Utils.toString(GetCompanyAccessTokenResponse.class,
+ "companyAccessToken", companyAccessToken,
+ "contentType", contentType,
+ "statusCode", statusCode,
+ "rawResponse", rawResponse);
+ }
+
+ public final static class Builder {
+
+ private Optional extends CompanyAccessToken> companyAccessToken = Optional.empty();
+
+ private String contentType;
+
+ private Integer statusCode;
+
+ private HttpResponse rawResponse;
+
+ private Builder() {
+ // force use of static builder() method
+ }
+
+ /**
+ * OK
+ */
+ public Builder companyAccessToken(CompanyAccessToken companyAccessToken) {
+ Utils.checkNotNull(companyAccessToken, "companyAccessToken");
+ this.companyAccessToken = Optional.ofNullable(companyAccessToken);
+ return this;
+ }
+
+ /**
+ * OK
+ */
+ public Builder companyAccessToken(Optional extends CompanyAccessToken> companyAccessToken) {
+ Utils.checkNotNull(companyAccessToken, "companyAccessToken");
+ this.companyAccessToken = companyAccessToken;
+ return this;
+ }
+
+ /**
+ * HTTP response content type for this operation
+ */
+ public Builder contentType(String contentType) {
+ Utils.checkNotNull(contentType, "contentType");
+ this.contentType = contentType;
+ return this;
+ }
+
+ /**
+ * HTTP response status code for this operation
+ */
+ public Builder statusCode(int statusCode) {
+ Utils.checkNotNull(statusCode, "statusCode");
+ this.statusCode = statusCode;
+ return this;
+ }
+
+ /**
+ * Raw HTTP response; suitable for custom response parsing
+ */
+ public Builder rawResponse(HttpResponse rawResponse) {
+ Utils.checkNotNull(rawResponse, "rawResponse");
+ this.rawResponse = rawResponse;
+ return this;
+ }
+
+ public GetCompanyAccessTokenResponse build() {
+ return new GetCompanyAccessTokenResponse(
+ companyAccessToken,
+ contentType,
+ statusCode,
+ rawResponse);
+ }
+ }
+}
+
diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelRequest.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelRequest.java
new file mode 100644
index 00000000..2352abd6
--- /dev/null
+++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelRequest.java
@@ -0,0 +1,183 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package io.codat.bank_feeds.models.operations;
+
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.codat.bank_feeds.utils.SpeakeasyMetadata;
+import io.codat.bank_feeds.utils.Utils;
+import java.lang.Override;
+import java.lang.String;
+import java.util.Objects;
+
+
+public class GetCreateBankTransactionsModelRequest {
+
+ /**
+ * Unique identifier for an account.
+ */
+ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=accountId")
+ private String accountId;
+
+ /**
+ * Unique identifier for a company.
+ */
+ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId")
+ private String companyId;
+
+ /**
+ * Unique identifier for a connection.
+ */
+ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=connectionId")
+ private String connectionId;
+
+ @JsonCreator
+ public GetCreateBankTransactionsModelRequest(
+ String accountId,
+ String companyId,
+ String connectionId) {
+ Utils.checkNotNull(accountId, "accountId");
+ Utils.checkNotNull(companyId, "companyId");
+ Utils.checkNotNull(connectionId, "connectionId");
+ this.accountId = accountId;
+ this.companyId = companyId;
+ this.connectionId = connectionId;
+ }
+
+ /**
+ * Unique identifier for an account.
+ */
+ @JsonIgnore
+ public String accountId() {
+ return accountId;
+ }
+
+ /**
+ * Unique identifier for a company.
+ */
+ @JsonIgnore
+ public String companyId() {
+ return companyId;
+ }
+
+ /**
+ * Unique identifier for a connection.
+ */
+ @JsonIgnore
+ public String connectionId() {
+ return connectionId;
+ }
+
+ public final static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * Unique identifier for an account.
+ */
+ public GetCreateBankTransactionsModelRequest withAccountId(String accountId) {
+ Utils.checkNotNull(accountId, "accountId");
+ this.accountId = accountId;
+ return this;
+ }
+
+ /**
+ * Unique identifier for a company.
+ */
+ public GetCreateBankTransactionsModelRequest withCompanyId(String companyId) {
+ Utils.checkNotNull(companyId, "companyId");
+ this.companyId = companyId;
+ return this;
+ }
+
+ /**
+ * Unique identifier for a connection.
+ */
+ public GetCreateBankTransactionsModelRequest withConnectionId(String connectionId) {
+ Utils.checkNotNull(connectionId, "connectionId");
+ this.connectionId = connectionId;
+ return this;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ GetCreateBankTransactionsModelRequest other = (GetCreateBankTransactionsModelRequest) o;
+ return
+ Objects.deepEquals(this.accountId, other.accountId) &&
+ Objects.deepEquals(this.companyId, other.companyId) &&
+ Objects.deepEquals(this.connectionId, other.connectionId);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ accountId,
+ companyId,
+ connectionId);
+ }
+
+ @Override
+ public String toString() {
+ return Utils.toString(GetCreateBankTransactionsModelRequest.class,
+ "accountId", accountId,
+ "companyId", companyId,
+ "connectionId", connectionId);
+ }
+
+ public final static class Builder {
+
+ private String accountId;
+
+ private String companyId;
+
+ private String connectionId;
+
+ private Builder() {
+ // force use of static builder() method
+ }
+
+ /**
+ * Unique identifier for an account.
+ */
+ public Builder accountId(String accountId) {
+ Utils.checkNotNull(accountId, "accountId");
+ this.accountId = accountId;
+ return this;
+ }
+
+ /**
+ * Unique identifier for a company.
+ */
+ public Builder companyId(String companyId) {
+ Utils.checkNotNull(companyId, "companyId");
+ this.companyId = companyId;
+ return this;
+ }
+
+ /**
+ * Unique identifier for a connection.
+ */
+ public Builder connectionId(String connectionId) {
+ Utils.checkNotNull(connectionId, "connectionId");
+ this.connectionId = connectionId;
+ return this;
+ }
+
+ public GetCreateBankTransactionsModelRequest build() {
+ return new GetCreateBankTransactionsModelRequest(
+ accountId,
+ companyId,
+ connectionId);
+ }
+ }
+}
+
diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelRequestBuilder.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelRequestBuilder.java
new file mode 100644
index 00000000..50092af7
--- /dev/null
+++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelRequestBuilder.java
@@ -0,0 +1,48 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package io.codat.bank_feeds.models.operations;
+
+import io.codat.bank_feeds.utils.Options;
+import io.codat.bank_feeds.utils.RetryConfig;
+import io.codat.bank_feeds.utils.Utils;
+import java.util.Optional;
+
+public class GetCreateBankTransactionsModelRequestBuilder {
+
+ private GetCreateBankTransactionsModelRequest request;
+ private Optional retryConfig = Optional.empty();
+ private final SDKMethodInterfaces.MethodCallGetCreateBankTransactionsModel sdk;
+
+ public GetCreateBankTransactionsModelRequestBuilder(SDKMethodInterfaces.MethodCallGetCreateBankTransactionsModel sdk) {
+ this.sdk = sdk;
+ }
+
+ public GetCreateBankTransactionsModelRequestBuilder request(GetCreateBankTransactionsModelRequest request) {
+ Utils.checkNotNull(request, "request");
+ this.request = request;
+ return this;
+ }
+
+ public GetCreateBankTransactionsModelRequestBuilder retryConfig(RetryConfig retryConfig) {
+ Utils.checkNotNull(retryConfig, "retryConfig");
+ this.retryConfig = Optional.of(retryConfig);
+ return this;
+ }
+
+ public GetCreateBankTransactionsModelRequestBuilder retryConfig(Optional retryConfig) {
+ Utils.checkNotNull(retryConfig, "retryConfig");
+ this.retryConfig = retryConfig;
+ return this;
+ }
+
+ public GetCreateBankTransactionsModelResponse call() throws Exception {
+ Optional options = Optional.of(Options.builder()
+ .retryConfig(retryConfig)
+ .build());
+ return sdk.getCreateModel(
+ request,
+ options);
+ }
+}
diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelResponse.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelResponse.java
new file mode 100644
index 00000000..f7a62656
--- /dev/null
+++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelResponse.java
@@ -0,0 +1,252 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package io.codat.bank_feeds.models.operations;
+
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.codat.bank_feeds.models.components.PushOption;
+import io.codat.bank_feeds.utils.Response;
+import io.codat.bank_feeds.utils.Utils;
+import java.io.InputStream;
+import java.lang.Integer;
+import java.lang.Override;
+import java.lang.String;
+import java.lang.SuppressWarnings;
+import java.net.http.HttpResponse;
+import java.util.Objects;
+import java.util.Optional;
+
+
+public class GetCreateBankTransactionsModelResponse implements Response {
+
+ /**
+ * HTTP response content type for this operation
+ */
+ private String contentType;
+
+ /**
+ * Success
+ */
+ private Optional extends PushOption> pushOption;
+
+ /**
+ * HTTP response status code for this operation
+ */
+ private int statusCode;
+
+ /**
+ * Raw HTTP response; suitable for custom response parsing
+ */
+ private HttpResponse rawResponse;
+
+ @JsonCreator
+ public GetCreateBankTransactionsModelResponse(
+ String contentType,
+ Optional extends PushOption> pushOption,
+ int statusCode,
+ HttpResponse rawResponse) {
+ Utils.checkNotNull(contentType, "contentType");
+ Utils.checkNotNull(pushOption, "pushOption");
+ Utils.checkNotNull(statusCode, "statusCode");
+ Utils.checkNotNull(rawResponse, "rawResponse");
+ this.contentType = contentType;
+ this.pushOption = pushOption;
+ this.statusCode = statusCode;
+ this.rawResponse = rawResponse;
+ }
+
+ public GetCreateBankTransactionsModelResponse(
+ String contentType,
+ int statusCode,
+ HttpResponse rawResponse) {
+ this(contentType, Optional.empty(), statusCode, rawResponse);
+ }
+
+ /**
+ * HTTP response content type for this operation
+ */
+ @JsonIgnore
+ public String contentType() {
+ return contentType;
+ }
+
+ /**
+ * Success
+ */
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Optional pushOption() {
+ return (Optional) pushOption;
+ }
+
+ /**
+ * HTTP response status code for this operation
+ */
+ @JsonIgnore
+ public int statusCode() {
+ return statusCode;
+ }
+
+ /**
+ * Raw HTTP response; suitable for custom response parsing
+ */
+ @JsonIgnore
+ public HttpResponse rawResponse() {
+ return rawResponse;
+ }
+
+ public final static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * HTTP response content type for this operation
+ */
+ public GetCreateBankTransactionsModelResponse withContentType(String contentType) {
+ Utils.checkNotNull(contentType, "contentType");
+ this.contentType = contentType;
+ return this;
+ }
+
+ /**
+ * Success
+ */
+ public GetCreateBankTransactionsModelResponse withPushOption(PushOption pushOption) {
+ Utils.checkNotNull(pushOption, "pushOption");
+ this.pushOption = Optional.ofNullable(pushOption);
+ return this;
+ }
+
+ /**
+ * Success
+ */
+ public GetCreateBankTransactionsModelResponse withPushOption(Optional extends PushOption> pushOption) {
+ Utils.checkNotNull(pushOption, "pushOption");
+ this.pushOption = pushOption;
+ return this;
+ }
+
+ /**
+ * HTTP response status code for this operation
+ */
+ public GetCreateBankTransactionsModelResponse withStatusCode(int statusCode) {
+ Utils.checkNotNull(statusCode, "statusCode");
+ this.statusCode = statusCode;
+ return this;
+ }
+
+ /**
+ * Raw HTTP response; suitable for custom response parsing
+ */
+ public GetCreateBankTransactionsModelResponse withRawResponse(HttpResponse rawResponse) {
+ Utils.checkNotNull(rawResponse, "rawResponse");
+ this.rawResponse = rawResponse;
+ return this;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ GetCreateBankTransactionsModelResponse other = (GetCreateBankTransactionsModelResponse) o;
+ return
+ Objects.deepEquals(this.contentType, other.contentType) &&
+ Objects.deepEquals(this.pushOption, other.pushOption) &&
+ Objects.deepEquals(this.statusCode, other.statusCode) &&
+ Objects.deepEquals(this.rawResponse, other.rawResponse);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ contentType,
+ pushOption,
+ statusCode,
+ rawResponse);
+ }
+
+ @Override
+ public String toString() {
+ return Utils.toString(GetCreateBankTransactionsModelResponse.class,
+ "contentType", contentType,
+ "pushOption", pushOption,
+ "statusCode", statusCode,
+ "rawResponse", rawResponse);
+ }
+
+ public final static class Builder {
+
+ private String contentType;
+
+ private Optional extends PushOption> pushOption = Optional.empty();
+
+ private Integer statusCode;
+
+ private HttpResponse rawResponse;
+
+ private Builder() {
+ // force use of static builder() method
+ }
+
+ /**
+ * HTTP response content type for this operation
+ */
+ public Builder contentType(String contentType) {
+ Utils.checkNotNull(contentType, "contentType");
+ this.contentType = contentType;
+ return this;
+ }
+
+ /**
+ * Success
+ */
+ public Builder pushOption(PushOption pushOption) {
+ Utils.checkNotNull(pushOption, "pushOption");
+ this.pushOption = Optional.ofNullable(pushOption);
+ return this;
+ }
+
+ /**
+ * Success
+ */
+ public Builder pushOption(Optional extends PushOption> pushOption) {
+ Utils.checkNotNull(pushOption, "pushOption");
+ this.pushOption = pushOption;
+ return this;
+ }
+
+ /**
+ * HTTP response status code for this operation
+ */
+ public Builder statusCode(int statusCode) {
+ Utils.checkNotNull(statusCode, "statusCode");
+ this.statusCode = statusCode;
+ return this;
+ }
+
+ /**
+ * Raw HTTP response; suitable for custom response parsing
+ */
+ public Builder rawResponse(HttpResponse rawResponse) {
+ Utils.checkNotNull(rawResponse, "rawResponse");
+ this.rawResponse = rawResponse;
+ return this;
+ }
+
+ public GetCreateBankTransactionsModelResponse build() {
+ return new GetCreateBankTransactionsModelResponse(
+ contentType,
+ pushOption,
+ statusCode,
+ rawResponse);
+ }
+ }
+}
+
diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/One.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/One.java
new file mode 100644
index 00000000..eb58d6e1
--- /dev/null
+++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/One.java
@@ -0,0 +1,99 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package io.codat.bank_feeds.models.operations;
+
+
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import io.codat.bank_feeds.models.components.SourceAccountBatchCreateResponse;
+import io.codat.bank_feeds.models.components.SourceAccountV2BatchCreateResponse;
+import io.codat.bank_feeds.utils.OneOfDeserializer;
+import io.codat.bank_feeds.utils.TypedObject;
+import io.codat.bank_feeds.utils.Utils.JsonShape;
+import io.codat.bank_feeds.utils.Utils.TypeReferenceWithShape;
+import io.codat.bank_feeds.utils.Utils;
+import java.lang.Override;
+import java.lang.String;
+import java.lang.SuppressWarnings;
+import java.util.Objects;
+
+
+@JsonDeserialize(using = One._Deserializer.class)
+public class One {
+
+ @JsonValue
+ private TypedObject value;
+
+ private One(TypedObject value) {
+ this.value = value;
+ }
+
+ public static One of(SourceAccountV2BatchCreateResponse value) {
+ Utils.checkNotNull(value, "value");
+ return new One(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){}));
+ }
+
+ public static One of(SourceAccountBatchCreateResponse value) {
+ Utils.checkNotNull(value, "value");
+ return new One(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){}));
+ }
+
+ /**
+ * Returns an instance of one of these types:
+ *
+ * - {@code io.codat.bank_feeds.models.components.SourceAccountV2BatchCreateResponse}
+ * - {@code io.codat.bank_feeds.models.components.SourceAccountBatchCreateResponse}
+ *
+ *
+ * Use {@code instanceof} to determine what type is returned. For example:
+ *
+ *
+ * if (obj.value() instanceof String) {
+ * String answer = (String) obj.value();
+ * System.out.println("answer=" + answer);
+ * }
+ *
+ *
+ * @return value of oneOf type
+ **/
+ public java.lang.Object value() {
+ return value.value();
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ One other = (One) o;
+ return Objects.deepEquals(this.value.value(), other.value.value());
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(value.value());
+ }
+
+ @SuppressWarnings("serial")
+ public static final class _Deserializer extends OneOfDeserializer {
+
+ public _Deserializer() {
+ super(One.class, false,
+ TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT),
+ TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT));
+ }
+ }
+
+ @Override
+ public String toString() {
+ return Utils.toString(One.class,
+ "value", value);
+ }
+
+}
diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/SDKMethodInterfaces.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/SDKMethodInterfaces.java
index 1371db3c..2e2605ec 100644
--- a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/SDKMethodInterfaces.java
+++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/SDKMethodInterfaces.java
@@ -33,6 +33,13 @@ GetCompanyResponse get(
}
+ public interface MethodCallGetCompanyAccessToken {
+ GetCompanyAccessTokenResponse getAccessToken(
+ GetCompanyAccessTokenRequest request,
+ Optional options) throws Exception;
+ }
+
+
public interface MethodCallListCompanies {
ListCompaniesResponse list(
ListCompaniesRequest request,
@@ -110,6 +117,13 @@ CreateSourceAccountResponse create(
}
+ public interface MethodCallCreateBatchSourceAccount {
+ CreateBatchSourceAccountResponse createBatch(
+ CreateBatchSourceAccountRequest request,
+ Optional options) throws Exception;
+ }
+
+
public interface MethodCallDeleteSourceAccount {
DeleteSourceAccountResponse delete(
DeleteSourceAccountRequest request,
@@ -173,6 +187,13 @@ CreateBankTransactionsResponse create(
}
+ public interface MethodCallGetCreateBankTransactionsModel {
+ GetCreateBankTransactionsModelResponse getCreateModel(
+ GetCreateBankTransactionsModelRequest request,
+ Optional options) throws Exception;
+ }
+
+
public interface MethodCallGetCreateOperation {
GetCreateOperationResponse getCreateOperation(
GetCreateOperationRequest request,
diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/HTTPRequest.java b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/HTTPRequest.java
index 55737da8..de3e5d05 100644
--- a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/HTTPRequest.java
+++ b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/HTTPRequest.java
@@ -4,6 +4,7 @@
package io.codat.bank_feeds.utils;
+import java.net.URI;
import java.net.URISyntaxException;
import java.net.http.HttpRequest;
import java.net.http.HttpRequest.BodyPublisher;
@@ -15,15 +16,15 @@
import java.util.Map;
import java.util.Optional;
-import org.apache.http.NameValuePair;
-import org.apache.http.client.utils.URIBuilder;
-import org.apache.http.message.BasicNameValuePair;
-
public class HTTPRequest {
+ private static final String FRAGMENT_SEGMENT_START = "#";
+ private static final String QUERY_NAME_VALUE_DELIMITER = "=";
+ private static final String QUERY_PARAMETER_DELIMITER = "&";
+ private static final String QUERY_SEGMENT_START = "?";
private final String baseURL;
private final String method;
- private final List queryParams = new ArrayList<>();
+ private final List queryParams = new ArrayList<>();
private final Map> headers = new HashMap<>();
private Optional body = Optional.empty(); // mutable
@@ -54,21 +55,21 @@ public HTTPRequest addHeaders(Map> map) {
return this;
}
- public HTTPRequest addQueryParam(String name, String value) {
- addQueryParam(new BasicNameValuePair(name, value));
+ public HTTPRequest addQueryParam(QueryParameter param) {
+ this.queryParams.add(param);
return this;
}
-
- public HTTPRequest addQueryParam(NameValuePair param) {
- this.queryParams.add(param);
+
+ public HTTPRequest addQueryParam(String key, String value, boolean allowReserved) {
+ this.queryParams.add(QueryParameter.of(key, value, allowReserved));
return this;
}
- public HTTPRequest addQueryParams(Collection params) {
+ public HTTPRequest addQueryParams(Collection params) {
params.forEach(p -> addQueryParam(p));
return this;
}
-
+
public HttpRequest build() {
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder();
@@ -81,14 +82,49 @@ public HttpRequest build() {
}
requestBuilder.method(method, bodyPublisher);
try {
- URIBuilder b = new URIBuilder(this.baseURL);
- queryParams.forEach(pair -> b.addParameter(pair.getName(), pair.getValue()));
- requestBuilder.uri(b.build());
+ requestBuilder.uri(new URI(buildUrl(baseURL, queryParams)));
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
headers.forEach((k, list) -> list.forEach(v -> requestBuilder.header(k, v)));
return requestBuilder.build();
}
-
+
+ // VisibleForTesting
+ public static String buildUrl(String baseURL, Collection queryParams) {
+ if (queryParams.isEmpty()) {
+ return baseURL;
+ } else {
+ final String base;
+ final String fragment;
+ int i = baseURL.indexOf(FRAGMENT_SEGMENT_START);
+ if (i == -1) {
+ base = baseURL;
+ fragment = "";
+ } else {
+ base = baseURL.substring(0, i);
+ fragment = baseURL.substring(i);
+ }
+ StringBuilder b = new StringBuilder(base);
+ if (!base.contains(QUERY_SEGMENT_START)) {
+ b.append(QUERY_SEGMENT_START);
+ } else {
+ b.append(QUERY_PARAMETER_DELIMITER);
+ }
+ boolean first = true;
+ for (QueryParameter p : queryParams) {
+ if (!first) {
+ b.append(QUERY_PARAMETER_DELIMITER);
+ }
+ first = false;
+ // don't allow reserved characters to be unencoded in key (??)
+ b.append(Utf8UrlEncoder.DEFAULT.encode(p.name()));
+ b.append(QUERY_NAME_VALUE_DELIMITER);
+ b.append(Utf8UrlEncoder.allowReserved(p.allowReserved()).encode(p.value()));
+ }
+ b.append(fragment);
+ return b.toString();
+ }
+ }
+
}
\ No newline at end of file
diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/PathParamsMetadata.java b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/PathParamsMetadata.java
index 76e3632c..b877b6e0 100644
--- a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/PathParamsMetadata.java
+++ b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/PathParamsMetadata.java
@@ -8,15 +8,17 @@
class PathParamsMetadata {
+ // these fields set via reflection
+
String style = "simple";
boolean explode;
String name;
String serialization;
+ boolean allowReserved;
private PathParamsMetadata() {
}
- // pathParam:style=simple,explode=false,name=apiID
static PathParamsMetadata parse(Field field) throws IllegalArgumentException, IllegalAccessException {
return Metadata.parse("pathParam", new PathParamsMetadata(), field);
}
diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParameter.java b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParameter.java
new file mode 100644
index 00000000..8a2e0c1f
--- /dev/null
+++ b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParameter.java
@@ -0,0 +1,62 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package io.codat.bank_feeds.utils;
+
+import java.util.Objects;
+
+// internal class, not for public use
+// TODO move to internal package
+public final class QueryParameter {
+
+ private final String name;
+ private final String value;
+ private final boolean allowReserved;
+
+ private QueryParameter(String name, String value, boolean allowReserved) {
+ this.name = name;
+ this.value = value;
+ this.allowReserved = allowReserved;
+ }
+
+ public static QueryParameter of(String name, String value, boolean allowReserved) {
+ return new QueryParameter(name, value, allowReserved);
+ }
+
+ public String name() {
+ return name;
+ }
+
+ public String value() {
+ return value;
+ }
+
+ public boolean allowReserved() {
+ return allowReserved;
+ }
+
+ @Override
+ public String toString() {
+ return "QueryParameter [name=" + name + ", value=" + value + ", allowReserved=" + allowReserved + "]";
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(allowReserved, name, value);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ QueryParameter other = (QueryParameter) obj;
+ return allowReserved == other.allowReserved && Objects.equals(name, other.name)
+ && Objects.equals(value, other.value);
+ }
+
+}
diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParameters.java b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParameters.java
index aff3f177..8d44fa6c 100644
--- a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParameters.java
+++ b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParameters.java
@@ -11,16 +11,13 @@
import java.util.Map;
import java.util.stream.Collectors;
-import org.apache.http.NameValuePair;
-import org.apache.http.message.BasicNameValuePair;
-
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
public class QueryParameters {
- public static List parseQueryParams(Class type, T queryParams,
+ public static List parseQueryParams(Class type, T queryParams,
Map>> globals) throws Exception {
- List allParams = new ArrayList<>();
+ List allParams = new ArrayList<>();
Field[] fields = type.getDeclaredFields();
@@ -45,20 +42,20 @@ public static List parseQueryParams(Class t
}
if (queryParamsMetadata.serialization != null && !queryParamsMetadata.serialization.isBlank()) {
- List params = parseSerializedParams(queryParamsMetadata, value);
+ List params = parseSerializedParams(queryParamsMetadata, value);
allParams.addAll(params);
} else {
switch (queryParamsMetadata.style) {
case "form":
- List formParams = parseDelimitedParams(queryParamsMetadata, value, ",");
+ List formParams = parseDelimitedParams(queryParamsMetadata, value, ",");
allParams.addAll(formParams);
break;
case "deepObject":
- List deepObjectParams = parseDeepObjectParams(queryParamsMetadata, value);
+ List deepObjectParams = parseDeepObjectParams(queryParamsMetadata, value);
allParams.addAll(deepObjectParams);
break;
case "pipeDelimited":
- List pipeDelimitedParams = parseDelimitedParams(queryParamsMetadata, value, "|");
+ List pipeDelimitedParams = parseDelimitedParams(queryParamsMetadata, value, "|");
allParams.addAll(pipeDelimitedParams);
break;
default:
@@ -70,14 +67,14 @@ public static List parseQueryParams(Class t
return allParams;
}
- private static List parseSerializedParams(QueryParamsMetadata queryParamsMetadata, Object value)
+ private static List parseSerializedParams(QueryParamsMetadata queryParamsMetadata, Object value)
throws JsonProcessingException {
- List params = new ArrayList<>();
+ List params = new ArrayList<>();
switch (queryParamsMetadata.serialization) {
case "json":
ObjectMapper mapper = JSON.getMapper();
String json = mapper.writeValueAsString(value);
- params.add(new BasicNameValuePair(queryParamsMetadata.name, json));
+ params.add(QueryParameter.of(queryParamsMetadata.name, json, queryParamsMetadata.allowReserved));
break;
default:
break;
@@ -85,9 +82,9 @@ private static List parseSerializedParams(QueryParamsMetadata que
return params;
}
- private static List parseDelimitedParams(QueryParamsMetadata queryParamsMetadata, Object value, String delimiter)
+ private static List parseDelimitedParams(QueryParamsMetadata queryParamsMetadata, Object value, String delimiter)
throws IllegalArgumentException, IllegalAccessException {
- List params = new ArrayList<>();
+ List params = new ArrayList<>();
switch (Types.getType(value.getClass())) {
case ARRAY: {
@@ -107,7 +104,7 @@ private static List parseDelimitedParams(QueryParamsMetadata quer
values.add(String.join(delimiter, items));
}
- params.addAll(values.stream().map(v -> new BasicNameValuePair(queryParamsMetadata.name, v))
+ params.addAll(values.stream().map(v -> QueryParameter.of(queryParamsMetadata.name, v, queryParamsMetadata.allowReserved))
.collect(Collectors.toList()));
break;
}
@@ -121,20 +118,20 @@ private static List parseDelimitedParams(QueryParamsMetadata quer
String val = Utils.valToString(entry.getValue());
if (queryParamsMetadata.explode) {
- params.add(new BasicNameValuePair(key, val));
+ params.add(QueryParameter.of(key, val, queryParamsMetadata.allowReserved));
} else {
items.add(String.format("%s%s%s", key, delimiter, val));
}
}
if (items.size() > 0) {
- params.add(new BasicNameValuePair(queryParamsMetadata.name, String.join(delimiter, items)));
+ params.add(QueryParameter.of(queryParamsMetadata.name, String.join(delimiter, items), queryParamsMetadata.allowReserved));
}
break;
}
case OBJECT: {
if (!Utils.allowIntrospection(value.getClass())) {
- params.add(new BasicNameValuePair(queryParamsMetadata.name, Utils.valToString(value)));
+ params.add(QueryParameter.of(queryParamsMetadata.name, Utils.valToString(value), queryParamsMetadata.allowReserved));
break;
}
Field[] fields = value.getClass().getDeclaredFields();
@@ -155,29 +152,29 @@ private static List parseDelimitedParams(QueryParamsMetadata quer
}
if (queryParamsMetadata.explode) {
- params.add(new BasicNameValuePair(metadata.name, Utils.valToString(val)));
+ params.add(QueryParameter.of(metadata.name, Utils.valToString(val), metadata.allowReserved));
} else {
items.add(String.format("%s%s%s", metadata.name, delimiter, Utils.valToString(val)));
}
}
if (items.size() > 0) {
- params.add(new BasicNameValuePair(queryParamsMetadata.name, String.join(delimiter, items)));
+ params.add(QueryParameter.of(queryParamsMetadata.name, String.join(delimiter, items), queryParamsMetadata.allowReserved));
}
break;
}
default:
- params.add(new BasicNameValuePair(queryParamsMetadata.name, Utils.valToString(value)));
+ params.add(QueryParameter.of(queryParamsMetadata.name, Utils.valToString(value), queryParamsMetadata.allowReserved));
break;
}
return params;
}
- private static List parseDeepObjectParams(QueryParamsMetadata queryParamsMetadata, Object value)
+ private static List parseDeepObjectParams(QueryParamsMetadata queryParamsMetadata, Object value)
throws Exception {
- List params = new ArrayList<>();
+ List params = new ArrayList<>();
switch (Types.getType(value.getClass())) {
case MAP: {
@@ -189,12 +186,12 @@ private static List parseDeepObjectParams(QueryParamsMetadata que
if (val instanceof List || val.getClass().isArray()) {
for (Object v : Utils.toList(val)) {
- params.add(new BasicNameValuePair(String.format("%s[%s]", queryParamsMetadata.name, key),
- Utils.valToString(v)));
+ params.add(QueryParameter.of(String.format("%s[%s]", queryParamsMetadata.name, key),
+ Utils.valToString(v), queryParamsMetadata.allowReserved));
}
} else {
- params.add(new BasicNameValuePair(String.format("%s[%s]", queryParamsMetadata.name, key),
- Utils.valToString(val)));
+ params.add(QueryParameter.of(String.format("%s[%s]", queryParamsMetadata.name, key),
+ Utils.valToString(val), queryParamsMetadata.allowReserved));
}
}
@@ -221,14 +218,14 @@ private static List parseDeepObjectParams(QueryParamsMetadata que
if (val instanceof List || val.getClass().isArray()) {
for (Object v : Utils.toList(val)) {
- params.add(new BasicNameValuePair(
+ params.add(QueryParameter.of(
String.format("%s[%s]", queryParamsMetadata.name, metadata.name),
- Utils.valToString(v)));
+ Utils.valToString(v), metadata.allowReserved));
}
} else {
params.add(
- new BasicNameValuePair(String.format("%s[%s]", queryParamsMetadata.name, metadata.name),
- Utils.valToString(val)));
+ QueryParameter.of(String.format("%s[%s]", queryParamsMetadata.name, metadata.name),
+ Utils.valToString(val), metadata.allowReserved));
}
}
diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParamsMetadata.java b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParamsMetadata.java
index e75f211a..ee919309 100644
--- a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParamsMetadata.java
+++ b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParamsMetadata.java
@@ -8,12 +8,14 @@
class QueryParamsMetadata {
+ // these parameters set via reflection
+
String style = "form";
boolean explode = true;
String name;
String serialization;
+ boolean allowReserved;
- // queryParam:style=simple,explode=false,name=apiID
static QueryParamsMetadata parse(Field field) throws IllegalArgumentException, IllegalAccessException {
return Metadata.parse("queryParam", new QueryParamsMetadata(), field);
}
diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/Security.java b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/Security.java
index 6affb5ac..66da5493 100644
--- a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/Security.java
+++ b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/Security.java
@@ -108,7 +108,7 @@ private static void parseSecuritySchemeValue(HTTPRequest request, SecurityMetada
break;
case "query":
request.addQueryParam(
- securityMetadata.name, Utils.valToString(value));
+ securityMetadata.name, Utils.valToString(value), false);
break;
case "cookie":
request.addHeader("Cookie",
diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/Utf8UrlEncoder.java b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/Utf8UrlEncoder.java
new file mode 100644
index 00000000..ada7f1c4
--- /dev/null
+++ b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/Utf8UrlEncoder.java
@@ -0,0 +1,117 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+package io.codat.bank_feeds.utils;
+
+import java.io.CharArrayWriter;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.util.BitSet;
+import java.util.Objects;
+
+// Internal use only
+// TODO move to an internal package
+public final class Utf8UrlEncoder {
+
+ private static final BitSet DO_NOT_ENCODE_CHARS = createDoNotEncodeChars();
+ private static final int CASE_DIFF = ('a' - 'A');
+
+ private final BitSet safeChars;
+
+ public static final Utf8UrlEncoder ALLOW_RESERVED = new Utf8UrlEncoder(":/?#[]@!$&'()*+,;=");
+ public static final Utf8UrlEncoder DEFAULT = new Utf8UrlEncoder("");
+
+ public static Utf8UrlEncoder allowReserved(boolean allowReserved) {
+ return allowReserved ? ALLOW_RESERVED : DEFAULT;
+ }
+
+ private Utf8UrlEncoder(String safeCharacters) {
+ Objects.requireNonNull(safeCharacters, "safeCharacters");
+ int max = -1;
+ for (int i = 0; i < safeCharacters.length(); i++) {
+ char ch = safeCharacters.charAt(i);
+ max = Math.max(ch, max);
+ }
+ BitSet safeChars = new BitSet(max + 1);
+ for (int i = 0; i < safeCharacters.length(); i++) {
+ char ch = safeCharacters.charAt(i);
+ safeChars.set(ch);
+ }
+ this.safeChars = safeChars;
+ }
+
+ public String encode(String s) {
+ return encode(s, StandardCharsets.UTF_8);
+ }
+
+ private String encode(String s, Charset charset) {
+ boolean changed = false;
+ StringBuilder out = new StringBuilder(s.length());
+ CharArrayWriter writer = new CharArrayWriter();
+
+ for (int i = 0; i < s.length();) {
+ int c = (int) s.charAt(i);
+ if (DO_NOT_ENCODE_CHARS.get(c) || safeChars.get(c)) {
+ out.append((char) c);
+ i++;
+ } else {
+ // convert to external encoding before hex conversion
+ do {
+ writer.write(c);
+ if (c >= 0xD800 && c <= 0xDBFF) {
+ if ((i + 1) < s.length()) {
+ int d = (int) s.charAt(i + 1);
+ if (d >= 0xDC00 && d <= 0xDFFF) {
+ writer.write(d);
+ i++;
+ }
+ }
+ }
+ i++;
+ } while (i < s.length() && !DO_NOT_ENCODE_CHARS.get((c = (int) s.charAt(i))));
+
+ writer.flush();
+ String str = new String(writer.toCharArray());
+ byte[] ba = str.getBytes(charset);
+ for (int j = 0; j < ba.length; j++) {
+ out.append('%');
+ char ch = Character.forDigit((ba[j] >> 4) & 0xF, 16);
+ // converting to use uppercase letter as part of
+ // the hex value if ch is a letter.
+ if (Character.isLetter(ch)) {
+ ch -= CASE_DIFF;
+ }
+ out.append(ch);
+ ch = Character.forDigit(ba[j] & 0xF, 16);
+ if (Character.isLetter(ch)) {
+ ch -= CASE_DIFF;
+ }
+ out.append(ch);
+ }
+ writer.reset();
+ changed = true;
+ }
+ }
+
+ return (changed ? out.toString() : s);
+ }
+
+ private static BitSet createDoNotEncodeChars() {
+ BitSet b = new BitSet(256);
+ for (int i = 'a'; i <= 'z'; i++) {
+ b.set(i);
+ }
+ for (int i = 'A'; i <= 'Z'; i++) {
+ b.set(i);
+ }
+ for (int i = '0'; i <= '9'; i++) {
+ b.set(i);
+ }
+ b.set('-');
+ b.set('_');
+ b.set('.');
+ b.set('*');
+ return b;
+ }
+}
diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/Utils.java b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/Utils.java
index 3277c66e..a2553537 100644
--- a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/Utils.java
+++ b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/Utils.java
@@ -15,7 +15,6 @@
import java.math.BigDecimal;
import java.math.BigInteger;
import java.net.URI;
-import java.net.URISyntaxException;
import java.net.URLEncoder;
import java.net.http.HttpClient.Version;
import java.net.http.HttpHeaders;
@@ -144,7 +143,9 @@ public static String generateURL(Class type, String baseURL, String path,
pathParams.put(pathParamsMetadata.name,
String.join(",",
- array.stream().map(v -> valToString(v))
+ array.stream()
+ .map(v -> valToString(v))
+ .map(v -> pathEncode(v, pathParamsMetadata.allowReserved))
.collect(Collectors.toList())));
break;
case MAP:
@@ -156,17 +157,17 @@ public static String generateURL(Class type, String baseURL, String path,
pathParams.put(pathParamsMetadata.name,
String.join(",", map.entrySet().stream().map(e -> {
if (pathParamsMetadata.explode) {
- return String.format("%s=%s", valToString(e.getKey()),
- valToString(e.getValue()));
+ return String.format("%s=%s", pathEncode(valToString(e.getKey()), false),
+ pathEncode(valToString(e.getValue()), false));
} else {
- return String.format("%s,%s", valToString(e.getKey()),
- valToString(e.getValue()));
+ return String.format("%s,%s", pathEncode(valToString(e.getKey()), false),
+ pathEncode(valToString(e.getValue()), false));
}
}).collect(Collectors.toList())));
break;
case OBJECT:
if (!allowIntrospection(value.getClass())) {
- pathParams.put(pathParamsMetadata.name, valToString(value));
+ pathParams.put(pathParamsMetadata.name, pathEncode(valToString(value), pathParamsMetadata.allowReserved));
break;
}
List values = new ArrayList<>();
@@ -187,17 +188,17 @@ public static String generateURL(Class type, String baseURL, String path,
if (pathParamsMetadata.explode) {
values.add(String.format("%s=%s", valuePathParamsMetadata.name,
- valToString(val)));
+ pathEncode(valToString(val), valuePathParamsMetadata.allowReserved)));
} else {
values.add(String.format("%s,%s", valuePathParamsMetadata.name,
- valToString(val)));
+ pathEncode(valToString(val), valuePathParamsMetadata.allowReserved)));
}
}
pathParams.put(pathParamsMetadata.name, String.join(",", values));
break;
default:
- pathParams.put(pathParamsMetadata.name, valToString(value));
+ pathParams.put(pathParamsMetadata.name, pathEncode(valToString(value), pathParamsMetadata.allowReserved));
break;
}
}
@@ -206,6 +207,10 @@ public static