listOrganizations(
- String id, ListTemplateOrganizationsRequestParameters request, RequestOptions requestOptions) {
- return this.rawClient.listOrganizations(id, request, requestOptions).body();
- }
-}
diff --git a/src/main/java/com/auth0/client/mgmt/OrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/OrganizationsClient.java
index 15b26958a..0ed3fd48e 100644
--- a/src/main/java/com/auth0/client/mgmt/OrganizationsClient.java
+++ b/src/main/java/com/auth0/client/mgmt/OrganizationsClient.java
@@ -23,6 +23,8 @@
import com.auth0.client.mgmt.types.GetOrganizationResponseContent;
import com.auth0.client.mgmt.types.ListOrganizationsRequestParameters;
import com.auth0.client.mgmt.types.Organization;
+import com.auth0.client.mgmt.types.SearchOrganization;
+import com.auth0.client.mgmt.types.SearchOrganizationsRequestParameters;
import com.auth0.client.mgmt.types.UpdateOrganizationRequestContent;
import com.auth0.client.mgmt.types.UpdateOrganizationResponseContent;
import java.util.function.Supplier;
@@ -184,6 +186,79 @@ public GetOrganizationByNameResponseContent getByName(String name, RequestOption
return this.rawClient.getByName(name, requestOptions).body();
}
+ /**
+ * Retrieve details of organizations matching a search criteria. It is possible to:
+ *
+ * - Specify a search criteria for organizations
+ * - Search via
name
+ * - Search via
display_name
+ * - Substring matching (
contains and ends-with) requires at least 3 characters
+ * - Use wildcards
+ *
+ * The q query parameter can be used to get organizations that match the specified criteria on name OR display_name.
+ * This endpoint supports SCIM or Lucene filter syntax with low-latency, cursor-based pagination. Use the parser parameter to specify "scim" or "lucene" syntax (default: "lucene").
+ * Results are eventually consistent and may not reflect recent updates immediately.
+ * Sortable fields: name, display_name, created_at (ascending only). Defaults to insertion order (oldest first).
+ */
+ public SyncPagingIterable search() {
+ return this.rawClient.search().body();
+ }
+
+ /**
+ * Retrieve details of organizations matching a search criteria. It is possible to:
+ *
+ * - Specify a search criteria for organizations
+ * - Search via
name
+ * - Search via
display_name
+ * - Substring matching (
contains and ends-with) requires at least 3 characters
+ * - Use wildcards
+ *
+ * The q query parameter can be used to get organizations that match the specified criteria on name OR display_name.
+ * This endpoint supports SCIM or Lucene filter syntax with low-latency, cursor-based pagination. Use the parser parameter to specify "scim" or "lucene" syntax (default: "lucene").
+ * Results are eventually consistent and may not reflect recent updates immediately.
+ * Sortable fields: name, display_name, created_at (ascending only). Defaults to insertion order (oldest first).
+ */
+ public SyncPagingIterable search(RequestOptions requestOptions) {
+ return this.rawClient.search(requestOptions).body();
+ }
+
+ /**
+ * Retrieve details of organizations matching a search criteria. It is possible to:
+ *
+ * - Specify a search criteria for organizations
+ * - Search via
name
+ * - Search via
display_name
+ * - Substring matching (
contains and ends-with) requires at least 3 characters
+ * - Use wildcards
+ *
+ * The q query parameter can be used to get organizations that match the specified criteria on name OR display_name.
+ * This endpoint supports SCIM or Lucene filter syntax with low-latency, cursor-based pagination. Use the parser parameter to specify "scim" or "lucene" syntax (default: "lucene").
+ * Results are eventually consistent and may not reflect recent updates immediately.
+ * Sortable fields: name, display_name, created_at (ascending only). Defaults to insertion order (oldest first).
+ */
+ public SyncPagingIterable search(SearchOrganizationsRequestParameters request) {
+ return this.rawClient.search(request).body();
+ }
+
+ /**
+ * Retrieve details of organizations matching a search criteria. It is possible to:
+ *
+ * - Specify a search criteria for organizations
+ * - Search via
name
+ * - Search via
display_name
+ * - Substring matching (
contains and ends-with) requires at least 3 characters
+ * - Use wildcards
+ *
+ * The q query parameter can be used to get organizations that match the specified criteria on name OR display_name.
+ * This endpoint supports SCIM or Lucene filter syntax with low-latency, cursor-based pagination. Use the parser parameter to specify "scim" or "lucene" syntax (default: "lucene").
+ * Results are eventually consistent and may not reflect recent updates immediately.
+ * Sortable fields: name, display_name, created_at (ascending only). Defaults to insertion order (oldest first).
+ */
+ public SyncPagingIterable search(
+ SearchOrganizationsRequestParameters request, RequestOptions requestOptions) {
+ return this.rawClient.search(request, requestOptions).body();
+ }
+
/**
* Retrieve details about a single Organization specified by ID.
*/
diff --git a/src/main/java/com/auth0/client/mgmt/RawGuardianClient.java b/src/main/java/com/auth0/client/mgmt/RawGuardianClient.java
new file mode 100644
index 000000000..264efdbb0
--- /dev/null
+++ b/src/main/java/com/auth0/client/mgmt/RawGuardianClient.java
@@ -0,0 +1,194 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.auth0.client.mgmt;
+
+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.RequestOptions;
+import com.auth0.client.mgmt.core.RetryInterceptor;
+import com.auth0.client.mgmt.errors.BadRequestError;
+import com.auth0.client.mgmt.errors.ForbiddenError;
+import com.auth0.client.mgmt.errors.TooManyRequestsError;
+import com.auth0.client.mgmt.errors.UnauthorizedError;
+import com.auth0.client.mgmt.types.GetGuardianSettingsResponseContent;
+import com.auth0.client.mgmt.types.SetGuardianSettingsRequestContent;
+import com.auth0.client.mgmt.types.SetGuardianSettingsResponseContent;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import java.io.IOException;
+import okhttp3.Headers;
+import okhttp3.HttpUrl;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+import okhttp3.ResponseBody;
+
+public class RawGuardianClient {
+ protected final ClientOptions clientOptions;
+
+ public RawGuardianClient(ClientOptions clientOptions) {
+ this.clientOptions = clientOptions;
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public ManagementApiHttpResponse get() {
+ return get(null);
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public ManagementApiHttpResponse get(RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("guardian/settings");
+ 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);
+ }
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
+ 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, GetGuardianSettingsResponseContent.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 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 (JsonProcessingException e) {
+ throw new ManagementException("Failed to deserialize response: " + e.getMessage(), e);
+ } catch (IOException e) {
+ throw new ManagementException("Network error executing HTTP request", e);
+ }
+ }
+
+ /**
+ * Update a tenant's guardian settings such as Remember Me
+ */
+ public ManagementApiHttpResponse set(
+ SetGuardianSettingsRequestContent request) {
+ return set(request, null);
+ }
+
+ /**
+ * Update a tenant's guardian settings such as Remember Me
+ */
+ public ManagementApiHttpResponse set(
+ SetGuardianSettingsRequestContent request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("guardian/settings");
+ 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("PUT", 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);
+ }
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
+ 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, SetGuardianSettingsResponseContent.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 (JsonProcessingException e) {
+ throw new ManagementException("Failed to deserialize response: " + e.getMessage(), e);
+ } catch (IOException e) {
+ throw new ManagementException("Network error executing HTTP request", e);
+ }
+ }
+}
diff --git a/src/main/java/com/auth0/client/mgmt/RawOrganizationTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/RawOrganizationTemplatesClient.java
deleted file mode 100644
index fd3eefb09..000000000
--- a/src/main/java/com/auth0/client/mgmt/RawOrganizationTemplatesClient.java
+++ /dev/null
@@ -1,530 +0,0 @@
-/**
- * This file was auto-generated by Fern from our API Definition.
- */
-package com.auth0.client.mgmt;
-
-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.RetryInterceptor;
-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.types.CreateOrganizationTemplateRequestContent;
-import com.auth0.client.mgmt.types.ListOrganizationTemplatesPaginatedResponseContent;
-import com.auth0.client.mgmt.types.ListOrganizationTemplatesRequestParameters;
-import com.auth0.client.mgmt.types.ListTemplateOrganizationsPaginatedResponseContent;
-import com.auth0.client.mgmt.types.ListTemplateOrganizationsRequestParameters;
-import com.auth0.client.mgmt.types.OrganizationTemplate;
-import com.auth0.client.mgmt.types.OrganizationTemplateAssignedOrganization;
-import com.auth0.client.mgmt.types.UpdateOrganizationTemplateRequestContent;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.List;
-import java.util.Optional;
-import okhttp3.Headers;
-import okhttp3.HttpUrl;
-import okhttp3.OkHttpClient;
-import okhttp3.Request;
-import okhttp3.RequestBody;
-import okhttp3.Response;
-import okhttp3.ResponseBody;
-
-public class RawOrganizationTemplatesClient {
- protected final ClientOptions clientOptions;
-
- public RawOrganizationTemplatesClient(ClientOptions clientOptions) {
- this.clientOptions = clientOptions;
- }
-
- /**
- * Retrieve a list of Organization Templates. This endpoint supports Checkpoint pagination. Results are returned in a stable order, sorted by their identifier (id) in ascending order.
- */
- public ManagementApiHttpResponse> list() {
- return list(ListOrganizationTemplatesRequestParameters.builder().build());
- }
-
- /**
- * Retrieve a list of Organization Templates. This endpoint supports Checkpoint pagination. Results are returned in a stable order, sorted by their identifier (id) in ascending order.
- */
- public ManagementApiHttpResponse> list(RequestOptions requestOptions) {
- return list(ListOrganizationTemplatesRequestParameters.builder().build(), requestOptions);
- }
-
- /**
- * Retrieve a list of Organization Templates. This endpoint supports Checkpoint pagination. Results are returned in a stable order, sorted by their identifier (id) in ascending order.
- */
- public ManagementApiHttpResponse> list(
- ListOrganizationTemplatesRequestParameters request) {
- return list(request, null);
- }
-
- /**
- * Retrieve a list of Organization Templates. This endpoint supports Checkpoint pagination. Results are returned in a stable order, sorted by their identifier (id) in ascending order.
- */
- public ManagementApiHttpResponse> list(
- ListOrganizationTemplatesRequestParameters request, RequestOptions requestOptions) {
- HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
- .newBuilder()
- .addPathSegments("organization-templates");
- if (!request.getFrom().isAbsent()) {
- QueryStringMapper.addQueryParameter(
- httpUrl, "from", request.getFrom().orElse(null), false);
- }
- QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(5), 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);
- }
- if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
- okhttpRequest = okhttpRequest
- .newBuilder()
- .tag(
- RetryInterceptor.MaxRetriesOverride.class,
- new RetryInterceptor.MaxRetriesOverride(
- requestOptions.getMaxRetries().get()))
- .build();
- }
- try (Response response = client.newCall(okhttpRequest).execute()) {
- ResponseBody responseBody = response.body();
- String responseBodyString = responseBody != null ? responseBody.string() : "{}";
- if (response.isSuccessful()) {
- ListOrganizationTemplatesPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue(
- responseBodyString, ListOrganizationTemplatesPaginatedResponseContent.class);
- Optional startingAfter = parsedResponse.getNext();
- ListOrganizationTemplatesRequestParameters nextRequest =
- ListOrganizationTemplatesRequestParameters.builder()
- .from(request)
- .from(startingAfter)
- .build();
- List result =
- parsedResponse.getOrganizationTemplates().orElse(Collections.emptyList());
- return new ManagementApiHttpResponse<>(
- new SyncPagingIterable(
- startingAfter.isPresent(), result, parsedResponse, () -> list(
- 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 (JsonProcessingException e) {
- throw new ManagementException("Failed to deserialize response: " + e.getMessage(), e);
- } catch (IOException e) {
- throw new ManagementException("Network error executing HTTP request", e);
- }
- }
-
- /**
- * Create an Organization Template.
- */
- public ManagementApiHttpResponse create(CreateOrganizationTemplateRequestContent request) {
- return create(request, null);
- }
-
- /**
- * Create an Organization Template.
- */
- public ManagementApiHttpResponse create(
- CreateOrganizationTemplateRequestContent request, RequestOptions requestOptions) {
- HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
- .newBuilder()
- .addPathSegments("organization-templates");
- 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);
- }
- if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
- okhttpRequest = okhttpRequest
- .newBuilder()
- .tag(
- RetryInterceptor.MaxRetriesOverride.class,
- new RetryInterceptor.MaxRetriesOverride(
- requestOptions.getMaxRetries().get()))
- .build();
- }
- 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, OrganizationTemplate.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 (JsonProcessingException e) {
- throw new ManagementException("Failed to deserialize response: " + e.getMessage(), e);
- } catch (IOException e) {
- throw new ManagementException("Network error executing HTTP request", e);
- }
- }
-
- /**
- * Retrieve details about a single Organization Template specified by ID.
- */
- public ManagementApiHttpResponse get(String id) {
- return get(id, null);
- }
-
- /**
- * Retrieve details about a single Organization Template specified by ID.
- */
- public ManagementApiHttpResponse get(String id, RequestOptions requestOptions) {
- HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
- .newBuilder()
- .addPathSegments("organization-templates")
- .addPathSegment(id);
- 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);
- }
- if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
- okhttpRequest = okhttpRequest
- .newBuilder()
- .tag(
- RetryInterceptor.MaxRetriesOverride.class,
- new RetryInterceptor.MaxRetriesOverride(
- requestOptions.getMaxRetries().get()))
- .build();
- }
- 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, OrganizationTemplate.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 (JsonProcessingException e) {
- throw new ManagementException("Failed to deserialize response: " + e.getMessage(), e);
- } catch (IOException e) {
- throw new ManagementException("Network error executing HTTP request", e);
- }
- }
-
- /**
- * Update the details of a specific Organization Template.
- */
- public ManagementApiHttpResponse update(String id) {
- return update(id, UpdateOrganizationTemplateRequestContent.builder().build());
- }
-
- /**
- * Update the details of a specific Organization Template.
- */
- public ManagementApiHttpResponse update(String id, RequestOptions requestOptions) {
- return update(id, UpdateOrganizationTemplateRequestContent.builder().build(), requestOptions);
- }
-
- /**
- * Update the details of a specific Organization Template.
- */
- public ManagementApiHttpResponse update(
- String id, UpdateOrganizationTemplateRequestContent request) {
- return update(id, request, null);
- }
-
- /**
- * Update the details of a specific Organization Template.
- */
- public ManagementApiHttpResponse update(
- String id, UpdateOrganizationTemplateRequestContent request, RequestOptions requestOptions) {
- HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
- .newBuilder()
- .addPathSegments("organization-templates")
- .addPathSegment(id);
- 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);
- }
- if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
- okhttpRequest = okhttpRequest
- .newBuilder()
- .tag(
- RetryInterceptor.MaxRetriesOverride.class,
- new RetryInterceptor.MaxRetriesOverride(
- requestOptions.getMaxRetries().get()))
- .build();
- }
- 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, OrganizationTemplate.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 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 (JsonProcessingException e) {
- throw new ManagementException("Failed to deserialize response: " + e.getMessage(), e);
- } catch (IOException e) {
- throw new ManagementException("Network error executing HTTP request", e);
- }
- }
-
- /**
- * Retrieve a list of organizations assigned to an Organization Template. This endpoint supports Checkpoint pagination. Results are returned in a stable order, sorted by their identifier (id) in ascending order.
- */
- public ManagementApiHttpResponse> listOrganizations(
- String id) {
- return listOrganizations(
- id, ListTemplateOrganizationsRequestParameters.builder().build());
- }
-
- /**
- * Retrieve a list of organizations assigned to an Organization Template. This endpoint supports Checkpoint pagination. Results are returned in a stable order, sorted by their identifier (id) in ascending order.
- */
- public ManagementApiHttpResponse> listOrganizations(
- String id, RequestOptions requestOptions) {
- return listOrganizations(
- id, ListTemplateOrganizationsRequestParameters.builder().build(), requestOptions);
- }
-
- /**
- * Retrieve a list of organizations assigned to an Organization Template. This endpoint supports Checkpoint pagination. Results are returned in a stable order, sorted by their identifier (id) in ascending order.
- */
- public ManagementApiHttpResponse> listOrganizations(
- String id, ListTemplateOrganizationsRequestParameters request) {
- return listOrganizations(id, request, null);
- }
-
- /**
- * Retrieve a list of organizations assigned to an Organization Template. This endpoint supports Checkpoint pagination. Results are returned in a stable order, sorted by their identifier (id) in ascending order.
- */
- public ManagementApiHttpResponse> listOrganizations(
- String id, ListTemplateOrganizationsRequestParameters request, RequestOptions requestOptions) {
- HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
- .newBuilder()
- .addPathSegments("organization-templates")
- .addPathSegment(id)
- .addPathSegments("organizations");
- if (!request.getFrom().isAbsent()) {
- QueryStringMapper.addQueryParameter(
- httpUrl, "from", request.getFrom().orElse(null), false);
- }
- QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(5), 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);
- }
- if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
- okhttpRequest = okhttpRequest
- .newBuilder()
- .tag(
- RetryInterceptor.MaxRetriesOverride.class,
- new RetryInterceptor.MaxRetriesOverride(
- requestOptions.getMaxRetries().get()))
- .build();
- }
- try (Response response = client.newCall(okhttpRequest).execute()) {
- ResponseBody responseBody = response.body();
- String responseBodyString = responseBody != null ? responseBody.string() : "{}";
- if (response.isSuccessful()) {
- ListTemplateOrganizationsPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue(
- responseBodyString, ListTemplateOrganizationsPaginatedResponseContent.class);
- Optional startingAfter = parsedResponse.getNext();
- ListTemplateOrganizationsRequestParameters nextRequest =
- ListTemplateOrganizationsRequestParameters.builder()
- .from(request)
- .from(startingAfter)
- .build();
- List result = parsedResponse.getOrganizations();
- return new ManagementApiHttpResponse<>(
- new SyncPagingIterable(
- startingAfter.isPresent(), result, parsedResponse, () -> listOrganizations(
- 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 (JsonProcessingException e) {
- throw new ManagementException("Failed to deserialize response: " + e.getMessage(), e);
- } catch (IOException e) {
- throw new ManagementException("Network error executing HTTP request", e);
- }
- }
-}
diff --git a/src/main/java/com/auth0/client/mgmt/RawOrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/RawOrganizationsClient.java
index d1203604f..490b70870 100644
--- a/src/main/java/com/auth0/client/mgmt/RawOrganizationsClient.java
+++ b/src/main/java/com/auth0/client/mgmt/RawOrganizationsClient.java
@@ -16,6 +16,7 @@
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.GatewayTimeoutError;
import com.auth0.client.mgmt.errors.NotFoundError;
import com.auth0.client.mgmt.errors.TooManyRequestsError;
import com.auth0.client.mgmt.errors.UnauthorizedError;
@@ -26,6 +27,9 @@
import com.auth0.client.mgmt.types.ListOrganizationsPaginatedResponseContent;
import com.auth0.client.mgmt.types.ListOrganizationsRequestParameters;
import com.auth0.client.mgmt.types.Organization;
+import com.auth0.client.mgmt.types.SearchOrganization;
+import com.auth0.client.mgmt.types.SearchOrganizationsPaginatedResponseContent;
+import com.auth0.client.mgmt.types.SearchOrganizationsRequestParameters;
import com.auth0.client.mgmt.types.UpdateOrganizationRequestContent;
import com.auth0.client.mgmt.types.UpdateOrganizationResponseContent;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -387,6 +391,170 @@ public ManagementApiHttpResponse getByName
}
}
+ /**
+ * Retrieve details of organizations matching a search criteria. It is possible to:
+ *
+ * - Specify a search criteria for organizations
+ * - Search via
name
+ * - Search via
display_name
+ * - Substring matching (
contains and ends-with) requires at least 3 characters
+ * - Use wildcards
+ *
+ * The q query parameter can be used to get organizations that match the specified criteria on name OR display_name.
+ * This endpoint supports SCIM or Lucene filter syntax with low-latency, cursor-based pagination. Use the parser parameter to specify "scim" or "lucene" syntax (default: "lucene").
+ * Results are eventually consistent and may not reflect recent updates immediately.
+ * Sortable fields: name, display_name, created_at (ascending only). Defaults to insertion order (oldest first).
+ */
+ public ManagementApiHttpResponse> search() {
+ return search(SearchOrganizationsRequestParameters.builder().build());
+ }
+
+ /**
+ * Retrieve details of organizations matching a search criteria. It is possible to:
+ *
+ * - Specify a search criteria for organizations
+ * - Search via
name
+ * - Search via
display_name
+ * - Substring matching (
contains and ends-with) requires at least 3 characters
+ * - Use wildcards
+ *
+ * The q query parameter can be used to get organizations that match the specified criteria on name OR display_name.
+ * This endpoint supports SCIM or Lucene filter syntax with low-latency, cursor-based pagination. Use the parser parameter to specify "scim" or "lucene" syntax (default: "lucene").
+ * Results are eventually consistent and may not reflect recent updates immediately.
+ * Sortable fields: name, display_name, created_at (ascending only). Defaults to insertion order (oldest first).
+ */
+ public ManagementApiHttpResponse> search(RequestOptions requestOptions) {
+ return search(SearchOrganizationsRequestParameters.builder().build(), requestOptions);
+ }
+
+ /**
+ * Retrieve details of organizations matching a search criteria. It is possible to:
+ *
+ * - Specify a search criteria for organizations
+ * - Search via
name
+ * - Search via
display_name
+ * - Substring matching (
contains and ends-with) requires at least 3 characters
+ * - Use wildcards
+ *
+ * The q query parameter can be used to get organizations that match the specified criteria on name OR display_name.
+ * This endpoint supports SCIM or Lucene filter syntax with low-latency, cursor-based pagination. Use the parser parameter to specify "scim" or "lucene" syntax (default: "lucene").
+ * Results are eventually consistent and may not reflect recent updates immediately.
+ * Sortable fields: name, display_name, created_at (ascending only). Defaults to insertion order (oldest first).
+ */
+ public ManagementApiHttpResponse> search(
+ SearchOrganizationsRequestParameters request) {
+ return search(request, null);
+ }
+
+ /**
+ * Retrieve details of organizations matching a search criteria. It is possible to:
+ *
+ * - Specify a search criteria for organizations
+ * - Search via
name
+ * - Search via
display_name
+ * - Substring matching (
contains and ends-with) requires at least 3 characters
+ * - Use wildcards
+ *
+ * The q query parameter can be used to get organizations that match the specified criteria on name OR display_name.
+ * This endpoint supports SCIM or Lucene filter syntax with low-latency, cursor-based pagination. Use the parser parameter to specify "scim" or "lucene" syntax (default: "lucene").
+ * Results are eventually consistent and may not reflect recent updates immediately.
+ * Sortable fields: name, display_name, created_at (ascending only). Defaults to insertion order (oldest first).
+ */
+ public ManagementApiHttpResponse> search(
+ SearchOrganizationsRequestParameters request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("organizations/search");
+ if (!request.getQ().isAbsent()) {
+ QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().orElse(null), false);
+ }
+ if (!request.getParser().isAbsent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "parser", request.getParser().orElse(null), false);
+ }
+ QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false);
+ if (!request.getFrom().isAbsent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "from", request.getFrom().orElse(null), false);
+ }
+ if (!request.getSort().isAbsent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "sort", request.getSort().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);
+ }
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
+ try (Response response = client.newCall(okhttpRequest).execute()) {
+ ResponseBody responseBody = response.body();
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ if (response.isSuccessful()) {
+ SearchOrganizationsPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue(
+ responseBodyString, SearchOrganizationsPaginatedResponseContent.class);
+ Optional startingAfter = parsedResponse.getNext();
+ SearchOrganizationsRequestParameters nextRequest = SearchOrganizationsRequestParameters.builder()
+ .from(request)
+ .from(startingAfter)
+ .build();
+ List result = parsedResponse.getOrganizations();
+ return new ManagementApiHttpResponse<>(
+ new SyncPagingIterable(
+ startingAfter.isPresent(), result, parsedResponse, () -> search(
+ 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);
+ case 504:
+ throw new GatewayTimeoutError(
+ 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 (JsonProcessingException e) {
+ throw new ManagementException("Failed to deserialize response: " + e.getMessage(), e);
+ } catch (IOException e) {
+ throw new ManagementException("Network error executing HTTP request", e);
+ }
+ }
+
/**
* Retrieve details about a single Organization specified by ID.
*/
diff --git a/src/main/java/com/auth0/client/mgmt/RawResourceServersClient.java b/src/main/java/com/auth0/client/mgmt/RawResourceServersClient.java
index f4f448e18..82bcdfa7e 100644
--- a/src/main/java/com/auth0/client/mgmt/RawResourceServersClient.java
+++ b/src/main/java/com/auth0/client/mgmt/RawResourceServersClient.java
@@ -16,6 +16,8 @@
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.GatewayTimeoutError;
+import com.auth0.client.mgmt.errors.InternalServerError;
import com.auth0.client.mgmt.errors.NotFoundError;
import com.auth0.client.mgmt.errors.TooManyRequestsError;
import com.auth0.client.mgmt.errors.UnauthorizedError;
@@ -26,12 +28,16 @@
import com.auth0.client.mgmt.types.ListResourceServerOffsetPaginatedResponseContent;
import com.auth0.client.mgmt.types.ListResourceServerRequestParameters;
import com.auth0.client.mgmt.types.ResourceServer;
+import com.auth0.client.mgmt.types.ResourceServerSearchResponse;
+import com.auth0.client.mgmt.types.SearchResourceServersRequestParameters;
+import com.auth0.client.mgmt.types.SearchResourceServersResponseContent;
import com.auth0.client.mgmt.types.UpdateResourceServerRequestContent;
import com.auth0.client.mgmt.types.UpdateResourceServerResponseContent;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
+import java.util.Optional;
import okhttp3.Headers;
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
@@ -250,6 +256,149 @@ public ManagementApiHttpResponse create(
}
}
+ /**
+ * Search resource servers using SCIM or Lucene filter syntax with low-latency, eventually consistent results. Use the parser parameter to specify "scim" or "lucene" syntax (default: "lucene"). This endpoint provides an alternative to the standard GET /resource-servers endpoint with better performance for complex queries.
+ * Results may not reflect recent updates immediately.
+ * The signing_secret field is not supported by this endpoint.
+ */
+ public ManagementApiHttpResponse> search() {
+ return search(SearchResourceServersRequestParameters.builder().build());
+ }
+
+ /**
+ * Search resource servers using SCIM or Lucene filter syntax with low-latency, eventually consistent results. Use the parser parameter to specify "scim" or "lucene" syntax (default: "lucene"). This endpoint provides an alternative to the standard GET /resource-servers endpoint with better performance for complex queries.
+ * Results may not reflect recent updates immediately.
+ * The signing_secret field is not supported by this endpoint.
+ */
+ public ManagementApiHttpResponse> search(
+ RequestOptions requestOptions) {
+ return search(SearchResourceServersRequestParameters.builder().build(), requestOptions);
+ }
+
+ /**
+ * Search resource servers using SCIM or Lucene filter syntax with low-latency, eventually consistent results. Use the parser parameter to specify "scim" or "lucene" syntax (default: "lucene"). This endpoint provides an alternative to the standard GET /resource-servers endpoint with better performance for complex queries.
+ * Results may not reflect recent updates immediately.
+ * The signing_secret field is not supported by this endpoint.
+ */
+ public ManagementApiHttpResponse> search(
+ SearchResourceServersRequestParameters request) {
+ return search(request, null);
+ }
+
+ /**
+ * Search resource servers using SCIM or Lucene filter syntax with low-latency, eventually consistent results. Use the parser parameter to specify "scim" or "lucene" syntax (default: "lucene"). This endpoint provides an alternative to the standard GET /resource-servers endpoint with better performance for complex queries.
+ * Results may not reflect recent updates immediately.
+ * The signing_secret field is not supported by this endpoint.
+ */
+ public ManagementApiHttpResponse> search(
+ SearchResourceServersRequestParameters request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("resource-servers/search");
+ if (!request.getQ().isAbsent()) {
+ QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().orElse(null), false);
+ }
+ if (!request.getParser().isAbsent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "parser", request.getParser().orElse(null), false);
+ }
+ if (!request.getFields().isAbsent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "fields", request.getFields().orElse(null), false);
+ }
+ if (!request.getIncludeFields().isAbsent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "include_fields", request.getIncludeFields().orElse(null), false);
+ }
+ QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false);
+ if (!request.getFrom().isAbsent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "from", request.getFrom().orElse(null), false);
+ }
+ if (!request.getSort().isAbsent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "sort", request.getSort().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);
+ }
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
+ try (Response response = client.newCall(okhttpRequest).execute()) {
+ ResponseBody responseBody = response.body();
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ if (response.isSuccessful()) {
+ SearchResourceServersResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue(
+ responseBodyString, SearchResourceServersResponseContent.class);
+ Optional startingAfter = parsedResponse.getNext();
+ SearchResourceServersRequestParameters nextRequest = SearchResourceServersRequestParameters.builder()
+ .from(request)
+ .from(startingAfter)
+ .build();
+ List result = parsedResponse.getResourceServers();
+ return new ManagementApiHttpResponse<>(
+ new SyncPagingIterable(
+ startingAfter.isPresent(), result, parsedResponse, () -> search(
+ 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 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);
+ case 500:
+ throw new InternalServerError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response);
+ case 504:
+ throw new GatewayTimeoutError(
+ 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 (JsonProcessingException e) {
+ throw new ManagementException("Failed to deserialize response: " + e.getMessage(), e);
+ } catch (IOException e) {
+ throw new ManagementException("Network error executing HTTP request", e);
+ }
+ }
+
/**
* Retrieve API details with the given ID.
*/
diff --git a/src/main/java/com/auth0/client/mgmt/ResourceServersClient.java b/src/main/java/com/auth0/client/mgmt/ResourceServersClient.java
index 34716dcfd..38b31ee1d 100644
--- a/src/main/java/com/auth0/client/mgmt/ResourceServersClient.java
+++ b/src/main/java/com/auth0/client/mgmt/ResourceServersClient.java
@@ -12,6 +12,8 @@
import com.auth0.client.mgmt.types.GetResourceServerResponseContent;
import com.auth0.client.mgmt.types.ListResourceServerRequestParameters;
import com.auth0.client.mgmt.types.ResourceServer;
+import com.auth0.client.mgmt.types.ResourceServerSearchResponse;
+import com.auth0.client.mgmt.types.SearchResourceServersRequestParameters;
import com.auth0.client.mgmt.types.UpdateResourceServerRequestContent;
import com.auth0.client.mgmt.types.UpdateResourceServerResponseContent;
@@ -76,6 +78,43 @@ public CreateResourceServerResponseContent create(
return this.rawClient.create(request, requestOptions).body();
}
+ /**
+ * Search resource servers using SCIM or Lucene filter syntax with low-latency, eventually consistent results. Use the parser parameter to specify "scim" or "lucene" syntax (default: "lucene"). This endpoint provides an alternative to the standard GET /resource-servers endpoint with better performance for complex queries.
+ * Results may not reflect recent updates immediately.
+ * The signing_secret field is not supported by this endpoint.
+ */
+ public SyncPagingIterable search() {
+ return this.rawClient.search().body();
+ }
+
+ /**
+ * Search resource servers using SCIM or Lucene filter syntax with low-latency, eventually consistent results. Use the parser parameter to specify "scim" or "lucene" syntax (default: "lucene"). This endpoint provides an alternative to the standard GET /resource-servers endpoint with better performance for complex queries.
+ * Results may not reflect recent updates immediately.
+ * The signing_secret field is not supported by this endpoint.
+ */
+ public SyncPagingIterable search(RequestOptions requestOptions) {
+ return this.rawClient.search(requestOptions).body();
+ }
+
+ /**
+ * Search resource servers using SCIM or Lucene filter syntax with low-latency, eventually consistent results. Use the parser parameter to specify "scim" or "lucene" syntax (default: "lucene"). This endpoint provides an alternative to the standard GET /resource-servers endpoint with better performance for complex queries.
+ * Results may not reflect recent updates immediately.
+ * The signing_secret field is not supported by this endpoint.
+ */
+ public SyncPagingIterable search(SearchResourceServersRequestParameters request) {
+ return this.rawClient.search(request).body();
+ }
+
+ /**
+ * Search resource servers using SCIM or Lucene filter syntax with low-latency, eventually consistent results. Use the parser parameter to specify "scim" or "lucene" syntax (default: "lucene"). This endpoint provides an alternative to the standard GET /resource-servers endpoint with better performance for complex queries.
+ * Results may not reflect recent updates immediately.
+ * The signing_secret field is not supported by this endpoint.
+ */
+ public SyncPagingIterable search(
+ SearchResourceServersRequestParameters request, RequestOptions requestOptions) {
+ return this.rawClient.search(request, requestOptions).body();
+ }
+
/**
* Retrieve API details with the given ID.
*/
diff --git a/src/main/java/com/auth0/client/mgmt/errors/GatewayTimeoutError.java b/src/main/java/com/auth0/client/mgmt/errors/GatewayTimeoutError.java
new file mode 100644
index 000000000..3cdcca814
--- /dev/null
+++ b/src/main/java/com/auth0/client/mgmt/errors/GatewayTimeoutError.java
@@ -0,0 +1,32 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.auth0.client.mgmt.errors;
+
+import com.auth0.client.mgmt.core.ManagementApiException;
+import okhttp3.Response;
+
+public final class GatewayTimeoutError extends ManagementApiException {
+ /**
+ * The body of the response that triggered the exception.
+ */
+ private final Object body;
+
+ public GatewayTimeoutError(Object body) {
+ super("GatewayTimeoutError", 504, body);
+ this.body = body;
+ }
+
+ public GatewayTimeoutError(Object body, Response rawResponse) {
+ super("GatewayTimeoutError", 504, body, rawResponse);
+ this.body = body;
+ }
+
+ /**
+ * @return the body
+ */
+ @java.lang.Override
+ public Object body() {
+ return this.body;
+ }
+}
diff --git a/src/main/java/com/auth0/client/mgmt/experimentation/AsyncExperimentationClient.java b/src/main/java/com/auth0/client/mgmt/experimentation/AsyncExperimentationClient.java
new file mode 100644
index 000000000..8d032e2bc
--- /dev/null
+++ b/src/main/java/com/auth0/client/mgmt/experimentation/AsyncExperimentationClient.java
@@ -0,0 +1,23 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.auth0.client.mgmt.experimentation;
+
+import com.auth0.client.mgmt.core.ClientOptions;
+import com.auth0.client.mgmt.core.Suppliers;
+import java.util.function.Supplier;
+
+public class AsyncExperimentationClient {
+ protected final ClientOptions clientOptions;
+
+ protected final Supplier experimentsClient;
+
+ public AsyncExperimentationClient(ClientOptions clientOptions) {
+ this.clientOptions = clientOptions;
+ this.experimentsClient = Suppliers.memoize(() -> new AsyncExperimentsClient(clientOptions));
+ }
+
+ public AsyncExperimentsClient experiments() {
+ return this.experimentsClient.get();
+ }
+}
diff --git a/src/main/java/com/auth0/client/mgmt/experimentation/AsyncExperimentsClient.java b/src/main/java/com/auth0/client/mgmt/experimentation/AsyncExperimentsClient.java
new file mode 100644
index 000000000..5148c7636
--- /dev/null
+++ b/src/main/java/com/auth0/client/mgmt/experimentation/AsyncExperimentsClient.java
@@ -0,0 +1,43 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.auth0.client.mgmt.experimentation;
+
+import com.auth0.client.mgmt.core.ClientOptions;
+import com.auth0.client.mgmt.core.RequestOptions;
+import com.auth0.client.mgmt.experimentation.types.AdvanceRampRequestContent;
+import com.auth0.client.mgmt.types.AdvanceRampResponseContent;
+import java.util.concurrent.CompletableFuture;
+
+public class AsyncExperimentsClient {
+ protected final ClientOptions clientOptions;
+
+ private final AsyncRawExperimentsClient rawClient;
+
+ public AsyncExperimentsClient(ClientOptions clientOptions) {
+ this.clientOptions = clientOptions;
+ this.rawClient = new AsyncRawExperimentsClient(clientOptions);
+ }
+
+ /**
+ * Get responses with HTTP metadata like headers
+ */
+ public AsyncRawExperimentsClient withRawResponse() {
+ return this.rawClient;
+ }
+
+ /**
+ * Increments the current ramp index to the requested target level. Up-only: the target must be the immediate next level in the schedule. Idempotent: calling with the current level returns success without writing anything.
+ */
+ public CompletableFuture advanceRamp(String id, AdvanceRampRequestContent request) {
+ return this.rawClient.advanceRamp(id, request).thenApply(response -> response.body());
+ }
+
+ /**
+ * Increments the current ramp index to the requested target level. Up-only: the target must be the immediate next level in the schedule. Idempotent: calling with the current level returns success without writing anything.
+ */
+ public CompletableFuture advanceRamp(
+ String id, AdvanceRampRequestContent request, RequestOptions requestOptions) {
+ return this.rawClient.advanceRamp(id, request, requestOptions).thenApply(response -> response.body());
+ }
+}
diff --git a/src/main/java/com/auth0/client/mgmt/experimentation/AsyncRawExperimentsClient.java b/src/main/java/com/auth0/client/mgmt/experimentation/AsyncRawExperimentsClient.java
new file mode 100644
index 000000000..0e1bbf2f2
--- /dev/null
+++ b/src/main/java/com/auth0/client/mgmt/experimentation/AsyncRawExperimentsClient.java
@@ -0,0 +1,161 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.auth0.client.mgmt.experimentation;
+
+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.RequestOptions;
+import com.auth0.client.mgmt.core.RetryInterceptor;
+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.experimentation.types.AdvanceRampRequestContent;
+import com.auth0.client.mgmt.types.AdvanceRampResponseContent;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import java.io.IOException;
+import java.util.concurrent.CompletableFuture;
+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 AsyncRawExperimentsClient {
+ protected final ClientOptions clientOptions;
+
+ public AsyncRawExperimentsClient(ClientOptions clientOptions) {
+ this.clientOptions = clientOptions;
+ }
+
+ /**
+ * Increments the current ramp index to the requested target level. Up-only: the target must be the immediate next level in the schedule. Idempotent: calling with the current level returns success without writing anything.
+ */
+ public CompletableFuture> advanceRamp(
+ String id, AdvanceRampRequestContent request) {
+ return advanceRamp(id, request, null);
+ }
+
+ /**
+ * Increments the current ramp index to the requested target level. Up-only: the target must be the immediate next level in the schedule. Idempotent: calling with the current level returns success without writing anything.
+ */
+ public CompletableFuture> advanceRamp(
+ String id, AdvanceRampRequestContent request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("experimentation/experiments")
+ .addPathSegment(id)
+ .addPathSegments("advance-ramp");
+ 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);
+ }
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
+ 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, AdvanceRampResponseContent.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 404:
+ future.completeExceptionally(new NotFoundError(
+ 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 (JsonProcessingException e) {
+ future.completeExceptionally(
+ new ManagementException("Failed to deserialize response: " + e.getMessage(), e));
+ } 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/experimentation/ExperimentationClient.java b/src/main/java/com/auth0/client/mgmt/experimentation/ExperimentationClient.java
new file mode 100644
index 000000000..6c123d76a
--- /dev/null
+++ b/src/main/java/com/auth0/client/mgmt/experimentation/ExperimentationClient.java
@@ -0,0 +1,23 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.auth0.client.mgmt.experimentation;
+
+import com.auth0.client.mgmt.core.ClientOptions;
+import com.auth0.client.mgmt.core.Suppliers;
+import java.util.function.Supplier;
+
+public class ExperimentationClient {
+ protected final ClientOptions clientOptions;
+
+ protected final Supplier experimentsClient;
+
+ public ExperimentationClient(ClientOptions clientOptions) {
+ this.clientOptions = clientOptions;
+ this.experimentsClient = Suppliers.memoize(() -> new ExperimentsClient(clientOptions));
+ }
+
+ public ExperimentsClient experiments() {
+ return this.experimentsClient.get();
+ }
+}
diff --git a/src/main/java/com/auth0/client/mgmt/experimentation/ExperimentsClient.java b/src/main/java/com/auth0/client/mgmt/experimentation/ExperimentsClient.java
new file mode 100644
index 000000000..3cfb5729d
--- /dev/null
+++ b/src/main/java/com/auth0/client/mgmt/experimentation/ExperimentsClient.java
@@ -0,0 +1,42 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.auth0.client.mgmt.experimentation;
+
+import com.auth0.client.mgmt.core.ClientOptions;
+import com.auth0.client.mgmt.core.RequestOptions;
+import com.auth0.client.mgmt.experimentation.types.AdvanceRampRequestContent;
+import com.auth0.client.mgmt.types.AdvanceRampResponseContent;
+
+public class ExperimentsClient {
+ protected final ClientOptions clientOptions;
+
+ private final RawExperimentsClient rawClient;
+
+ public ExperimentsClient(ClientOptions clientOptions) {
+ this.clientOptions = clientOptions;
+ this.rawClient = new RawExperimentsClient(clientOptions);
+ }
+
+ /**
+ * Get responses with HTTP metadata like headers
+ */
+ public RawExperimentsClient withRawResponse() {
+ return this.rawClient;
+ }
+
+ /**
+ * Increments the current ramp index to the requested target level. Up-only: the target must be the immediate next level in the schedule. Idempotent: calling with the current level returns success without writing anything.
+ */
+ public AdvanceRampResponseContent advanceRamp(String id, AdvanceRampRequestContent request) {
+ return this.rawClient.advanceRamp(id, request).body();
+ }
+
+ /**
+ * Increments the current ramp index to the requested target level. Up-only: the target must be the immediate next level in the schedule. Idempotent: calling with the current level returns success without writing anything.
+ */
+ public AdvanceRampResponseContent advanceRamp(
+ String id, AdvanceRampRequestContent request, RequestOptions requestOptions) {
+ return this.rawClient.advanceRamp(id, request, requestOptions).body();
+ }
+}
diff --git a/src/main/java/com/auth0/client/mgmt/experimentation/RawExperimentsClient.java b/src/main/java/com/auth0/client/mgmt/experimentation/RawExperimentsClient.java
new file mode 100644
index 000000000..828ffb322
--- /dev/null
+++ b/src/main/java/com/auth0/client/mgmt/experimentation/RawExperimentsClient.java
@@ -0,0 +1,130 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.auth0.client.mgmt.experimentation;
+
+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.RequestOptions;
+import com.auth0.client.mgmt.core.RetryInterceptor;
+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.experimentation.types.AdvanceRampRequestContent;
+import com.auth0.client.mgmt.types.AdvanceRampResponseContent;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import java.io.IOException;
+import okhttp3.Headers;
+import okhttp3.HttpUrl;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+import okhttp3.ResponseBody;
+
+public class RawExperimentsClient {
+ protected final ClientOptions clientOptions;
+
+ public RawExperimentsClient(ClientOptions clientOptions) {
+ this.clientOptions = clientOptions;
+ }
+
+ /**
+ * Increments the current ramp index to the requested target level. Up-only: the target must be the immediate next level in the schedule. Idempotent: calling with the current level returns success without writing anything.
+ */
+ public ManagementApiHttpResponse advanceRamp(
+ String id, AdvanceRampRequestContent request) {
+ return advanceRamp(id, request, null);
+ }
+
+ /**
+ * Increments the current ramp index to the requested target level. Up-only: the target must be the immediate next level in the schedule. Idempotent: calling with the current level returns success without writing anything.
+ */
+ public ManagementApiHttpResponse advanceRamp(
+ String id, AdvanceRampRequestContent request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("experimentation/experiments")
+ .addPathSegment(id)
+ .addPathSegments("advance-ramp");
+ 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);
+ }
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
+ 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, AdvanceRampResponseContent.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 404:
+ throw new NotFoundError(
+ 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 (JsonProcessingException e) {
+ throw new ManagementException("Failed to deserialize response: " + e.getMessage(), e);
+ } catch (IOException e) {
+ throw new ManagementException("Network error executing HTTP request", e);
+ }
+ }
+}
diff --git a/src/main/java/com/auth0/client/mgmt/experimentation/types/AdvanceRampRequestContent.java b/src/main/java/com/auth0/client/mgmt/experimentation/types/AdvanceRampRequestContent.java
new file mode 100644
index 000000000..27606366a
--- /dev/null
+++ b/src/main/java/com/auth0/client/mgmt/experimentation/types/AdvanceRampRequestContent.java
@@ -0,0 +1,127 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.auth0.client.mgmt.experimentation.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.databind.annotation.JsonDeserialize;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = AdvanceRampRequestContent.Builder.class)
+public final class AdvanceRampRequestContent {
+ private final int targetLevel;
+
+ private final Map additionalProperties;
+
+ private AdvanceRampRequestContent(int targetLevel, Map additionalProperties) {
+ this.targetLevel = targetLevel;
+ this.additionalProperties = additionalProperties;
+ }
+
+ /**
+ * @return The target percentage level from the experiment schedule. Must be the immediate next level.
+ */
+ @JsonProperty("target_level")
+ public int getTargetLevel() {
+ return targetLevel;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof AdvanceRampRequestContent && equalTo((AdvanceRampRequestContent) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(AdvanceRampRequestContent other) {
+ return targetLevel == other.targetLevel;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.targetLevel);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static TargetLevelStage builder() {
+ return new Builder();
+ }
+
+ public interface TargetLevelStage {
+ /**
+ * The target percentage level from the experiment schedule. Must be the immediate next level.
+ */
+ _FinalStage targetLevel(int targetLevel);
+
+ Builder from(AdvanceRampRequestContent other);
+ }
+
+ public interface _FinalStage {
+ AdvanceRampRequestContent build();
+
+ _FinalStage additionalProperty(String key, Object value);
+
+ _FinalStage additionalProperties(Map additionalProperties);
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder implements TargetLevelStage, _FinalStage {
+ private int targetLevel;
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ @java.lang.Override
+ public Builder from(AdvanceRampRequestContent other) {
+ targetLevel(other.getTargetLevel());
+ return this;
+ }
+
+ /**
+ * The target percentage level from the experiment schedule. Must be the immediate next level.
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ @JsonSetter("target_level")
+ public _FinalStage targetLevel(int targetLevel) {
+ this.targetLevel = targetLevel;
+ return this;
+ }
+
+ @java.lang.Override
+ public AdvanceRampRequestContent build() {
+ return new AdvanceRampRequestContent(targetLevel, 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/guardian/AsyncFactorsClient.java b/src/main/java/com/auth0/client/mgmt/guardian/AsyncFactorsClient.java
index e387e1911..8b80553f9 100644
--- a/src/main/java/com/auth0/client/mgmt/guardian/AsyncFactorsClient.java
+++ b/src/main/java/com/auth0/client/mgmt/guardian/AsyncFactorsClient.java
@@ -6,6 +6,7 @@
import com.auth0.client.mgmt.core.ClientOptions;
import com.auth0.client.mgmt.core.RequestOptions;
import com.auth0.client.mgmt.core.Suppliers;
+import com.auth0.client.mgmt.guardian.factors.AsyncEmailClient;
import com.auth0.client.mgmt.guardian.factors.AsyncPhoneClient;
import com.auth0.client.mgmt.guardian.factors.AsyncPushNotificationClient;
import com.auth0.client.mgmt.guardian.factors.AsyncSmsClient;
@@ -23,6 +24,8 @@ public class AsyncFactorsClient {
private final AsyncRawFactorsClient rawClient;
+ protected final Supplier emailClient;
+
protected final Supplier phoneClient;
protected final Supplier pushNotificationClient;
@@ -34,6 +37,7 @@ public class AsyncFactorsClient {
public AsyncFactorsClient(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
this.rawClient = new AsyncRawFactorsClient(clientOptions);
+ this.emailClient = Suppliers.memoize(() -> new AsyncEmailClient(clientOptions));
this.phoneClient = Suppliers.memoize(() -> new AsyncPhoneClient(clientOptions));
this.pushNotificationClient = Suppliers.memoize(() -> new AsyncPushNotificationClient(clientOptions));
this.smsClient = Suppliers.memoize(() -> new AsyncSmsClient(clientOptions));
@@ -77,6 +81,10 @@ public CompletableFuture set(
return this.rawClient.set(name, request, requestOptions).thenApply(response -> response.body());
}
+ public AsyncEmailClient email() {
+ return this.emailClient.get();
+ }
+
public AsyncPhoneClient phone() {
return this.phoneClient.get();
}
diff --git a/src/main/java/com/auth0/client/mgmt/guardian/AsyncGuardianClient.java b/src/main/java/com/auth0/client/mgmt/guardian/AsyncGuardianClient.java
deleted file mode 100644
index ce7f4ca9b..000000000
--- a/src/main/java/com/auth0/client/mgmt/guardian/AsyncGuardianClient.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * This file was auto-generated by Fern from our API Definition.
- */
-package com.auth0.client.mgmt.guardian;
-
-import com.auth0.client.mgmt.core.ClientOptions;
-import com.auth0.client.mgmt.core.Suppliers;
-import java.util.function.Supplier;
-
-public class AsyncGuardianClient {
- protected final ClientOptions clientOptions;
-
- protected final Supplier enrollmentsClient;
-
- protected final Supplier factorsClient;
-
- protected final Supplier policiesClient;
-
- public AsyncGuardianClient(ClientOptions clientOptions) {
- this.clientOptions = clientOptions;
- this.enrollmentsClient = Suppliers.memoize(() -> new AsyncEnrollmentsClient(clientOptions));
- this.factorsClient = Suppliers.memoize(() -> new AsyncFactorsClient(clientOptions));
- this.policiesClient = Suppliers.memoize(() -> new AsyncPoliciesClient(clientOptions));
- }
-
- public AsyncEnrollmentsClient enrollments() {
- return this.enrollmentsClient.get();
- }
-
- public AsyncFactorsClient factors() {
- return this.factorsClient.get();
- }
-
- public AsyncPoliciesClient policies() {
- return this.policiesClient.get();
- }
-}
diff --git a/src/main/java/com/auth0/client/mgmt/guardian/FactorsClient.java b/src/main/java/com/auth0/client/mgmt/guardian/FactorsClient.java
index 8425b8b9c..0e29a31f0 100644
--- a/src/main/java/com/auth0/client/mgmt/guardian/FactorsClient.java
+++ b/src/main/java/com/auth0/client/mgmt/guardian/FactorsClient.java
@@ -6,6 +6,7 @@
import com.auth0.client.mgmt.core.ClientOptions;
import com.auth0.client.mgmt.core.RequestOptions;
import com.auth0.client.mgmt.core.Suppliers;
+import com.auth0.client.mgmt.guardian.factors.EmailClient;
import com.auth0.client.mgmt.guardian.factors.PhoneClient;
import com.auth0.client.mgmt.guardian.factors.PushNotificationClient;
import com.auth0.client.mgmt.guardian.factors.SmsClient;
@@ -22,6 +23,8 @@ public class FactorsClient {
private final RawFactorsClient rawClient;
+ protected final Supplier emailClient;
+
protected final Supplier phoneClient;
protected final Supplier pushNotificationClient;
@@ -33,6 +36,7 @@ public class FactorsClient {
public FactorsClient(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
this.rawClient = new RawFactorsClient(clientOptions);
+ this.emailClient = Suppliers.memoize(() -> new EmailClient(clientOptions));
this.phoneClient = Suppliers.memoize(() -> new PhoneClient(clientOptions));
this.pushNotificationClient = Suppliers.memoize(() -> new PushNotificationClient(clientOptions));
this.smsClient = Suppliers.memoize(() -> new SmsClient(clientOptions));
@@ -75,6 +79,10 @@ public SetGuardianFactorResponseContent set(
return this.rawClient.set(name, request, requestOptions).body();
}
+ public EmailClient email() {
+ return this.emailClient.get();
+ }
+
public PhoneClient phone() {
return this.phoneClient.get();
}
diff --git a/src/main/java/com/auth0/client/mgmt/guardian/GuardianClient.java b/src/main/java/com/auth0/client/mgmt/guardian/GuardianClient.java
deleted file mode 100644
index 0850d1d09..000000000
--- a/src/main/java/com/auth0/client/mgmt/guardian/GuardianClient.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * This file was auto-generated by Fern from our API Definition.
- */
-package com.auth0.client.mgmt.guardian;
-
-import com.auth0.client.mgmt.core.ClientOptions;
-import com.auth0.client.mgmt.core.Suppliers;
-import java.util.function.Supplier;
-
-public class GuardianClient {
- protected final ClientOptions clientOptions;
-
- protected final Supplier enrollmentsClient;
-
- protected final Supplier factorsClient;
-
- protected final Supplier policiesClient;
-
- public GuardianClient(ClientOptions clientOptions) {
- this.clientOptions = clientOptions;
- this.enrollmentsClient = Suppliers.memoize(() -> new EnrollmentsClient(clientOptions));
- this.factorsClient = Suppliers.memoize(() -> new FactorsClient(clientOptions));
- this.policiesClient = Suppliers.memoize(() -> new PoliciesClient(clientOptions));
- }
-
- public EnrollmentsClient enrollments() {
- return this.enrollmentsClient.get();
- }
-
- public FactorsClient factors() {
- return this.factorsClient.get();
- }
-
- public PoliciesClient policies() {
- return this.policiesClient.get();
- }
-}
diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncEmailClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncEmailClient.java
new file mode 100644
index 000000000..0f5fa9043
--- /dev/null
+++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncEmailClient.java
@@ -0,0 +1,58 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.auth0.client.mgmt.guardian.factors;
+
+import com.auth0.client.mgmt.core.ClientOptions;
+import com.auth0.client.mgmt.core.RequestOptions;
+import com.auth0.client.mgmt.guardian.factors.types.SetEmailFactorSettingsRequestContent;
+import com.auth0.client.mgmt.types.GetEmailFactorSettingsResponseContent;
+import com.auth0.client.mgmt.types.SetEmailFactorSettingsResponseContent;
+import java.util.concurrent.CompletableFuture;
+
+public class AsyncEmailClient {
+ protected final ClientOptions clientOptions;
+
+ private final AsyncRawEmailClient rawClient;
+
+ public AsyncEmailClient(ClientOptions clientOptions) {
+ this.clientOptions = clientOptions;
+ this.rawClient = new AsyncRawEmailClient(clientOptions);
+ }
+
+ /**
+ * Get responses with HTTP metadata like headers
+ */
+ public AsyncRawEmailClient withRawResponse() {
+ return this.rawClient;
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public CompletableFuture get() {
+ return this.rawClient.get().thenApply(response -> response.body());
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public CompletableFuture get(RequestOptions requestOptions) {
+ return this.rawClient.get(requestOptions).thenApply(response -> response.body());
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public CompletableFuture set(SetEmailFactorSettingsRequestContent request) {
+ return this.rawClient.set(request).thenApply(response -> response.body());
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public CompletableFuture set(
+ SetEmailFactorSettingsRequestContent request, RequestOptions requestOptions) {
+ return this.rawClient.set(request, requestOptions).thenApply(response -> response.body());
+ }
+}
diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncPhoneClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncPhoneClient.java
index 955dcc44f..864c6e0aa 100644
--- a/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncPhoneClient.java
+++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncPhoneClient.java
@@ -9,14 +9,17 @@
import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorPhoneTemplatesRequestContent;
import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPhoneRequestContent;
import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPhoneTwilioRequestContent;
+import com.auth0.client.mgmt.guardian.factors.types.SetPhoneFactorSettingsRequestContent;
import com.auth0.client.mgmt.types.GetGuardianFactorPhoneMessageTypesResponseContent;
import com.auth0.client.mgmt.types.GetGuardianFactorPhoneTemplatesResponseContent;
import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPhoneResponseContent;
import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPhoneTwilioResponseContent;
+import com.auth0.client.mgmt.types.GetPhoneFactorSettingsResponseContent;
import com.auth0.client.mgmt.types.SetGuardianFactorPhoneMessageTypesResponseContent;
import com.auth0.client.mgmt.types.SetGuardianFactorPhoneTemplatesResponseContent;
import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPhoneResponseContent;
import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPhoneTwilioResponseContent;
+import com.auth0.client.mgmt.types.SetPhoneFactorSettingsResponseContent;
import java.util.concurrent.CompletableFuture;
public class AsyncPhoneClient {
@@ -138,6 +141,35 @@ public CompletableFuture setProv
return this.rawClient.setProvider(request, requestOptions).thenApply(response -> response.body());
}
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public CompletableFuture get() {
+ return this.rawClient.get().thenApply(response -> response.body());
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public CompletableFuture get(RequestOptions requestOptions) {
+ return this.rawClient.get(requestOptions).thenApply(response -> response.body());
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public CompletableFuture set(SetPhoneFactorSettingsRequestContent request) {
+ return this.rawClient.set(request).thenApply(response -> response.body());
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public CompletableFuture set(
+ SetPhoneFactorSettingsRequestContent request, RequestOptions requestOptions) {
+ return this.rawClient.set(request, requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Retrieve details of the multi-factor authentication enrollment and verification templates for phone-type factors available in your tenant.
*/
diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncRawEmailClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncRawEmailClient.java
new file mode 100644
index 000000000..700b5898e
--- /dev/null
+++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncRawEmailClient.java
@@ -0,0 +1,243 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.auth0.client.mgmt.guardian.factors;
+
+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.RequestOptions;
+import com.auth0.client.mgmt.core.RetryInterceptor;
+import com.auth0.client.mgmt.errors.BadRequestError;
+import com.auth0.client.mgmt.errors.ForbiddenError;
+import com.auth0.client.mgmt.errors.TooManyRequestsError;
+import com.auth0.client.mgmt.errors.UnauthorizedError;
+import com.auth0.client.mgmt.guardian.factors.types.SetEmailFactorSettingsRequestContent;
+import com.auth0.client.mgmt.types.GetEmailFactorSettingsResponseContent;
+import com.auth0.client.mgmt.types.SetEmailFactorSettingsResponseContent;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import java.io.IOException;
+import java.util.concurrent.CompletableFuture;
+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 AsyncRawEmailClient {
+ protected final ClientOptions clientOptions;
+
+ public AsyncRawEmailClient(ClientOptions clientOptions) {
+ this.clientOptions = clientOptions;
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public CompletableFuture> get() {
+ return get(null);
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public CompletableFuture> get(
+ RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("guardian/factors/email/settings");
+ 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);
+ }
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
+ 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, GetEmailFactorSettingsResponseContent.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 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 (JsonProcessingException e) {
+ future.completeExceptionally(
+ new ManagementException("Failed to deserialize response: " + e.getMessage(), e));
+ } 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;
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public CompletableFuture> set(
+ SetEmailFactorSettingsRequestContent request) {
+ return set(request, null);
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public CompletableFuture> set(
+ SetEmailFactorSettingsRequestContent request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("guardian/factors/email/settings");
+ 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("PUT", 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);
+ }
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
+ 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, SetEmailFactorSettingsResponseContent.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 (JsonProcessingException e) {
+ future.completeExceptionally(
+ new ManagementException("Failed to deserialize response: " + e.getMessage(), e));
+ } 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/guardian/factors/AsyncRawPhoneClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncRawPhoneClient.java
index b3610c867..b8c1c411e 100644
--- a/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncRawPhoneClient.java
+++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/AsyncRawPhoneClient.java
@@ -14,19 +14,23 @@
import com.auth0.client.mgmt.errors.BadRequestError;
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.guardian.factors.types.SetGuardianFactorPhoneMessageTypesRequestContent;
import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorPhoneTemplatesRequestContent;
import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPhoneRequestContent;
import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPhoneTwilioRequestContent;
+import com.auth0.client.mgmt.guardian.factors.types.SetPhoneFactorSettingsRequestContent;
import com.auth0.client.mgmt.types.GetGuardianFactorPhoneMessageTypesResponseContent;
import com.auth0.client.mgmt.types.GetGuardianFactorPhoneTemplatesResponseContent;
import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPhoneResponseContent;
import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPhoneTwilioResponseContent;
+import com.auth0.client.mgmt.types.GetPhoneFactorSettingsResponseContent;
import com.auth0.client.mgmt.types.SetGuardianFactorPhoneMessageTypesResponseContent;
import com.auth0.client.mgmt.types.SetGuardianFactorPhoneTemplatesResponseContent;
import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPhoneResponseContent;
import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPhoneTwilioResponseContent;
+import com.auth0.client.mgmt.types.SetPhoneFactorSettingsResponseContent;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.io.IOException;
import java.util.concurrent.CompletableFuture;
@@ -660,6 +664,208 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
return future;
}
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public CompletableFuture> get() {
+ return get(null);
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public CompletableFuture> get(
+ RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("guardian/factors/phone/settings");
+ 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);
+ }
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
+ 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, GetPhoneFactorSettingsResponseContent.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 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 (JsonProcessingException e) {
+ future.completeExceptionally(
+ new ManagementException("Failed to deserialize response: " + e.getMessage(), e));
+ } 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;
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public CompletableFuture> set(
+ SetPhoneFactorSettingsRequestContent request) {
+ return set(request, null);
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public CompletableFuture> set(
+ SetPhoneFactorSettingsRequestContent request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("guardian/factors/phone/settings");
+ 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("PUT", 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);
+ }
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
+ 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, SetPhoneFactorSettingsResponseContent.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 (JsonProcessingException e) {
+ future.completeExceptionally(
+ new ManagementException("Failed to deserialize response: " + e.getMessage(), e));
+ } 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;
+ }
+
/**
* Retrieve details of the multi-factor authentication enrollment and verification templates for phone-type factors available in your tenant.
*/
diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/EmailClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/EmailClient.java
new file mode 100644
index 000000000..8107c39d5
--- /dev/null
+++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/EmailClient.java
@@ -0,0 +1,57 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.auth0.client.mgmt.guardian.factors;
+
+import com.auth0.client.mgmt.core.ClientOptions;
+import com.auth0.client.mgmt.core.RequestOptions;
+import com.auth0.client.mgmt.guardian.factors.types.SetEmailFactorSettingsRequestContent;
+import com.auth0.client.mgmt.types.GetEmailFactorSettingsResponseContent;
+import com.auth0.client.mgmt.types.SetEmailFactorSettingsResponseContent;
+
+public class EmailClient {
+ protected final ClientOptions clientOptions;
+
+ private final RawEmailClient rawClient;
+
+ public EmailClient(ClientOptions clientOptions) {
+ this.clientOptions = clientOptions;
+ this.rawClient = new RawEmailClient(clientOptions);
+ }
+
+ /**
+ * Get responses with HTTP metadata like headers
+ */
+ public RawEmailClient withRawResponse() {
+ return this.rawClient;
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public GetEmailFactorSettingsResponseContent get() {
+ return this.rawClient.get().body();
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public GetEmailFactorSettingsResponseContent get(RequestOptions requestOptions) {
+ return this.rawClient.get(requestOptions).body();
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public SetEmailFactorSettingsResponseContent set(SetEmailFactorSettingsRequestContent request) {
+ return this.rawClient.set(request).body();
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public SetEmailFactorSettingsResponseContent set(
+ SetEmailFactorSettingsRequestContent request, RequestOptions requestOptions) {
+ return this.rawClient.set(request, requestOptions).body();
+ }
+}
diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/PhoneClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/PhoneClient.java
index baae8b16a..a41e3157e 100644
--- a/src/main/java/com/auth0/client/mgmt/guardian/factors/PhoneClient.java
+++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/PhoneClient.java
@@ -9,14 +9,17 @@
import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorPhoneTemplatesRequestContent;
import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPhoneRequestContent;
import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPhoneTwilioRequestContent;
+import com.auth0.client.mgmt.guardian.factors.types.SetPhoneFactorSettingsRequestContent;
import com.auth0.client.mgmt.types.GetGuardianFactorPhoneMessageTypesResponseContent;
import com.auth0.client.mgmt.types.GetGuardianFactorPhoneTemplatesResponseContent;
import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPhoneResponseContent;
import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPhoneTwilioResponseContent;
+import com.auth0.client.mgmt.types.GetPhoneFactorSettingsResponseContent;
import com.auth0.client.mgmt.types.SetGuardianFactorPhoneMessageTypesResponseContent;
import com.auth0.client.mgmt.types.SetGuardianFactorPhoneTemplatesResponseContent;
import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPhoneResponseContent;
import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPhoneTwilioResponseContent;
+import com.auth0.client.mgmt.types.SetPhoneFactorSettingsResponseContent;
public class PhoneClient {
protected final ClientOptions clientOptions;
@@ -133,6 +136,35 @@ public SetGuardianFactorsProviderPhoneResponseContent setProvider(
return this.rawClient.setProvider(request, requestOptions).body();
}
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public GetPhoneFactorSettingsResponseContent get() {
+ return this.rawClient.get().body();
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public GetPhoneFactorSettingsResponseContent get(RequestOptions requestOptions) {
+ return this.rawClient.get(requestOptions).body();
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public SetPhoneFactorSettingsResponseContent set(SetPhoneFactorSettingsRequestContent request) {
+ return this.rawClient.set(request).body();
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public SetPhoneFactorSettingsResponseContent set(
+ SetPhoneFactorSettingsRequestContent request, RequestOptions requestOptions) {
+ return this.rawClient.set(request, requestOptions).body();
+ }
+
/**
* Retrieve details of the multi-factor authentication enrollment and verification templates for phone-type factors available in your tenant.
*/
diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/RawEmailClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/RawEmailClient.java
new file mode 100644
index 000000000..fe18b67c8
--- /dev/null
+++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/RawEmailClient.java
@@ -0,0 +1,194 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.auth0.client.mgmt.guardian.factors;
+
+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.RequestOptions;
+import com.auth0.client.mgmt.core.RetryInterceptor;
+import com.auth0.client.mgmt.errors.BadRequestError;
+import com.auth0.client.mgmt.errors.ForbiddenError;
+import com.auth0.client.mgmt.errors.TooManyRequestsError;
+import com.auth0.client.mgmt.errors.UnauthorizedError;
+import com.auth0.client.mgmt.guardian.factors.types.SetEmailFactorSettingsRequestContent;
+import com.auth0.client.mgmt.types.GetEmailFactorSettingsResponseContent;
+import com.auth0.client.mgmt.types.SetEmailFactorSettingsResponseContent;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import java.io.IOException;
+import okhttp3.Headers;
+import okhttp3.HttpUrl;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+import okhttp3.ResponseBody;
+
+public class RawEmailClient {
+ protected final ClientOptions clientOptions;
+
+ public RawEmailClient(ClientOptions clientOptions) {
+ this.clientOptions = clientOptions;
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public ManagementApiHttpResponse get() {
+ return get(null);
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public ManagementApiHttpResponse get(RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("guardian/factors/email/settings");
+ 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);
+ }
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
+ 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, GetEmailFactorSettingsResponseContent.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 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 (JsonProcessingException e) {
+ throw new ManagementException("Failed to deserialize response: " + e.getMessage(), e);
+ } catch (IOException e) {
+ throw new ManagementException("Network error executing HTTP request", e);
+ }
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public ManagementApiHttpResponse set(
+ SetEmailFactorSettingsRequestContent request) {
+ return set(request, null);
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public ManagementApiHttpResponse set(
+ SetEmailFactorSettingsRequestContent request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("guardian/factors/email/settings");
+ 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("PUT", 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);
+ }
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
+ 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, SetEmailFactorSettingsResponseContent.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 (JsonProcessingException e) {
+ throw new ManagementException("Failed to deserialize response: " + e.getMessage(), e);
+ } catch (IOException e) {
+ throw new ManagementException("Network error executing HTTP request", e);
+ }
+ }
+}
diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/RawPhoneClient.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/RawPhoneClient.java
index 298166602..2926220f4 100644
--- a/src/main/java/com/auth0/client/mgmt/guardian/factors/RawPhoneClient.java
+++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/RawPhoneClient.java
@@ -14,19 +14,23 @@
import com.auth0.client.mgmt.errors.BadRequestError;
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.guardian.factors.types.SetGuardianFactorPhoneMessageTypesRequestContent;
import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorPhoneTemplatesRequestContent;
import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPhoneRequestContent;
import com.auth0.client.mgmt.guardian.factors.types.SetGuardianFactorsProviderPhoneTwilioRequestContent;
+import com.auth0.client.mgmt.guardian.factors.types.SetPhoneFactorSettingsRequestContent;
import com.auth0.client.mgmt.types.GetGuardianFactorPhoneMessageTypesResponseContent;
import com.auth0.client.mgmt.types.GetGuardianFactorPhoneTemplatesResponseContent;
import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPhoneResponseContent;
import com.auth0.client.mgmt.types.GetGuardianFactorsProviderPhoneTwilioResponseContent;
+import com.auth0.client.mgmt.types.GetPhoneFactorSettingsResponseContent;
import com.auth0.client.mgmt.types.SetGuardianFactorPhoneMessageTypesResponseContent;
import com.auth0.client.mgmt.types.SetGuardianFactorPhoneTemplatesResponseContent;
import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPhoneResponseContent;
import com.auth0.client.mgmt.types.SetGuardianFactorsProviderPhoneTwilioResponseContent;
+import com.auth0.client.mgmt.types.SetPhoneFactorSettingsResponseContent;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.io.IOException;
import okhttp3.Headers;
@@ -523,6 +527,163 @@ public ManagementApiHttpResponse
}
}
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public ManagementApiHttpResponse get() {
+ return get(null);
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public ManagementApiHttpResponse get(RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("guardian/factors/phone/settings");
+ 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);
+ }
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
+ 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, GetPhoneFactorSettingsResponseContent.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 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 (JsonProcessingException e) {
+ throw new ManagementException("Failed to deserialize response: " + e.getMessage(), e);
+ } catch (IOException e) {
+ throw new ManagementException("Network error executing HTTP request", e);
+ }
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public ManagementApiHttpResponse set(
+ SetPhoneFactorSettingsRequestContent request) {
+ return set(request, null);
+ }
+
+ /**
+ * TODO: Link this endpoint to relevant documentation when available.
+ */
+ public ManagementApiHttpResponse set(
+ SetPhoneFactorSettingsRequestContent request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("guardian/factors/phone/settings");
+ 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("PUT", 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);
+ }
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
+ 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, SetPhoneFactorSettingsResponseContent.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 (JsonProcessingException e) {
+ throw new ManagementException("Failed to deserialize response: " + e.getMessage(), e);
+ } catch (IOException e) {
+ throw new ManagementException("Network error executing HTTP request", e);
+ }
+ }
+
/**
* Retrieve details of the multi-factor authentication enrollment and verification templates for phone-type factors available in your tenant.
*/
diff --git a/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetEmailFactorSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetEmailFactorSettingsRequestContent.java
new file mode 100644
index 000000000..6dbf47aea
--- /dev/null
+++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetEmailFactorSettingsRequestContent.java
@@ -0,0 +1,161 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.auth0.client.mgmt.guardian.factors.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.databind.annotation.JsonDeserialize;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = SetEmailFactorSettingsRequestContent.Builder.class)
+public final class SetEmailFactorSettingsRequestContent {
+ private final int otpLength;
+
+ private final int otpExpirationTime;
+
+ private final Map additionalProperties;
+
+ private SetEmailFactorSettingsRequestContent(
+ int otpLength, int otpExpirationTime, Map additionalProperties) {
+ this.otpLength = otpLength;
+ this.otpExpirationTime = otpExpirationTime;
+ this.additionalProperties = additionalProperties;
+ }
+
+ /**
+ * @return The length of the OTP code.
+ */
+ @JsonProperty("otp_length")
+ public int getOtpLength() {
+ return otpLength;
+ }
+
+ /**
+ * @return The OTP expiration time in seconds.
+ */
+ @JsonProperty("otp_expiration_time")
+ public int getOtpExpirationTime() {
+ return otpExpirationTime;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof SetEmailFactorSettingsRequestContent
+ && equalTo((SetEmailFactorSettingsRequestContent) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(SetEmailFactorSettingsRequestContent other) {
+ return otpLength == other.otpLength && otpExpirationTime == other.otpExpirationTime;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.otpLength, this.otpExpirationTime);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static OtpLengthStage builder() {
+ return new Builder();
+ }
+
+ public interface OtpLengthStage {
+ /**
+ * The length of the OTP code.
+ */
+ OtpExpirationTimeStage otpLength(int otpLength);
+
+ Builder from(SetEmailFactorSettingsRequestContent other);
+ }
+
+ public interface OtpExpirationTimeStage {
+ /**
+ * The OTP expiration time in seconds.
+ */
+ _FinalStage otpExpirationTime(int otpExpirationTime);
+ }
+
+ public interface _FinalStage {
+ SetEmailFactorSettingsRequestContent build();
+
+ _FinalStage additionalProperty(String key, Object value);
+
+ _FinalStage additionalProperties(Map additionalProperties);
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder implements OtpLengthStage, OtpExpirationTimeStage, _FinalStage {
+ private int otpLength;
+
+ private int otpExpirationTime;
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ @java.lang.Override
+ public Builder from(SetEmailFactorSettingsRequestContent other) {
+ otpLength(other.getOtpLength());
+ otpExpirationTime(other.getOtpExpirationTime());
+ return this;
+ }
+
+ /**
+ * The length of the OTP code.
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ @JsonSetter("otp_length")
+ public OtpExpirationTimeStage otpLength(int otpLength) {
+ this.otpLength = otpLength;
+ return this;
+ }
+
+ /**
+ * The OTP expiration time in seconds.
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ @JsonSetter("otp_expiration_time")
+ public _FinalStage otpExpirationTime(int otpExpirationTime) {
+ this.otpExpirationTime = otpExpirationTime;
+ return this;
+ }
+
+ @java.lang.Override
+ public SetEmailFactorSettingsRequestContent build() {
+ return new SetEmailFactorSettingsRequestContent(otpLength, otpExpirationTime, 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/guardian/factors/types/SetPhoneFactorSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetPhoneFactorSettingsRequestContent.java
new file mode 100644
index 000000000..ecd3bbbae
--- /dev/null
+++ b/src/main/java/com/auth0/client/mgmt/guardian/factors/types/SetPhoneFactorSettingsRequestContent.java
@@ -0,0 +1,161 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.auth0.client.mgmt.guardian.factors.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.databind.annotation.JsonDeserialize;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = SetPhoneFactorSettingsRequestContent.Builder.class)
+public final class SetPhoneFactorSettingsRequestContent {
+ private final int otpLength;
+
+ private final int otpExpirationTime;
+
+ private final Map additionalProperties;
+
+ private SetPhoneFactorSettingsRequestContent(
+ int otpLength, int otpExpirationTime, Map additionalProperties) {
+ this.otpLength = otpLength;
+ this.otpExpirationTime = otpExpirationTime;
+ this.additionalProperties = additionalProperties;
+ }
+
+ /**
+ * @return The length of the OTP code.
+ */
+ @JsonProperty("otp_length")
+ public int getOtpLength() {
+ return otpLength;
+ }
+
+ /**
+ * @return The OTP expiration time in seconds.
+ */
+ @JsonProperty("otp_expiration_time")
+ public int getOtpExpirationTime() {
+ return otpExpirationTime;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof SetPhoneFactorSettingsRequestContent
+ && equalTo((SetPhoneFactorSettingsRequestContent) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(SetPhoneFactorSettingsRequestContent other) {
+ return otpLength == other.otpLength && otpExpirationTime == other.otpExpirationTime;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.otpLength, this.otpExpirationTime);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static OtpLengthStage builder() {
+ return new Builder();
+ }
+
+ public interface OtpLengthStage {
+ /**
+ * The length of the OTP code.
+ */
+ OtpExpirationTimeStage otpLength(int otpLength);
+
+ Builder from(SetPhoneFactorSettingsRequestContent other);
+ }
+
+ public interface OtpExpirationTimeStage {
+ /**
+ * The OTP expiration time in seconds.
+ */
+ _FinalStage otpExpirationTime(int otpExpirationTime);
+ }
+
+ public interface _FinalStage {
+ SetPhoneFactorSettingsRequestContent build();
+
+ _FinalStage additionalProperty(String key, Object value);
+
+ _FinalStage additionalProperties(Map additionalProperties);
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder implements OtpLengthStage, OtpExpirationTimeStage, _FinalStage {
+ private int otpLength;
+
+ private int otpExpirationTime;
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ @java.lang.Override
+ public Builder from(SetPhoneFactorSettingsRequestContent other) {
+ otpLength(other.getOtpLength());
+ otpExpirationTime(other.getOtpExpirationTime());
+ return this;
+ }
+
+ /**
+ * The length of the OTP code.
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ @JsonSetter("otp_length")
+ public OtpExpirationTimeStage otpLength(int otpLength) {
+ this.otpLength = otpLength;
+ return this;
+ }
+
+ /**
+ * The OTP expiration time in seconds.
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ @JsonSetter("otp_expiration_time")
+ public _FinalStage otpExpirationTime(int otpExpirationTime) {
+ this.otpExpirationTime = otpExpirationTime;
+ return this;
+ }
+
+ @java.lang.Override
+ public SetPhoneFactorSettingsRequestContent build() {
+ return new SetPhoneFactorSettingsRequestContent(otpLength, otpExpirationTime, 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/AdvanceRampResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/AdvanceRampResponseContent.java
new file mode 100644
index 000000000..769abc26d
--- /dev/null
+++ b/src/main/java/com/auth0/client/mgmt/types/AdvanceRampResponseContent.java
@@ -0,0 +1,193 @@
+/**
+ * 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.databind.annotation.JsonDeserialize;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import org.jetbrains.annotations.NotNull;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = AdvanceRampResponseContent.Builder.class)
+public final class AdvanceRampResponseContent {
+ private final String experimentId;
+
+ private final int fromLevel;
+
+ private final int toLevel;
+
+ private final int currentLevel;
+
+ private final Map additionalProperties;
+
+ private AdvanceRampResponseContent(
+ String experimentId,
+ int fromLevel,
+ int toLevel,
+ int currentLevel,
+ Map additionalProperties) {
+ this.experimentId = experimentId;
+ this.fromLevel = fromLevel;
+ this.toLevel = toLevel;
+ this.currentLevel = currentLevel;
+ this.additionalProperties = additionalProperties;
+ }
+
+ @JsonProperty("experiment_id")
+ public String getExperimentId() {
+ return experimentId;
+ }
+
+ @JsonProperty("from_level")
+ public int getFromLevel() {
+ return fromLevel;
+ }
+
+ @JsonProperty("to_level")
+ public int getToLevel() {
+ return toLevel;
+ }
+
+ @JsonProperty("current_level")
+ public int getCurrentLevel() {
+ return currentLevel;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof AdvanceRampResponseContent && equalTo((AdvanceRampResponseContent) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(AdvanceRampResponseContent other) {
+ return experimentId.equals(other.experimentId)
+ && fromLevel == other.fromLevel
+ && toLevel == other.toLevel
+ && currentLevel == other.currentLevel;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.experimentId, this.fromLevel, this.toLevel, this.currentLevel);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static ExperimentIdStage builder() {
+ return new Builder();
+ }
+
+ public interface ExperimentIdStage {
+ FromLevelStage experimentId(@NotNull String experimentId);
+
+ Builder from(AdvanceRampResponseContent other);
+ }
+
+ public interface FromLevelStage {
+ ToLevelStage fromLevel(int fromLevel);
+ }
+
+ public interface ToLevelStage {
+ CurrentLevelStage toLevel(int toLevel);
+ }
+
+ public interface CurrentLevelStage {
+ _FinalStage currentLevel(int currentLevel);
+ }
+
+ public interface _FinalStage {
+ AdvanceRampResponseContent build();
+
+ _FinalStage additionalProperty(String key, Object value);
+
+ _FinalStage additionalProperties(Map additionalProperties);
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder
+ implements ExperimentIdStage, FromLevelStage, ToLevelStage, CurrentLevelStage, _FinalStage {
+ private String experimentId;
+
+ private int fromLevel;
+
+ private int toLevel;
+
+ private int currentLevel;
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ @java.lang.Override
+ public Builder from(AdvanceRampResponseContent other) {
+ experimentId(other.getExperimentId());
+ fromLevel(other.getFromLevel());
+ toLevel(other.getToLevel());
+ currentLevel(other.getCurrentLevel());
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("experiment_id")
+ public FromLevelStage experimentId(@NotNull String experimentId) {
+ this.experimentId = Objects.requireNonNull(experimentId, "experimentId must not be null");
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("from_level")
+ public ToLevelStage fromLevel(int fromLevel) {
+ this.fromLevel = fromLevel;
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("to_level")
+ public CurrentLevelStage toLevel(int toLevel) {
+ this.toLevel = toLevel;
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("current_level")
+ public _FinalStage currentLevel(int currentLevel) {
+ this.currentLevel = currentLevel;
+ return this;
+ }
+
+ @java.lang.Override
+ public AdvanceRampResponseContent build() {
+ return new AdvanceRampResponseContent(experimentId, fromLevel, toLevel, currentLevel, 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/OrganizationTemplateAssignedOrganization.java b/src/main/java/com/auth0/client/mgmt/types/AnonymousSessions.java
similarity index 59%
rename from src/main/java/com/auth0/client/mgmt/types/OrganizationTemplateAssignedOrganization.java
rename to src/main/java/com/auth0/client/mgmt/types/AnonymousSessions.java
index 7bc0006b0..74a13666c 100644
--- a/src/main/java/com/auth0/client/mgmt/types/OrganizationTemplateAssignedOrganization.java
+++ b/src/main/java/com/auth0/client/mgmt/types/AnonymousSessions.java
@@ -14,33 +14,31 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
-import org.jetbrains.annotations.NotNull;
@JsonInclude(JsonInclude.Include.NON_ABSENT)
-@JsonDeserialize(builder = OrganizationTemplateAssignedOrganization.Builder.class)
-public final class OrganizationTemplateAssignedOrganization {
- private final String id;
+@JsonDeserialize(builder = AnonymousSessions.Builder.class)
+public final class AnonymousSessions {
+ private final boolean active;
private final Map additionalProperties;
- private OrganizationTemplateAssignedOrganization(String id, Map additionalProperties) {
- this.id = id;
+ private AnonymousSessions(boolean active, Map additionalProperties) {
+ this.active = active;
this.additionalProperties = additionalProperties;
}
/**
- * @return Organization identifier.
+ * @return If set to true, this client is allowed to create anonymous sessions.
*/
- @JsonProperty("id")
- public String getId() {
- return id;
+ @JsonProperty("active")
+ public boolean getActive() {
+ return active;
}
@java.lang.Override
public boolean equals(Object other) {
if (this == other) return true;
- return other instanceof OrganizationTemplateAssignedOrganization
- && equalTo((OrganizationTemplateAssignedOrganization) other);
+ return other instanceof AnonymousSessions && equalTo((AnonymousSessions) other);
}
@JsonAnyGetter
@@ -48,13 +46,13 @@ public Map getAdditionalProperties() {
return this.additionalProperties;
}
- private boolean equalTo(OrganizationTemplateAssignedOrganization other) {
- return id.equals(other.id);
+ private boolean equalTo(AnonymousSessions other) {
+ return active == other.active;
}
@java.lang.Override
public int hashCode() {
- return Objects.hash(this.id);
+ return Objects.hash(this.active);
}
@java.lang.Override
@@ -62,21 +60,21 @@ public String toString() {
return ObjectMappers.stringify(this);
}
- public static IdStage builder() {
+ public static ActiveStage builder() {
return new Builder();
}
- public interface IdStage {
+ public interface ActiveStage {
/**
- * Organization identifier.
+ * If set to true, this client is allowed to create anonymous sessions.
*/
- _FinalStage id(@NotNull String id);
+ _FinalStage active(boolean active);
- Builder from(OrganizationTemplateAssignedOrganization other);
+ Builder from(AnonymousSessions other);
}
public interface _FinalStage {
- OrganizationTemplateAssignedOrganization build();
+ AnonymousSessions build();
_FinalStage additionalProperty(String key, Object value);
@@ -84,8 +82,8 @@ public interface _FinalStage {
}
@JsonIgnoreProperties(ignoreUnknown = true)
- public static final class Builder implements IdStage, _FinalStage {
- private String id;
+ public static final class Builder implements ActiveStage, _FinalStage {
+ private boolean active;
@JsonAnySetter
private Map additionalProperties = new HashMap<>();
@@ -93,25 +91,25 @@ public static final class Builder implements IdStage, _FinalStage {
private Builder() {}
@java.lang.Override
- public Builder from(OrganizationTemplateAssignedOrganization other) {
- id(other.getId());
+ public Builder from(AnonymousSessions other) {
+ active(other.getActive());
return this;
}
/**
- * Organization identifier.
+ * If set to true, this client is allowed to create anonymous sessions.
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
- @JsonSetter("id")
- public _FinalStage id(@NotNull String id) {
- this.id = Objects.requireNonNull(id, "id must not be null");
+ @JsonSetter("active")
+ public _FinalStage active(boolean active) {
+ this.active = active;
return this;
}
@java.lang.Override
- public OrganizationTemplateAssignedOrganization build() {
- return new OrganizationTemplateAssignedOrganization(id, additionalProperties);
+ public AnonymousSessions build() {
+ return new AnonymousSessions(active, additionalProperties);
}
@java.lang.Override
diff --git a/src/main/java/com/auth0/client/mgmt/types/Client.java b/src/main/java/com/auth0/client/mgmt/types/Client.java
index ce2cb3645..2ab27c242 100644
--- a/src/main/java/com/auth0/client/mgmt/types/Client.java
+++ b/src/main/java/com/auth0/client/mgmt/types/Client.java
@@ -14,6 +14,7 @@
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import java.time.OffsetDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -26,6 +27,10 @@
public final class Client {
private final Optional clientId;
+ private final Optional createdAt;
+
+ private final Optional updatedAt;
+
private final Optional tenant;
private final Optional name;
@@ -138,6 +143,8 @@ public final class Client {
private final Optional identityAssertionAuthorizationGrant;
+ private final Optional