diff --git a/src/main/java/com/basistheory/resources/applepay/ApplePayClient.java b/src/main/java/com/basistheory/resources/applepay/ApplePayClient.java index ec95f43..d8e763f 100644 --- a/src/main/java/com/basistheory/resources/applepay/ApplePayClient.java +++ b/src/main/java/com/basistheory/resources/applepay/ApplePayClient.java @@ -56,12 +56,12 @@ public ApplePayToken get(String id, RequestOptions requestOptions) { return this.rawClient.get(id, requestOptions).body(); } - public String unlink(String id) { - return this.rawClient.unlink(id).body(); + public String delete(String id) { + return this.rawClient.delete(id).body(); } - public String unlink(String id, RequestOptions requestOptions) { - return this.rawClient.unlink(id, requestOptions).body(); + public String delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).body(); } public DomainClient domain() { diff --git a/src/main/java/com/basistheory/resources/applepay/AsyncApplePayClient.java b/src/main/java/com/basistheory/resources/applepay/AsyncApplePayClient.java index 97274ca..a3df1dc 100644 --- a/src/main/java/com/basistheory/resources/applepay/AsyncApplePayClient.java +++ b/src/main/java/com/basistheory/resources/applepay/AsyncApplePayClient.java @@ -58,12 +58,12 @@ public CompletableFuture get(String id, RequestOptions requestOpt return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); } - public CompletableFuture unlink(String id) { - return this.rawClient.unlink(id).thenApply(response -> response.body()); + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); } - public CompletableFuture unlink(String id, RequestOptions requestOptions) { - return this.rawClient.unlink(id, requestOptions).thenApply(response -> response.body()); + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); } public AsyncDomainClient domain() { diff --git a/src/main/java/com/basistheory/resources/applepay/AsyncRawApplePayClient.java b/src/main/java/com/basistheory/resources/applepay/AsyncRawApplePayClient.java index 4250dac..5cdd697 100644 --- a/src/main/java/com/basistheory/resources/applepay/AsyncRawApplePayClient.java +++ b/src/main/java/com/basistheory/resources/applepay/AsyncRawApplePayClient.java @@ -204,20 +204,19 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } - public CompletableFuture> unlink(String id) { - return unlink(id, null); + public CompletableFuture> delete(String id) { + return delete(id, null); } - public CompletableFuture> unlink(String id, RequestOptions requestOptions) { + public CompletableFuture> delete(String id, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("apple-pay") .addPathSegment(id) - .addPathSegments("unlink") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) - .method("POST", RequestBody.create("", null)) + .method("DELETE", null) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Accept", "application/json") .build(); @@ -248,9 +247,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), response)); return; - case 422: - future.completeExceptionally(new UnprocessableEntityError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } diff --git a/src/main/java/com/basistheory/resources/applepay/RawApplePayClient.java b/src/main/java/com/basistheory/resources/applepay/RawApplePayClient.java index 5981441..d353d75 100644 --- a/src/main/java/com/basistheory/resources/applepay/RawApplePayClient.java +++ b/src/main/java/com/basistheory/resources/applepay/RawApplePayClient.java @@ -163,20 +163,19 @@ public BasisTheoryApiHttpResponse get(String id, RequestOptions r } } - public BasisTheoryApiHttpResponse unlink(String id) { - return unlink(id, null); + public BasisTheoryApiHttpResponse delete(String id) { + return delete(id, null); } - public BasisTheoryApiHttpResponse unlink(String id, RequestOptions requestOptions) { + public BasisTheoryApiHttpResponse delete(String id, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("apple-pay") .addPathSegment(id) - .addPathSegments("unlink") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) - .method("POST", RequestBody.create("", null)) + .method("DELETE", null) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Accept", "application/json") .build(); @@ -201,10 +200,9 @@ public BasisTheoryApiHttpResponse unlink(String id, RequestOptions reque throw new ForbiddenError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), response); - case 422: - throw new UnprocessableEntityError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProblemDetails.class), - response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error diff --git a/src/main/java/com/basistheory/resources/reactors/requests/CreateReactorRequest.java b/src/main/java/com/basistheory/resources/reactors/requests/CreateReactorRequest.java index 3b6faad..85b2f10 100644 --- a/src/main/java/com/basistheory/resources/reactors/requests/CreateReactorRequest.java +++ b/src/main/java/com/basistheory/resources/reactors/requests/CreateReactorRequest.java @@ -30,6 +30,10 @@ public final class CreateReactorRequest { private final Optional>> configuration; + private final Optional>> dependencies; + + private final Optional runtime; + private final Map additionalProperties; private CreateReactorRequest( @@ -37,11 +41,15 @@ private CreateReactorRequest( String code, Optional application, Optional>> configuration, + Optional>> dependencies, + Optional runtime, Map additionalProperties) { this.name = name; this.code = code; this.application = application; this.configuration = configuration; + this.dependencies = dependencies; + this.runtime = runtime; this.additionalProperties = additionalProperties; } @@ -65,6 +73,16 @@ public Optional>> getConfiguration() { return configuration; } + @JsonProperty("dependencies") + public Optional>> getDependencies() { + return dependencies; + } + + @JsonProperty("runtime") + public Optional getRuntime() { + return runtime; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -80,12 +98,15 @@ private boolean equalTo(CreateReactorRequest other) { return name.equals(other.name) && code.equals(other.code) && application.equals(other.application) - && configuration.equals(other.configuration); + && configuration.equals(other.configuration) + && dependencies.equals(other.dependencies) + && runtime.equals(other.runtime); } @java.lang.Override public int hashCode() { - return Objects.hash(this.name, this.code, this.application, this.configuration); + return Objects.hash( + this.name, this.code, this.application, this.configuration, this.dependencies, this.runtime); } @java.lang.Override @@ -117,6 +138,14 @@ public interface _FinalStage { _FinalStage configuration(Optional>> configuration); _FinalStage configuration(Map> configuration); + + _FinalStage dependencies(Optional>> dependencies); + + _FinalStage dependencies(Map> dependencies); + + _FinalStage runtime(Optional runtime); + + _FinalStage runtime(String runtime); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -125,6 +154,10 @@ public static final class Builder implements NameStage, CodeStage, _FinalStage { private String code; + private Optional runtime = Optional.empty(); + + private Optional>> dependencies = Optional.empty(); + private Optional>> configuration = Optional.empty(); private Optional application = Optional.empty(); @@ -140,6 +173,8 @@ public Builder from(CreateReactorRequest other) { code(other.getCode()); application(other.getApplication()); configuration(other.getConfiguration()); + dependencies(other.getDependencies()); + runtime(other.getRuntime()); return this; } @@ -157,6 +192,32 @@ public _FinalStage code(@NotNull String code) { return this; } + @java.lang.Override + public _FinalStage runtime(String runtime) { + this.runtime = Optional.ofNullable(runtime); + return this; + } + + @java.lang.Override + @JsonSetter(value = "runtime", nulls = Nulls.SKIP) + public _FinalStage runtime(Optional runtime) { + this.runtime = runtime; + return this; + } + + @java.lang.Override + public _FinalStage dependencies(Map> dependencies) { + this.dependencies = Optional.ofNullable(dependencies); + return this; + } + + @java.lang.Override + @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) + public _FinalStage dependencies(Optional>> dependencies) { + this.dependencies = dependencies; + return this; + } + @java.lang.Override public _FinalStage configuration(Map> configuration) { this.configuration = Optional.ofNullable(configuration); @@ -185,7 +246,8 @@ public _FinalStage application(Optional application) { @java.lang.Override public CreateReactorRequest build() { - return new CreateReactorRequest(name, code, application, configuration, additionalProperties); + return new CreateReactorRequest( + name, code, application, configuration, dependencies, runtime, additionalProperties); } } } diff --git a/src/main/java/com/basistheory/resources/reactors/requests/UpdateReactorRequest.java b/src/main/java/com/basistheory/resources/reactors/requests/UpdateReactorRequest.java index 9b4b6bf..214554a 100644 --- a/src/main/java/com/basistheory/resources/reactors/requests/UpdateReactorRequest.java +++ b/src/main/java/com/basistheory/resources/reactors/requests/UpdateReactorRequest.java @@ -30,6 +30,10 @@ public final class UpdateReactorRequest { private final Optional>> configuration; + private final Optional>> dependencies; + + private final Optional runtime; + private final Map additionalProperties; private UpdateReactorRequest( @@ -37,11 +41,15 @@ private UpdateReactorRequest( Optional application, String code, Optional>> configuration, + Optional>> dependencies, + Optional runtime, Map additionalProperties) { this.name = name; this.application = application; this.code = code; this.configuration = configuration; + this.dependencies = dependencies; + this.runtime = runtime; this.additionalProperties = additionalProperties; } @@ -65,6 +73,16 @@ public Optional>> getConfiguration() { return configuration; } + @JsonProperty("dependencies") + public Optional>> getDependencies() { + return dependencies; + } + + @JsonProperty("runtime") + public Optional getRuntime() { + return runtime; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -80,12 +98,15 @@ private boolean equalTo(UpdateReactorRequest other) { return name.equals(other.name) && application.equals(other.application) && code.equals(other.code) - && configuration.equals(other.configuration); + && configuration.equals(other.configuration) + && dependencies.equals(other.dependencies) + && runtime.equals(other.runtime); } @java.lang.Override public int hashCode() { - return Objects.hash(this.name, this.application, this.code, this.configuration); + return Objects.hash( + this.name, this.application, this.code, this.configuration, this.dependencies, this.runtime); } @java.lang.Override @@ -117,6 +138,14 @@ public interface _FinalStage { _FinalStage configuration(Optional>> configuration); _FinalStage configuration(Map> configuration); + + _FinalStage dependencies(Optional>> dependencies); + + _FinalStage dependencies(Map> dependencies); + + _FinalStage runtime(Optional runtime); + + _FinalStage runtime(String runtime); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -125,6 +154,10 @@ public static final class Builder implements NameStage, CodeStage, _FinalStage { private String code; + private Optional runtime = Optional.empty(); + + private Optional>> dependencies = Optional.empty(); + private Optional>> configuration = Optional.empty(); private Optional application = Optional.empty(); @@ -140,6 +173,8 @@ public Builder from(UpdateReactorRequest other) { application(other.getApplication()); code(other.getCode()); configuration(other.getConfiguration()); + dependencies(other.getDependencies()); + runtime(other.getRuntime()); return this; } @@ -157,6 +192,32 @@ public _FinalStage code(@NotNull String code) { return this; } + @java.lang.Override + public _FinalStage runtime(String runtime) { + this.runtime = Optional.ofNullable(runtime); + return this; + } + + @java.lang.Override + @JsonSetter(value = "runtime", nulls = Nulls.SKIP) + public _FinalStage runtime(Optional runtime) { + this.runtime = runtime; + return this; + } + + @java.lang.Override + public _FinalStage dependencies(Map> dependencies) { + this.dependencies = Optional.ofNullable(dependencies); + return this; + } + + @java.lang.Override + @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) + public _FinalStage dependencies(Optional>> dependencies) { + this.dependencies = dependencies; + return this; + } + @java.lang.Override public _FinalStage configuration(Map> configuration) { this.configuration = Optional.ofNullable(configuration); @@ -185,7 +246,8 @@ public _FinalStage application(Optional application) { @java.lang.Override public UpdateReactorRequest build() { - return new UpdateReactorRequest(name, application, code, configuration, additionalProperties); + return new UpdateReactorRequest( + name, application, code, configuration, dependencies, runtime, additionalProperties); } } } diff --git a/src/main/java/com/basistheory/types/Reactor.java b/src/main/java/com/basistheory/types/Reactor.java index 347638d..709f488 100644 --- a/src/main/java/com/basistheory/types/Reactor.java +++ b/src/main/java/com/basistheory/types/Reactor.java @@ -43,6 +43,10 @@ public final class Reactor { private final Optional>> configuration; + private final Optional>> dependencies; + + private final Optional runtime; + private final Map additionalProperties; private Reactor( @@ -57,6 +61,8 @@ private Reactor( Optional modifiedBy, Optional modifiedAt, Optional>> configuration, + Optional>> dependencies, + Optional runtime, Map additionalProperties) { this.id = id; this.tenantId = tenantId; @@ -69,6 +75,8 @@ private Reactor( this.modifiedBy = modifiedBy; this.modifiedAt = modifiedAt; this.configuration = configuration; + this.dependencies = dependencies; + this.runtime = runtime; this.additionalProperties = additionalProperties; } @@ -127,6 +135,16 @@ public Optional>> getConfiguration() { return configuration; } + @JsonProperty("dependencies") + public Optional>> getDependencies() { + return dependencies; + } + + @JsonProperty("runtime") + public Optional getRuntime() { + return runtime; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -149,7 +167,9 @@ private boolean equalTo(Reactor other) { && createdAt.equals(other.createdAt) && modifiedBy.equals(other.modifiedBy) && modifiedAt.equals(other.modifiedAt) - && configuration.equals(other.configuration); + && configuration.equals(other.configuration) + && dependencies.equals(other.dependencies) + && runtime.equals(other.runtime); } @java.lang.Override @@ -165,7 +185,9 @@ public int hashCode() { this.createdAt, this.modifiedBy, this.modifiedAt, - this.configuration); + this.configuration, + this.dependencies, + this.runtime); } @java.lang.Override @@ -201,6 +223,10 @@ public static final class Builder { private Optional>> configuration = Optional.empty(); + private Optional>> dependencies = Optional.empty(); + + private Optional runtime = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -218,6 +244,8 @@ public Builder from(Reactor other) { modifiedBy(other.getModifiedBy()); modifiedAt(other.getModifiedAt()); configuration(other.getConfiguration()); + dependencies(other.getDependencies()); + runtime(other.getRuntime()); return this; } @@ -342,6 +370,28 @@ public Builder configuration(Map> configuration) { return this; } + @JsonSetter(value = "dependencies", nulls = Nulls.SKIP) + public Builder dependencies(Optional>> dependencies) { + this.dependencies = dependencies; + return this; + } + + public Builder dependencies(Map> dependencies) { + this.dependencies = Optional.ofNullable(dependencies); + return this; + } + + @JsonSetter(value = "runtime", nulls = Nulls.SKIP) + public Builder runtime(Optional runtime) { + this.runtime = runtime; + return this; + } + + public Builder runtime(String runtime) { + this.runtime = Optional.ofNullable(runtime); + return this; + } + public Reactor build() { return new Reactor( id, @@ -355,6 +405,8 @@ public Reactor build() { modifiedBy, modifiedAt, configuration, + dependencies, + runtime, additionalProperties); } }