diff --git a/reference.md b/reference.md index d37e177d6..38c0442d7 100644 --- a/reference.md +++ b/reference.md @@ -24160,6 +24160,396 @@ client.organizations().clientGrants().delete("id", "grant_id"); + + + + +## Organizations Connections +
client.organizations.connections.list(id) -> SyncPagingIterable<OrganizationAllConnectionPost> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().connections().list( + "id", + ListOrganizationAllConnectionsRequestParameters + .builder() + .page( + OptionalNullable.of(1) + ) + .perPage( + OptionalNullable.of(1) + ) + .includeTotals( + OptionalNullable.of(true) + ) + .isEnabled( + OptionalNullable.of(true) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**page:** `Optional` — Page index of the results to return. First page is 0. + +
+
+ +
+
+ +**perPage:** `Optional` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+ +
+
+ +**isEnabled:** `Optional` — Filter connections by enabled status. + +
+
+
+
+ + +
+
+
+ +
client.organizations.connections.create(id, request) -> CreateOrganizationAllConnectionResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().connections().create( + "id", + CreateOrganizationAllConnectionRequestParameters + .builder() + .connectionId("connection_id") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**organizationConnectionName:** `Optional` — Name of the connection in the scope of this organization. + +
+
+ +
+
+ +**assignMembershipOnLogin:** `Optional` — When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection. + +
+
+ +
+
+ +**showAsButton:** `Optional` — Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true. + +
+
+ +
+
+ +**isSignupEnabled:** `Optional` — Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false. + +
+
+ +
+
+ +**organizationAccessLevel:** `Optional` + +
+
+ +
+
+ +**isEnabled:** `Optional` — Whether the connection is enabled for the organization. + +
+
+ +
+
+ +**connectionId:** `String` — Connection identifier. + +
+
+
+
+ + +
+
+
+ +
client.organizations.connections.get(id, connectionId) -> GetOrganizationAllConnectionResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().connections().get("id", "connection_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**connectionId:** `String` — Connection identifier. + +
+
+
+
+ + +
+
+
+ +
client.organizations.connections.delete(id, connectionId) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().connections().delete("id", "connection_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**connectionId:** `String` — Connection identifier. + +
+
+
+
+ + +
+
+
+ +
client.organizations.connections.update(id, connectionId, request) -> UpdateOrganizationAllConnectionResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.organizations().connections().update( + "id", + "connection_id", + UpdateOrganizationConnectionRequestParameters + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Organization identifier. + +
+
+ +
+
+ +**connectionId:** `String` — Connection identifier. + +
+
+ +
+
+ +**organizationConnectionName:** `Optional` — Name of the connection in the scope of this organization. + +
+
+ +
+
+ +**assignMembershipOnLogin:** `Optional` — When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection. + +
+
+ +
+
+ +**showAsButton:** `Optional` — Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true. + +
+
+ +
+
+ +**isSignupEnabled:** `Optional` — Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false. + +
+
+ +
+
+ +**organizationAccessLevel:** `Optional` + +
+
+ +
+
+ +**isEnabled:** `Optional` — Whether the connection is enabled for the organization. + +
+
+
+
+ +
diff --git a/src/main/java/com/auth0/client/mgmt/AsyncOrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncOrganizationsClient.java index 5489a3809..471b87167 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncOrganizationsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncOrganizationsClient.java @@ -8,6 +8,7 @@ import com.auth0.client.mgmt.core.Suppliers; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.organizations.AsyncClientGrantsClient; +import com.auth0.client.mgmt.organizations.AsyncConnectionsClient; import com.auth0.client.mgmt.organizations.AsyncDiscoveryDomainsClient; import com.auth0.client.mgmt.organizations.AsyncEnabledConnectionsClient; import com.auth0.client.mgmt.organizations.AsyncInvitationsClient; @@ -30,6 +31,8 @@ public class AsyncOrganizationsClient { protected final Supplier clientGrantsClient; + protected final Supplier connectionsClient; + protected final Supplier discoveryDomainsClient; protected final Supplier enabledConnectionsClient; @@ -42,6 +45,7 @@ public AsyncOrganizationsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; this.rawClient = new AsyncRawOrganizationsClient(clientOptions); this.clientGrantsClient = Suppliers.memoize(() -> new AsyncClientGrantsClient(clientOptions)); + this.connectionsClient = Suppliers.memoize(() -> new AsyncConnectionsClient(clientOptions)); this.discoveryDomainsClient = Suppliers.memoize(() -> new AsyncDiscoveryDomainsClient(clientOptions)); this.enabledConnectionsClient = Suppliers.memoize(() -> new AsyncEnabledConnectionsClient(clientOptions)); this.invitationsClient = Suppliers.memoize(() -> new AsyncInvitationsClient(clientOptions)); @@ -230,6 +234,10 @@ public AsyncClientGrantsClient clientGrants() { return this.clientGrantsClient.get(); } + public AsyncConnectionsClient connections() { + return this.connectionsClient.get(); + } + public AsyncDiscoveryDomainsClient discoveryDomains() { return this.discoveryDomainsClient.get(); } diff --git a/src/main/java/com/auth0/client/mgmt/OrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/OrganizationsClient.java index 5a1782ab5..e81225f71 100644 --- a/src/main/java/com/auth0/client/mgmt/OrganizationsClient.java +++ b/src/main/java/com/auth0/client/mgmt/OrganizationsClient.java @@ -8,6 +8,7 @@ import com.auth0.client.mgmt.core.Suppliers; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.organizations.ClientGrantsClient; +import com.auth0.client.mgmt.organizations.ConnectionsClient; import com.auth0.client.mgmt.organizations.DiscoveryDomainsClient; import com.auth0.client.mgmt.organizations.EnabledConnectionsClient; import com.auth0.client.mgmt.organizations.InvitationsClient; @@ -29,6 +30,8 @@ public class OrganizationsClient { protected final Supplier clientGrantsClient; + protected final Supplier connectionsClient; + protected final Supplier discoveryDomainsClient; protected final Supplier enabledConnectionsClient; @@ -41,6 +44,7 @@ public OrganizationsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; this.rawClient = new RawOrganizationsClient(clientOptions); this.clientGrantsClient = Suppliers.memoize(() -> new ClientGrantsClient(clientOptions)); + this.connectionsClient = Suppliers.memoize(() -> new ConnectionsClient(clientOptions)); this.discoveryDomainsClient = Suppliers.memoize(() -> new DiscoveryDomainsClient(clientOptions)); this.enabledConnectionsClient = Suppliers.memoize(() -> new EnabledConnectionsClient(clientOptions)); this.invitationsClient = Suppliers.memoize(() -> new InvitationsClient(clientOptions)); @@ -227,6 +231,10 @@ public ClientGrantsClient clientGrants() { return this.clientGrantsClient.get(); } + public ConnectionsClient connections() { + return this.connectionsClient.get(); + } + public DiscoveryDomainsClient discoveryDomains() { return this.discoveryDomainsClient.get(); } diff --git a/src/main/java/com/auth0/client/mgmt/organizations/AsyncConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/AsyncConnectionsClient.java new file mode 100644 index 000000000..984333c28 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/AsyncConnectionsClient.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.organizations.types.CreateOrganizationAllConnectionRequestParameters; +import com.auth0.client.mgmt.organizations.types.ListOrganizationAllConnectionsRequestParameters; +import com.auth0.client.mgmt.organizations.types.UpdateOrganizationConnectionRequestParameters; +import com.auth0.client.mgmt.types.CreateOrganizationAllConnectionResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationAllConnectionResponseContent; +import com.auth0.client.mgmt.types.OrganizationAllConnectionPost; +import com.auth0.client.mgmt.types.UpdateOrganizationAllConnectionResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncConnectionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawConnectionsClient rawClient; + + public AsyncConnectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawConnectionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawConnectionsClient withRawResponse() { + return this.rawClient; + } + + public CompletableFuture> list(String id) { + return this.rawClient.list(id).thenApply(response -> response.body()); + } + + public CompletableFuture> list( + String id, RequestOptions requestOptions) { + return this.rawClient.list(id, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture> list( + String id, ListOrganizationAllConnectionsRequestParameters request) { + return this.rawClient.list(id, request).thenApply(response -> response.body()); + } + + public CompletableFuture> list( + String id, ListOrganizationAllConnectionsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture create( + String id, CreateOrganizationAllConnectionRequestParameters request) { + return this.rawClient.create(id, request).thenApply(response -> response.body()); + } + + public CompletableFuture create( + String id, CreateOrganizationAllConnectionRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture get(String id, String connectionId) { + return this.rawClient.get(id, connectionId).thenApply(response -> response.body()); + } + + public CompletableFuture get( + String id, String connectionId, RequestOptions requestOptions) { + return this.rawClient.get(id, connectionId, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id, String connectionId) { + return this.rawClient.delete(id, connectionId).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id, String connectionId, RequestOptions requestOptions) { + return this.rawClient.delete(id, connectionId, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture update(String id, String connectionId) { + return this.rawClient.update(id, connectionId).thenApply(response -> response.body()); + } + + public CompletableFuture update( + String id, String connectionId, RequestOptions requestOptions) { + return this.rawClient.update(id, connectionId, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture update( + String id, String connectionId, UpdateOrganizationConnectionRequestParameters request) { + return this.rawClient.update(id, connectionId, request).thenApply(response -> response.body()); + } + + public CompletableFuture update( + String id, + String connectionId, + UpdateOrganizationConnectionRequestParameters request, + RequestOptions requestOptions) { + return this.rawClient.update(id, connectionId, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawConnectionsClient.java new file mode 100644 index 000000000..c34866c57 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/AsyncRawConnectionsClient.java @@ -0,0 +1,549 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.organizations.types.CreateOrganizationAllConnectionRequestParameters; +import com.auth0.client.mgmt.organizations.types.ListOrganizationAllConnectionsRequestParameters; +import com.auth0.client.mgmt.organizations.types.UpdateOrganizationConnectionRequestParameters; +import com.auth0.client.mgmt.types.CreateOrganizationAllConnectionResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationAllConnectionResponseContent; +import com.auth0.client.mgmt.types.ListOrganizationAllConnectionsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.OrganizationAllConnectionPost; +import com.auth0.client.mgmt.types.UpdateOrganizationAllConnectionResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawConnectionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawConnectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public CompletableFuture>> list( + String id) { + return list( + id, ListOrganizationAllConnectionsRequestParameters.builder().build()); + } + + public CompletableFuture>> list( + String id, RequestOptions requestOptions) { + return list( + id, ListOrganizationAllConnectionsRequestParameters.builder().build(), requestOptions); + } + + public CompletableFuture>> list( + String id, ListOrganizationAllConnectionsRequestParameters request) { + return list(id, request, null); + } + + public CompletableFuture>> list( + String id, ListOrganizationAllConnectionsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("connections"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); + if (!request.getIsEnabled().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_enabled", request.getIsEnabled().orElse(null), false); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListOrganizationAllConnectionsOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, + ListOrganizationAllConnectionsOffsetPaginatedResponseContent.class); + int newPageNumber = request.getPage() + .map((Integer page) -> page + 1) + .orElse(1); + ListOrganizationAllConnectionsRequestParameters nextRequest = + ListOrganizationAllConnectionsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getConnections().orElse(Collections.emptyList()); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> { + try { + return list(id, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> create( + String id, CreateOrganizationAllConnectionRequestParameters request) { + return create(id, request, null); + } + + public CompletableFuture> create( + String id, CreateOrganizationAllConnectionRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("connections"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateOrganizationAllConnectionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> get( + String id, String connectionId) { + return get(id, connectionId, null); + } + + public CompletableFuture> get( + String id, String connectionId, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("connections") + .addPathSegment(connectionId); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetOrganizationAllConnectionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> delete(String id, String connectionId) { + return delete(id, connectionId, null); + } + + public CompletableFuture> delete( + String id, String connectionId, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("connections") + .addPathSegment(connectionId); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> update( + String id, String connectionId) { + return update( + id, + connectionId, + UpdateOrganizationConnectionRequestParameters.builder().build()); + } + + public CompletableFuture> update( + String id, String connectionId, RequestOptions requestOptions) { + return update( + id, + connectionId, + UpdateOrganizationConnectionRequestParameters.builder().build(), + requestOptions); + } + + public CompletableFuture> update( + String id, String connectionId, UpdateOrganizationConnectionRequestParameters request) { + return update(id, connectionId, request, null); + } + + public CompletableFuture> update( + String id, + String connectionId, + UpdateOrganizationConnectionRequestParameters request, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("connections") + .addPathSegment(connectionId); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateOrganizationAllConnectionResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/ConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/ConnectionsClient.java new file mode 100644 index 000000000..8fde0b24d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/ConnectionsClient.java @@ -0,0 +1,100 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.organizations.types.CreateOrganizationAllConnectionRequestParameters; +import com.auth0.client.mgmt.organizations.types.ListOrganizationAllConnectionsRequestParameters; +import com.auth0.client.mgmt.organizations.types.UpdateOrganizationConnectionRequestParameters; +import com.auth0.client.mgmt.types.CreateOrganizationAllConnectionResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationAllConnectionResponseContent; +import com.auth0.client.mgmt.types.OrganizationAllConnectionPost; +import com.auth0.client.mgmt.types.UpdateOrganizationAllConnectionResponseContent; + +public class ConnectionsClient { + protected final ClientOptions clientOptions; + + private final RawConnectionsClient rawClient; + + public ConnectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawConnectionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawConnectionsClient withRawResponse() { + return this.rawClient; + } + + public SyncPagingIterable list(String id) { + return this.rawClient.list(id).body(); + } + + public SyncPagingIterable list(String id, RequestOptions requestOptions) { + return this.rawClient.list(id, requestOptions).body(); + } + + public SyncPagingIterable list( + String id, ListOrganizationAllConnectionsRequestParameters request) { + return this.rawClient.list(id, request).body(); + } + + public SyncPagingIterable list( + String id, ListOrganizationAllConnectionsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).body(); + } + + public CreateOrganizationAllConnectionResponseContent create( + String id, CreateOrganizationAllConnectionRequestParameters request) { + return this.rawClient.create(id, request).body(); + } + + public CreateOrganizationAllConnectionResponseContent create( + String id, CreateOrganizationAllConnectionRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).body(); + } + + public GetOrganizationAllConnectionResponseContent get(String id, String connectionId) { + return this.rawClient.get(id, connectionId).body(); + } + + public GetOrganizationAllConnectionResponseContent get( + String id, String connectionId, RequestOptions requestOptions) { + return this.rawClient.get(id, connectionId, requestOptions).body(); + } + + public void delete(String id, String connectionId) { + this.rawClient.delete(id, connectionId).body(); + } + + public void delete(String id, String connectionId, RequestOptions requestOptions) { + this.rawClient.delete(id, connectionId, requestOptions).body(); + } + + public UpdateOrganizationAllConnectionResponseContent update(String id, String connectionId) { + return this.rawClient.update(id, connectionId).body(); + } + + public UpdateOrganizationAllConnectionResponseContent update( + String id, String connectionId, RequestOptions requestOptions) { + return this.rawClient.update(id, connectionId, requestOptions).body(); + } + + public UpdateOrganizationAllConnectionResponseContent update( + String id, String connectionId, UpdateOrganizationConnectionRequestParameters request) { + return this.rawClient.update(id, connectionId, request).body(); + } + + public UpdateOrganizationAllConnectionResponseContent update( + String id, + String connectionId, + UpdateOrganizationConnectionRequestParameters request, + RequestOptions requestOptions) { + return this.rawClient.update(id, connectionId, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/RawConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/organizations/RawConnectionsClient.java new file mode 100644 index 000000000..c1225cafa --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/RawConnectionsClient.java @@ -0,0 +1,423 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.ConflictError; +import com.auth0.client.mgmt.errors.ForbiddenError; +import com.auth0.client.mgmt.errors.NotFoundError; +import com.auth0.client.mgmt.errors.TooManyRequestsError; +import com.auth0.client.mgmt.errors.UnauthorizedError; +import com.auth0.client.mgmt.organizations.types.CreateOrganizationAllConnectionRequestParameters; +import com.auth0.client.mgmt.organizations.types.ListOrganizationAllConnectionsRequestParameters; +import com.auth0.client.mgmt.organizations.types.UpdateOrganizationConnectionRequestParameters; +import com.auth0.client.mgmt.types.CreateOrganizationAllConnectionResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationAllConnectionResponseContent; +import com.auth0.client.mgmt.types.ListOrganizationAllConnectionsOffsetPaginatedResponseContent; +import com.auth0.client.mgmt.types.OrganizationAllConnectionPost; +import com.auth0.client.mgmt.types.UpdateOrganizationAllConnectionResponseContent; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawConnectionsClient { + protected final ClientOptions clientOptions; + + public RawConnectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public ManagementApiHttpResponse> list(String id) { + return list( + id, ListOrganizationAllConnectionsRequestParameters.builder().build()); + } + + public ManagementApiHttpResponse> list( + String id, RequestOptions requestOptions) { + return list( + id, ListOrganizationAllConnectionsRequestParameters.builder().build(), requestOptions); + } + + public ManagementApiHttpResponse> list( + String id, ListOrganizationAllConnectionsRequestParameters request) { + return list(id, request, null); + } + + public ManagementApiHttpResponse> list( + String id, ListOrganizationAllConnectionsRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("connections"); + QueryStringMapper.addQueryParameter(httpUrl, "page", request.getPage().orElse(0), false); + QueryStringMapper.addQueryParameter( + httpUrl, "per_page", request.getPerPage().orElse(50), false); + QueryStringMapper.addQueryParameter( + httpUrl, "include_totals", request.getIncludeTotals().orElse(true), false); + if (!request.getIsEnabled().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_enabled", request.getIsEnabled().orElse(null), false); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListOrganizationAllConnectionsOffsetPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListOrganizationAllConnectionsOffsetPaginatedResponseContent.class); + int newPageNumber = + request.getPage().map((Integer page) -> page + 1).orElse(1); + ListOrganizationAllConnectionsRequestParameters nextRequest = + ListOrganizationAllConnectionsRequestParameters.builder() + .from(request) + .page(newPageNumber) + .build(); + List result = + parsedResponse.getConnections().orElse(Collections.emptyList()); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable( + true, result, parsedResponse, () -> list(id, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse create( + String id, CreateOrganizationAllConnectionRequestParameters request) { + return create(id, request, null); + } + + public ManagementApiHttpResponse create( + String id, CreateOrganizationAllConnectionRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("connections"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateOrganizationAllConnectionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse get(String id, String connectionId) { + return get(id, connectionId, null); + } + + public ManagementApiHttpResponse get( + String id, String connectionId, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("connections") + .addPathSegment(connectionId); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetOrganizationAllConnectionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse delete(String id, String connectionId) { + return delete(id, connectionId, null); + } + + public ManagementApiHttpResponse delete(String id, String connectionId, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("connections") + .addPathSegment(connectionId); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse update( + String id, String connectionId) { + return update( + id, + connectionId, + UpdateOrganizationConnectionRequestParameters.builder().build()); + } + + public ManagementApiHttpResponse update( + String id, String connectionId, RequestOptions requestOptions) { + return update( + id, + connectionId, + UpdateOrganizationConnectionRequestParameters.builder().build(), + requestOptions); + } + + public ManagementApiHttpResponse update( + String id, String connectionId, UpdateOrganizationConnectionRequestParameters request) { + return update(id, connectionId, request, null); + } + + public ManagementApiHttpResponse update( + String id, + String connectionId, + UpdateOrganizationConnectionRequestParameters request, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("organizations") + .addPathSegment(id) + .addPathSegments("connections") + .addPathSegment(connectionId); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, UpdateOrganizationAllConnectionResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationAllConnectionRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationAllConnectionRequestParameters.java new file mode 100644 index 000000000..facd18fd8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/CreateOrganizationAllConnectionRequestParameters.java @@ -0,0 +1,395 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.types.OrganizationAccessLevelEnum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateOrganizationAllConnectionRequestParameters.Builder.class) +public final class CreateOrganizationAllConnectionRequestParameters { + private final Optional organizationConnectionName; + + private final Optional assignMembershipOnLogin; + + private final Optional showAsButton; + + private final Optional isSignupEnabled; + + private final Optional organizationAccessLevel; + + private final Optional isEnabled; + + private final String connectionId; + + private final Map additionalProperties; + + private CreateOrganizationAllConnectionRequestParameters( + Optional organizationConnectionName, + Optional assignMembershipOnLogin, + Optional showAsButton, + Optional isSignupEnabled, + Optional organizationAccessLevel, + Optional isEnabled, + String connectionId, + Map additionalProperties) { + this.organizationConnectionName = organizationConnectionName; + this.assignMembershipOnLogin = assignMembershipOnLogin; + this.showAsButton = showAsButton; + this.isSignupEnabled = isSignupEnabled; + this.organizationAccessLevel = organizationAccessLevel; + this.isEnabled = isEnabled; + this.connectionId = connectionId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of the connection in the scope of this organization. + */ + @JsonProperty("organization_connection_name") + public Optional getOrganizationConnectionName() { + return organizationConnectionName; + } + + /** + * @return When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection. + */ + @JsonProperty("assign_membership_on_login") + public Optional getAssignMembershipOnLogin() { + return assignMembershipOnLogin; + } + + /** + * @return Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true. + */ + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + /** + * @return Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false. + */ + @JsonProperty("is_signup_enabled") + public Optional getIsSignupEnabled() { + return isSignupEnabled; + } + + @JsonProperty("organization_access_level") + public Optional getOrganizationAccessLevel() { + return organizationAccessLevel; + } + + /** + * @return Whether the connection is enabled for the organization. + */ + @JsonProperty("is_enabled") + public Optional getIsEnabled() { + return isEnabled; + } + + /** + * @return Connection identifier. + */ + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateOrganizationAllConnectionRequestParameters + && equalTo((CreateOrganizationAllConnectionRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateOrganizationAllConnectionRequestParameters other) { + return organizationConnectionName.equals(other.organizationConnectionName) + && assignMembershipOnLogin.equals(other.assignMembershipOnLogin) + && showAsButton.equals(other.showAsButton) + && isSignupEnabled.equals(other.isSignupEnabled) + && organizationAccessLevel.equals(other.organizationAccessLevel) + && isEnabled.equals(other.isEnabled) + && connectionId.equals(other.connectionId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.organizationConnectionName, + this.assignMembershipOnLogin, + this.showAsButton, + this.isSignupEnabled, + this.organizationAccessLevel, + this.isEnabled, + this.connectionId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + /** + *

Connection identifier.

+ */ + _FinalStage connectionId(@NotNull String connectionId); + + Builder from(CreateOrganizationAllConnectionRequestParameters other); + } + + public interface _FinalStage { + CreateOrganizationAllConnectionRequestParameters build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

Name of the connection in the scope of this organization.

+ */ + _FinalStage organizationConnectionName(Optional organizationConnectionName); + + _FinalStage organizationConnectionName(String organizationConnectionName); + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + _FinalStage assignMembershipOnLogin(Optional assignMembershipOnLogin); + + _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin); + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + _FinalStage showAsButton(Optional showAsButton); + + _FinalStage showAsButton(Boolean showAsButton); + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ */ + _FinalStage isSignupEnabled(Optional isSignupEnabled); + + _FinalStage isSignupEnabled(Boolean isSignupEnabled); + + _FinalStage organizationAccessLevel(Optional organizationAccessLevel); + + _FinalStage organizationAccessLevel(OrganizationAccessLevelEnum organizationAccessLevel); + + /** + *

Whether the connection is enabled for the organization.

+ */ + _FinalStage isEnabled(Optional isEnabled); + + _FinalStage isEnabled(Boolean isEnabled); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, _FinalStage { + private String connectionId; + + private Optional isEnabled = Optional.empty(); + + private Optional organizationAccessLevel = Optional.empty(); + + private Optional isSignupEnabled = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional assignMembershipOnLogin = Optional.empty(); + + private Optional organizationConnectionName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateOrganizationAllConnectionRequestParameters other) { + organizationConnectionName(other.getOrganizationConnectionName()); + assignMembershipOnLogin(other.getAssignMembershipOnLogin()); + showAsButton(other.getShowAsButton()); + isSignupEnabled(other.getIsSignupEnabled()); + organizationAccessLevel(other.getOrganizationAccessLevel()); + isEnabled(other.getIsEnabled()); + connectionId(other.getConnectionId()); + return this; + } + + /** + *

Connection identifier.

+ *

Connection identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("connection_id") + public _FinalStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + /** + *

Whether the connection is enabled for the organization.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isEnabled(Boolean isEnabled) { + this.isEnabled = Optional.ofNullable(isEnabled); + return this; + } + + /** + *

Whether the connection is enabled for the organization.

+ */ + @java.lang.Override + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public _FinalStage isEnabled(Optional isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + @java.lang.Override + public _FinalStage organizationAccessLevel(OrganizationAccessLevelEnum organizationAccessLevel) { + this.organizationAccessLevel = Optional.ofNullable(organizationAccessLevel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "organization_access_level", nulls = Nulls.SKIP) + public _FinalStage organizationAccessLevel(Optional organizationAccessLevel) { + this.organizationAccessLevel = organizationAccessLevel; + return this; + } + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isSignupEnabled(Boolean isSignupEnabled) { + this.isSignupEnabled = Optional.ofNullable(isSignupEnabled); + return this; + } + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ */ + @java.lang.Override + @JsonSetter(value = "is_signup_enabled", nulls = Nulls.SKIP) + public _FinalStage isSignupEnabled(Optional isSignupEnabled) { + this.isSignupEnabled = isSignupEnabled; + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + @java.lang.Override + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public _FinalStage showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin) { + this.assignMembershipOnLogin = Optional.ofNullable(assignMembershipOnLogin); + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + @java.lang.Override + @JsonSetter(value = "assign_membership_on_login", nulls = Nulls.SKIP) + public _FinalStage assignMembershipOnLogin(Optional assignMembershipOnLogin) { + this.assignMembershipOnLogin = assignMembershipOnLogin; + return this; + } + + /** + *

Name of the connection in the scope of this organization.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage organizationConnectionName(String organizationConnectionName) { + this.organizationConnectionName = Optional.ofNullable(organizationConnectionName); + return this; + } + + /** + *

Name of the connection in the scope of this organization.

+ */ + @java.lang.Override + @JsonSetter(value = "organization_connection_name", nulls = Nulls.SKIP) + public _FinalStage organizationConnectionName(Optional organizationConnectionName) { + this.organizationConnectionName = organizationConnectionName; + return this; + } + + @java.lang.Override + public CreateOrganizationAllConnectionRequestParameters build() { + return new CreateOrganizationAllConnectionRequestParameters( + organizationConnectionName, + assignMembershipOnLogin, + showAsButton, + isSignupEnabled, + organizationAccessLevel, + isEnabled, + connectionId, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationAllConnectionsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationAllConnectionsRequestParameters.java new file mode 100644 index 000000000..1932f7051 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/ListOrganizationAllConnectionsRequestParameters.java @@ -0,0 +1,301 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.types; + +import com.auth0.client.mgmt.core.Nullable; +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListOrganizationAllConnectionsRequestParameters.Builder.class) +public final class ListOrganizationAllConnectionsRequestParameters { + private final OptionalNullable page; + + private final OptionalNullable perPage; + + private final OptionalNullable includeTotals; + + private final OptionalNullable isEnabled; + + private final Map additionalProperties; + + private ListOrganizationAllConnectionsRequestParameters( + OptionalNullable page, + OptionalNullable perPage, + OptionalNullable includeTotals, + OptionalNullable isEnabled, + Map additionalProperties) { + this.page = page; + this.perPage = perPage; + this.includeTotals = includeTotals; + this.isEnabled = isEnabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return Page index of the results to return. First page is 0. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page") + public OptionalNullable getPage() { + return page; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("per_page") + public OptionalNullable getPerPage() { + return perPage; + } + + /** + * @return Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_totals") + public OptionalNullable getIncludeTotals() { + return includeTotals; + } + + /** + * @return Filter connections by enabled status. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_enabled") + public OptionalNullable getIsEnabled() { + if (isEnabled == null) { + return OptionalNullable.absent(); + } + return isEnabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_enabled") + private OptionalNullable _getIsEnabled() { + return isEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListOrganizationAllConnectionsRequestParameters + && equalTo((ListOrganizationAllConnectionsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListOrganizationAllConnectionsRequestParameters other) { + return page.equals(other.page) + && perPage.equals(other.perPage) + && includeTotals.equals(other.includeTotals) + && isEnabled.equals(other.isEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.page, this.perPage, this.includeTotals, this.isEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable page = OptionalNullable.absent(); + + private OptionalNullable perPage = OptionalNullable.absent(); + + private OptionalNullable includeTotals = OptionalNullable.absent(); + + private OptionalNullable isEnabled = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListOrganizationAllConnectionsRequestParameters other) { + page(other.getPage()); + perPage(other.getPerPage()); + includeTotals(other.getIncludeTotals()); + isEnabled(other.getIsEnabled()); + return this; + } + + /** + *

Page index of the results to return. First page is 0.

+ */ + @JsonSetter(value = "page", nulls = Nulls.SKIP) + public Builder page(OptionalNullable page) { + this.page = page; + return this; + } + + public Builder page(Integer page) { + this.page = OptionalNullable.of(page); + return this; + } + + public Builder page(Optional page) { + if (page.isPresent()) { + this.page = OptionalNullable.of(page.get()); + } else { + this.page = OptionalNullable.absent(); + } + return this; + } + + public Builder page(Nullable page) { + if (page.isNull()) { + this.page = OptionalNullable.ofNull(); + } else if (page.isEmpty()) { + this.page = OptionalNullable.absent(); + } else { + this.page = OptionalNullable.of(page.get()); + } + return this; + } + + /** + *

Number of results per page. Defaults to 50.

+ */ + @JsonSetter(value = "per_page", nulls = Nulls.SKIP) + public Builder perPage(OptionalNullable perPage) { + this.perPage = perPage; + return this; + } + + public Builder perPage(Integer perPage) { + this.perPage = OptionalNullable.of(perPage); + return this; + } + + public Builder perPage(Optional perPage) { + if (perPage.isPresent()) { + this.perPage = OptionalNullable.of(perPage.get()); + } else { + this.perPage = OptionalNullable.absent(); + } + return this; + } + + public Builder perPage(Nullable perPage) { + if (perPage.isNull()) { + this.perPage = OptionalNullable.ofNull(); + } else if (perPage.isEmpty()) { + this.perPage = OptionalNullable.absent(); + } else { + this.perPage = OptionalNullable.of(perPage.get()); + } + return this; + } + + /** + *

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

+ */ + @JsonSetter(value = "include_totals", nulls = Nulls.SKIP) + public Builder includeTotals(OptionalNullable includeTotals) { + this.includeTotals = includeTotals; + return this; + } + + public Builder includeTotals(Boolean includeTotals) { + this.includeTotals = OptionalNullable.of(includeTotals); + return this; + } + + public Builder includeTotals(Optional includeTotals) { + if (includeTotals.isPresent()) { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } else { + this.includeTotals = OptionalNullable.absent(); + } + return this; + } + + public Builder includeTotals(Nullable includeTotals) { + if (includeTotals.isNull()) { + this.includeTotals = OptionalNullable.ofNull(); + } else if (includeTotals.isEmpty()) { + this.includeTotals = OptionalNullable.absent(); + } else { + this.includeTotals = OptionalNullable.of(includeTotals.get()); + } + return this; + } + + /** + *

Filter connections by enabled status.

+ */ + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public Builder isEnabled(@org.jetbrains.annotations.Nullable OptionalNullable isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + public Builder isEnabled(Boolean isEnabled) { + this.isEnabled = OptionalNullable.of(isEnabled); + return this; + } + + public Builder isEnabled(Optional isEnabled) { + if (isEnabled.isPresent()) { + this.isEnabled = OptionalNullable.of(isEnabled.get()); + } else { + this.isEnabled = OptionalNullable.absent(); + } + return this; + } + + public Builder isEnabled(Nullable isEnabled) { + if (isEnabled.isNull()) { + this.isEnabled = OptionalNullable.ofNull(); + } else if (isEnabled.isEmpty()) { + this.isEnabled = OptionalNullable.absent(); + } else { + this.isEnabled = OptionalNullable.of(isEnabled.get()); + } + return this; + } + + public ListOrganizationAllConnectionsRequestParameters build() { + return new ListOrganizationAllConnectionsRequestParameters( + page, perPage, includeTotals, isEnabled, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationConnectionRequestParameters.java b/src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationConnectionRequestParameters.java new file mode 100644 index 000000000..b5ef77532 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/organizations/types/UpdateOrganizationConnectionRequestParameters.java @@ -0,0 +1,369 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.organizations.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.types.OrganizationAccessLevelEnumWithNull; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateOrganizationConnectionRequestParameters.Builder.class) +public final class UpdateOrganizationConnectionRequestParameters { + private final OptionalNullable organizationConnectionName; + + private final Optional assignMembershipOnLogin; + + private final Optional showAsButton; + + private final Optional isSignupEnabled; + + private final OptionalNullable organizationAccessLevel; + + private final OptionalNullable isEnabled; + + private final Map additionalProperties; + + private UpdateOrganizationConnectionRequestParameters( + OptionalNullable organizationConnectionName, + Optional assignMembershipOnLogin, + Optional showAsButton, + Optional isSignupEnabled, + OptionalNullable organizationAccessLevel, + OptionalNullable isEnabled, + Map additionalProperties) { + this.organizationConnectionName = organizationConnectionName; + this.assignMembershipOnLogin = assignMembershipOnLogin; + this.showAsButton = showAsButton; + this.isSignupEnabled = isSignupEnabled; + this.organizationAccessLevel = organizationAccessLevel; + this.isEnabled = isEnabled; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of the connection in the scope of this organization. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("organization_connection_name") + public OptionalNullable getOrganizationConnectionName() { + if (organizationConnectionName == null) { + return OptionalNullable.absent(); + } + return organizationConnectionName; + } + + /** + * @return When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection. + */ + @JsonProperty("assign_membership_on_login") + public Optional getAssignMembershipOnLogin() { + return assignMembershipOnLogin; + } + + /** + * @return Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true. + */ + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + /** + * @return Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false. + */ + @JsonProperty("is_signup_enabled") + public Optional getIsSignupEnabled() { + return isSignupEnabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("organization_access_level") + public OptionalNullable getOrganizationAccessLevel() { + if (organizationAccessLevel == null) { + return OptionalNullable.absent(); + } + return organizationAccessLevel; + } + + /** + * @return Whether the connection is enabled for the organization. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_enabled") + public OptionalNullable getIsEnabled() { + if (isEnabled == null) { + return OptionalNullable.absent(); + } + return isEnabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("organization_connection_name") + private OptionalNullable _getOrganizationConnectionName() { + return organizationConnectionName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("organization_access_level") + private OptionalNullable _getOrganizationAccessLevel() { + return organizationAccessLevel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_enabled") + private OptionalNullable _getIsEnabled() { + return isEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateOrganizationConnectionRequestParameters + && equalTo((UpdateOrganizationConnectionRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateOrganizationConnectionRequestParameters other) { + return organizationConnectionName.equals(other.organizationConnectionName) + && assignMembershipOnLogin.equals(other.assignMembershipOnLogin) + && showAsButton.equals(other.showAsButton) + && isSignupEnabled.equals(other.isSignupEnabled) + && organizationAccessLevel.equals(other.organizationAccessLevel) + && isEnabled.equals(other.isEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.organizationConnectionName, + this.assignMembershipOnLogin, + this.showAsButton, + this.isSignupEnabled, + this.organizationAccessLevel, + this.isEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable organizationConnectionName = OptionalNullable.absent(); + + private Optional assignMembershipOnLogin = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional isSignupEnabled = Optional.empty(); + + private OptionalNullable organizationAccessLevel = + OptionalNullable.absent(); + + private OptionalNullable isEnabled = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateOrganizationConnectionRequestParameters other) { + organizationConnectionName(other.getOrganizationConnectionName()); + assignMembershipOnLogin(other.getAssignMembershipOnLogin()); + showAsButton(other.getShowAsButton()); + isSignupEnabled(other.getIsSignupEnabled()); + organizationAccessLevel(other.getOrganizationAccessLevel()); + isEnabled(other.getIsEnabled()); + return this; + } + + /** + *

Name of the connection in the scope of this organization.

+ */ + @JsonSetter(value = "organization_connection_name", nulls = Nulls.SKIP) + public Builder organizationConnectionName(@Nullable OptionalNullable organizationConnectionName) { + this.organizationConnectionName = organizationConnectionName; + return this; + } + + public Builder organizationConnectionName(String organizationConnectionName) { + this.organizationConnectionName = OptionalNullable.of(organizationConnectionName); + return this; + } + + public Builder organizationConnectionName(Optional organizationConnectionName) { + if (organizationConnectionName.isPresent()) { + this.organizationConnectionName = OptionalNullable.of(organizationConnectionName.get()); + } else { + this.organizationConnectionName = OptionalNullable.absent(); + } + return this; + } + + public Builder organizationConnectionName( + com.auth0.client.mgmt.core.Nullable organizationConnectionName) { + if (organizationConnectionName.isNull()) { + this.organizationConnectionName = OptionalNullable.ofNull(); + } else if (organizationConnectionName.isEmpty()) { + this.organizationConnectionName = OptionalNullable.absent(); + } else { + this.organizationConnectionName = OptionalNullable.of(organizationConnectionName.get()); + } + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + @JsonSetter(value = "assign_membership_on_login", nulls = Nulls.SKIP) + public Builder assignMembershipOnLogin(Optional assignMembershipOnLogin) { + this.assignMembershipOnLogin = assignMembershipOnLogin; + return this; + } + + public Builder assignMembershipOnLogin(Boolean assignMembershipOnLogin) { + this.assignMembershipOnLogin = Optional.ofNullable(assignMembershipOnLogin); + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public Builder showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + public Builder showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ */ + @JsonSetter(value = "is_signup_enabled", nulls = Nulls.SKIP) + public Builder isSignupEnabled(Optional isSignupEnabled) { + this.isSignupEnabled = isSignupEnabled; + return this; + } + + public Builder isSignupEnabled(Boolean isSignupEnabled) { + this.isSignupEnabled = Optional.ofNullable(isSignupEnabled); + return this; + } + + @JsonSetter(value = "organization_access_level", nulls = Nulls.SKIP) + public Builder organizationAccessLevel( + @Nullable OptionalNullable organizationAccessLevel) { + this.organizationAccessLevel = organizationAccessLevel; + return this; + } + + public Builder organizationAccessLevel(OrganizationAccessLevelEnumWithNull organizationAccessLevel) { + this.organizationAccessLevel = OptionalNullable.of(organizationAccessLevel); + return this; + } + + public Builder organizationAccessLevel(Optional organizationAccessLevel) { + if (organizationAccessLevel.isPresent()) { + this.organizationAccessLevel = OptionalNullable.of(organizationAccessLevel.get()); + } else { + this.organizationAccessLevel = OptionalNullable.absent(); + } + return this; + } + + public Builder organizationAccessLevel( + com.auth0.client.mgmt.core.Nullable organizationAccessLevel) { + if (organizationAccessLevel.isNull()) { + this.organizationAccessLevel = OptionalNullable.ofNull(); + } else if (organizationAccessLevel.isEmpty()) { + this.organizationAccessLevel = OptionalNullable.absent(); + } else { + this.organizationAccessLevel = OptionalNullable.of(organizationAccessLevel.get()); + } + return this; + } + + /** + *

Whether the connection is enabled for the organization.

+ */ + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public Builder isEnabled(@Nullable OptionalNullable isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + public Builder isEnabled(Boolean isEnabled) { + this.isEnabled = OptionalNullable.of(isEnabled); + return this; + } + + public Builder isEnabled(Optional isEnabled) { + if (isEnabled.isPresent()) { + this.isEnabled = OptionalNullable.of(isEnabled.get()); + } else { + this.isEnabled = OptionalNullable.absent(); + } + return this; + } + + public Builder isEnabled(com.auth0.client.mgmt.core.Nullable isEnabled) { + if (isEnabled.isNull()) { + this.isEnabled = OptionalNullable.ofNull(); + } else if (isEnabled.isEmpty()) { + this.isEnabled = OptionalNullable.absent(); + } else { + this.isEnabled = OptionalNullable.of(isEnabled.get()); + } + return this; + } + + public UpdateOrganizationConnectionRequestParameters build() { + return new UpdateOrganizationConnectionRequestParameters( + organizationConnectionName, + assignMembershipOnLogin, + showAsButton, + isSignupEnabled, + organizationAccessLevel, + isEnabled, + additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFlickrStrategy.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionDpopSigningAlgEnum.java similarity index 53% rename from src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFlickrStrategy.java rename to src/main/java/com/auth0/client/mgmt/types/ConnectionDpopSigningAlgEnum.java index 28c502003..cb4e688af 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFlickrStrategy.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionDpopSigningAlgEnum.java @@ -6,15 +6,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -public final class CreateConnectionRequestContentFlickrStrategy { - public static final CreateConnectionRequestContentFlickrStrategy FLICKR = - new CreateConnectionRequestContentFlickrStrategy(Value.FLICKR, "flickr"); +public final class ConnectionDpopSigningAlgEnum { + public static final ConnectionDpopSigningAlgEnum ES256 = new ConnectionDpopSigningAlgEnum(Value.ES256, "ES256"); + + public static final ConnectionDpopSigningAlgEnum ED25519 = + new ConnectionDpopSigningAlgEnum(Value.ED25519, "Ed25519"); private final Value value; private final String string; - CreateConnectionRequestContentFlickrStrategy(Value value, String string) { + ConnectionDpopSigningAlgEnum(Value value, String string) { this.value = value; this.string = string; } @@ -32,8 +34,8 @@ public String toString() { @java.lang.Override public boolean equals(Object other) { return (this == other) - || (other instanceof CreateConnectionRequestContentFlickrStrategy - && this.string.equals(((CreateConnectionRequestContentFlickrStrategy) other).string)); + || (other instanceof ConnectionDpopSigningAlgEnum + && this.string.equals(((ConnectionDpopSigningAlgEnum) other).string)); } @java.lang.Override @@ -43,8 +45,10 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { - case FLICKR: - return visitor.visitFlickr(); + case ES256: + return visitor.visitEs256(); + case ED25519: + return visitor.visitEd25519(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -52,23 +56,29 @@ public T visit(Visitor visitor) { } @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - public static CreateConnectionRequestContentFlickrStrategy valueOf(String value) { + public static ConnectionDpopSigningAlgEnum valueOf(String value) { switch (value) { - case "flickr": - return FLICKR; + case "ES256": + return ES256; + case "Ed25519": + return ED25519; default: - return new CreateConnectionRequestContentFlickrStrategy(Value.UNKNOWN, value); + return new ConnectionDpopSigningAlgEnum(Value.UNKNOWN, value); } } public enum Value { - FLICKR, + ES256, + + ED25519, UNKNOWN } public interface Visitor { - T visitFlickr(); + T visitEs256(); + + T visitEd25519(); T visitUnknown(String unknownType); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityProviderEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityProviderEnum.java index 27f6e9b25..0fe7ab6db 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityProviderEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityProviderEnum.java @@ -15,9 +15,6 @@ public final class ConnectionIdentityProviderEnum { public static final ConnectionIdentityProviderEnum DWOLLA = new ConnectionIdentityProviderEnum(Value.DWOLLA, "dwolla"); - public static final ConnectionIdentityProviderEnum FLICKR = - new ConnectionIdentityProviderEnum(Value.FLICKR, "flickr"); - public static final ConnectionIdentityProviderEnum OKTA = new ConnectionIdentityProviderEnum(Value.OKTA, "okta"); public static final ConnectionIdentityProviderEnum PLANNINGCENTER = @@ -195,8 +192,6 @@ public T visit(Visitor visitor) { return visitor.visitAuth0Oidc(); case DWOLLA: return visitor.visitDwolla(); - case FLICKR: - return visitor.visitFlickr(); case OKTA: return visitor.visitOkta(); case PLANNINGCENTER: @@ -316,8 +311,6 @@ public static ConnectionIdentityProviderEnum valueOf(String value) { return AUTH0OIDC; case "dwolla": return DWOLLA; - case "flickr": - return FLICKR; case "okta": return OKTA; case "planningcenter": @@ -468,8 +461,6 @@ public enum Value { FITBIT, - FLICKR, - GITHUB, GOOGLE_APPS, @@ -584,8 +575,6 @@ public interface Visitor { T visitFitbit(); - T visitFlickr(); - T visitGithub(); T visitGoogleApps(); diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsCommonOidc.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsCommonOidc.java index 0c5874440..46a055635 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsCommonOidc.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsCommonOidc.java @@ -35,6 +35,8 @@ public final class ConnectionOptionsCommonOidc implements IConnectionOptionsComm private final Optional> domainAliases; + private final Optional dpopSigningAlg; + private final OptionalNullable federatedConnectionsAccessTokens; private final Optional iconUrl; @@ -74,6 +76,7 @@ private ConnectionOptionsCommonOidc( Optional clientSecret, Optional connectionSettings, Optional> domainAliases, + Optional dpopSigningAlg, OptionalNullable federatedConnectionsAccessTokens, Optional iconUrl, OptionalNullable> idTokenSignedResponseAlgs, @@ -95,6 +98,7 @@ private ConnectionOptionsCommonOidc( this.clientSecret = clientSecret; this.connectionSettings = connectionSettings; this.domainAliases = domainAliases; + this.dpopSigningAlg = dpopSigningAlg; this.federatedConnectionsAccessTokens = federatedConnectionsAccessTokens; this.iconUrl = iconUrl; this.idTokenSignedResponseAlgs = idTokenSignedResponseAlgs; @@ -143,6 +147,12 @@ public Optional> getDomainAliases() { return domainAliases; } + @JsonProperty("dpop_signing_alg") + @java.lang.Override + public Optional getDpopSigningAlg() { + return dpopSigningAlg; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("federated_connections_access_tokens") @java.lang.Override @@ -301,6 +311,7 @@ private boolean equalTo(ConnectionOptionsCommonOidc other) { && clientSecret.equals(other.clientSecret) && connectionSettings.equals(other.connectionSettings) && domainAliases.equals(other.domainAliases) + && dpopSigningAlg.equals(other.dpopSigningAlg) && federatedConnectionsAccessTokens.equals(other.federatedConnectionsAccessTokens) && iconUrl.equals(other.iconUrl) && idTokenSignedResponseAlgs.equals(other.idTokenSignedResponseAlgs) @@ -326,6 +337,7 @@ public int hashCode() { this.clientSecret, this.connectionSettings, this.domainAliases, + this.dpopSigningAlg, this.federatedConnectionsAccessTokens, this.iconUrl, this.idTokenSignedResponseAlgs, @@ -381,6 +393,10 @@ public interface _FinalStage { _FinalStage domainAliases(List domainAliases); + _FinalStage dpopSigningAlg(Optional dpopSigningAlg); + + _FinalStage dpopSigningAlg(ConnectionDpopSigningAlgEnum dpopSigningAlg); + _FinalStage federatedConnectionsAccessTokens( @Nullable OptionalNullable federatedConnectionsAccessTokens); @@ -525,6 +541,8 @@ public static final class Builder implements ClientIdStage, _FinalStage { private OptionalNullable federatedConnectionsAccessTokens = OptionalNullable.absent(); + private Optional dpopSigningAlg = Optional.empty(); + private Optional> domainAliases = Optional.empty(); private Optional connectionSettings = Optional.empty(); @@ -545,6 +563,7 @@ public Builder from(ConnectionOptionsCommonOidc other) { clientSecret(other.getClientSecret()); connectionSettings(other.getConnectionSettings()); domainAliases(other.getDomainAliases()); + dpopSigningAlg(other.getDpopSigningAlg()); federatedConnectionsAccessTokens(other.getFederatedConnectionsAccessTokens()); iconUrl(other.getIconUrl()); idTokenSignedResponseAlgs(other.getIdTokenSignedResponseAlgs()); @@ -902,6 +921,19 @@ public _FinalStage federatedConnectionsAccessTokens( return this; } + @java.lang.Override + public _FinalStage dpopSigningAlg(ConnectionDpopSigningAlgEnum dpopSigningAlg) { + this.dpopSigningAlg = Optional.ofNullable(dpopSigningAlg); + return this; + } + + @java.lang.Override + @JsonSetter(value = "dpop_signing_alg", nulls = Nulls.SKIP) + public _FinalStage dpopSigningAlg(Optional dpopSigningAlg) { + this.dpopSigningAlg = dpopSigningAlg; + return this; + } + @java.lang.Override public _FinalStage domainAliases(List domainAliases) { this.domainAliases = Optional.ofNullable(domainAliases); @@ -962,6 +994,7 @@ public ConnectionOptionsCommonOidc build() { clientSecret, connectionSettings, domainAliases, + dpopSigningAlg, federatedConnectionsAccessTokens, iconUrl, idTokenSignedResponseAlgs, diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsFlickr.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsFlickr.java deleted file mode 100644 index 3e35fdfda..000000000 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsFlickr.java +++ /dev/null @@ -1,276 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.auth0.client.mgmt.types; - -import com.auth0.client.mgmt.core.NullableNonemptyFilter; -import com.auth0.client.mgmt.core.ObjectMappers; -import com.auth0.client.mgmt.core.OptionalNullable; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.Nullable; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ConnectionOptionsFlickr.Builder.class) -public final class ConnectionOptionsFlickr implements IConnectionOptionsOAuth1Common, IConnectionOptionsCommon { - private final Optional clientId; - - private final Optional clientSecret; - - private final Optional setUserRootAttributes; - - private final OptionalNullable>> - upstreamParams; - - private final Optional> nonPersistentAttrs; - - private final Map additionalProperties; - - private ConnectionOptionsFlickr( - Optional clientId, - Optional clientSecret, - Optional setUserRootAttributes, - OptionalNullable>> upstreamParams, - Optional> nonPersistentAttrs, - Map additionalProperties) { - this.clientId = clientId; - this.clientSecret = clientSecret; - this.setUserRootAttributes = setUserRootAttributes; - this.upstreamParams = upstreamParams; - this.nonPersistentAttrs = nonPersistentAttrs; - this.additionalProperties = additionalProperties; - } - - /** - * @return OAuth 1.0 client identifier issued by the identity provider during application registration. This value identifies your Auth0 connection to the identity provider. - */ - @JsonProperty("client_id") - @java.lang.Override - public Optional getClientId() { - return clientId; - } - - /** - * @return OAuth 1.0 client secret issued by the identity provider during application registration. Used to authenticate your Auth0 connection when signing requests and exchanging request tokens and verifiers for access tokens. May be null for public clients. - */ - @JsonProperty("client_secret") - @java.lang.Override - public Optional getClientSecret() { - return clientSecret; - } - - @JsonProperty("set_user_root_attributes") - @java.lang.Override - public Optional getSetUserRootAttributes() { - return setUserRootAttributes; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("upstream_params") - @java.lang.Override - public OptionalNullable>> getUpstreamParams() { - if (upstreamParams == null) { - return OptionalNullable.absent(); - } - return upstreamParams; - } - - @JsonProperty("non_persistent_attrs") - @java.lang.Override - public Optional> getNonPersistentAttrs() { - return nonPersistentAttrs; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("upstream_params") - private OptionalNullable>> - _getUpstreamParams() { - return upstreamParams; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ConnectionOptionsFlickr && equalTo((ConnectionOptionsFlickr) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ConnectionOptionsFlickr other) { - return clientId.equals(other.clientId) - && clientSecret.equals(other.clientSecret) - && setUserRootAttributes.equals(other.setUserRootAttributes) - && upstreamParams.equals(other.upstreamParams) - && nonPersistentAttrs.equals(other.nonPersistentAttrs); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.clientId, - this.clientSecret, - this.setUserRootAttributes, - this.upstreamParams, - this.nonPersistentAttrs); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional clientId = Optional.empty(); - - private Optional clientSecret = Optional.empty(); - - private Optional setUserRootAttributes = Optional.empty(); - - private OptionalNullable>> upstreamParams = - OptionalNullable.absent(); - - private Optional> nonPersistentAttrs = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ConnectionOptionsFlickr other) { - clientId(other.getClientId()); - clientSecret(other.getClientSecret()); - setUserRootAttributes(other.getSetUserRootAttributes()); - upstreamParams(other.getUpstreamParams()); - nonPersistentAttrs(other.getNonPersistentAttrs()); - return this; - } - - /** - *

OAuth 1.0 client identifier issued by the identity provider during application registration. This value identifies your Auth0 connection to the identity provider.

- */ - @JsonSetter(value = "client_id", nulls = Nulls.SKIP) - public Builder clientId(Optional clientId) { - this.clientId = clientId; - return this; - } - - public Builder clientId(String clientId) { - this.clientId = Optional.ofNullable(clientId); - return this; - } - - /** - *

OAuth 1.0 client secret issued by the identity provider during application registration. Used to authenticate your Auth0 connection when signing requests and exchanging request tokens and verifiers for access tokens. May be null for public clients.

- */ - @JsonSetter(value = "client_secret", nulls = Nulls.SKIP) - public Builder clientSecret(Optional clientSecret) { - this.clientSecret = clientSecret; - return this; - } - - public Builder clientSecret(String clientSecret) { - this.clientSecret = Optional.ofNullable(clientSecret); - return this; - } - - @JsonSetter(value = "set_user_root_attributes", nulls = Nulls.SKIP) - public Builder setUserRootAttributes(Optional setUserRootAttributes) { - this.setUserRootAttributes = setUserRootAttributes; - return this; - } - - public Builder setUserRootAttributes(ConnectionSetUserRootAttributesEnum setUserRootAttributes) { - this.setUserRootAttributes = Optional.ofNullable(setUserRootAttributes); - return this; - } - - @JsonSetter(value = "upstream_params", nulls = Nulls.SKIP) - public Builder upstreamParams( - @Nullable - OptionalNullable>> - upstreamParams) { - this.upstreamParams = upstreamParams; - return this; - } - - public Builder upstreamParams( - Map> upstreamParams) { - this.upstreamParams = OptionalNullable.of(upstreamParams); - return this; - } - - public Builder upstreamParams( - Optional>> upstreamParams) { - if (upstreamParams.isPresent()) { - this.upstreamParams = OptionalNullable.of(upstreamParams.get()); - } else { - this.upstreamParams = OptionalNullable.absent(); - } - return this; - } - - public Builder upstreamParams( - com.auth0.client.mgmt.core.Nullable< - Map>> - upstreamParams) { - if (upstreamParams.isNull()) { - this.upstreamParams = OptionalNullable.ofNull(); - } else if (upstreamParams.isEmpty()) { - this.upstreamParams = OptionalNullable.absent(); - } else { - this.upstreamParams = OptionalNullable.of(upstreamParams.get()); - } - return this; - } - - @JsonSetter(value = "non_persistent_attrs", nulls = Nulls.SKIP) - public Builder nonPersistentAttrs(Optional> nonPersistentAttrs) { - this.nonPersistentAttrs = nonPersistentAttrs; - return this; - } - - public Builder nonPersistentAttrs(List nonPersistentAttrs) { - this.nonPersistentAttrs = Optional.ofNullable(nonPersistentAttrs); - return this; - } - - public ConnectionOptionsFlickr build() { - return new ConnectionOptionsFlickr( - clientId, - clientSecret, - setUserRootAttributes, - upstreamParams, - nonPersistentAttrs, - additionalProperties); - } - - public Builder additionalProperty(String key, Object value) { - this.additionalProperties.put(key, value); - return this; - } - - public Builder additionalProperties(Map additionalProperties) { - this.additionalProperties.putAll(additionalProperties); - return this; - } - } -} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOidc.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOidc.java index 35f3c9d76..457cc8d09 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOidc.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOidc.java @@ -35,6 +35,8 @@ public final class ConnectionOptionsOidc implements IConnectionOptionsCommonOidc private final Optional> domainAliases; + private final Optional dpopSigningAlg; + private final OptionalNullable federatedConnectionsAccessTokens; private final Optional iconUrl; @@ -82,6 +84,7 @@ private ConnectionOptionsOidc( Optional clientSecret, Optional connectionSettings, Optional> domainAliases, + Optional dpopSigningAlg, OptionalNullable federatedConnectionsAccessTokens, Optional iconUrl, OptionalNullable> idTokenSignedResponseAlgs, @@ -107,6 +110,7 @@ private ConnectionOptionsOidc( this.clientSecret = clientSecret; this.connectionSettings = connectionSettings; this.domainAliases = domainAliases; + this.dpopSigningAlg = dpopSigningAlg; this.federatedConnectionsAccessTokens = federatedConnectionsAccessTokens; this.iconUrl = iconUrl; this.idTokenSignedResponseAlgs = idTokenSignedResponseAlgs; @@ -159,6 +163,12 @@ public Optional> getDomainAliases() { return domainAliases; } + @JsonProperty("dpop_signing_alg") + @java.lang.Override + public Optional getDpopSigningAlg() { + return dpopSigningAlg; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("federated_connections_access_tokens") @java.lang.Override @@ -338,6 +348,7 @@ private boolean equalTo(ConnectionOptionsOidc other) { && clientSecret.equals(other.clientSecret) && connectionSettings.equals(other.connectionSettings) && domainAliases.equals(other.domainAliases) + && dpopSigningAlg.equals(other.dpopSigningAlg) && federatedConnectionsAccessTokens.equals(other.federatedConnectionsAccessTokens) && iconUrl.equals(other.iconUrl) && idTokenSignedResponseAlgs.equals(other.idTokenSignedResponseAlgs) @@ -367,6 +378,7 @@ public int hashCode() { this.clientSecret, this.connectionSettings, this.domainAliases, + this.dpopSigningAlg, this.federatedConnectionsAccessTokens, this.iconUrl, this.idTokenSignedResponseAlgs, @@ -426,6 +438,10 @@ public interface _FinalStage { _FinalStage domainAliases(List domainAliases); + _FinalStage dpopSigningAlg(Optional dpopSigningAlg); + + _FinalStage dpopSigningAlg(ConnectionDpopSigningAlgEnum dpopSigningAlg); + _FinalStage federatedConnectionsAccessTokens( @Nullable OptionalNullable federatedConnectionsAccessTokens); @@ -594,6 +610,8 @@ public static final class Builder implements ClientIdStage, _FinalStage { private OptionalNullable federatedConnectionsAccessTokens = OptionalNullable.absent(); + private Optional dpopSigningAlg = Optional.empty(); + private Optional> domainAliases = Optional.empty(); private Optional connectionSettings = Optional.empty(); @@ -614,6 +632,7 @@ public Builder from(ConnectionOptionsOidc other) { clientSecret(other.getClientSecret()); connectionSettings(other.getConnectionSettings()); domainAliases(other.getDomainAliases()); + dpopSigningAlg(other.getDpopSigningAlg()); federatedConnectionsAccessTokens(other.getFederatedConnectionsAccessTokens()); iconUrl(other.getIconUrl()); idTokenSignedResponseAlgs(other.getIdTokenSignedResponseAlgs()); @@ -1027,6 +1046,19 @@ public _FinalStage federatedConnectionsAccessTokens( return this; } + @java.lang.Override + public _FinalStage dpopSigningAlg(ConnectionDpopSigningAlgEnum dpopSigningAlg) { + this.dpopSigningAlg = Optional.ofNullable(dpopSigningAlg); + return this; + } + + @java.lang.Override + @JsonSetter(value = "dpop_signing_alg", nulls = Nulls.SKIP) + public _FinalStage dpopSigningAlg(Optional dpopSigningAlg) { + this.dpopSigningAlg = dpopSigningAlg; + return this; + } + @java.lang.Override public _FinalStage domainAliases(List domainAliases) { this.domainAliases = Optional.ofNullable(domainAliases); @@ -1087,6 +1119,7 @@ public ConnectionOptionsOidc build() { clientSecret, connectionSettings, domainAliases, + dpopSigningAlg, federatedConnectionsAccessTokens, iconUrl, idTokenSignedResponseAlgs, diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOkta.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOkta.java index b25024bec..376926cac 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOkta.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionOptionsOkta.java @@ -37,6 +37,8 @@ public final class ConnectionOptionsOkta implements IConnectionOptionsCommon, IC private final Optional> domainAliases; + private final Optional dpopSigningAlg; + private final OptionalNullable federatedConnectionsAccessTokens; private final Optional iconUrl; @@ -83,6 +85,7 @@ private ConnectionOptionsOkta( Optional clientSecret, Optional connectionSettings, Optional> domainAliases, + Optional dpopSigningAlg, OptionalNullable federatedConnectionsAccessTokens, Optional iconUrl, OptionalNullable> idTokenSignedResponseAlgs, @@ -108,6 +111,7 @@ private ConnectionOptionsOkta( this.clientSecret = clientSecret; this.connectionSettings = connectionSettings; this.domainAliases = domainAliases; + this.dpopSigningAlg = dpopSigningAlg; this.federatedConnectionsAccessTokens = federatedConnectionsAccessTokens; this.iconUrl = iconUrl; this.idTokenSignedResponseAlgs = idTokenSignedResponseAlgs; @@ -165,6 +169,12 @@ public Optional> getDomainAliases() { return domainAliases; } + @JsonProperty("dpop_signing_alg") + @java.lang.Override + public Optional getDpopSigningAlg() { + return dpopSigningAlg; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("federated_connections_access_tokens") @java.lang.Override @@ -339,6 +349,7 @@ private boolean equalTo(ConnectionOptionsOkta other) { && clientSecret.equals(other.clientSecret) && connectionSettings.equals(other.connectionSettings) && domainAliases.equals(other.domainAliases) + && dpopSigningAlg.equals(other.dpopSigningAlg) && federatedConnectionsAccessTokens.equals(other.federatedConnectionsAccessTokens) && iconUrl.equals(other.iconUrl) && idTokenSignedResponseAlgs.equals(other.idTokenSignedResponseAlgs) @@ -368,6 +379,7 @@ public int hashCode() { this.clientSecret, this.connectionSettings, this.domainAliases, + this.dpopSigningAlg, this.federatedConnectionsAccessTokens, this.iconUrl, this.idTokenSignedResponseAlgs, @@ -430,6 +442,10 @@ public interface _FinalStage { _FinalStage domainAliases(List domainAliases); + _FinalStage dpopSigningAlg(Optional dpopSigningAlg); + + _FinalStage dpopSigningAlg(ConnectionDpopSigningAlgEnum dpopSigningAlg); + _FinalStage federatedConnectionsAccessTokens( @Nullable OptionalNullable federatedConnectionsAccessTokens); @@ -592,6 +608,8 @@ public static final class Builder implements ClientIdStage, _FinalStage { private OptionalNullable federatedConnectionsAccessTokens = OptionalNullable.absent(); + private Optional dpopSigningAlg = Optional.empty(); + private Optional> domainAliases = Optional.empty(); private Optional connectionSettings = Optional.empty(); @@ -615,6 +633,7 @@ public Builder from(ConnectionOptionsOkta other) { clientSecret(other.getClientSecret()); connectionSettings(other.getConnectionSettings()); domainAliases(other.getDomainAliases()); + dpopSigningAlg(other.getDpopSigningAlg()); federatedConnectionsAccessTokens(other.getFederatedConnectionsAccessTokens()); iconUrl(other.getIconUrl()); idTokenSignedResponseAlgs(other.getIdTokenSignedResponseAlgs()); @@ -1014,6 +1033,19 @@ public _FinalStage federatedConnectionsAccessTokens( return this; } + @java.lang.Override + public _FinalStage dpopSigningAlg(ConnectionDpopSigningAlgEnum dpopSigningAlg) { + this.dpopSigningAlg = Optional.ofNullable(dpopSigningAlg); + return this; + } + + @java.lang.Override + @JsonSetter(value = "dpop_signing_alg", nulls = Nulls.SKIP) + public _FinalStage dpopSigningAlg(Optional dpopSigningAlg) { + this.dpopSigningAlg = dpopSigningAlg; + return this; + } + @java.lang.Override public _FinalStage domainAliases(List domainAliases) { this.domainAliases = Optional.ofNullable(domainAliases); @@ -1088,6 +1120,7 @@ public ConnectionOptionsOkta build() { clientSecret, connectionSettings, domainAliases, + dpopSigningAlg, federatedConnectionsAccessTokens, iconUrl, idTokenSignedResponseAlgs, diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFlickr.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFlickr.java deleted file mode 100644 index fe5e76a3c..000000000 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFlickr.java +++ /dev/null @@ -1,458 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.auth0.client.mgmt.types; - -import com.auth0.client.mgmt.core.ObjectMappers; -import com.auth0.client.mgmt.core.OptionalNullable; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ConnectionResponseContentFlickr.Builder.class) -public final class ConnectionResponseContentFlickr - implements IConnectionPurposes, IConnectionResponseCommon, ICreateConnectionCommon { - private final Optional authentication; - - private final Optional connectedAccounts; - - private final String id; - - private final Optional> realms; - - private final String name; - - private final Optional> enabledClients; - - private final Optional displayName; - - private final Optional isDomainConnection; - - private final Optional>> metadata; - - private final ConnectionResponseContentFlickrStrategy strategy; - - private final Optional options; - - private final Map additionalProperties; - - private ConnectionResponseContentFlickr( - Optional authentication, - Optional connectedAccounts, - String id, - Optional> realms, - String name, - Optional> enabledClients, - Optional displayName, - Optional isDomainConnection, - Optional>> metadata, - ConnectionResponseContentFlickrStrategy strategy, - Optional options, - Map additionalProperties) { - this.authentication = authentication; - this.connectedAccounts = connectedAccounts; - this.id = id; - this.realms = realms; - this.name = name; - this.enabledClients = enabledClients; - this.displayName = displayName; - this.isDomainConnection = isDomainConnection; - this.metadata = metadata; - this.strategy = strategy; - this.options = options; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("authentication") - @java.lang.Override - public Optional getAuthentication() { - return authentication; - } - - @JsonProperty("connected_accounts") - @java.lang.Override - public Optional getConnectedAccounts() { - return connectedAccounts; - } - - @JsonProperty("id") - @java.lang.Override - public String getId() { - return id; - } - - @JsonProperty("realms") - @java.lang.Override - public Optional> getRealms() { - return realms; - } - - @JsonProperty("name") - @java.lang.Override - public String getName() { - return name; - } - - /** - * @return Use of this property is NOT RECOMMENDED. Use the PATCH /v2/connections/{id}/clients endpoint to enable the connection for a set of clients. - */ - @JsonProperty("enabled_clients") - @java.lang.Override - public Optional> getEnabledClients() { - return enabledClients; - } - - @JsonProperty("display_name") - @java.lang.Override - public Optional getDisplayName() { - return displayName; - } - - @JsonProperty("is_domain_connection") - @java.lang.Override - public Optional getIsDomainConnection() { - return isDomainConnection; - } - - @JsonProperty("metadata") - @java.lang.Override - public Optional>> getMetadata() { - return metadata; - } - - @JsonProperty("strategy") - public ConnectionResponseContentFlickrStrategy getStrategy() { - return strategy; - } - - @JsonProperty("options") - public Optional getOptions() { - return options; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ConnectionResponseContentFlickr && equalTo((ConnectionResponseContentFlickr) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ConnectionResponseContentFlickr other) { - return authentication.equals(other.authentication) - && connectedAccounts.equals(other.connectedAccounts) - && id.equals(other.id) - && realms.equals(other.realms) - && name.equals(other.name) - && enabledClients.equals(other.enabledClients) - && displayName.equals(other.displayName) - && isDomainConnection.equals(other.isDomainConnection) - && metadata.equals(other.metadata) - && strategy.equals(other.strategy) - && options.equals(other.options); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.authentication, - this.connectedAccounts, - this.id, - this.realms, - this.name, - this.enabledClients, - this.displayName, - this.isDomainConnection, - this.metadata, - this.strategy, - this.options); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IdStage builder() { - return new Builder(); - } - - public interface IdStage { - NameStage id(@NotNull String id); - - Builder from(ConnectionResponseContentFlickr other); - } - - public interface NameStage { - StrategyStage name(@NotNull String name); - } - - public interface StrategyStage { - _FinalStage strategy(@NotNull ConnectionResponseContentFlickrStrategy strategy); - } - - public interface _FinalStage { - ConnectionResponseContentFlickr build(); - - _FinalStage additionalProperty(String key, Object value); - - _FinalStage additionalProperties(Map additionalProperties); - - _FinalStage authentication(Optional authentication); - - _FinalStage authentication(ConnectionAuthenticationPurpose authentication); - - _FinalStage connectedAccounts(Optional connectedAccounts); - - _FinalStage connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts); - - _FinalStage realms(Optional> realms); - - _FinalStage realms(List realms); - - /** - *

Use of this property is NOT RECOMMENDED. Use the PATCH /v2/connections/{id}/clients endpoint to enable the connection for a set of clients.

- */ - _FinalStage enabledClients(Optional> enabledClients); - - _FinalStage enabledClients(List enabledClients); - - _FinalStage displayName(Optional displayName); - - _FinalStage displayName(String displayName); - - _FinalStage isDomainConnection(Optional isDomainConnection); - - _FinalStage isDomainConnection(Boolean isDomainConnection); - - _FinalStage metadata(Optional>> metadata); - - _FinalStage metadata(Map> metadata); - - _FinalStage options(Optional options); - - _FinalStage options(ConnectionOptionsFlickr options); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IdStage, NameStage, StrategyStage, _FinalStage { - private String id; - - private String name; - - private ConnectionResponseContentFlickrStrategy strategy; - - private Optional options = Optional.empty(); - - private Optional>> metadata = Optional.empty(); - - private Optional isDomainConnection = Optional.empty(); - - private Optional displayName = Optional.empty(); - - private Optional> enabledClients = Optional.empty(); - - private Optional> realms = Optional.empty(); - - private Optional connectedAccounts = Optional.empty(); - - private Optional authentication = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ConnectionResponseContentFlickr other) { - authentication(other.getAuthentication()); - connectedAccounts(other.getConnectedAccounts()); - id(other.getId()); - realms(other.getRealms()); - name(other.getName()); - enabledClients(other.getEnabledClients()); - displayName(other.getDisplayName()); - isDomainConnection(other.getIsDomainConnection()); - metadata(other.getMetadata()); - strategy(other.getStrategy()); - options(other.getOptions()); - return this; - } - - @java.lang.Override - @JsonSetter("id") - public NameStage id(@NotNull String id) { - this.id = Objects.requireNonNull(id, "id must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("name") - public StrategyStage name(@NotNull String name) { - this.name = Objects.requireNonNull(name, "name must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("strategy") - public _FinalStage strategy(@NotNull ConnectionResponseContentFlickrStrategy strategy) { - this.strategy = Objects.requireNonNull(strategy, "strategy must not be null"); - return this; - } - - @java.lang.Override - public _FinalStage options(ConnectionOptionsFlickr options) { - this.options = Optional.ofNullable(options); - return this; - } - - @java.lang.Override - @JsonSetter(value = "options", nulls = Nulls.SKIP) - public _FinalStage options(Optional options) { - this.options = options; - return this; - } - - @java.lang.Override - public _FinalStage metadata(Map> metadata) { - this.metadata = Optional.ofNullable(metadata); - return this; - } - - @java.lang.Override - @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public _FinalStage metadata(Optional>> metadata) { - this.metadata = metadata; - return this; - } - - @java.lang.Override - public _FinalStage isDomainConnection(Boolean isDomainConnection) { - this.isDomainConnection = Optional.ofNullable(isDomainConnection); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) - public _FinalStage isDomainConnection(Optional isDomainConnection) { - this.isDomainConnection = isDomainConnection; - return this; - } - - @java.lang.Override - public _FinalStage displayName(String displayName) { - this.displayName = Optional.ofNullable(displayName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "display_name", nulls = Nulls.SKIP) - public _FinalStage displayName(Optional displayName) { - this.displayName = displayName; - return this; - } - - /** - *

Use of this property is NOT RECOMMENDED. Use the PATCH /v2/connections/{id}/clients endpoint to enable the connection for a set of clients.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage enabledClients(List enabledClients) { - this.enabledClients = Optional.ofNullable(enabledClients); - return this; - } - - /** - *

Use of this property is NOT RECOMMENDED. Use the PATCH /v2/connections/{id}/clients endpoint to enable the connection for a set of clients.

- */ - @java.lang.Override - @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) - public _FinalStage enabledClients(Optional> enabledClients) { - this.enabledClients = enabledClients; - return this; - } - - @java.lang.Override - public _FinalStage realms(List realms) { - this.realms = Optional.ofNullable(realms); - return this; - } - - @java.lang.Override - @JsonSetter(value = "realms", nulls = Nulls.SKIP) - public _FinalStage realms(Optional> realms) { - this.realms = realms; - return this; - } - - @java.lang.Override - public _FinalStage connectedAccounts(ConnectionConnectedAccountsPurpose connectedAccounts) { - this.connectedAccounts = Optional.ofNullable(connectedAccounts); - return this; - } - - @java.lang.Override - @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) - public _FinalStage connectedAccounts(Optional connectedAccounts) { - this.connectedAccounts = connectedAccounts; - return this; - } - - @java.lang.Override - public _FinalStage authentication(ConnectionAuthenticationPurpose authentication) { - this.authentication = Optional.ofNullable(authentication); - return this; - } - - @java.lang.Override - @JsonSetter(value = "authentication", nulls = Nulls.SKIP) - public _FinalStage authentication(Optional authentication) { - this.authentication = authentication; - return this; - } - - @java.lang.Override - public ConnectionResponseContentFlickr build() { - return new ConnectionResponseContentFlickr( - authentication, - connectedAccounts, - id, - realms, - name, - enabledClients, - displayName, - isDomainConnection, - metadata, - strategy, - options, - additionalProperties); - } - - @java.lang.Override - public Builder additionalProperty(String key, Object value) { - this.additionalProperties.put(key, value); - return this; - } - - @java.lang.Override - public Builder additionalProperties(Map additionalProperties) { - this.additionalProperties.putAll(additionalProperties); - return this; - } - } -} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFlickrStrategy.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFlickrStrategy.java deleted file mode 100644 index 56fa474f7..000000000 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionResponseContentFlickrStrategy.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.auth0.client.mgmt.types; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -public final class ConnectionResponseContentFlickrStrategy { - public static final ConnectionResponseContentFlickrStrategy FLICKR = - new ConnectionResponseContentFlickrStrategy(Value.FLICKR, "flickr"); - - private final Value value; - - private final String string; - - ConnectionResponseContentFlickrStrategy(Value value, String string) { - this.value = value; - this.string = string; - } - - public Value getEnumValue() { - return value; - } - - @java.lang.Override - @JsonValue - public String toString() { - return this.string; - } - - @java.lang.Override - public boolean equals(Object other) { - return (this == other) - || (other instanceof ConnectionResponseContentFlickrStrategy - && this.string.equals(((ConnectionResponseContentFlickrStrategy) other).string)); - } - - @java.lang.Override - public int hashCode() { - return this.string.hashCode(); - } - - public T visit(Visitor visitor) { - switch (value) { - case FLICKR: - return visitor.visitFlickr(); - case UNKNOWN: - default: - return visitor.visitUnknown(string); - } - } - - @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - public static ConnectionResponseContentFlickrStrategy valueOf(String value) { - switch (value) { - case "flickr": - return FLICKR; - default: - return new ConnectionResponseContentFlickrStrategy(Value.UNKNOWN, value); - } - } - - public enum Value { - FLICKR, - - UNKNOWN - } - - public interface Visitor { - T visitFlickr(); - - T visitUnknown(String unknownType); - } -} diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionStrategyEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionStrategyEnum.java index 9a57042b7..7b196125b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionStrategyEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionStrategyEnum.java @@ -13,8 +13,6 @@ public final class ConnectionStrategyEnum { public static final ConnectionStrategyEnum DWOLLA = new ConnectionStrategyEnum(Value.DWOLLA, "dwolla"); - public static final ConnectionStrategyEnum FLICKR = new ConnectionStrategyEnum(Value.FLICKR, "flickr"); - public static final ConnectionStrategyEnum OKTA = new ConnectionStrategyEnum(Value.OKTA, "okta"); public static final ConnectionStrategyEnum PLANNINGCENTER = @@ -171,8 +169,6 @@ public T visit(Visitor visitor) { return visitor.visitAuth0Oidc(); case DWOLLA: return visitor.visitDwolla(); - case FLICKR: - return visitor.visitFlickr(); case OKTA: return visitor.visitOkta(); case PLANNINGCENTER: @@ -294,8 +290,6 @@ public static ConnectionStrategyEnum valueOf(String value) { return AUTH0OIDC; case "dwolla": return DWOLLA; - case "flickr": - return FLICKR; case "okta": return OKTA; case "planningcenter": @@ -448,8 +442,6 @@ public enum Value { FITBIT, - FLICKR, - GITHUB, GOOGLE_APPS, @@ -566,8 +558,6 @@ public interface Visitor { T visitFitbit(); - T visitFlickr(); - T visitGithub(); T visitGoogleApps(); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFlickr.java b/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFlickr.java deleted file mode 100644 index cfdc7c1c9..000000000 --- a/src/main/java/com/auth0/client/mgmt/types/CreateConnectionRequestContentFlickr.java +++ /dev/null @@ -1,332 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.auth0.client.mgmt.types; - -import com.auth0.client.mgmt.core.ObjectMappers; -import com.auth0.client.mgmt.core.OptionalNullable; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CreateConnectionRequestContentFlickr.Builder.class) -public final class CreateConnectionRequestContentFlickr implements ICreateConnectionCommon { - private final String name; - - private final Optional> enabledClients; - - private final Optional displayName; - - private final Optional isDomainConnection; - - private final Optional>> metadata; - - private final CreateConnectionRequestContentFlickrStrategy strategy; - - private final Optional options; - - private final Map additionalProperties; - - private CreateConnectionRequestContentFlickr( - String name, - Optional> enabledClients, - Optional displayName, - Optional isDomainConnection, - Optional>> metadata, - CreateConnectionRequestContentFlickrStrategy strategy, - Optional options, - Map additionalProperties) { - this.name = name; - this.enabledClients = enabledClients; - this.displayName = displayName; - this.isDomainConnection = isDomainConnection; - this.metadata = metadata; - this.strategy = strategy; - this.options = options; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - @java.lang.Override - public String getName() { - return name; - } - - /** - * @return Use of this property is NOT RECOMMENDED. Use the PATCH /v2/connections/{id}/clients endpoint to enable the connection for a set of clients. - */ - @JsonProperty("enabled_clients") - @java.lang.Override - public Optional> getEnabledClients() { - return enabledClients; - } - - @JsonProperty("display_name") - @java.lang.Override - public Optional getDisplayName() { - return displayName; - } - - @JsonProperty("is_domain_connection") - @java.lang.Override - public Optional getIsDomainConnection() { - return isDomainConnection; - } - - @JsonProperty("metadata") - @java.lang.Override - public Optional>> getMetadata() { - return metadata; - } - - @JsonProperty("strategy") - public CreateConnectionRequestContentFlickrStrategy getStrategy() { - return strategy; - } - - @JsonProperty("options") - public Optional getOptions() { - return options; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CreateConnectionRequestContentFlickr - && equalTo((CreateConnectionRequestContentFlickr) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CreateConnectionRequestContentFlickr other) { - return name.equals(other.name) - && enabledClients.equals(other.enabledClients) - && displayName.equals(other.displayName) - && isDomainConnection.equals(other.isDomainConnection) - && metadata.equals(other.metadata) - && strategy.equals(other.strategy) - && options.equals(other.options); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.name, - this.enabledClients, - this.displayName, - this.isDomainConnection, - this.metadata, - this.strategy, - this.options); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - StrategyStage name(@NotNull String name); - - Builder from(CreateConnectionRequestContentFlickr other); - } - - public interface StrategyStage { - _FinalStage strategy(@NotNull CreateConnectionRequestContentFlickrStrategy strategy); - } - - public interface _FinalStage { - CreateConnectionRequestContentFlickr build(); - - _FinalStage additionalProperty(String key, Object value); - - _FinalStage additionalProperties(Map additionalProperties); - - /** - *

Use of this property is NOT RECOMMENDED. Use the PATCH /v2/connections/{id}/clients endpoint to enable the connection for a set of clients.

- */ - _FinalStage enabledClients(Optional> enabledClients); - - _FinalStage enabledClients(List enabledClients); - - _FinalStage displayName(Optional displayName); - - _FinalStage displayName(String displayName); - - _FinalStage isDomainConnection(Optional isDomainConnection); - - _FinalStage isDomainConnection(Boolean isDomainConnection); - - _FinalStage metadata(Optional>> metadata); - - _FinalStage metadata(Map> metadata); - - _FinalStage options(Optional options); - - _FinalStage options(ConnectionOptionsFlickr options); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, StrategyStage, _FinalStage { - private String name; - - private CreateConnectionRequestContentFlickrStrategy strategy; - - private Optional options = Optional.empty(); - - private Optional>> metadata = Optional.empty(); - - private Optional isDomainConnection = Optional.empty(); - - private Optional displayName = Optional.empty(); - - private Optional> enabledClients = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CreateConnectionRequestContentFlickr other) { - name(other.getName()); - enabledClients(other.getEnabledClients()); - displayName(other.getDisplayName()); - isDomainConnection(other.getIsDomainConnection()); - metadata(other.getMetadata()); - strategy(other.getStrategy()); - options(other.getOptions()); - return this; - } - - @java.lang.Override - @JsonSetter("name") - public StrategyStage name(@NotNull String name) { - this.name = Objects.requireNonNull(name, "name must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("strategy") - public _FinalStage strategy(@NotNull CreateConnectionRequestContentFlickrStrategy strategy) { - this.strategy = Objects.requireNonNull(strategy, "strategy must not be null"); - return this; - } - - @java.lang.Override - public _FinalStage options(ConnectionOptionsFlickr options) { - this.options = Optional.ofNullable(options); - return this; - } - - @java.lang.Override - @JsonSetter(value = "options", nulls = Nulls.SKIP) - public _FinalStage options(Optional options) { - this.options = options; - return this; - } - - @java.lang.Override - public _FinalStage metadata(Map> metadata) { - this.metadata = Optional.ofNullable(metadata); - return this; - } - - @java.lang.Override - @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public _FinalStage metadata(Optional>> metadata) { - this.metadata = metadata; - return this; - } - - @java.lang.Override - public _FinalStage isDomainConnection(Boolean isDomainConnection) { - this.isDomainConnection = Optional.ofNullable(isDomainConnection); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) - public _FinalStage isDomainConnection(Optional isDomainConnection) { - this.isDomainConnection = isDomainConnection; - return this; - } - - @java.lang.Override - public _FinalStage displayName(String displayName) { - this.displayName = Optional.ofNullable(displayName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "display_name", nulls = Nulls.SKIP) - public _FinalStage displayName(Optional displayName) { - this.displayName = displayName; - return this; - } - - /** - *

Use of this property is NOT RECOMMENDED. Use the PATCH /v2/connections/{id}/clients endpoint to enable the connection for a set of clients.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage enabledClients(List enabledClients) { - this.enabledClients = Optional.ofNullable(enabledClients); - return this; - } - - /** - *

Use of this property is NOT RECOMMENDED. Use the PATCH /v2/connections/{id}/clients endpoint to enable the connection for a set of clients.

- */ - @java.lang.Override - @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) - public _FinalStage enabledClients(Optional> enabledClients) { - this.enabledClients = enabledClients; - return this; - } - - @java.lang.Override - public CreateConnectionRequestContentFlickr build() { - return new CreateConnectionRequestContentFlickr( - name, - enabledClients, - displayName, - isDomainConnection, - metadata, - strategy, - options, - additionalProperties); - } - - @java.lang.Override - public Builder additionalProperty(String key, Object value) { - this.additionalProperties.put(key, value); - return this; - } - - @java.lang.Override - public Builder additionalProperties(Map additionalProperties) { - this.additionalProperties.putAll(additionalProperties); - return this; - } - } -} diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningRequestContent.java index 3b9e88b66..fcd9e53f1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningRequestContent.java @@ -25,14 +25,14 @@ public final class CreateDirectoryProvisioningRequestContent { private final Optional synchronizeAutomatically; - private final Optional synchronizeGroups; + private final Optional synchronizeGroups; private final Map additionalProperties; private CreateDirectoryProvisioningRequestContent( Optional> mapping, Optional synchronizeAutomatically, - Optional synchronizeGroups, + Optional synchronizeGroups, Map additionalProperties) { this.mapping = mapping; this.synchronizeAutomatically = synchronizeAutomatically; @@ -57,7 +57,7 @@ public Optional getSynchronizeAutomatically() { } @JsonProperty("synchronize_groups") - public Optional getSynchronizeGroups() { + public Optional getSynchronizeGroups() { return synchronizeGroups; } @@ -99,7 +99,7 @@ public static final class Builder { private Optional synchronizeAutomatically = Optional.empty(); - private Optional synchronizeGroups = Optional.empty(); + private Optional synchronizeGroups = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -142,12 +142,12 @@ public Builder synchronizeAutomatically(Boolean synchronizeAutomatically) { } @JsonSetter(value = "synchronize_groups", nulls = Nulls.SKIP) - public Builder synchronizeGroups(Optional synchronizeGroups) { + public Builder synchronizeGroups(Optional synchronizeGroups) { this.synchronizeGroups = synchronizeGroups; return this; } - public Builder synchronizeGroups(String synchronizeGroups) { + public Builder synchronizeGroups(SynchronizeGroupsEnum synchronizeGroups) { this.synchronizeGroups = Optional.ofNullable(synchronizeGroups); return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningResponseContent.java index 7a3abb5bb..9538773e6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateDirectoryProvisioningResponseContent.java @@ -34,7 +34,7 @@ public final class CreateDirectoryProvisioningResponseContent { private final boolean synchronizeAutomatically; - private final Optional synchronizeGroups; + private final Optional synchronizeGroups; private final OffsetDateTime createdAt; @@ -54,7 +54,7 @@ private CreateDirectoryProvisioningResponseContent( String strategy, List mapping, boolean synchronizeAutomatically, - Optional synchronizeGroups, + Optional synchronizeGroups, OffsetDateTime createdAt, OffsetDateTime updatedAt, Optional lastSynchronizationAt, @@ -116,7 +116,7 @@ public boolean getSynchronizeAutomatically() { } @JsonProperty("synchronize_groups") - public Optional getSynchronizeGroups() { + public Optional getSynchronizeGroups() { return synchronizeGroups; } @@ -271,9 +271,9 @@ public interface _FinalStage { _FinalStage addAllMapping(List mapping); - _FinalStage synchronizeGroups(Optional synchronizeGroups); + _FinalStage synchronizeGroups(Optional synchronizeGroups); - _FinalStage synchronizeGroups(String synchronizeGroups); + _FinalStage synchronizeGroups(SynchronizeGroupsEnum synchronizeGroups); /** *

The timestamp at which the connection was last synchronized

@@ -324,7 +324,7 @@ public static final class Builder private Optional lastSynchronizationAt = Optional.empty(); - private Optional synchronizeGroups = Optional.empty(); + private Optional synchronizeGroups = Optional.empty(); private List mapping = new ArrayList<>(); @@ -482,14 +482,14 @@ public _FinalStage lastSynchronizationAt(Optional lastSynchroniz } @java.lang.Override - public _FinalStage synchronizeGroups(String synchronizeGroups) { + public _FinalStage synchronizeGroups(SynchronizeGroupsEnum synchronizeGroups) { this.synchronizeGroups = Optional.ofNullable(synchronizeGroups); return this; } @java.lang.Override @JsonSetter(value = "synchronize_groups", nulls = Nulls.SKIP) - public _FinalStage synchronizeGroups(Optional synchronizeGroups) { + public _FinalStage synchronizeGroups(Optional synchronizeGroups) { this.synchronizeGroups = synchronizeGroups; return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationAllConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationAllConnectionResponseContent.java new file mode 100644 index 000000000..72848bb6e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationAllConnectionResponseContent.java @@ -0,0 +1,426 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateOrganizationAllConnectionResponseContent.Builder.class) +public final class CreateOrganizationAllConnectionResponseContent { + private final Optional organizationConnectionName; + + private final Optional assignMembershipOnLogin; + + private final Optional showAsButton; + + private final Optional isSignupEnabled; + + private final Optional organizationAccessLevel; + + private final Optional isEnabled; + + private final String connectionId; + + private final Optional connection; + + private final Map additionalProperties; + + private CreateOrganizationAllConnectionResponseContent( + Optional organizationConnectionName, + Optional assignMembershipOnLogin, + Optional showAsButton, + Optional isSignupEnabled, + Optional organizationAccessLevel, + Optional isEnabled, + String connectionId, + Optional connection, + Map additionalProperties) { + this.organizationConnectionName = organizationConnectionName; + this.assignMembershipOnLogin = assignMembershipOnLogin; + this.showAsButton = showAsButton; + this.isSignupEnabled = isSignupEnabled; + this.organizationAccessLevel = organizationAccessLevel; + this.isEnabled = isEnabled; + this.connectionId = connectionId; + this.connection = connection; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of the connection in the scope of this organization. + */ + @JsonProperty("organization_connection_name") + public Optional getOrganizationConnectionName() { + return organizationConnectionName; + } + + /** + * @return When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection. + */ + @JsonProperty("assign_membership_on_login") + public Optional getAssignMembershipOnLogin() { + return assignMembershipOnLogin; + } + + /** + * @return Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true. + */ + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + /** + * @return Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false. + */ + @JsonProperty("is_signup_enabled") + public Optional getIsSignupEnabled() { + return isSignupEnabled; + } + + @JsonProperty("organization_access_level") + public Optional getOrganizationAccessLevel() { + return organizationAccessLevel; + } + + /** + * @return Whether the connection is enabled for the organization. + */ + @JsonProperty("is_enabled") + public Optional getIsEnabled() { + return isEnabled; + } + + /** + * @return Connection identifier. + */ + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("connection") + public Optional getConnection() { + return connection; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateOrganizationAllConnectionResponseContent + && equalTo((CreateOrganizationAllConnectionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateOrganizationAllConnectionResponseContent other) { + return organizationConnectionName.equals(other.organizationConnectionName) + && assignMembershipOnLogin.equals(other.assignMembershipOnLogin) + && showAsButton.equals(other.showAsButton) + && isSignupEnabled.equals(other.isSignupEnabled) + && organizationAccessLevel.equals(other.organizationAccessLevel) + && isEnabled.equals(other.isEnabled) + && connectionId.equals(other.connectionId) + && connection.equals(other.connection); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.organizationConnectionName, + this.assignMembershipOnLogin, + this.showAsButton, + this.isSignupEnabled, + this.organizationAccessLevel, + this.isEnabled, + this.connectionId, + this.connection); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + /** + *

Connection identifier.

+ */ + _FinalStage connectionId(@NotNull String connectionId); + + Builder from(CreateOrganizationAllConnectionResponseContent other); + } + + public interface _FinalStage { + CreateOrganizationAllConnectionResponseContent build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

Name of the connection in the scope of this organization.

+ */ + _FinalStage organizationConnectionName(Optional organizationConnectionName); + + _FinalStage organizationConnectionName(String organizationConnectionName); + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + _FinalStage assignMembershipOnLogin(Optional assignMembershipOnLogin); + + _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin); + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + _FinalStage showAsButton(Optional showAsButton); + + _FinalStage showAsButton(Boolean showAsButton); + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ */ + _FinalStage isSignupEnabled(Optional isSignupEnabled); + + _FinalStage isSignupEnabled(Boolean isSignupEnabled); + + _FinalStage organizationAccessLevel(Optional organizationAccessLevel); + + _FinalStage organizationAccessLevel(OrganizationAccessLevelEnum organizationAccessLevel); + + /** + *

Whether the connection is enabled for the organization.

+ */ + _FinalStage isEnabled(Optional isEnabled); + + _FinalStage isEnabled(Boolean isEnabled); + + _FinalStage connection(Optional connection); + + _FinalStage connection(OrganizationConnectionInformation connection); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, _FinalStage { + private String connectionId; + + private Optional connection = Optional.empty(); + + private Optional isEnabled = Optional.empty(); + + private Optional organizationAccessLevel = Optional.empty(); + + private Optional isSignupEnabled = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional assignMembershipOnLogin = Optional.empty(); + + private Optional organizationConnectionName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateOrganizationAllConnectionResponseContent other) { + organizationConnectionName(other.getOrganizationConnectionName()); + assignMembershipOnLogin(other.getAssignMembershipOnLogin()); + showAsButton(other.getShowAsButton()); + isSignupEnabled(other.getIsSignupEnabled()); + organizationAccessLevel(other.getOrganizationAccessLevel()); + isEnabled(other.getIsEnabled()); + connectionId(other.getConnectionId()); + connection(other.getConnection()); + return this; + } + + /** + *

Connection identifier.

+ *

Connection identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("connection_id") + public _FinalStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage connection(OrganizationConnectionInformation connection) { + this.connection = Optional.ofNullable(connection); + return this; + } + + @java.lang.Override + @JsonSetter(value = "connection", nulls = Nulls.SKIP) + public _FinalStage connection(Optional connection) { + this.connection = connection; + return this; + } + + /** + *

Whether the connection is enabled for the organization.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isEnabled(Boolean isEnabled) { + this.isEnabled = Optional.ofNullable(isEnabled); + return this; + } + + /** + *

Whether the connection is enabled for the organization.

+ */ + @java.lang.Override + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public _FinalStage isEnabled(Optional isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + @java.lang.Override + public _FinalStage organizationAccessLevel(OrganizationAccessLevelEnum organizationAccessLevel) { + this.organizationAccessLevel = Optional.ofNullable(organizationAccessLevel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "organization_access_level", nulls = Nulls.SKIP) + public _FinalStage organizationAccessLevel(Optional organizationAccessLevel) { + this.organizationAccessLevel = organizationAccessLevel; + return this; + } + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isSignupEnabled(Boolean isSignupEnabled) { + this.isSignupEnabled = Optional.ofNullable(isSignupEnabled); + return this; + } + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ */ + @java.lang.Override + @JsonSetter(value = "is_signup_enabled", nulls = Nulls.SKIP) + public _FinalStage isSignupEnabled(Optional isSignupEnabled) { + this.isSignupEnabled = isSignupEnabled; + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + @java.lang.Override + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public _FinalStage showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin) { + this.assignMembershipOnLogin = Optional.ofNullable(assignMembershipOnLogin); + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + @java.lang.Override + @JsonSetter(value = "assign_membership_on_login", nulls = Nulls.SKIP) + public _FinalStage assignMembershipOnLogin(Optional assignMembershipOnLogin) { + this.assignMembershipOnLogin = assignMembershipOnLogin; + return this; + } + + /** + *

Name of the connection in the scope of this organization.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage organizationConnectionName(String organizationConnectionName) { + this.organizationConnectionName = Optional.ofNullable(organizationConnectionName); + return this; + } + + /** + *

Name of the connection in the scope of this organization.

+ */ + @java.lang.Override + @JsonSetter(value = "organization_connection_name", nulls = Nulls.SKIP) + public _FinalStage organizationConnectionName(Optional organizationConnectionName) { + this.organizationConnectionName = organizationConnectionName; + return this; + } + + @java.lang.Override + public CreateOrganizationAllConnectionResponseContent build() { + return new CreateOrganizationAllConnectionResponseContent( + organizationConnectionName, + assignMembershipOnLogin, + showAsButton, + isSignupEnabled, + organizationAccessLevel, + isEnabled, + connectionId, + connection, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/DirectoryProvisioning.java b/src/main/java/com/auth0/client/mgmt/types/DirectoryProvisioning.java index b1807dda2..dcddd0b3f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/DirectoryProvisioning.java +++ b/src/main/java/com/auth0/client/mgmt/types/DirectoryProvisioning.java @@ -34,7 +34,7 @@ public final class DirectoryProvisioning { private final boolean synchronizeAutomatically; - private final Optional synchronizeGroups; + private final Optional synchronizeGroups; private final OffsetDateTime createdAt; @@ -54,7 +54,7 @@ private DirectoryProvisioning( String strategy, List mapping, boolean synchronizeAutomatically, - Optional synchronizeGroups, + Optional synchronizeGroups, OffsetDateTime createdAt, OffsetDateTime updatedAt, Optional lastSynchronizationAt, @@ -116,7 +116,7 @@ public boolean getSynchronizeAutomatically() { } @JsonProperty("synchronize_groups") - public Optional getSynchronizeGroups() { + public Optional getSynchronizeGroups() { return synchronizeGroups; } @@ -270,9 +270,9 @@ public interface _FinalStage { _FinalStage addAllMapping(List mapping); - _FinalStage synchronizeGroups(Optional synchronizeGroups); + _FinalStage synchronizeGroups(Optional synchronizeGroups); - _FinalStage synchronizeGroups(String synchronizeGroups); + _FinalStage synchronizeGroups(SynchronizeGroupsEnum synchronizeGroups); /** *

The timestamp at which the connection was last synchronized

@@ -323,7 +323,7 @@ public static final class Builder private Optional lastSynchronizationAt = Optional.empty(); - private Optional synchronizeGroups = Optional.empty(); + private Optional synchronizeGroups = Optional.empty(); private List mapping = new ArrayList<>(); @@ -481,14 +481,14 @@ public _FinalStage lastSynchronizationAt(Optional lastSynchroniz } @java.lang.Override - public _FinalStage synchronizeGroups(String synchronizeGroups) { + public _FinalStage synchronizeGroups(SynchronizeGroupsEnum synchronizeGroups) { this.synchronizeGroups = Optional.ofNullable(synchronizeGroups); return this; } @java.lang.Override @JsonSetter(value = "synchronize_groups", nulls = Nulls.SKIP) - public _FinalStage synchronizeGroups(Optional synchronizeGroups) { + public _FinalStage synchronizeGroups(Optional synchronizeGroups) { this.synchronizeGroups = synchronizeGroups; return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetDirectoryProvisioningResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetDirectoryProvisioningResponseContent.java index 1947b1e64..09ed2315a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetDirectoryProvisioningResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetDirectoryProvisioningResponseContent.java @@ -34,7 +34,7 @@ public final class GetDirectoryProvisioningResponseContent { private final boolean synchronizeAutomatically; - private final Optional synchronizeGroups; + private final Optional synchronizeGroups; private final OffsetDateTime createdAt; @@ -54,7 +54,7 @@ private GetDirectoryProvisioningResponseContent( String strategy, List mapping, boolean synchronizeAutomatically, - Optional synchronizeGroups, + Optional synchronizeGroups, OffsetDateTime createdAt, OffsetDateTime updatedAt, Optional lastSynchronizationAt, @@ -116,7 +116,7 @@ public boolean getSynchronizeAutomatically() { } @JsonProperty("synchronize_groups") - public Optional getSynchronizeGroups() { + public Optional getSynchronizeGroups() { return synchronizeGroups; } @@ -271,9 +271,9 @@ public interface _FinalStage { _FinalStage addAllMapping(List mapping); - _FinalStage synchronizeGroups(Optional synchronizeGroups); + _FinalStage synchronizeGroups(Optional synchronizeGroups); - _FinalStage synchronizeGroups(String synchronizeGroups); + _FinalStage synchronizeGroups(SynchronizeGroupsEnum synchronizeGroups); /** *

The timestamp at which the connection was last synchronized

@@ -324,7 +324,7 @@ public static final class Builder private Optional lastSynchronizationAt = Optional.empty(); - private Optional synchronizeGroups = Optional.empty(); + private Optional synchronizeGroups = Optional.empty(); private List mapping = new ArrayList<>(); @@ -482,14 +482,14 @@ public _FinalStage lastSynchronizationAt(Optional lastSynchroniz } @java.lang.Override - public _FinalStage synchronizeGroups(String synchronizeGroups) { + public _FinalStage synchronizeGroups(SynchronizeGroupsEnum synchronizeGroups) { this.synchronizeGroups = Optional.ofNullable(synchronizeGroups); return this; } @java.lang.Override @JsonSetter(value = "synchronize_groups", nulls = Nulls.SKIP) - public _FinalStage synchronizeGroups(Optional synchronizeGroups) { + public _FinalStage synchronizeGroups(Optional synchronizeGroups) { this.synchronizeGroups = synchronizeGroups; return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/GetOrganizationAllConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationAllConnectionResponseContent.java new file mode 100644 index 000000000..180a87756 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetOrganizationAllConnectionResponseContent.java @@ -0,0 +1,426 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetOrganizationAllConnectionResponseContent.Builder.class) +public final class GetOrganizationAllConnectionResponseContent { + private final Optional organizationConnectionName; + + private final Optional assignMembershipOnLogin; + + private final Optional showAsButton; + + private final Optional isSignupEnabled; + + private final Optional organizationAccessLevel; + + private final Optional isEnabled; + + private final String connectionId; + + private final Optional connection; + + private final Map additionalProperties; + + private GetOrganizationAllConnectionResponseContent( + Optional organizationConnectionName, + Optional assignMembershipOnLogin, + Optional showAsButton, + Optional isSignupEnabled, + Optional organizationAccessLevel, + Optional isEnabled, + String connectionId, + Optional connection, + Map additionalProperties) { + this.organizationConnectionName = organizationConnectionName; + this.assignMembershipOnLogin = assignMembershipOnLogin; + this.showAsButton = showAsButton; + this.isSignupEnabled = isSignupEnabled; + this.organizationAccessLevel = organizationAccessLevel; + this.isEnabled = isEnabled; + this.connectionId = connectionId; + this.connection = connection; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of the connection in the scope of this organization. + */ + @JsonProperty("organization_connection_name") + public Optional getOrganizationConnectionName() { + return organizationConnectionName; + } + + /** + * @return When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection. + */ + @JsonProperty("assign_membership_on_login") + public Optional getAssignMembershipOnLogin() { + return assignMembershipOnLogin; + } + + /** + * @return Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true. + */ + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + /** + * @return Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false. + */ + @JsonProperty("is_signup_enabled") + public Optional getIsSignupEnabled() { + return isSignupEnabled; + } + + @JsonProperty("organization_access_level") + public Optional getOrganizationAccessLevel() { + return organizationAccessLevel; + } + + /** + * @return Whether the connection is enabled for the organization. + */ + @JsonProperty("is_enabled") + public Optional getIsEnabled() { + return isEnabled; + } + + /** + * @return Connection identifier. + */ + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("connection") + public Optional getConnection() { + return connection; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetOrganizationAllConnectionResponseContent + && equalTo((GetOrganizationAllConnectionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetOrganizationAllConnectionResponseContent other) { + return organizationConnectionName.equals(other.organizationConnectionName) + && assignMembershipOnLogin.equals(other.assignMembershipOnLogin) + && showAsButton.equals(other.showAsButton) + && isSignupEnabled.equals(other.isSignupEnabled) + && organizationAccessLevel.equals(other.organizationAccessLevel) + && isEnabled.equals(other.isEnabled) + && connectionId.equals(other.connectionId) + && connection.equals(other.connection); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.organizationConnectionName, + this.assignMembershipOnLogin, + this.showAsButton, + this.isSignupEnabled, + this.organizationAccessLevel, + this.isEnabled, + this.connectionId, + this.connection); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + /** + *

Connection identifier.

+ */ + _FinalStage connectionId(@NotNull String connectionId); + + Builder from(GetOrganizationAllConnectionResponseContent other); + } + + public interface _FinalStage { + GetOrganizationAllConnectionResponseContent build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

Name of the connection in the scope of this organization.

+ */ + _FinalStage organizationConnectionName(Optional organizationConnectionName); + + _FinalStage organizationConnectionName(String organizationConnectionName); + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + _FinalStage assignMembershipOnLogin(Optional assignMembershipOnLogin); + + _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin); + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + _FinalStage showAsButton(Optional showAsButton); + + _FinalStage showAsButton(Boolean showAsButton); + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ */ + _FinalStage isSignupEnabled(Optional isSignupEnabled); + + _FinalStage isSignupEnabled(Boolean isSignupEnabled); + + _FinalStage organizationAccessLevel(Optional organizationAccessLevel); + + _FinalStage organizationAccessLevel(OrganizationAccessLevelEnum organizationAccessLevel); + + /** + *

Whether the connection is enabled for the organization.

+ */ + _FinalStage isEnabled(Optional isEnabled); + + _FinalStage isEnabled(Boolean isEnabled); + + _FinalStage connection(Optional connection); + + _FinalStage connection(OrganizationConnectionInformation connection); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, _FinalStage { + private String connectionId; + + private Optional connection = Optional.empty(); + + private Optional isEnabled = Optional.empty(); + + private Optional organizationAccessLevel = Optional.empty(); + + private Optional isSignupEnabled = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional assignMembershipOnLogin = Optional.empty(); + + private Optional organizationConnectionName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetOrganizationAllConnectionResponseContent other) { + organizationConnectionName(other.getOrganizationConnectionName()); + assignMembershipOnLogin(other.getAssignMembershipOnLogin()); + showAsButton(other.getShowAsButton()); + isSignupEnabled(other.getIsSignupEnabled()); + organizationAccessLevel(other.getOrganizationAccessLevel()); + isEnabled(other.getIsEnabled()); + connectionId(other.getConnectionId()); + connection(other.getConnection()); + return this; + } + + /** + *

Connection identifier.

+ *

Connection identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("connection_id") + public _FinalStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage connection(OrganizationConnectionInformation connection) { + this.connection = Optional.ofNullable(connection); + return this; + } + + @java.lang.Override + @JsonSetter(value = "connection", nulls = Nulls.SKIP) + public _FinalStage connection(Optional connection) { + this.connection = connection; + return this; + } + + /** + *

Whether the connection is enabled for the organization.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isEnabled(Boolean isEnabled) { + this.isEnabled = Optional.ofNullable(isEnabled); + return this; + } + + /** + *

Whether the connection is enabled for the organization.

+ */ + @java.lang.Override + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public _FinalStage isEnabled(Optional isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + @java.lang.Override + public _FinalStage organizationAccessLevel(OrganizationAccessLevelEnum organizationAccessLevel) { + this.organizationAccessLevel = Optional.ofNullable(organizationAccessLevel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "organization_access_level", nulls = Nulls.SKIP) + public _FinalStage organizationAccessLevel(Optional organizationAccessLevel) { + this.organizationAccessLevel = organizationAccessLevel; + return this; + } + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isSignupEnabled(Boolean isSignupEnabled) { + this.isSignupEnabled = Optional.ofNullable(isSignupEnabled); + return this; + } + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ */ + @java.lang.Override + @JsonSetter(value = "is_signup_enabled", nulls = Nulls.SKIP) + public _FinalStage isSignupEnabled(Optional isSignupEnabled) { + this.isSignupEnabled = isSignupEnabled; + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + @java.lang.Override + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public _FinalStage showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin) { + this.assignMembershipOnLogin = Optional.ofNullable(assignMembershipOnLogin); + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + @java.lang.Override + @JsonSetter(value = "assign_membership_on_login", nulls = Nulls.SKIP) + public _FinalStage assignMembershipOnLogin(Optional assignMembershipOnLogin) { + this.assignMembershipOnLogin = assignMembershipOnLogin; + return this; + } + + /** + *

Name of the connection in the scope of this organization.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage organizationConnectionName(String organizationConnectionName) { + this.organizationConnectionName = Optional.ofNullable(organizationConnectionName); + return this; + } + + /** + *

Name of the connection in the scope of this organization.

+ */ + @java.lang.Override + @JsonSetter(value = "organization_connection_name", nulls = Nulls.SKIP) + public _FinalStage organizationConnectionName(Optional organizationConnectionName) { + this.organizationConnectionName = organizationConnectionName; + return this; + } + + @java.lang.Override + public GetOrganizationAllConnectionResponseContent build() { + return new GetOrganizationAllConnectionResponseContent( + organizationConnectionName, + assignMembershipOnLogin, + showAsButton, + isSignupEnabled, + organizationAccessLevel, + isEnabled, + connectionId, + connection, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/IConnectionOptionsCommonOidc.java b/src/main/java/com/auth0/client/mgmt/types/IConnectionOptionsCommonOidc.java index efcaeaf8d..81697eb4f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/IConnectionOptionsCommonOidc.java +++ b/src/main/java/com/auth0/client/mgmt/types/IConnectionOptionsCommonOidc.java @@ -19,6 +19,8 @@ public interface IConnectionOptionsCommonOidc { Optional> getDomainAliases(); + Optional getDpopSigningAlg(); + OptionalNullable getFederatedConnectionsAccessTokens(); Optional getIconUrl(); diff --git a/src/main/java/com/auth0/client/mgmt/types/IdentityProviderEnum.java b/src/main/java/com/auth0/client/mgmt/types/IdentityProviderEnum.java index b0f517830..31c8b2ab0 100644 --- a/src/main/java/com/auth0/client/mgmt/types/IdentityProviderEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/IdentityProviderEnum.java @@ -13,8 +13,6 @@ public final class IdentityProviderEnum { public static final IdentityProviderEnum DWOLLA = new IdentityProviderEnum(Value.DWOLLA, "dwolla"); - public static final IdentityProviderEnum FLICKR = new IdentityProviderEnum(Value.FLICKR, "flickr"); - public static final IdentityProviderEnum OKTA = new IdentityProviderEnum(Value.OKTA, "okta"); public static final IdentityProviderEnum PLANNINGCENTER = @@ -165,8 +163,6 @@ public T visit(Visitor visitor) { return visitor.visitAuth0Oidc(); case DWOLLA: return visitor.visitDwolla(); - case FLICKR: - return visitor.visitFlickr(); case OKTA: return visitor.visitOkta(); case PLANNINGCENTER: @@ -286,8 +282,6 @@ public static IdentityProviderEnum valueOf(String value) { return AUTH0OIDC; case "dwolla": return DWOLLA; - case "flickr": - return FLICKR; case "okta": return OKTA; case "planningcenter": @@ -438,8 +432,6 @@ public enum Value { FITBIT, - FLICKR, - GITHUB, GOOGLE_APPS, @@ -554,8 +546,6 @@ public interface Visitor { T visitFitbit(); - T visitFlickr(); - T visitGithub(); T visitGoogleApps(); diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationAllConnectionsOffsetPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationAllConnectionsOffsetPaginatedResponseContent.java new file mode 100644 index 000000000..c987542e2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationAllConnectionsOffsetPaginatedResponseContent.java @@ -0,0 +1,182 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListOrganizationAllConnectionsOffsetPaginatedResponseContent.Builder.class) +public final class ListOrganizationAllConnectionsOffsetPaginatedResponseContent { + private final Optional start; + + private final Optional limit; + + private final Optional total; + + private final Optional> connections; + + private final Map additionalProperties; + + private ListOrganizationAllConnectionsOffsetPaginatedResponseContent( + Optional start, + Optional limit, + Optional total, + Optional> connections, + Map additionalProperties) { + this.start = start; + this.limit = limit; + this.total = total; + this.connections = connections; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start") + public Optional getStart() { + return start; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("connections") + public Optional> getConnections() { + return connections; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListOrganizationAllConnectionsOffsetPaginatedResponseContent + && equalTo((ListOrganizationAllConnectionsOffsetPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListOrganizationAllConnectionsOffsetPaginatedResponseContent other) { + return start.equals(other.start) + && limit.equals(other.limit) + && total.equals(other.total) + && connections.equals(other.connections); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.start, this.limit, this.total, this.connections); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> connections = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListOrganizationAllConnectionsOffsetPaginatedResponseContent other) { + start(other.getStart()); + limit(other.getLimit()); + total(other.getTotal()); + connections(other.getConnections()); + return this; + } + + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(Double start) { + this.start = Optional.ofNullable(start); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "connections", nulls = Nulls.SKIP) + public Builder connections(Optional> connections) { + this.connections = connections; + return this; + } + + public Builder connections(List connections) { + this.connections = Optional.ofNullable(connections); + return this; + } + + public ListOrganizationAllConnectionsOffsetPaginatedResponseContent build() { + return new ListOrganizationAllConnectionsOffsetPaginatedResponseContent( + start, limit, total, connections, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationAccessLevelEnum.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationAccessLevelEnum.java new file mode 100644 index 000000000..936ba5f11 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationAccessLevelEnum.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class OrganizationAccessLevelEnum { + public static final OrganizationAccessLevelEnum READONLY = + new OrganizationAccessLevelEnum(Value.READONLY, "readonly"); + + public static final OrganizationAccessLevelEnum FULL = new OrganizationAccessLevelEnum(Value.FULL, "full"); + + public static final OrganizationAccessLevelEnum LIMITED = new OrganizationAccessLevelEnum(Value.LIMITED, "limited"); + + public static final OrganizationAccessLevelEnum NONE = new OrganizationAccessLevelEnum(Value.NONE, "none"); + + private final Value value; + + private final String string; + + OrganizationAccessLevelEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof OrganizationAccessLevelEnum + && this.string.equals(((OrganizationAccessLevelEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case READONLY: + return visitor.visitReadonly(); + case FULL: + return visitor.visitFull(); + case LIMITED: + return visitor.visitLimited(); + case NONE: + return visitor.visitNone(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static OrganizationAccessLevelEnum valueOf(String value) { + switch (value) { + case "readonly": + return READONLY; + case "full": + return FULL; + case "limited": + return LIMITED; + case "none": + return NONE; + default: + return new OrganizationAccessLevelEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + NONE, + + READONLY, + + LIMITED, + + FULL, + + UNKNOWN + } + + public interface Visitor { + T visitNone(); + + T visitReadonly(); + + T visitLimited(); + + T visitFull(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationAccessLevelEnumWithNull.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationAccessLevelEnumWithNull.java new file mode 100644 index 000000000..c0c550ee6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationAccessLevelEnumWithNull.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class OrganizationAccessLevelEnumWithNull { + public static final OrganizationAccessLevelEnumWithNull READONLY = + new OrganizationAccessLevelEnumWithNull(Value.READONLY, "readonly"); + + public static final OrganizationAccessLevelEnumWithNull FULL = + new OrganizationAccessLevelEnumWithNull(Value.FULL, "full"); + + public static final OrganizationAccessLevelEnumWithNull LIMITED = + new OrganizationAccessLevelEnumWithNull(Value.LIMITED, "limited"); + + public static final OrganizationAccessLevelEnumWithNull NONE = + new OrganizationAccessLevelEnumWithNull(Value.NONE, "none"); + + private final Value value; + + private final String string; + + OrganizationAccessLevelEnumWithNull(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof OrganizationAccessLevelEnumWithNull + && this.string.equals(((OrganizationAccessLevelEnumWithNull) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case READONLY: + return visitor.visitReadonly(); + case FULL: + return visitor.visitFull(); + case LIMITED: + return visitor.visitLimited(); + case NONE: + return visitor.visitNone(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static OrganizationAccessLevelEnumWithNull valueOf(String value) { + switch (value) { + case "readonly": + return READONLY; + case "full": + return FULL; + case "limited": + return LIMITED; + case "none": + return NONE; + default: + return new OrganizationAccessLevelEnumWithNull(Value.UNKNOWN, value); + } + } + + public enum Value { + NONE, + + READONLY, + + LIMITED, + + FULL, + + UNKNOWN + } + + public interface Visitor { + T visitNone(); + + T visitReadonly(); + + T visitLimited(); + + T visitFull(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationAllConnectionPost.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationAllConnectionPost.java new file mode 100644 index 000000000..14de55cac --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationAllConnectionPost.java @@ -0,0 +1,425 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = OrganizationAllConnectionPost.Builder.class) +public final class OrganizationAllConnectionPost { + private final Optional organizationConnectionName; + + private final Optional assignMembershipOnLogin; + + private final Optional showAsButton; + + private final Optional isSignupEnabled; + + private final Optional organizationAccessLevel; + + private final Optional isEnabled; + + private final String connectionId; + + private final Optional connection; + + private final Map additionalProperties; + + private OrganizationAllConnectionPost( + Optional organizationConnectionName, + Optional assignMembershipOnLogin, + Optional showAsButton, + Optional isSignupEnabled, + Optional organizationAccessLevel, + Optional isEnabled, + String connectionId, + Optional connection, + Map additionalProperties) { + this.organizationConnectionName = organizationConnectionName; + this.assignMembershipOnLogin = assignMembershipOnLogin; + this.showAsButton = showAsButton; + this.isSignupEnabled = isSignupEnabled; + this.organizationAccessLevel = organizationAccessLevel; + this.isEnabled = isEnabled; + this.connectionId = connectionId; + this.connection = connection; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of the connection in the scope of this organization. + */ + @JsonProperty("organization_connection_name") + public Optional getOrganizationConnectionName() { + return organizationConnectionName; + } + + /** + * @return When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection. + */ + @JsonProperty("assign_membership_on_login") + public Optional getAssignMembershipOnLogin() { + return assignMembershipOnLogin; + } + + /** + * @return Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true. + */ + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + /** + * @return Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false. + */ + @JsonProperty("is_signup_enabled") + public Optional getIsSignupEnabled() { + return isSignupEnabled; + } + + @JsonProperty("organization_access_level") + public Optional getOrganizationAccessLevel() { + return organizationAccessLevel; + } + + /** + * @return Whether the connection is enabled for the organization. + */ + @JsonProperty("is_enabled") + public Optional getIsEnabled() { + return isEnabled; + } + + /** + * @return Connection identifier. + */ + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("connection") + public Optional getConnection() { + return connection; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OrganizationAllConnectionPost && equalTo((OrganizationAllConnectionPost) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OrganizationAllConnectionPost other) { + return organizationConnectionName.equals(other.organizationConnectionName) + && assignMembershipOnLogin.equals(other.assignMembershipOnLogin) + && showAsButton.equals(other.showAsButton) + && isSignupEnabled.equals(other.isSignupEnabled) + && organizationAccessLevel.equals(other.organizationAccessLevel) + && isEnabled.equals(other.isEnabled) + && connectionId.equals(other.connectionId) + && connection.equals(other.connection); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.organizationConnectionName, + this.assignMembershipOnLogin, + this.showAsButton, + this.isSignupEnabled, + this.organizationAccessLevel, + this.isEnabled, + this.connectionId, + this.connection); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + /** + *

Connection identifier.

+ */ + _FinalStage connectionId(@NotNull String connectionId); + + Builder from(OrganizationAllConnectionPost other); + } + + public interface _FinalStage { + OrganizationAllConnectionPost build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

Name of the connection in the scope of this organization.

+ */ + _FinalStage organizationConnectionName(Optional organizationConnectionName); + + _FinalStage organizationConnectionName(String organizationConnectionName); + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + _FinalStage assignMembershipOnLogin(Optional assignMembershipOnLogin); + + _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin); + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + _FinalStage showAsButton(Optional showAsButton); + + _FinalStage showAsButton(Boolean showAsButton); + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ */ + _FinalStage isSignupEnabled(Optional isSignupEnabled); + + _FinalStage isSignupEnabled(Boolean isSignupEnabled); + + _FinalStage organizationAccessLevel(Optional organizationAccessLevel); + + _FinalStage organizationAccessLevel(OrganizationAccessLevelEnum organizationAccessLevel); + + /** + *

Whether the connection is enabled for the organization.

+ */ + _FinalStage isEnabled(Optional isEnabled); + + _FinalStage isEnabled(Boolean isEnabled); + + _FinalStage connection(Optional connection); + + _FinalStage connection(OrganizationConnectionInformation connection); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, _FinalStage { + private String connectionId; + + private Optional connection = Optional.empty(); + + private Optional isEnabled = Optional.empty(); + + private Optional organizationAccessLevel = Optional.empty(); + + private Optional isSignupEnabled = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional assignMembershipOnLogin = Optional.empty(); + + private Optional organizationConnectionName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(OrganizationAllConnectionPost other) { + organizationConnectionName(other.getOrganizationConnectionName()); + assignMembershipOnLogin(other.getAssignMembershipOnLogin()); + showAsButton(other.getShowAsButton()); + isSignupEnabled(other.getIsSignupEnabled()); + organizationAccessLevel(other.getOrganizationAccessLevel()); + isEnabled(other.getIsEnabled()); + connectionId(other.getConnectionId()); + connection(other.getConnection()); + return this; + } + + /** + *

Connection identifier.

+ *

Connection identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("connection_id") + public _FinalStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage connection(OrganizationConnectionInformation connection) { + this.connection = Optional.ofNullable(connection); + return this; + } + + @java.lang.Override + @JsonSetter(value = "connection", nulls = Nulls.SKIP) + public _FinalStage connection(Optional connection) { + this.connection = connection; + return this; + } + + /** + *

Whether the connection is enabled for the organization.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isEnabled(Boolean isEnabled) { + this.isEnabled = Optional.ofNullable(isEnabled); + return this; + } + + /** + *

Whether the connection is enabled for the organization.

+ */ + @java.lang.Override + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public _FinalStage isEnabled(Optional isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + @java.lang.Override + public _FinalStage organizationAccessLevel(OrganizationAccessLevelEnum organizationAccessLevel) { + this.organizationAccessLevel = Optional.ofNullable(organizationAccessLevel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "organization_access_level", nulls = Nulls.SKIP) + public _FinalStage organizationAccessLevel(Optional organizationAccessLevel) { + this.organizationAccessLevel = organizationAccessLevel; + return this; + } + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isSignupEnabled(Boolean isSignupEnabled) { + this.isSignupEnabled = Optional.ofNullable(isSignupEnabled); + return this; + } + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ */ + @java.lang.Override + @JsonSetter(value = "is_signup_enabled", nulls = Nulls.SKIP) + public _FinalStage isSignupEnabled(Optional isSignupEnabled) { + this.isSignupEnabled = isSignupEnabled; + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + @java.lang.Override + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public _FinalStage showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin) { + this.assignMembershipOnLogin = Optional.ofNullable(assignMembershipOnLogin); + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + @java.lang.Override + @JsonSetter(value = "assign_membership_on_login", nulls = Nulls.SKIP) + public _FinalStage assignMembershipOnLogin(Optional assignMembershipOnLogin) { + this.assignMembershipOnLogin = assignMembershipOnLogin; + return this; + } + + /** + *

Name of the connection in the scope of this organization.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage organizationConnectionName(String organizationConnectionName) { + this.organizationConnectionName = Optional.ofNullable(organizationConnectionName); + return this; + } + + /** + *

Name of the connection in the scope of this organization.

+ */ + @java.lang.Override + @JsonSetter(value = "organization_connection_name", nulls = Nulls.SKIP) + public _FinalStage organizationConnectionName(Optional organizationConnectionName) { + this.organizationConnectionName = organizationConnectionName; + return this; + } + + @java.lang.Override + public OrganizationAllConnectionPost build() { + return new OrganizationAllConnectionPost( + organizationConnectionName, + assignMembershipOnLogin, + showAsButton, + isSignupEnabled, + organizationAccessLevel, + isEnabled, + connectionId, + connection, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SynchronizeGroupsEaEnum.java b/src/main/java/com/auth0/client/mgmt/types/SynchronizeGroupsEnum.java similarity index 74% rename from src/main/java/com/auth0/client/mgmt/types/SynchronizeGroupsEaEnum.java rename to src/main/java/com/auth0/client/mgmt/types/SynchronizeGroupsEnum.java index 8e27f3a8c..0cd7b8339 100644 --- a/src/main/java/com/auth0/client/mgmt/types/SynchronizeGroupsEaEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/SynchronizeGroupsEnum.java @@ -6,16 +6,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -public final class SynchronizeGroupsEaEnum { - public static final SynchronizeGroupsEaEnum ALL = new SynchronizeGroupsEaEnum(Value.ALL, "all"); +public final class SynchronizeGroupsEnum { + public static final SynchronizeGroupsEnum ALL = new SynchronizeGroupsEnum(Value.ALL, "all"); - public static final SynchronizeGroupsEaEnum OFF = new SynchronizeGroupsEaEnum(Value.OFF, "off"); + public static final SynchronizeGroupsEnum OFF = new SynchronizeGroupsEnum(Value.OFF, "off"); private final Value value; private final String string; - SynchronizeGroupsEaEnum(Value value, String string) { + SynchronizeGroupsEnum(Value value, String string) { this.value = value; this.string = string; } @@ -33,8 +33,8 @@ public String toString() { @java.lang.Override public boolean equals(Object other) { return (this == other) - || (other instanceof SynchronizeGroupsEaEnum - && this.string.equals(((SynchronizeGroupsEaEnum) other).string)); + || (other instanceof SynchronizeGroupsEnum + && this.string.equals(((SynchronizeGroupsEnum) other).string)); } @java.lang.Override @@ -55,14 +55,14 @@ public T visit(Visitor visitor) { } @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - public static SynchronizeGroupsEaEnum valueOf(String value) { + public static SynchronizeGroupsEnum valueOf(String value) { switch (value) { case "all": return ALL; case "off": return OFF; default: - return new SynchronizeGroupsEaEnum(Value.UNKNOWN, value); + return new SynchronizeGroupsEnum(Value.UNKNOWN, value); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionRequestContentFlickr.java b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionRequestContentFlickr.java deleted file mode 100644 index feb47f369..000000000 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionRequestContentFlickr.java +++ /dev/null @@ -1,212 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.auth0.client.mgmt.types; - -import com.auth0.client.mgmt.core.ObjectMappers; -import com.auth0.client.mgmt.core.OptionalNullable; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = UpdateConnectionRequestContentFlickr.Builder.class) -public final class UpdateConnectionRequestContentFlickr implements IConnectionCommon { - private final Optional displayName; - - private final Optional> enabledClients; - - private final Optional isDomainConnection; - - private final Optional>> metadata; - - private final Optional options; - - private final Map additionalProperties; - - private UpdateConnectionRequestContentFlickr( - Optional displayName, - Optional> enabledClients, - Optional isDomainConnection, - Optional>> metadata, - Optional options, - Map additionalProperties) { - this.displayName = displayName; - this.enabledClients = enabledClients; - this.isDomainConnection = isDomainConnection; - this.metadata = metadata; - this.options = options; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("display_name") - @java.lang.Override - public Optional getDisplayName() { - return displayName; - } - - @JsonProperty("enabled_clients") - @java.lang.Override - public Optional> getEnabledClients() { - return enabledClients; - } - - @JsonProperty("is_domain_connection") - @java.lang.Override - public Optional getIsDomainConnection() { - return isDomainConnection; - } - - @JsonProperty("metadata") - @java.lang.Override - public Optional>> getMetadata() { - return metadata; - } - - @JsonProperty("options") - public Optional getOptions() { - return options; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof UpdateConnectionRequestContentFlickr - && equalTo((UpdateConnectionRequestContentFlickr) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(UpdateConnectionRequestContentFlickr other) { - return displayName.equals(other.displayName) - && enabledClients.equals(other.enabledClients) - && isDomainConnection.equals(other.isDomainConnection) - && metadata.equals(other.metadata) - && options.equals(other.options); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.displayName, this.enabledClients, this.isDomainConnection, this.metadata, this.options); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional displayName = Optional.empty(); - - private Optional> enabledClients = Optional.empty(); - - private Optional isDomainConnection = Optional.empty(); - - private Optional>> metadata = Optional.empty(); - - private Optional options = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(UpdateConnectionRequestContentFlickr other) { - displayName(other.getDisplayName()); - enabledClients(other.getEnabledClients()); - isDomainConnection(other.getIsDomainConnection()); - metadata(other.getMetadata()); - options(other.getOptions()); - return this; - } - - @JsonSetter(value = "display_name", nulls = Nulls.SKIP) - public Builder displayName(Optional displayName) { - this.displayName = displayName; - return this; - } - - public Builder displayName(String displayName) { - this.displayName = Optional.ofNullable(displayName); - return this; - } - - @JsonSetter(value = "enabled_clients", nulls = Nulls.SKIP) - public Builder enabledClients(Optional> enabledClients) { - this.enabledClients = enabledClients; - return this; - } - - public Builder enabledClients(List enabledClients) { - this.enabledClients = Optional.ofNullable(enabledClients); - return this; - } - - @JsonSetter(value = "is_domain_connection", nulls = Nulls.SKIP) - public Builder isDomainConnection(Optional isDomainConnection) { - this.isDomainConnection = isDomainConnection; - return this; - } - - public Builder isDomainConnection(Boolean isDomainConnection) { - this.isDomainConnection = Optional.ofNullable(isDomainConnection); - return this; - } - - @JsonSetter(value = "metadata", nulls = Nulls.SKIP) - public Builder metadata(Optional>> metadata) { - this.metadata = metadata; - return this; - } - - public Builder metadata(Map> metadata) { - this.metadata = Optional.ofNullable(metadata); - return this; - } - - @JsonSetter(value = "options", nulls = Nulls.SKIP) - public Builder options(Optional options) { - this.options = options; - return this; - } - - public Builder options(ConnectionOptionsFlickr options) { - this.options = Optional.ofNullable(options); - return this; - } - - public UpdateConnectionRequestContentFlickr build() { - return new UpdateConnectionRequestContentFlickr( - displayName, enabledClients, isDomainConnection, metadata, options, additionalProperties); - } - - public Builder additionalProperty(String key, Object value) { - this.additionalProperties.put(key, value); - return this; - } - - public Builder additionalProperties(Map additionalProperties) { - this.additionalProperties.putAll(additionalProperties); - return this; - } - } -} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningRequestContent.java index 7190a4cd3..cbf14575a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningRequestContent.java @@ -25,14 +25,14 @@ public final class UpdateDirectoryProvisioningRequestContent { private final Optional synchronizeAutomatically; - private final Optional synchronizeGroups; + private final Optional synchronizeGroups; private final Map additionalProperties; private UpdateDirectoryProvisioningRequestContent( Optional> mapping, Optional synchronizeAutomatically, - Optional synchronizeGroups, + Optional synchronizeGroups, Map additionalProperties) { this.mapping = mapping; this.synchronizeAutomatically = synchronizeAutomatically; @@ -57,7 +57,7 @@ public Optional getSynchronizeAutomatically() { } @JsonProperty("synchronize_groups") - public Optional getSynchronizeGroups() { + public Optional getSynchronizeGroups() { return synchronizeGroups; } @@ -99,7 +99,7 @@ public static final class Builder { private Optional synchronizeAutomatically = Optional.empty(); - private Optional synchronizeGroups = Optional.empty(); + private Optional synchronizeGroups = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -142,12 +142,12 @@ public Builder synchronizeAutomatically(Boolean synchronizeAutomatically) { } @JsonSetter(value = "synchronize_groups", nulls = Nulls.SKIP) - public Builder synchronizeGroups(Optional synchronizeGroups) { + public Builder synchronizeGroups(Optional synchronizeGroups) { this.synchronizeGroups = synchronizeGroups; return this; } - public Builder synchronizeGroups(String synchronizeGroups) { + public Builder synchronizeGroups(SynchronizeGroupsEnum synchronizeGroups) { this.synchronizeGroups = Optional.ofNullable(synchronizeGroups); return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningResponseContent.java index dd9ecff07..75dfb1d00 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateDirectoryProvisioningResponseContent.java @@ -34,7 +34,7 @@ public final class UpdateDirectoryProvisioningResponseContent { private final boolean synchronizeAutomatically; - private final Optional synchronizeGroups; + private final Optional synchronizeGroups; private final OffsetDateTime createdAt; @@ -54,7 +54,7 @@ private UpdateDirectoryProvisioningResponseContent( String strategy, List mapping, boolean synchronizeAutomatically, - Optional synchronizeGroups, + Optional synchronizeGroups, OffsetDateTime createdAt, OffsetDateTime updatedAt, Optional lastSynchronizationAt, @@ -116,7 +116,7 @@ public boolean getSynchronizeAutomatically() { } @JsonProperty("synchronize_groups") - public Optional getSynchronizeGroups() { + public Optional getSynchronizeGroups() { return synchronizeGroups; } @@ -271,9 +271,9 @@ public interface _FinalStage { _FinalStage addAllMapping(List mapping); - _FinalStage synchronizeGroups(Optional synchronizeGroups); + _FinalStage synchronizeGroups(Optional synchronizeGroups); - _FinalStage synchronizeGroups(String synchronizeGroups); + _FinalStage synchronizeGroups(SynchronizeGroupsEnum synchronizeGroups); /** *

The timestamp at which the connection was last synchronized

@@ -324,7 +324,7 @@ public static final class Builder private Optional lastSynchronizationAt = Optional.empty(); - private Optional synchronizeGroups = Optional.empty(); + private Optional synchronizeGroups = Optional.empty(); private List mapping = new ArrayList<>(); @@ -482,14 +482,14 @@ public _FinalStage lastSynchronizationAt(Optional lastSynchroniz } @java.lang.Override - public _FinalStage synchronizeGroups(String synchronizeGroups) { + public _FinalStage synchronizeGroups(SynchronizeGroupsEnum synchronizeGroups) { this.synchronizeGroups = Optional.ofNullable(synchronizeGroups); return this; } @java.lang.Override @JsonSetter(value = "synchronize_groups", nulls = Nulls.SKIP) - public _FinalStage synchronizeGroups(Optional synchronizeGroups) { + public _FinalStage synchronizeGroups(Optional synchronizeGroups) { this.synchronizeGroups = synchronizeGroups; return this; } diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationAllConnectionResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationAllConnectionResponseContent.java new file mode 100644 index 000000000..c73c1e9fc --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationAllConnectionResponseContent.java @@ -0,0 +1,426 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateOrganizationAllConnectionResponseContent.Builder.class) +public final class UpdateOrganizationAllConnectionResponseContent { + private final Optional organizationConnectionName; + + private final Optional assignMembershipOnLogin; + + private final Optional showAsButton; + + private final Optional isSignupEnabled; + + private final Optional organizationAccessLevel; + + private final Optional isEnabled; + + private final String connectionId; + + private final Optional connection; + + private final Map additionalProperties; + + private UpdateOrganizationAllConnectionResponseContent( + Optional organizationConnectionName, + Optional assignMembershipOnLogin, + Optional showAsButton, + Optional isSignupEnabled, + Optional organizationAccessLevel, + Optional isEnabled, + String connectionId, + Optional connection, + Map additionalProperties) { + this.organizationConnectionName = organizationConnectionName; + this.assignMembershipOnLogin = assignMembershipOnLogin; + this.showAsButton = showAsButton; + this.isSignupEnabled = isSignupEnabled; + this.organizationAccessLevel = organizationAccessLevel; + this.isEnabled = isEnabled; + this.connectionId = connectionId; + this.connection = connection; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of the connection in the scope of this organization. + */ + @JsonProperty("organization_connection_name") + public Optional getOrganizationConnectionName() { + return organizationConnectionName; + } + + /** + * @return When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection. + */ + @JsonProperty("assign_membership_on_login") + public Optional getAssignMembershipOnLogin() { + return assignMembershipOnLogin; + } + + /** + * @return Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true. + */ + @JsonProperty("show_as_button") + public Optional getShowAsButton() { + return showAsButton; + } + + /** + * @return Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false. + */ + @JsonProperty("is_signup_enabled") + public Optional getIsSignupEnabled() { + return isSignupEnabled; + } + + @JsonProperty("organization_access_level") + public Optional getOrganizationAccessLevel() { + return organizationAccessLevel; + } + + /** + * @return Whether the connection is enabled for the organization. + */ + @JsonProperty("is_enabled") + public Optional getIsEnabled() { + return isEnabled; + } + + /** + * @return Connection identifier. + */ + @JsonProperty("connection_id") + public String getConnectionId() { + return connectionId; + } + + @JsonProperty("connection") + public Optional getConnection() { + return connection; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateOrganizationAllConnectionResponseContent + && equalTo((UpdateOrganizationAllConnectionResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateOrganizationAllConnectionResponseContent other) { + return organizationConnectionName.equals(other.organizationConnectionName) + && assignMembershipOnLogin.equals(other.assignMembershipOnLogin) + && showAsButton.equals(other.showAsButton) + && isSignupEnabled.equals(other.isSignupEnabled) + && organizationAccessLevel.equals(other.organizationAccessLevel) + && isEnabled.equals(other.isEnabled) + && connectionId.equals(other.connectionId) + && connection.equals(other.connection); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.organizationConnectionName, + this.assignMembershipOnLogin, + this.showAsButton, + this.isSignupEnabled, + this.organizationAccessLevel, + this.isEnabled, + this.connectionId, + this.connection); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectionIdStage builder() { + return new Builder(); + } + + public interface ConnectionIdStage { + /** + *

Connection identifier.

+ */ + _FinalStage connectionId(@NotNull String connectionId); + + Builder from(UpdateOrganizationAllConnectionResponseContent other); + } + + public interface _FinalStage { + UpdateOrganizationAllConnectionResponseContent build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

Name of the connection in the scope of this organization.

+ */ + _FinalStage organizationConnectionName(Optional organizationConnectionName); + + _FinalStage organizationConnectionName(String organizationConnectionName); + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + _FinalStage assignMembershipOnLogin(Optional assignMembershipOnLogin); + + _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin); + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + _FinalStage showAsButton(Optional showAsButton); + + _FinalStage showAsButton(Boolean showAsButton); + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ */ + _FinalStage isSignupEnabled(Optional isSignupEnabled); + + _FinalStage isSignupEnabled(Boolean isSignupEnabled); + + _FinalStage organizationAccessLevel(Optional organizationAccessLevel); + + _FinalStage organizationAccessLevel(OrganizationAccessLevelEnum organizationAccessLevel); + + /** + *

Whether the connection is enabled for the organization.

+ */ + _FinalStage isEnabled(Optional isEnabled); + + _FinalStage isEnabled(Boolean isEnabled); + + _FinalStage connection(Optional connection); + + _FinalStage connection(OrganizationConnectionInformation connection); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectionIdStage, _FinalStage { + private String connectionId; + + private Optional connection = Optional.empty(); + + private Optional isEnabled = Optional.empty(); + + private Optional organizationAccessLevel = Optional.empty(); + + private Optional isSignupEnabled = Optional.empty(); + + private Optional showAsButton = Optional.empty(); + + private Optional assignMembershipOnLogin = Optional.empty(); + + private Optional organizationConnectionName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdateOrganizationAllConnectionResponseContent other) { + organizationConnectionName(other.getOrganizationConnectionName()); + assignMembershipOnLogin(other.getAssignMembershipOnLogin()); + showAsButton(other.getShowAsButton()); + isSignupEnabled(other.getIsSignupEnabled()); + organizationAccessLevel(other.getOrganizationAccessLevel()); + isEnabled(other.getIsEnabled()); + connectionId(other.getConnectionId()); + connection(other.getConnection()); + return this; + } + + /** + *

Connection identifier.

+ *

Connection identifier.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("connection_id") + public _FinalStage connectionId(@NotNull String connectionId) { + this.connectionId = Objects.requireNonNull(connectionId, "connectionId must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage connection(OrganizationConnectionInformation connection) { + this.connection = Optional.ofNullable(connection); + return this; + } + + @java.lang.Override + @JsonSetter(value = "connection", nulls = Nulls.SKIP) + public _FinalStage connection(Optional connection) { + this.connection = connection; + return this; + } + + /** + *

Whether the connection is enabled for the organization.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isEnabled(Boolean isEnabled) { + this.isEnabled = Optional.ofNullable(isEnabled); + return this; + } + + /** + *

Whether the connection is enabled for the organization.

+ */ + @java.lang.Override + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public _FinalStage isEnabled(Optional isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + @java.lang.Override + public _FinalStage organizationAccessLevel(OrganizationAccessLevelEnum organizationAccessLevel) { + this.organizationAccessLevel = Optional.ofNullable(organizationAccessLevel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "organization_access_level", nulls = Nulls.SKIP) + public _FinalStage organizationAccessLevel(Optional organizationAccessLevel) { + this.organizationAccessLevel = organizationAccessLevel; + return this; + } + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isSignupEnabled(Boolean isSignupEnabled) { + this.isSignupEnabled = Optional.ofNullable(isSignupEnabled); + return this; + } + + /** + *

Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.

+ */ + @java.lang.Override + @JsonSetter(value = "is_signup_enabled", nulls = Nulls.SKIP) + public _FinalStage isSignupEnabled(Optional isSignupEnabled) { + this.isSignupEnabled = isSignupEnabled; + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage showAsButton(Boolean showAsButton) { + this.showAsButton = Optional.ofNullable(showAsButton); + return this; + } + + /** + *

Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.

+ */ + @java.lang.Override + @JsonSetter(value = "show_as_button", nulls = Nulls.SKIP) + public _FinalStage showAsButton(Optional showAsButton) { + this.showAsButton = showAsButton; + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage assignMembershipOnLogin(Boolean assignMembershipOnLogin) { + this.assignMembershipOnLogin = Optional.ofNullable(assignMembershipOnLogin); + return this; + } + + /** + *

When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.

+ */ + @java.lang.Override + @JsonSetter(value = "assign_membership_on_login", nulls = Nulls.SKIP) + public _FinalStage assignMembershipOnLogin(Optional assignMembershipOnLogin) { + this.assignMembershipOnLogin = assignMembershipOnLogin; + return this; + } + + /** + *

Name of the connection in the scope of this organization.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage organizationConnectionName(String organizationConnectionName) { + this.organizationConnectionName = Optional.ofNullable(organizationConnectionName); + return this; + } + + /** + *

Name of the connection in the scope of this organization.

+ */ + @java.lang.Override + @JsonSetter(value = "organization_connection_name", nulls = Nulls.SKIP) + public _FinalStage organizationConnectionName(Optional organizationConnectionName) { + this.organizationConnectionName = organizationConnectionName; + return this; + } + + @java.lang.Override + public UpdateOrganizationAllConnectionResponseContent build() { + return new UpdateOrganizationAllConnectionResponseContent( + organizationConnectionName, + assignMembershipOnLogin, + showAsButton, + isSignupEnabled, + organizationAccessLevel, + isEnabled, + connectionId, + connection, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UserIdentityProviderEnum.java b/src/main/java/com/auth0/client/mgmt/types/UserIdentityProviderEnum.java index 56a593463..4897abd71 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserIdentityProviderEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserIdentityProviderEnum.java @@ -14,8 +14,6 @@ public final class UserIdentityProviderEnum { public static final UserIdentityProviderEnum DWOLLA = new UserIdentityProviderEnum(Value.DWOLLA, "dwolla"); - public static final UserIdentityProviderEnum FLICKR = new UserIdentityProviderEnum(Value.FLICKR, "flickr"); - public static final UserIdentityProviderEnum OKTA = new UserIdentityProviderEnum(Value.OKTA, "okta"); public static final UserIdentityProviderEnum PLANNINGCENTER = @@ -172,8 +170,6 @@ public T visit(Visitor visitor) { return visitor.visitAuth0Oidc(); case DWOLLA: return visitor.visitDwolla(); - case FLICKR: - return visitor.visitFlickr(); case OKTA: return visitor.visitOkta(); case PLANNINGCENTER: @@ -293,8 +289,6 @@ public static UserIdentityProviderEnum valueOf(String value) { return AUTH0OIDC; case "dwolla": return DWOLLA; - case "flickr": - return FLICKR; case "okta": return OKTA; case "planningcenter": @@ -445,8 +439,6 @@ public enum Value { FITBIT, - FLICKR, - GITHUB, GOOGLE_APPS, @@ -561,8 +553,6 @@ public interface Visitor { T visitFitbit(); - T visitFlickr(); - T visitGithub(); T visitGoogleApps(); diff --git a/src/test/java/com/auth0/client/mgmt/ConnectionsDirectoryProvisioningWireTest.java b/src/test/java/com/auth0/client/mgmt/ConnectionsDirectoryProvisioningWireTest.java index 5bfa36669..325839a3e 100644 --- a/src/test/java/com/auth0/client/mgmt/ConnectionsDirectoryProvisioningWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/ConnectionsDirectoryProvisioningWireTest.java @@ -45,7 +45,7 @@ public void testList() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"directory_provisionings\":[{\"connection_id\":\"connection_id\",\"connection_name\":\"connection_name\",\"strategy\":\"strategy\",\"mapping\":[{\"auth0\":\"auth0\",\"idp\":\"idp\"}],\"synchronize_automatically\":true,\"synchronize_groups\":\"synchronize_groups\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"last_synchronization_at\":\"2024-01-15T09:30:00Z\",\"last_synchronization_status\":\"last_synchronization_status\",\"last_synchronization_error\":\"last_synchronization_error\"}],\"next\":\"next\"}")); + "{\"directory_provisionings\":[{\"connection_id\":\"connection_id\",\"connection_name\":\"connection_name\",\"strategy\":\"strategy\",\"mapping\":[{\"auth0\":\"auth0\",\"idp\":\"idp\"}],\"synchronize_automatically\":true,\"synchronize_groups\":\"all\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"last_synchronization_at\":\"2024-01-15T09:30:00Z\",\"last_synchronization_status\":\"last_synchronization_status\",\"last_synchronization_error\":\"last_synchronization_error\"}],\"next\":\"next\"}")); SyncPagingIterable response = client.connections() .directoryProvisioning() .list(ListDirectoryProvisioningsRequestParameters.builder() @@ -68,7 +68,7 @@ public void testGet() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"connection_id\":\"connection_id\",\"connection_name\":\"connection_name\",\"strategy\":\"strategy\",\"mapping\":[{\"auth0\":\"auth0\",\"idp\":\"idp\"}],\"synchronize_automatically\":true,\"synchronize_groups\":\"synchronize_groups\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"last_synchronization_at\":\"2024-01-15T09:30:00Z\",\"last_synchronization_status\":\"last_synchronization_status\",\"last_synchronization_error\":\"last_synchronization_error\"}")); + "{\"connection_id\":\"connection_id\",\"connection_name\":\"connection_name\",\"strategy\":\"strategy\",\"mapping\":[{\"auth0\":\"auth0\",\"idp\":\"idp\"}],\"synchronize_automatically\":true,\"synchronize_groups\":\"all\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"last_synchronization_at\":\"2024-01-15T09:30:00Z\",\"last_synchronization_status\":\"last_synchronization_status\",\"last_synchronization_error\":\"last_synchronization_error\"}")); GetDirectoryProvisioningResponseContent response = client.connections().directoryProvisioning().get("id"); RecordedRequest request = server.takeRequest(); @@ -90,7 +90,7 @@ public void testGet() throws Exception { + " }\n" + " ],\n" + " \"synchronize_automatically\": true,\n" - + " \"synchronize_groups\": \"synchronize_groups\",\n" + + " \"synchronize_groups\": \"all\",\n" + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + " \"last_synchronization_at\": \"2024-01-15T09:30:00Z\",\n" @@ -134,7 +134,7 @@ public void testCreate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"connection_id\":\"connection_id\",\"connection_name\":\"connection_name\",\"strategy\":\"strategy\",\"mapping\":[{\"auth0\":\"auth0\",\"idp\":\"idp\"}],\"synchronize_automatically\":true,\"synchronize_groups\":\"synchronize_groups\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"last_synchronization_at\":\"2024-01-15T09:30:00Z\",\"last_synchronization_status\":\"last_synchronization_status\",\"last_synchronization_error\":\"last_synchronization_error\"}")); + "{\"connection_id\":\"connection_id\",\"connection_name\":\"connection_name\",\"strategy\":\"strategy\",\"mapping\":[{\"auth0\":\"auth0\",\"idp\":\"idp\"}],\"synchronize_automatically\":true,\"synchronize_groups\":\"all\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"last_synchronization_at\":\"2024-01-15T09:30:00Z\",\"last_synchronization_status\":\"last_synchronization_status\",\"last_synchronization_error\":\"last_synchronization_error\"}")); CreateDirectoryProvisioningResponseContent response = client.connections().directoryProvisioning().create("id", OptionalNullable.absent()); RecordedRequest request = server.takeRequest(); @@ -156,7 +156,7 @@ public void testCreate() throws Exception { + " }\n" + " ],\n" + " \"synchronize_automatically\": true,\n" - + " \"synchronize_groups\": \"synchronize_groups\",\n" + + " \"synchronize_groups\": \"all\",\n" + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + " \"last_synchronization_at\": \"2024-01-15T09:30:00Z\",\n" @@ -209,7 +209,7 @@ public void testUpdate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"connection_id\":\"connection_id\",\"connection_name\":\"connection_name\",\"strategy\":\"strategy\",\"mapping\":[{\"auth0\":\"auth0\",\"idp\":\"idp\"}],\"synchronize_automatically\":true,\"synchronize_groups\":\"synchronize_groups\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"last_synchronization_at\":\"2024-01-15T09:30:00Z\",\"last_synchronization_status\":\"last_synchronization_status\",\"last_synchronization_error\":\"last_synchronization_error\"}")); + "{\"connection_id\":\"connection_id\",\"connection_name\":\"connection_name\",\"strategy\":\"strategy\",\"mapping\":[{\"auth0\":\"auth0\",\"idp\":\"idp\"}],\"synchronize_automatically\":true,\"synchronize_groups\":\"all\",\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\",\"last_synchronization_at\":\"2024-01-15T09:30:00Z\",\"last_synchronization_status\":\"last_synchronization_status\",\"last_synchronization_error\":\"last_synchronization_error\"}")); UpdateDirectoryProvisioningResponseContent response = client.connections().directoryProvisioning().update("id", OptionalNullable.absent()); RecordedRequest request = server.takeRequest(); @@ -231,7 +231,7 @@ public void testUpdate() throws Exception { + " }\n" + " ],\n" + " \"synchronize_automatically\": true,\n" - + " \"synchronize_groups\": \"synchronize_groups\",\n" + + " \"synchronize_groups\": \"all\",\n" + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" + " \"updated_at\": \"2024-01-15T09:30:00Z\",\n" + " \"last_synchronization_at\": \"2024-01-15T09:30:00Z\",\n" diff --git a/src/test/java/com/auth0/client/mgmt/OrganizationsConnectionsWireTest.java b/src/test/java/com/auth0/client/mgmt/OrganizationsConnectionsWireTest.java new file mode 100644 index 000000000..d66a2e69b --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/OrganizationsConnectionsWireTest.java @@ -0,0 +1,358 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.organizations.types.CreateOrganizationAllConnectionRequestParameters; +import com.auth0.client.mgmt.organizations.types.ListOrganizationAllConnectionsRequestParameters; +import com.auth0.client.mgmt.organizations.types.UpdateOrganizationConnectionRequestParameters; +import com.auth0.client.mgmt.types.CreateOrganizationAllConnectionResponseContent; +import com.auth0.client.mgmt.types.GetOrganizationAllConnectionResponseContent; +import com.auth0.client.mgmt.types.OrganizationAllConnectionPost; +import com.auth0.client.mgmt.types.UpdateOrganizationAllConnectionResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class OrganizationsConnectionsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testList() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"connections\":[{\"organization_connection_name\":\"organization_connection_name\",\"assign_membership_on_login\":true,\"show_as_button\":true,\"is_signup_enabled\":true,\"organization_access_level\":\"none\",\"is_enabled\":true,\"connection_id\":\"connection_id\"}]}")); + SyncPagingIterable response = client.organizations() + .connections() + .list( + "id", + ListOrganizationAllConnectionsRequestParameters.builder() + .page(OptionalNullable.of(1)) + .perPage(OptionalNullable.of(1)) + .includeTotals(OptionalNullable.of(true)) + .isEnabled(OptionalNullable.of(true)) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + + @Test + public void testCreate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"organization_connection_name\":\"organization_connection_name\",\"assign_membership_on_login\":true,\"show_as_button\":true,\"is_signup_enabled\":true,\"organization_access_level\":\"none\",\"is_enabled\":true,\"connection_id\":\"connection_id\",\"connection\":{\"name\":\"name\",\"strategy\":\"strategy\"}}")); + CreateOrganizationAllConnectionResponseContent response = client.organizations() + .connections() + .create( + "id", + CreateOrganizationAllConnectionRequestParameters.builder() + .connectionId("connection_id") + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"connection_id\": \"connection_id\"\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"organization_connection_name\": \"organization_connection_name\",\n" + + " \"assign_membership_on_login\": true,\n" + + " \"show_as_button\": true,\n" + + " \"is_signup_enabled\": true,\n" + + " \"organization_access_level\": \"none\",\n" + + " \"is_enabled\": true,\n" + + " \"connection_id\": \"connection_id\",\n" + + " \"connection\": {\n" + + " \"name\": \"name\",\n" + + " \"strategy\": \"strategy\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"organization_connection_name\":\"organization_connection_name\",\"assign_membership_on_login\":true,\"show_as_button\":true,\"is_signup_enabled\":true,\"organization_access_level\":\"none\",\"is_enabled\":true,\"connection_id\":\"connection_id\",\"connection\":{\"name\":\"name\",\"strategy\":\"strategy\"}}")); + GetOrganizationAllConnectionResponseContent response = + client.organizations().connections().get("id", "connection_id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"organization_connection_name\": \"organization_connection_name\",\n" + + " \"assign_membership_on_login\": true,\n" + + " \"show_as_button\": true,\n" + + " \"is_signup_enabled\": true,\n" + + " \"organization_access_level\": \"none\",\n" + + " \"is_enabled\": true,\n" + + " \"connection_id\": \"connection_id\",\n" + + " \"connection\": {\n" + + " \"name\": \"name\",\n" + + " \"strategy\": \"strategy\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.organizations().connections().delete("id", "connection_id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"organization_connection_name\":\"organization_connection_name\",\"assign_membership_on_login\":true,\"show_as_button\":true,\"is_signup_enabled\":true,\"organization_access_level\":\"none\",\"is_enabled\":true,\"connection_id\":\"connection_id\",\"connection\":{\"name\":\"name\",\"strategy\":\"strategy\"}}")); + UpdateOrganizationAllConnectionResponseContent response = client.organizations() + .connections() + .update( + "id", + "connection_id", + UpdateOrganizationConnectionRequestParameters.builder().build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"organization_connection_name\": \"organization_connection_name\",\n" + + " \"assign_membership_on_login\": true,\n" + + " \"show_as_button\": true,\n" + + " \"is_signup_enabled\": true,\n" + + " \"organization_access_level\": \"none\",\n" + + " \"is_enabled\": true,\n" + + " \"connection_id\": \"connection_id\",\n" + + " \"connection\": {\n" + + " \"name\": \"name\",\n" + + " \"strategy\": \"strategy\"\n" + + " }\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). + */ + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null || !jsonEquals(entry.getValue(), actualValue)) return false; + } + return true; + } + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; + } + return true; + } + return false; + } +}