diff --git a/.fern/replay.lock b/.fern/replay.lock index 67af0e9fc..cc282d9c5 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -42,5 +42,11 @@ generations: cli_version: unknown generator_versions: fernapi/fern-java-sdk: 4.11.1 -current_generation: 6981a2ead10a6b0f4d15c2b21942acdb6de4a930 + - commit_sha: b97372b9f40b0341aa2ac580fa64488e2ad2aff2 + tree_hash: 9904aaf894abb20b613cbd03d6e2fea95e28de1f + timestamp: 2026-09-11T02:55:27.155Z + cli_version: unknown + generator_versions: + fernapi/fern-java-sdk: 4.11.1 +current_generation: b97372b9f40b0341aa2ac580fa64488e2ad2aff2 patches: [] diff --git a/reference.md b/reference.md index 739d6695c..656c10111 100644 --- a/reference.md +++ b/reference.md @@ -2138,6 +2138,14 @@ See https://auth0.com/docs/secure/security-guidance/measures-against-app-imperso
+**anonymousSessions:** `Optional` + +
+
+ +
+
+ **thirdPartySecurityMode:** `Optional`
@@ -2779,6 +2787,14 @@ client.clients().update(
+**anonymousSessions:** `Optional` + +
+
+ +
+
+ **formTemplate:** `Optional` — Form template for WS-Federation protocol
@@ -4956,7 +4972,7 @@ client.deviceCredentials().list(
-**type:** `Optional` — Type of credentials to retrieve. Must be `public_key`, `refresh_token` or `rotating_refresh_token`. The property will default to `refresh_token` when paging is requested +**type:** `Optional` — Type of credentials to retrieve. Must be `public_key`, `refresh_token` or `rotating_refresh_token`. If none is provided a combined list of `refresh_tokens` and `public_keys` will be returned (and no `rotating_refresh_token`), in this case `page`, `per_page` and `include_totals` will be ignored.
@@ -7109,6 +7125,132 @@ client.groups().delete("id");
+ +
+ + +## Guardian +
client.guardian.get() -> GetGuardianSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +TODO: Link this endpoint to relevant documentation when available. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().get(); +``` +
+
+
+
+ + +
+
+
+ +
client.guardian.set(request) -> SetGuardianSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update a tenant's guardian settings such as Remember Me +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().set( + SetGuardianSettingsRequestContent + .builder() + .displayRememberMeCheckbox(true) + .rememberMeDefaultValue(true) + .mfaSessionInactivityTimeout(1) + .mfaSessionOverallTimeout(1) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**displayRememberMeCheckbox:** `Boolean` — Determines whether to display the "Remember Me" checkbox on the MFA prompt in Universal Login. + +
+
+ +
+
+ +**rememberMeDefaultValue:** `Boolean` — Determines the default state of the "Remember Me" checkbox on the MFA prompt in Universal Login. + +
+
+ +
+
+ +**mfaSessionInactivityTimeout:** `Integer` — Duration of inactivity after which the user will be prompted for MFA. Represented as seconds. Minimum duration is 1 hour, maximum is 30 days, and cannot exceed the overall timeout. + +
+
+ +
+
+ +**mfaSessionOverallTimeout:** `Integer` — Maximum duration after which the user will be prompted for MFA regardless of activity. Represented as seconds. Minimum duration is 1 hour, maximum is 90 days. + +
+
+
+
+ +
@@ -9064,8 +9206,8 @@ client.networkAcls().update( -## OrganizationTemplates -
client.organizationTemplates.list() -> SyncPagingIterable<OrganizationTemplate> +## Organizations +
client.organizations.list() -> SyncPagingIterable<Organization>
@@ -9077,7 +9219,23 @@ client.networkAcls().update(
-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. +Retrieve detailed list of all Organizations available in your tenant. For more information, see Auth0 Organizations. + +This endpoint supports two types of pagination: + +- Offset pagination +- Checkpoint pagination + +Checkpoint pagination must be used if you need to retrieve more than 1000 organizations. + +**Checkpoint Pagination** + +To search by checkpoint, use the following parameters: + +- `from`: Optional id from which to start selection. +- `take`: The total number of entries to retrieve when using the `from` parameter. Defaults to 50. + +**Note**: The first time you call this endpoint using checkpoint pagination, omit the `from` parameter. If there are more results, a `next` value is included in the response. You can use this for subsequent API calls. When `next` is no longer included in the response, no pages are remaining.
@@ -9092,11 +9250,14 @@ Retrieve a list of Organization Templates. This endpoint supports Checkpoint pag
```java -client.organizationTemplates().list( - ListOrganizationTemplatesRequestParameters +client.organizations().list( + ListOrganizationsRequestParameters .builder() + .includeTotals(true) .from("from") .take(1) + .sort("sort") + .includeClientAssociationFor("include_client_association_for") .build() ); ``` @@ -9113,6 +9274,14 @@ client.organizationTemplates().list(
+**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + +
+
+ +
+
+ **from:** `Optional` — Optional Id from which to start selection.
@@ -9121,7 +9290,23 @@ client.organizationTemplates().list(
-**take:** `Optional` — Number of results per page. Defaults to 5. Values greater than 10 are capped at 10. +**take:** `Optional` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**sort:** `Optional` — Field to sort by. Use field:order where order is 1 for ascending and -1 for descending. e.g. created_at:1. We currently support sorting by the following fields: name, display_name and created_at. + +
+
+ +
+
+ +**includeClientAssociationFor:** `Optional` — Client ID. When set, each returned organization that has an association with this client gains a client object describing it; organizations without one omit the field.
@@ -9133,7 +9318,7 @@ client.organizationTemplates().list(
-
client.organizationTemplates.create(request) -> OrganizationTemplate +
client.organizations.create(request) -> CreateOrganizationResponseContent
@@ -9145,7 +9330,7 @@ client.organizationTemplates().list(
-Create an Organization Template. +Create a new Organization within your tenant. To learn more about Organization settings, behavior, and configuration options, review [Create Your First Organization](https://auth0.com/docs/manage-users/organizations/create-first-organization).
@@ -9160,13 +9345,10 @@ Create an Organization Template.
```java -client.organizationTemplates().create( - CreateOrganizationTemplateRequestContent +client.organizations().create( + CreateOrganizationRequestContent .builder() .name("name") - .organizationDeletionBehavior(OrganizationDeletionBehaviorEnum.ALLOW) - .enforcePermissionCeiling(true) - .enforceSelfAssignmentRestriction(true) .build() ); ``` @@ -9183,47 +9365,7 @@ client.organizationTemplates().create(
-**name:** `String` — The name of the organization template. - -
-
- -
-
- -**isDefault:** `Optional` — Whether this is the default template applied to new organizations. - -
-
- -
-
- -**organizationDeletionBehavior:** `OrganizationDeletionBehaviorEnum` - -
-
- -
-
- -**connectionDeletionBehavior:** `Optional` - -
-
- -
-
- -**enforcePermissionCeiling:** `Boolean` — Whether to enforce permission ceiling for organizations using this template. - -
-
- -
-
- -**enforceSelfAssignmentRestriction:** `Boolean` — Whether to enforce self-assignment restrictions for organizations using this template. +**name:** `String` — The name of this organization.
@@ -9231,7 +9373,7 @@ client.organizationTemplates().create(
-**connectionProfileId:** `Optional` — The connection profile to apply to new connections. +**displayName:** `Optional` — Friendly name of this organization.
@@ -9239,7 +9381,7 @@ client.organizationTemplates().create(
-**userAttributeProfileId:** `Optional` — The user attribute profile to apply to organizations. +**branding:** `Optional`
@@ -9247,7 +9389,7 @@ client.organizationTemplates().create(
-**allowedStrategies:** `Optional>` — List of allowed connection strategies for this template. +**metadata:** `Optional>>`
@@ -9255,7 +9397,7 @@ client.organizationTemplates().create(
-**invitationLandingClientId:** `Optional` — The client ID for the invitation landing page. +**enabledConnections:** `Optional>` — Connections that will be enabled for this organization. See POST enabled_connections endpoint for the object format. (Max of 10 connections allowed)
@@ -9263,7 +9405,7 @@ client.organizationTemplates().create(
-**adminRolesAssignment:** `Optional>` — Default admin roles to assign to organization creators. +**tokenQuota:** `Optional`
@@ -9271,7 +9413,7 @@ client.organizationTemplates().create(
-**useForOrganizationDiscovery:** `Optional` +**thirdPartyClientAccess:** `Optional`
@@ -9279,7 +9421,7 @@ client.organizationTemplates().create(
-**roleVisibilityPolicy:** `Optional` +**isAppEntitlementActive:** `Optional` — Whether app entitlement is active for this organization.
@@ -9291,7 +9433,7 @@ client.organizationTemplates().create(
-
client.organizationTemplates.get(id) -> OrganizationTemplate +
client.organizations.getByName(name) -> GetOrganizationByNameResponseContent
@@ -9303,7 +9445,7 @@ client.organizationTemplates().create(
-Retrieve details about a single Organization Template specified by ID. +Retrieve details about a single Organization specified by name.
@@ -9318,7 +9460,7 @@ Retrieve details about a single Organization Template specified by ID.
```java -client.organizationTemplates().get("id"); +client.organizations().getByName("name"); ```
@@ -9333,7 +9475,7 @@ client.organizationTemplates().get("id");
-**id:** `String` — Organization Template identifier. +**name:** `String` — name of the organization to retrieve.
@@ -9345,7 +9487,7 @@ client.organizationTemplates().get("id");
-
client.organizationTemplates.update(id, request) -> OrganizationTemplate +
client.organizations.search() -> SyncPagingIterable<SearchOrganization>
@@ -9357,7 +9499,21 @@ client.organizationTemplates().get("id");
-Update the details of a specific Organization Template. +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).
@@ -9372,10 +9528,14 @@ Update the details of a specific Organization Template.
```java -client.organizationTemplates().update( - "id", - UpdateOrganizationTemplateRequestContent +client.organizations().search( + SearchOrganizationsRequestParameters .builder() + .q("q") + .parser(SearchParserEnum.SCIM) + .take(1) + .from("from") + .sort(OrganizationSortFieldEnum.NAME) .build() ); ``` @@ -9392,7 +9552,7 @@ client.organizationTemplates().update(
-**id:** `String` — Organization Template identifier. +**q:** `Optional` — Filter expression in SCIM or Lucene syntax (depending on parser parameter, default: Lucene). Lucene examples: `name:acme*`, `display_name:*auth*`. SCIM examples: `name eq "Auth0"`, `display_name sw "auth" and created_at gt "2024-01-01"`. SCIM operators: eq, ne, sw, ew, co, pr, gt, ge, lt, le, and, or.

Supported Fields:
  • id - Organization ID (case-sensitive, exact match)
  • name - Organization name (supports contains, starts-with, ends-with operators; sortable)
  • display_name - Organization display name (supports contains, starts-with, ends-with operators; sortable)
  • created_at - Creation timestamp (supports date range operators; sortable)
  • metadata.{key} - Filter by organization metadata key-value pairs
Maximum 5 filter operations per query. Results are eventually consistent and may not reflect recent updates.
@@ -9400,7 +9560,7 @@ client.organizationTemplates().update(
-**name:** `Optional` — The name of the organization template. +**parser:** `Optional` — Query parser to use for the filter expression. Use "scim" for SCIM filter syntax or "lucene" for Lucene query syntax (default).
@@ -9408,7 +9568,7 @@ client.organizationTemplates().update(
-**isDefault:** `Optional` — Whether this is the default template applied to new organizations. +**take:** `Optional` — Maximum number of results to return per page (1-100). Defaults to 50.
@@ -9416,7 +9576,7 @@ client.organizationTemplates().update(
-**organizationDeletionBehavior:** `Optional` +**from:** `Optional` — Cursor for the next page of results. Use the value from the next field in the previous response.
@@ -9424,468 +9584,38 @@ client.organizationTemplates().update(
-**connectionDeletionBehavior:** `Optional` +**sort:** `Optional` — Field name to sort results by in ascending order only. Defaults to insertion order (oldest first) if not provided.
+
+
-
-
-**enforcePermissionCeiling:** `Optional` — Whether to enforce permission ceiling for organizations using this template. -
+
+
client.organizations.get(id) -> GetOrganizationResponseContent
-**enforceSelfAssignmentRestriction:** `Optional` — Whether to enforce self-assignment restrictions for organizations using this template. - -
-
+#### 📝 Description
-**connectionProfileId:** `Optional` — The connection profile to apply to new connections. - -
-
-
-**userAttributeProfileId:** `Optional` — The user attribute profile to apply to organizations. - +Retrieve details about a single Organization specified by ID. +
+
-
-
- -**allowedStrategies:** `Optional>` — List of allowed connection strategies for this template. - -
-
- -
-
- -**invitationLandingClientId:** `Optional` — The client ID for the invitation landing page. - -
-
- -
-
- -**adminRolesAssignment:** `Optional>` — Default admin roles to assign to organization creators. - -
-
- -
-
- -**useForOrganizationDiscovery:** `Optional` - -
-
- -
-
- -**roleVisibilityPolicy:** `Optional` - -
-
- - - - - - -
- -
client.organizationTemplates.listOrganizations(id) -> SyncPagingIterable<OrganizationTemplateAssignedOrganization> -
-
- -#### 📝 Description - -
-
- -
-
- -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. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```java -client.organizationTemplates().listOrganizations( - "id", - ListTemplateOrganizationsRequestParameters - .builder() - .from("from") - .take(1) - .build() -); -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `String` — The ID of the organization template. - -
-
- -
-
- -**from:** `Optional` — Optional Id from which to start selection. - -
-
- -
-
- -**take:** `Optional` — Number of results per page. Defaults to 5. Values greater than 10 are capped at 10. - -
-
-
-
- - -
-
-
- -## Organizations -
client.organizations.list() -> SyncPagingIterable<Organization> -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve detailed list of all Organizations available in your tenant. For more information, see Auth0 Organizations. - -This endpoint supports two types of pagination: - -- Offset pagination -- Checkpoint pagination - -Checkpoint pagination must be used if you need to retrieve more than 1000 organizations. - -**Checkpoint Pagination** - -To search by checkpoint, use the following parameters: - -- `from`: Optional id from which to start selection. -- `take`: The total number of entries to retrieve when using the `from` parameter. Defaults to 50. - -**Note**: The first time you call this endpoint using checkpoint pagination, omit the `from` parameter. If there are more results, a `next` value is included in the response. You can use this for subsequent API calls. When `next` is no longer included in the response, no pages are remaining. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```java -client.organizations().list( - ListOrganizationsRequestParameters - .builder() - .includeTotals(true) - .from("from") - .take(1) - .sort("sort") - .includeClientAssociationFor("include_client_association_for") - .build() -); -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**includeTotals:** `Optional` — Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). - -
-
- -
-
- -**from:** `Optional` — Optional Id from which to start selection. - -
-
- -
-
- -**take:** `Optional` — Number of results per page. Defaults to 50. - -
-
- -
-
- -**sort:** `Optional` — Field to sort by. Use field:order where order is 1 for ascending and -1 for descending. e.g. created_at:1. We currently support sorting by the following fields: name, display_name and created_at. - -
-
- -
-
- -**includeClientAssociationFor:** `Optional` — Client ID. When set, each returned organization that has an association with this client gains a client object describing it; organizations without one omit the field. - -
-
-
-
- - -
-
-
- -
client.organizations.create(request) -> CreateOrganizationResponseContent -
-
- -#### 📝 Description - -
-
- -
-
- -Create a new Organization within your tenant. To learn more about Organization settings, behavior, and configuration options, review [Create Your First Organization](https://auth0.com/docs/manage-users/organizations/create-first-organization). -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```java -client.organizations().create( - CreateOrganizationRequestContent - .builder() - .name("name") - .build() -); -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**name:** `String` — The name of this organization. - -
-
- -
-
- -**displayName:** `Optional` — Friendly name of this organization. - -
-
- -
-
- -**branding:** `Optional` - -
-
- -
-
- -**metadata:** `Optional>>` - -
-
- -
-
- -**enabledConnections:** `Optional>` — Connections that will be enabled for this organization. See POST enabled_connections endpoint for the object format. (Max of 10 connections allowed) - -
-
- -
-
- -**tokenQuota:** `Optional` - -
-
- -
-
- -**thirdPartyClientAccess:** `Optional` - -
-
- -
-
- -**isAppEntitlementActive:** `Optional` — Whether app entitlement is active for this organization. - -
-
-
-
- - -
-
-
- -
client.organizations.getByName(name) -> GetOrganizationByNameResponseContent -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve details about a single Organization specified by name. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```java -client.organizations().getByName("name"); -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**name:** `String` — name of the organization to retrieve. - -
-
-
-
- - -
-
-
- -
client.organizations.get(id) -> GetOrganizationResponseContent -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve details about a single Organization specified by ID. -
-
-
-
- -#### 🔌 Usage - +#### 🔌 Usage +
@@ -11086,6 +10816,14 @@ client.resourceServers().create(
+**tokenLifetimeForAnonymousAccessTokens:** `Optional` — Expiration value (in seconds) for anonymous-session access tokens issued for this API. + +
+
+ +
+
+ **tokenDialect:** `Optional`
@@ -11158,6 +10896,122 @@ client.resourceServers().create(
+
+
+
+ +
client.resourceServers.search() -> SyncPagingIterable<ResourceServerSearchResponse> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +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. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.resourceServers().search( + SearchResourceServersRequestParameters + .builder() + .q("q") + .parser(SearchParserEnum.SCIM) + .fields("fields") + .includeFields(true) + .take(1) + .from("from") + .sort(ResourceServerSortFieldEnum.IDENTIFIER) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**q:** `Optional` — Filter expression in SCIM or Lucene syntax (depending on parser parameter). SCIM examples: `name eq "My API"`, `identifier sw "https://"`. SCIM operators: eq, ne, sw, ew, co, pr, gt, ge, lt, le, and, or.

Supported Fields:
  • id - Filter by resource server ID
  • identifier - Filter by resource server identifier
  • name - Filter by resource server name
  • updated_at - Filter by last update date
Maximum 5 filter operations per query. Results are eventually consistent and may not reflect recent updates. + +
+
+ +
+
+ +**parser:** `Optional` — Query parser to use for the filter expression. Use "scim" for SCIM filter syntax or "lucene" for Lucene query syntax (default). + +
+
+ +
+
+ +**fields:** `Optional` — Comma-separated list of fields to include or exclude in the response. Works with the include_fields parameter to control projection mode. + +
+
+ +
+
+ +**includeFields:** `Optional` — Controls field projection mode. Set to true to include only fields specified in the fields parameter. Set to false to exclude fields specified in the fields parameter. Defaults to true if not specified. + +
+
+ +
+
+ +**take:** `Optional` — Maximum number of results to return per page (1-100). Defaults to 50. + +
+
+ +
+
+ +**from:** `Optional` — Cursor for the next page of results. Use the value from the next field in the previous response. + +
+
+ +
+
+ +**sort:** `Optional` — Field name to sort results by in ascending order only. Defaults to insertion order (oldest first) if not provided. + +
+
+
+
+ +
@@ -11395,7 +11249,15 @@ client.resourceServers().update(
-**allowOnlineAccessWithEphemeralSessions:** `Optional` — Whether Online Refresh Tokens can be issued even when sessions are configured as ephemeral (true) or not (false). +**allowOnlineAccessWithEphemeralSessions:** `Optional` — Whether Online Refresh Tokens can be issued even when sessions are configured as ephemeral (true) or not (false). + +
+
+ +
+
+ +**tokenLifetime:** `Optional` — Expiration value (in seconds) for access tokens issued for this API from the token endpoint.
@@ -11403,7 +11265,7 @@ client.resourceServers().update(
-**tokenLifetime:** `Optional` — Expiration value (in seconds) for access tokens issued for this API from the token endpoint. +**tokenLifetimeForAnonymousAccessTokens:** `Optional` — Expiration value (in seconds) for anonymous-session access tokens issued for this API.
@@ -22018,6 +21880,75 @@ client.eventStreams().redeliveries().createById("id", "event_id"); + + +
+ +## Experimentation Experiments +
client.experimentation.experiments.advanceRamp(id, request) -> AdvanceRampResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +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. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.experimentation().experiments().advanceRamp( + "id", + AdvanceRampRequestContent + .builder() + .targetLevel(1) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The ID of the experiment to advance. + +
+
+ +
+
+ +**targetLevel:** `Integer` — The target percentage level from the experiment schedule. Must be the immediate next level. + +
+
+
+
+ +
@@ -23207,6 +23138,114 @@ client.guardian().policies().set( + + +
+ +## Guardian Factors Email +
client.guardian.factors.email.get() -> GetEmailFactorSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +TODO: Link this endpoint to relevant documentation when available. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().email().get(); +``` +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.email.set(request) -> SetEmailFactorSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +TODO: Link this endpoint to relevant documentation when available. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().email().set( + SetEmailFactorSettingsRequestContent + .builder() + .otpLength(1) + .otpExpirationTime(1) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**otpLength:** `Integer` — The length of the OTP code. + +
+
+ +
+
+ +**otpExpirationTime:** `Integer` — The OTP expiration time in seconds. + +
+
+
+
+ +
@@ -23513,6 +23552,113 @@ client.guardian().factors().phone().setProvider( + + +
+ +
client.guardian.factors.phone.get() -> GetPhoneFactorSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +TODO: Link this endpoint to relevant documentation when available. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().phone().get(); +``` +
+
+
+
+ + +
+
+
+ +
client.guardian.factors.phone.set(request) -> SetPhoneFactorSettingsResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +TODO: Link this endpoint to relevant documentation when available. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.guardian().factors().phone().set( + SetPhoneFactorSettingsRequestContent + .builder() + .otpLength(1) + .otpExpirationTime(1) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**otpLength:** `Integer` — The length of the OTP code. + +
+
+ +
+
+ +**otpExpirationTime:** `Integer` — The OTP expiration time in seconds. + +
+
+
+
+ +
diff --git a/src/main/java/com/auth0/client/mgmt/AsyncGuardianClient.java b/src/main/java/com/auth0/client/mgmt/AsyncGuardianClient.java new file mode 100644 index 000000000..908f2daa8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncGuardianClient.java @@ -0,0 +1,84 @@ +/** + * 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.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.guardian.AsyncEnrollmentsClient; +import com.auth0.client.mgmt.guardian.AsyncFactorsClient; +import com.auth0.client.mgmt.guardian.AsyncPoliciesClient; +import com.auth0.client.mgmt.types.GetGuardianSettingsResponseContent; +import com.auth0.client.mgmt.types.SetGuardianSettingsRequestContent; +import com.auth0.client.mgmt.types.SetGuardianSettingsResponseContent; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; + +public class AsyncGuardianClient { + protected final ClientOptions clientOptions; + + private final AsyncRawGuardianClient rawClient; + + protected final Supplier enrollmentsClient; + + protected final Supplier factorsClient; + + protected final Supplier policiesClient; + + public AsyncGuardianClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawGuardianClient(clientOptions); + this.enrollmentsClient = Suppliers.memoize(() -> new AsyncEnrollmentsClient(clientOptions)); + this.factorsClient = Suppliers.memoize(() -> new AsyncFactorsClient(clientOptions)); + this.policiesClient = Suppliers.memoize(() -> new AsyncPoliciesClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawGuardianClient 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()); + } + + /** + * Update a tenant's guardian settings such as Remember Me + */ + public CompletableFuture set(SetGuardianSettingsRequestContent request) { + return this.rawClient.set(request).thenApply(response -> response.body()); + } + + /** + * Update a tenant's guardian settings such as Remember Me + */ + public CompletableFuture set( + SetGuardianSettingsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.set(request, requestOptions).thenApply(response -> response.body()); + } + + 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/AsyncManagementApi.java b/src/main/java/com/auth0/client/mgmt/AsyncManagementApi.java index e9dcb745e..4ab69501b 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncManagementApi.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncManagementApi.java @@ -8,7 +8,7 @@ import com.auth0.client.mgmt.core.ClientOptions; import com.auth0.client.mgmt.core.Suppliers; import com.auth0.client.mgmt.emails.AsyncEmailsClient; -import com.auth0.client.mgmt.guardian.AsyncGuardianClient; +import com.auth0.client.mgmt.experimentation.AsyncExperimentationClient; import com.auth0.client.mgmt.keys.AsyncKeysClient; import com.auth0.client.mgmt.riskassessments.AsyncRiskAssessmentsClient; import com.auth0.client.mgmt.tenants.AsyncTenantsClient; @@ -50,6 +50,8 @@ public class AsyncManagementApi { protected final Supplier groupsClient; + protected final Supplier guardianClient; + protected final Supplier hooksClient; protected final Supplier jobsClient; @@ -60,8 +62,6 @@ public class AsyncManagementApi { protected final Supplier networkAclsClient; - protected final Supplier organizationTemplatesClient; - protected final Supplier organizationsClient; protected final Supplier promptsClient; @@ -102,7 +102,7 @@ public class AsyncManagementApi { protected final Supplier emailsClient; - protected final Supplier guardianClient; + protected final Supplier experimentationClient; protected final Supplier keysClient; @@ -130,12 +130,12 @@ public AsyncManagementApi(ClientOptions clientOptions) { this.formsClient = Suppliers.memoize(() -> new AsyncFormsClient(clientOptions)); this.userGrantsClient = Suppliers.memoize(() -> new AsyncUserGrantsClient(clientOptions)); this.groupsClient = Suppliers.memoize(() -> new AsyncGroupsClient(clientOptions)); + this.guardianClient = Suppliers.memoize(() -> new AsyncGuardianClient(clientOptions)); this.hooksClient = Suppliers.memoize(() -> new AsyncHooksClient(clientOptions)); this.jobsClient = Suppliers.memoize(() -> new AsyncJobsClient(clientOptions)); this.logStreamsClient = Suppliers.memoize(() -> new AsyncLogStreamsClient(clientOptions)); this.logsClient = Suppliers.memoize(() -> new AsyncLogsClient(clientOptions)); this.networkAclsClient = Suppliers.memoize(() -> new AsyncNetworkAclsClient(clientOptions)); - this.organizationTemplatesClient = Suppliers.memoize(() -> new AsyncOrganizationTemplatesClient(clientOptions)); this.organizationsClient = Suppliers.memoize(() -> new AsyncOrganizationsClient(clientOptions)); this.promptsClient = Suppliers.memoize(() -> new AsyncPromptsClient(clientOptions)); this.rateLimitPoliciesClient = Suppliers.memoize(() -> new AsyncRateLimitPoliciesClient(clientOptions)); @@ -156,7 +156,7 @@ public AsyncManagementApi(ClientOptions clientOptions) { this.anomalyClient = Suppliers.memoize(() -> new AsyncAnomalyClient(clientOptions)); this.attackProtectionClient = Suppliers.memoize(() -> new AsyncAttackProtectionClient(clientOptions)); this.emailsClient = Suppliers.memoize(() -> new AsyncEmailsClient(clientOptions)); - this.guardianClient = Suppliers.memoize(() -> new AsyncGuardianClient(clientOptions)); + this.experimentationClient = Suppliers.memoize(() -> new AsyncExperimentationClient(clientOptions)); this.keysClient = Suppliers.memoize(() -> new AsyncKeysClient(clientOptions)); this.riskAssessmentsClient = Suppliers.memoize(() -> new AsyncRiskAssessmentsClient(clientOptions)); this.tenantsClient = Suppliers.memoize(() -> new AsyncTenantsClient(clientOptions)); @@ -227,6 +227,10 @@ public AsyncGroupsClient groups() { return this.groupsClient.get(); } + public AsyncGuardianClient guardian() { + return this.guardianClient.get(); + } + public AsyncHooksClient hooks() { return this.hooksClient.get(); } @@ -247,10 +251,6 @@ public AsyncNetworkAclsClient networkAcls() { return this.networkAclsClient.get(); } - public AsyncOrganizationTemplatesClient organizationTemplates() { - return this.organizationTemplatesClient.get(); - } - public AsyncOrganizationsClient organizations() { return this.organizationsClient.get(); } @@ -331,8 +331,8 @@ public AsyncEmailsClient emails() { return this.emailsClient.get(); } - public AsyncGuardianClient guardian() { - return this.guardianClient.get(); + public AsyncExperimentationClient experimentation() { + return this.experimentationClient.get(); } public AsyncKeysClient keys() { diff --git a/src/main/java/com/auth0/client/mgmt/AsyncOrganizationTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncOrganizationTemplatesClient.java deleted file mode 100644 index 0b8d5f233..000000000 --- a/src/main/java/com/auth0/client/mgmt/AsyncOrganizationTemplatesClient.java +++ /dev/null @@ -1,153 +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.RequestOptions; -import com.auth0.client.mgmt.core.SyncPagingIterable; -import com.auth0.client.mgmt.types.CreateOrganizationTemplateRequestContent; -import com.auth0.client.mgmt.types.ListOrganizationTemplatesRequestParameters; -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 java.util.concurrent.CompletableFuture; - -public class AsyncOrganizationTemplatesClient { - protected final ClientOptions clientOptions; - - private final AsyncRawOrganizationTemplatesClient rawClient; - - public AsyncOrganizationTemplatesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new AsyncRawOrganizationTemplatesClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public AsyncRawOrganizationTemplatesClient withRawResponse() { - return this.rawClient; - } - - /** - * 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 CompletableFuture> list() { - return this.rawClient.list().thenApply(response -> response.body()); - } - - /** - * 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 CompletableFuture> list(RequestOptions requestOptions) { - return this.rawClient.list(requestOptions).thenApply(response -> response.body()); - } - - /** - * 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 CompletableFuture> list( - ListOrganizationTemplatesRequestParameters request) { - return this.rawClient.list(request).thenApply(response -> response.body()); - } - - /** - * 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 CompletableFuture> list( - ListOrganizationTemplatesRequestParameters request, RequestOptions requestOptions) { - return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); - } - - /** - * Create an Organization Template. - */ - public CompletableFuture create(CreateOrganizationTemplateRequestContent request) { - return this.rawClient.create(request).thenApply(response -> response.body()); - } - - /** - * Create an Organization Template. - */ - public CompletableFuture create( - CreateOrganizationTemplateRequestContent request, RequestOptions requestOptions) { - return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); - } - - /** - * Retrieve details about a single Organization Template specified by ID. - */ - public CompletableFuture get(String id) { - return this.rawClient.get(id).thenApply(response -> response.body()); - } - - /** - * Retrieve details about a single Organization Template specified by ID. - */ - public CompletableFuture get(String id, RequestOptions requestOptions) { - return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); - } - - /** - * Update the details of a specific Organization Template. - */ - public CompletableFuture update(String id) { - return this.rawClient.update(id).thenApply(response -> response.body()); - } - - /** - * Update the details of a specific Organization Template. - */ - public CompletableFuture update(String id, RequestOptions requestOptions) { - return this.rawClient.update(id, requestOptions).thenApply(response -> response.body()); - } - - /** - * Update the details of a specific Organization Template. - */ - public CompletableFuture update(String id, UpdateOrganizationTemplateRequestContent request) { - return this.rawClient.update(id, request).thenApply(response -> response.body()); - } - - /** - * Update the details of a specific Organization Template. - */ - public CompletableFuture update( - String id, UpdateOrganizationTemplateRequestContent request, RequestOptions requestOptions) { - return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); - } - - /** - * 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 CompletableFuture> listOrganizations( - String id) { - return this.rawClient.listOrganizations(id).thenApply(response -> response.body()); - } - - /** - * 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 CompletableFuture> listOrganizations( - String id, RequestOptions requestOptions) { - return this.rawClient.listOrganizations(id, requestOptions).thenApply(response -> response.body()); - } - - /** - * 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 CompletableFuture> listOrganizations( - String id, ListTemplateOrganizationsRequestParameters request) { - return this.rawClient.listOrganizations(id, request).thenApply(response -> response.body()); - } - - /** - * 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 CompletableFuture> listOrganizations( - String id, ListTemplateOrganizationsRequestParameters request, RequestOptions requestOptions) { - return this.rawClient.listOrganizations(id, request, requestOptions).thenApply(response -> response.body()); - } -} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncOrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncOrganizationsClient.java index 20c3d698a..e0f7da549 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncOrganizationsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncOrganizationsClient.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.concurrent.CompletableFuture; @@ -186,6 +188,80 @@ public CompletableFuture getByName( return this.rawClient.getByName(name, requestOptions).thenApply(response -> response.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 CompletableFuture> search() { + return this.rawClient.search().thenApply(response -> response.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 CompletableFuture> search(RequestOptions requestOptions) { + return this.rawClient.search(requestOptions).thenApply(response -> response.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 CompletableFuture> search( + SearchOrganizationsRequestParameters request) { + return this.rawClient.search(request).thenApply(response -> response.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 CompletableFuture> search( + SearchOrganizationsRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.search(request, requestOptions).thenApply(response -> response.body()); + } + /** * Retrieve details about a single Organization specified by ID. */ diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawGuardianClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawGuardianClient.java new file mode 100644 index 000000000..3ff3aa969 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawGuardianClient.java @@ -0,0 +1,243 @@ +/** + * 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 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 AsyncRawGuardianClient { + protected final ClientOptions clientOptions; + + public AsyncRawGuardianClient(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/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, GetGuardianSettingsResponseContent.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; + } + + /** + * Update a tenant's guardian settings such as Remember Me + */ + public CompletableFuture> set( + SetGuardianSettingsRequestContent request) { + return set(request, null); + } + + /** + * Update a tenant's guardian settings such as Remember Me + */ + public CompletableFuture> 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(); + } + 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, SetGuardianSettingsResponseContent.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/AsyncRawOrganizationTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawOrganizationTemplatesClient.java deleted file mode 100644 index 770298145..000000000 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawOrganizationTemplatesClient.java +++ /dev/null @@ -1,673 +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 java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; -import okhttp3.Call; -import okhttp3.Callback; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; -import org.jetbrains.annotations.NotNull; - -public class AsyncRawOrganizationTemplatesClient { - protected final ClientOptions clientOptions; - - public AsyncRawOrganizationTemplatesClient(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 CompletableFuture>> 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 CompletableFuture>> 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 CompletableFuture>> 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 CompletableFuture>> 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(); - } - 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()) { - 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()); - future.complete(new ManagementApiHttpResponse<>( - new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { - try { - return list(nextRequest, requestOptions) - .get() - .body(); - } catch (InterruptedException | ExecutionException e) { - throw new RuntimeException(e); - } - }), - response)); - return; - } - try { - switch (response.code()) { - case 400: - future.completeExceptionally(new BadRequestError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - case 401: - future.completeExceptionally(new UnauthorizedError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - case 403: - future.completeExceptionally(new ForbiddenError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - case 429: - future.completeExceptionally(new TooManyRequestsError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } - } catch (JsonProcessingException ignored) { - // unable to map error response, throwing generic error - } - Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); - future.completeExceptionally(new ManagementApiException( - "Error with status code " + response.code(), response.code(), errorBody, response)); - return; - } catch (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; - } - - /** - * Create an Organization Template. - */ - public CompletableFuture> create( - CreateOrganizationTemplateRequestContent request) { - return create(request, null); - } - - /** - * Create an Organization Template. - */ - public CompletableFuture> 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(); - } - 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, OrganizationTemplate.class), - response)); - return; - } - try { - switch (response.code()) { - case 400: - future.completeExceptionally(new BadRequestError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - case 401: - future.completeExceptionally(new UnauthorizedError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - case 403: - future.completeExceptionally(new ForbiddenError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - case 409: - future.completeExceptionally(new ConflictError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - case 429: - future.completeExceptionally(new TooManyRequestsError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } - } catch (JsonProcessingException ignored) { - // unable to map error response, throwing generic error - } - Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); - future.completeExceptionally(new ManagementApiException( - "Error with status code " + response.code(), response.code(), errorBody, response)); - return; - } catch (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 about a single Organization Template specified by ID. - */ - public CompletableFuture> get(String id) { - return get(id, null); - } - - /** - * Retrieve details about a single Organization Template specified by ID. - */ - public CompletableFuture> 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(); - } - 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, OrganizationTemplate.class), - response)); - return; - } - try { - switch (response.code()) { - case 401: - future.completeExceptionally(new UnauthorizedError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - case 403: - future.completeExceptionally(new ForbiddenError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - case 404: - future.completeExceptionally(new NotFoundError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - case 429: - future.completeExceptionally(new TooManyRequestsError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } - } catch (JsonProcessingException ignored) { - // unable to map error response, throwing generic error - } - Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); - future.completeExceptionally(new ManagementApiException( - "Error with status code " + response.code(), response.code(), errorBody, response)); - return; - } catch (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; - } - - /** - * Update the details of a specific Organization Template. - */ - public CompletableFuture> update(String id) { - return update(id, UpdateOrganizationTemplateRequestContent.builder().build()); - } - - /** - * Update the details of a specific Organization Template. - */ - public CompletableFuture> update( - String id, RequestOptions requestOptions) { - return update(id, UpdateOrganizationTemplateRequestContent.builder().build(), requestOptions); - } - - /** - * Update the details of a specific Organization Template. - */ - public CompletableFuture> update( - String id, UpdateOrganizationTemplateRequestContent request) { - return update(id, request, null); - } - - /** - * Update the details of a specific Organization Template. - */ - public CompletableFuture> 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(); - } - 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, OrganizationTemplate.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 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 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 CompletableFuture>> - 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 CompletableFuture>> - 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 CompletableFuture>> - 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 CompletableFuture>> - 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(); - } - 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()) { - 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(); - future.complete(new ManagementApiHttpResponse<>( - new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { - try { - return listOrganizations(id, nextRequest, requestOptions) - .get() - .body(); - } catch (InterruptedException | ExecutionException e) { - throw new RuntimeException(e); - } - }), - response)); - return; - } - try { - switch (response.code()) { - case 400: - future.completeExceptionally(new BadRequestError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - case 401: - future.completeExceptionally(new UnauthorizedError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - case 403: - future.completeExceptionally(new ForbiddenError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - case 429: - future.completeExceptionally(new TooManyRequestsError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } - } catch (JsonProcessingException ignored) { - // unable to map error response, throwing generic error - } - Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); - future.completeExceptionally(new ManagementApiException( - "Error with status code " + response.code(), response.code(), errorBody, response)); - return; - } catch (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/AsyncRawOrganizationsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawOrganizationsClient.java index 89745f55d..c7dda483b 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawOrganizationsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawOrganizationsClient.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; @@ -473,6 +477,204 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } + /** + * 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 CompletableFuture>> 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 CompletableFuture>> 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 CompletableFuture>> 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 CompletableFuture>> 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(); + } + 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()) { + 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(); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return search(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 504: + future.completeExceptionally(new GatewayTimeoutError( + 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 about a single Organization specified by ID. */ diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawResourceServersClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawResourceServersClient.java index 39aea3498..74cb3bfcd 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawResourceServersClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawResourceServersClient.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 java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import okhttp3.Call; @@ -312,6 +318,185 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } + /** + * 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 CompletableFuture>> 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 CompletableFuture>> 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 CompletableFuture>> 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 CompletableFuture>> 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(); + } + 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()) { + 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(); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return search(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 504: + future.completeExceptionally(new GatewayTimeoutError( + 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 API details with the given ID. */ diff --git a/src/main/java/com/auth0/client/mgmt/AsyncResourceServersClient.java b/src/main/java/com/auth0/client/mgmt/AsyncResourceServersClient.java index e8193c09d..e3e7ce0f9 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncResourceServersClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncResourceServersClient.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; import java.util.concurrent.CompletableFuture; @@ -77,6 +79,44 @@ public CompletableFuture create( return this.rawClient.create(request, requestOptions).thenApply(response -> response.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 CompletableFuture> search() { + return this.rawClient.search().thenApply(response -> response.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 CompletableFuture> search(RequestOptions requestOptions) { + return this.rawClient.search(requestOptions).thenApply(response -> response.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 CompletableFuture> search( + SearchResourceServersRequestParameters request) { + return this.rawClient.search(request).thenApply(response -> response.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 CompletableFuture> search( + SearchResourceServersRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.search(request, requestOptions).thenApply(response -> response.body()); + } + /** * Retrieve API details with the given ID. */ diff --git a/src/main/java/com/auth0/client/mgmt/GuardianClient.java b/src/main/java/com/auth0/client/mgmt/GuardianClient.java new file mode 100644 index 000000000..e7db3d9ac --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/GuardianClient.java @@ -0,0 +1,83 @@ +/** + * 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.RequestOptions; +import com.auth0.client.mgmt.core.Suppliers; +import com.auth0.client.mgmt.guardian.EnrollmentsClient; +import com.auth0.client.mgmt.guardian.FactorsClient; +import com.auth0.client.mgmt.guardian.PoliciesClient; +import com.auth0.client.mgmt.types.GetGuardianSettingsResponseContent; +import com.auth0.client.mgmt.types.SetGuardianSettingsRequestContent; +import com.auth0.client.mgmt.types.SetGuardianSettingsResponseContent; +import java.util.function.Supplier; + +public class GuardianClient { + protected final ClientOptions clientOptions; + + private final RawGuardianClient rawClient; + + protected final Supplier enrollmentsClient; + + protected final Supplier factorsClient; + + protected final Supplier policiesClient; + + public GuardianClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawGuardianClient(clientOptions); + this.enrollmentsClient = Suppliers.memoize(() -> new EnrollmentsClient(clientOptions)); + this.factorsClient = Suppliers.memoize(() -> new FactorsClient(clientOptions)); + this.policiesClient = Suppliers.memoize(() -> new PoliciesClient(clientOptions)); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawGuardianClient withRawResponse() { + return this.rawClient; + } + + /** + * TODO: Link this endpoint to relevant documentation when available. + */ + public GetGuardianSettingsResponseContent get() { + return this.rawClient.get().body(); + } + + /** + * TODO: Link this endpoint to relevant documentation when available. + */ + public GetGuardianSettingsResponseContent get(RequestOptions requestOptions) { + return this.rawClient.get(requestOptions).body(); + } + + /** + * Update a tenant's guardian settings such as Remember Me + */ + public SetGuardianSettingsResponseContent set(SetGuardianSettingsRequestContent request) { + return this.rawClient.set(request).body(); + } + + /** + * Update a tenant's guardian settings such as Remember Me + */ + public SetGuardianSettingsResponseContent set( + SetGuardianSettingsRequestContent request, RequestOptions requestOptions) { + return this.rawClient.set(request, requestOptions).body(); + } + + 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/ManagementApi.java b/src/main/java/com/auth0/client/mgmt/ManagementApi.java index 20d44de2f..ff2ff251b 100644 --- a/src/main/java/com/auth0/client/mgmt/ManagementApi.java +++ b/src/main/java/com/auth0/client/mgmt/ManagementApi.java @@ -8,7 +8,7 @@ import com.auth0.client.mgmt.core.ClientOptions; import com.auth0.client.mgmt.core.Suppliers; import com.auth0.client.mgmt.emails.EmailsClient; -import com.auth0.client.mgmt.guardian.GuardianClient; +import com.auth0.client.mgmt.experimentation.ExperimentationClient; import com.auth0.client.mgmt.keys.KeysClient; import com.auth0.client.mgmt.riskassessments.RiskAssessmentsClient; import com.auth0.client.mgmt.tenants.TenantsClient; @@ -50,6 +50,8 @@ public class ManagementApi { protected final Supplier groupsClient; + protected final Supplier guardianClient; + protected final Supplier hooksClient; protected final Supplier jobsClient; @@ -60,8 +62,6 @@ public class ManagementApi { protected final Supplier networkAclsClient; - protected final Supplier organizationTemplatesClient; - protected final Supplier organizationsClient; protected final Supplier promptsClient; @@ -102,7 +102,7 @@ public class ManagementApi { protected final Supplier emailsClient; - protected final Supplier guardianClient; + protected final Supplier experimentationClient; protected final Supplier keysClient; @@ -130,12 +130,12 @@ public ManagementApi(ClientOptions clientOptions) { this.formsClient = Suppliers.memoize(() -> new FormsClient(clientOptions)); this.userGrantsClient = Suppliers.memoize(() -> new UserGrantsClient(clientOptions)); this.groupsClient = Suppliers.memoize(() -> new GroupsClient(clientOptions)); + this.guardianClient = Suppliers.memoize(() -> new GuardianClient(clientOptions)); this.hooksClient = Suppliers.memoize(() -> new HooksClient(clientOptions)); this.jobsClient = Suppliers.memoize(() -> new JobsClient(clientOptions)); this.logStreamsClient = Suppliers.memoize(() -> new LogStreamsClient(clientOptions)); this.logsClient = Suppliers.memoize(() -> new LogsClient(clientOptions)); this.networkAclsClient = Suppliers.memoize(() -> new NetworkAclsClient(clientOptions)); - this.organizationTemplatesClient = Suppliers.memoize(() -> new OrganizationTemplatesClient(clientOptions)); this.organizationsClient = Suppliers.memoize(() -> new OrganizationsClient(clientOptions)); this.promptsClient = Suppliers.memoize(() -> new PromptsClient(clientOptions)); this.rateLimitPoliciesClient = Suppliers.memoize(() -> new RateLimitPoliciesClient(clientOptions)); @@ -156,7 +156,7 @@ public ManagementApi(ClientOptions clientOptions) { this.anomalyClient = Suppliers.memoize(() -> new AnomalyClient(clientOptions)); this.attackProtectionClient = Suppliers.memoize(() -> new AttackProtectionClient(clientOptions)); this.emailsClient = Suppliers.memoize(() -> new EmailsClient(clientOptions)); - this.guardianClient = Suppliers.memoize(() -> new GuardianClient(clientOptions)); + this.experimentationClient = Suppliers.memoize(() -> new ExperimentationClient(clientOptions)); this.keysClient = Suppliers.memoize(() -> new KeysClient(clientOptions)); this.riskAssessmentsClient = Suppliers.memoize(() -> new RiskAssessmentsClient(clientOptions)); this.tenantsClient = Suppliers.memoize(() -> new TenantsClient(clientOptions)); @@ -227,6 +227,10 @@ public GroupsClient groups() { return this.groupsClient.get(); } + public GuardianClient guardian() { + return this.guardianClient.get(); + } + public HooksClient hooks() { return this.hooksClient.get(); } @@ -247,10 +251,6 @@ public NetworkAclsClient networkAcls() { return this.networkAclsClient.get(); } - public OrganizationTemplatesClient organizationTemplates() { - return this.organizationTemplatesClient.get(); - } - public OrganizationsClient organizations() { return this.organizationsClient.get(); } @@ -331,8 +331,8 @@ public EmailsClient emails() { return this.emailsClient.get(); } - public GuardianClient guardian() { - return this.guardianClient.get(); + public ExperimentationClient experimentation() { + return this.experimentationClient.get(); } public KeysClient keys() { diff --git a/src/main/java/com/auth0/client/mgmt/OrganizationTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/OrganizationTemplatesClient.java deleted file mode 100644 index bb876fb92..000000000 --- a/src/main/java/com/auth0/client/mgmt/OrganizationTemplatesClient.java +++ /dev/null @@ -1,150 +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.RequestOptions; -import com.auth0.client.mgmt.core.SyncPagingIterable; -import com.auth0.client.mgmt.types.CreateOrganizationTemplateRequestContent; -import com.auth0.client.mgmt.types.ListOrganizationTemplatesRequestParameters; -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; - -public class OrganizationTemplatesClient { - protected final ClientOptions clientOptions; - - private final RawOrganizationTemplatesClient rawClient; - - public OrganizationTemplatesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new RawOrganizationTemplatesClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public RawOrganizationTemplatesClient withRawResponse() { - return this.rawClient; - } - - /** - * 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 SyncPagingIterable list() { - return this.rawClient.list().body(); - } - - /** - * 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 SyncPagingIterable list(RequestOptions requestOptions) { - return this.rawClient.list(requestOptions).body(); - } - - /** - * 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 SyncPagingIterable list(ListOrganizationTemplatesRequestParameters request) { - return this.rawClient.list(request).body(); - } - - /** - * 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 SyncPagingIterable list( - ListOrganizationTemplatesRequestParameters request, RequestOptions requestOptions) { - return this.rawClient.list(request, requestOptions).body(); - } - - /** - * Create an Organization Template. - */ - public OrganizationTemplate create(CreateOrganizationTemplateRequestContent request) { - return this.rawClient.create(request).body(); - } - - /** - * Create an Organization Template. - */ - public OrganizationTemplate create( - CreateOrganizationTemplateRequestContent request, RequestOptions requestOptions) { - return this.rawClient.create(request, requestOptions).body(); - } - - /** - * Retrieve details about a single Organization Template specified by ID. - */ - public OrganizationTemplate get(String id) { - return this.rawClient.get(id).body(); - } - - /** - * Retrieve details about a single Organization Template specified by ID. - */ - public OrganizationTemplate get(String id, RequestOptions requestOptions) { - return this.rawClient.get(id, requestOptions).body(); - } - - /** - * Update the details of a specific Organization Template. - */ - public OrganizationTemplate update(String id) { - return this.rawClient.update(id).body(); - } - - /** - * Update the details of a specific Organization Template. - */ - public OrganizationTemplate update(String id, RequestOptions requestOptions) { - return this.rawClient.update(id, requestOptions).body(); - } - - /** - * Update the details of a specific Organization Template. - */ - public OrganizationTemplate update(String id, UpdateOrganizationTemplateRequestContent request) { - return this.rawClient.update(id, request).body(); - } - - /** - * Update the details of a specific Organization Template. - */ - public OrganizationTemplate update( - String id, UpdateOrganizationTemplateRequestContent request, RequestOptions requestOptions) { - return this.rawClient.update(id, request, requestOptions).body(); - } - - /** - * 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 SyncPagingIterable listOrganizations(String id) { - return this.rawClient.listOrganizations(id).body(); - } - - /** - * 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 SyncPagingIterable listOrganizations( - String id, RequestOptions requestOptions) { - return this.rawClient.listOrganizations(id, requestOptions).body(); - } - - /** - * 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 SyncPagingIterable listOrganizations( - String id, ListTemplateOrganizationsRequestParameters request) { - return this.rawClient.listOrganizations(id, request).body(); - } - - /** - * 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 SyncPagingIterable 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 anonymousSessions; + private final Optional thirdPartySecurityMode; private final Optional redirectionPolicy; @@ -158,6 +165,8 @@ public final class Client { private Client( Optional clientId, + Optional createdAt, + Optional updatedAt, Optional tenant, Optional name, Optional description, @@ -214,6 +223,7 @@ private Client( Optional b2BIntegrationConfiguration, Optional myOrganizationConfiguration, Optional identityAssertionAuthorizationGrant, + Optional anonymousSessions, Optional thirdPartySecurityMode, Optional redirectionPolicy, Optional resourceServerIdentifier, @@ -224,6 +234,8 @@ private Client( Optional jwksUri, Map additionalProperties) { this.clientId = clientId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; this.tenant = tenant; this.name = name; this.description = description; @@ -280,6 +292,7 @@ private Client( this.b2BIntegrationConfiguration = b2BIntegrationConfiguration; this.myOrganizationConfiguration = myOrganizationConfiguration; this.identityAssertionAuthorizationGrant = identityAssertionAuthorizationGrant; + this.anonymousSessions = anonymousSessions; this.thirdPartySecurityMode = thirdPartySecurityMode; this.redirectionPolicy = redirectionPolicy; this.resourceServerIdentifier = resourceServerIdentifier; @@ -299,6 +312,22 @@ public Optional getClientId() { return clientId; } + /** + * @return The ISO 8601 timestamp of when this client was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The ISO 8601 timestamp of when this client was last updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + /** * @return Name of the tenant this client belongs to. */ @@ -703,6 +732,11 @@ public Optional getIdentityAssertionAuthori return identityAssertionAuthorizationGrant; } + @JsonProperty("anonymous_sessions") + public Optional getAnonymousSessions() { + return anonymousSessions; + } + @JsonProperty("third_party_security_mode") public Optional getThirdPartySecurityMode() { return thirdPartySecurityMode; @@ -813,6 +847,8 @@ public Map getAdditionalProperties() { private boolean equalTo(Client other) { return clientId.equals(other.clientId) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) && tenant.equals(other.tenant) && name.equals(other.name) && description.equals(other.description) @@ -870,6 +906,7 @@ private boolean equalTo(Client other) { && b2BIntegrationConfiguration.equals(other.b2BIntegrationConfiguration) && myOrganizationConfiguration.equals(other.myOrganizationConfiguration) && identityAssertionAuthorizationGrant.equals(other.identityAssertionAuthorizationGrant) + && anonymousSessions.equals(other.anonymousSessions) && thirdPartySecurityMode.equals(other.thirdPartySecurityMode) && redirectionPolicy.equals(other.redirectionPolicy) && resourceServerIdentifier.equals(other.resourceServerIdentifier) @@ -884,6 +921,8 @@ private boolean equalTo(Client other) { public int hashCode() { return Objects.hash( this.clientId, + this.createdAt, + this.updatedAt, this.tenant, this.name, this.description, @@ -940,6 +979,7 @@ public int hashCode() { this.b2BIntegrationConfiguration, this.myOrganizationConfiguration, this.identityAssertionAuthorizationGrant, + this.anonymousSessions, this.thirdPartySecurityMode, this.redirectionPolicy, this.resourceServerIdentifier, @@ -963,6 +1003,10 @@ public static Builder builder() { public static final class Builder { private Optional clientId = Optional.empty(); + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + private Optional tenant = Optional.empty(); private Optional name = Optional.empty(); @@ -1076,6 +1120,8 @@ public static final class Builder { private Optional identityAssertionAuthorizationGrant = Optional.empty(); + private Optional anonymousSessions = Optional.empty(); + private Optional thirdPartySecurityMode = Optional.empty(); private Optional redirectionPolicy = Optional.empty(); @@ -1100,6 +1146,8 @@ private Builder() {} public Builder from(Client other) { clientId(other.getClientId()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); tenant(other.getTenant()); name(other.getName()); description(other.getDescription()); @@ -1156,6 +1204,7 @@ public Builder from(Client other) { b2BIntegrationConfiguration(other.getB2BIntegrationConfiguration()); myOrganizationConfiguration(other.getMyOrganizationConfiguration()); identityAssertionAuthorizationGrant(other.getIdentityAssertionAuthorizationGrant()); + anonymousSessions(other.getAnonymousSessions()); thirdPartySecurityMode(other.getThirdPartySecurityMode()); redirectionPolicy(other.getRedirectionPolicy()); resourceServerIdentifier(other.getResourceServerIdentifier()); @@ -1181,6 +1230,34 @@ public Builder clientId(String clientId) { return this; } + /** + *

The ISO 8601 timestamp of when this client was created.

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

The ISO 8601 timestamp of when this client was last updated.

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

Name of the tenant this client belongs to.

*/ @@ -2065,6 +2142,17 @@ public Builder identityAssertionAuthorizationGrant( return this; } + @JsonSetter(value = "anonymous_sessions", nulls = Nulls.SKIP) + public Builder anonymousSessions(Optional anonymousSessions) { + this.anonymousSessions = anonymousSessions; + return this; + } + + public Builder anonymousSessions(AnonymousSessions anonymousSessions) { + this.anonymousSessions = Optional.ofNullable(anonymousSessions); + return this; + } + @JsonSetter(value = "third_party_security_mode", nulls = Nulls.SKIP) public Builder thirdPartySecurityMode(Optional thirdPartySecurityMode) { this.thirdPartySecurityMode = thirdPartySecurityMode; @@ -2168,6 +2256,8 @@ public Builder jwksUri(String jwksUri) { public Client build() { return new Client( clientId, + createdAt, + updatedAt, tenant, name, description, @@ -2224,6 +2314,7 @@ public Client build() { b2BIntegrationConfiguration, myOrganizationConfiguration, identityAssertionAuthorizationGrant, + anonymousSessions, thirdPartySecurityMode, redirectionPolicy, resourceServerIdentifier, diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityProviderEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityProviderEnum.java index 7b53e05d5..32e182ac8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityProviderEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionIdentityProviderEnum.java @@ -11,9 +11,6 @@ public final class ConnectionIdentityProviderEnum { public static final ConnectionIdentityProviderEnum BAIDU = new ConnectionIdentityProviderEnum(Value.BAIDU, "baidu"); - public static final ConnectionIdentityProviderEnum SUPABASE_MCP = - new ConnectionIdentityProviderEnum(Value.SUPABASE_MCP, "supabase-mcp"); - public static final ConnectionIdentityProviderEnum BITLY = new ConnectionIdentityProviderEnum(Value.BITLY, "bitly"); public static final ConnectionIdentityProviderEnum PAYPAL_SANDBOX = @@ -21,12 +18,6 @@ public final class ConnectionIdentityProviderEnum { public static final ConnectionIdentityProviderEnum SAMLP = new ConnectionIdentityProviderEnum(Value.SAMLP, "samlp"); - public static final ConnectionIdentityProviderEnum GUSTO_MCP = - new ConnectionIdentityProviderEnum(Value.GUSTO_MCP, "gusto-mcp"); - - public static final ConnectionIdentityProviderEnum GITLAB_MCP = - new ConnectionIdentityProviderEnum(Value.GITLAB_MCP, "gitlab-mcp"); - public static final ConnectionIdentityProviderEnum DROPBOX = new ConnectionIdentityProviderEnum(Value.DROPBOX, "dropbox"); @@ -39,9 +30,6 @@ public final class ConnectionIdentityProviderEnum { public static final ConnectionIdentityProviderEnum PINGFEDERATE = new ConnectionIdentityProviderEnum(Value.PINGFEDERATE, "pingfederate"); - public static final ConnectionIdentityProviderEnum XERO_MCP = - new ConnectionIdentityProviderEnum(Value.XERO_MCP, "xero-mcp"); - public static final ConnectionIdentityProviderEnum THIRTYSEVENSIGNALS = new ConnectionIdentityProviderEnum(Value.THIRTYSEVENSIGNALS, "thirtysevensignals"); @@ -49,9 +37,6 @@ public final class ConnectionIdentityProviderEnum { public static final ConnectionIdentityProviderEnum OIDC = new ConnectionIdentityProviderEnum(Value.OIDC, "oidc"); - public static final ConnectionIdentityProviderEnum FIGMA_MCP = - new ConnectionIdentityProviderEnum(Value.FIGMA_MCP, "figma-mcp"); - public static final ConnectionIdentityProviderEnum SALESFORCE_COMMUNITY = new ConnectionIdentityProviderEnum(Value.SALESFORCE_COMMUNITY, "salesforce-community"); @@ -71,8 +56,14 @@ public final class ConnectionIdentityProviderEnum { public static final ConnectionIdentityProviderEnum IP = new ConnectionIdentityProviderEnum(Value.IP, "ip"); + public static final ConnectionIdentityProviderEnum ATLASSIAN = + new ConnectionIdentityProviderEnum(Value.ATLASSIAN, "atlassian"); + public static final ConnectionIdentityProviderEnum ADFS = new ConnectionIdentityProviderEnum(Value.ADFS, "adfs"); + public static final ConnectionIdentityProviderEnum GITLAB = + new ConnectionIdentityProviderEnum(Value.GITLAB, "gitlab"); + public static final ConnectionIdentityProviderEnum EMAIL = new ConnectionIdentityProviderEnum(Value.EMAIL, "email"); public static final ConnectionIdentityProviderEnum YAHOO = new ConnectionIdentityProviderEnum(Value.YAHOO, "yahoo"); @@ -94,9 +85,6 @@ public final class ConnectionIdentityProviderEnum { public static final ConnectionIdentityProviderEnum LINKEDIN = new ConnectionIdentityProviderEnum(Value.LINKEDIN, "linkedin"); - public static final ConnectionIdentityProviderEnum ATLASSIAN_MCP = - new ConnectionIdentityProviderEnum(Value.ATLASSIAN_MCP, "atlassian-mcp"); - public static final ConnectionIdentityProviderEnum GOOGLE_APPS = new ConnectionIdentityProviderEnum(Value.GOOGLE_APPS, "google-apps"); @@ -121,43 +109,32 @@ public final class ConnectionIdentityProviderEnum { public static final ConnectionIdentityProviderEnum AUTH0 = new ConnectionIdentityProviderEnum(Value.AUTH0, "auth0"); - public static final ConnectionIdentityProviderEnum HEROKU_MCP = - new ConnectionIdentityProviderEnum(Value.HEROKU_MCP, "heroku-mcp"); - public static final ConnectionIdentityProviderEnum GOOGLE_OAUTH2 = new ConnectionIdentityProviderEnum(Value.GOOGLE_OAUTH2, "google-oauth2"); public static final ConnectionIdentityProviderEnum WORDPRESS = new ConnectionIdentityProviderEnum(Value.WORDPRESS, "wordpress"); - public static final ConnectionIdentityProviderEnum ASANA_MCP = - new ConnectionIdentityProviderEnum(Value.ASANA_MCP, "asana-mcp"); - public static final ConnectionIdentityProviderEnum EXACT = new ConnectionIdentityProviderEnum(Value.EXACT, "exact"); + public static final ConnectionIdentityProviderEnum ASANA = new ConnectionIdentityProviderEnum(Value.ASANA, "asana"); + public static final ConnectionIdentityProviderEnum FITBIT = new ConnectionIdentityProviderEnum(Value.FITBIT, "fitbit"); public static final ConnectionIdentityProviderEnum EVERNOTE = new ConnectionIdentityProviderEnum(Value.EVERNOTE, "evernote"); - public static final ConnectionIdentityProviderEnum SLACK_MCP = - new ConnectionIdentityProviderEnum(Value.SLACK_MCP, "slack-mcp"); - public static final ConnectionIdentityProviderEnum SHAREPOINT = new ConnectionIdentityProviderEnum(Value.SHAREPOINT, "sharepoint"); public static final ConnectionIdentityProviderEnum SHOPIFY = new ConnectionIdentityProviderEnum(Value.SHOPIFY, "shopify"); - public static final ConnectionIdentityProviderEnum VERCEL_MCP = - new ConnectionIdentityProviderEnum(Value.VERCEL_MCP, "vercel-mcp"); - public static final ConnectionIdentityProviderEnum SALESFORCE_SANDBOX = new ConnectionIdentityProviderEnum(Value.SALESFORCE_SANDBOX, "salesforce-sandbox"); - public static final ConnectionIdentityProviderEnum INTERCOM_MCP = - new ConnectionIdentityProviderEnum(Value.INTERCOM_MCP, "intercom-mcp"); + public static final ConnectionIdentityProviderEnum SLACK = new ConnectionIdentityProviderEnum(Value.SLACK, "slack"); public static final ConnectionIdentityProviderEnum SENTRY_MCP = new ConnectionIdentityProviderEnum(Value.SENTRY_MCP, "sentry-mcp"); @@ -175,9 +152,6 @@ public final class ConnectionIdentityProviderEnum { public static final ConnectionIdentityProviderEnum LINE = new ConnectionIdentityProviderEnum(Value.LINE, "line"); - public static final ConnectionIdentityProviderEnum DOCUSIGN_MCP = - new ConnectionIdentityProviderEnum(Value.DOCUSIGN_MCP, "docusign-mcp"); - public static final ConnectionIdentityProviderEnum UNTAPPD = new ConnectionIdentityProviderEnum(Value.UNTAPPD, "untappd"); @@ -187,9 +161,6 @@ public final class ConnectionIdentityProviderEnum { public static final ConnectionIdentityProviderEnum SALESFORCE = new ConnectionIdentityProviderEnum(Value.SALESFORCE, "salesforce"); - public static final ConnectionIdentityProviderEnum PAGERDUTY_MCP = - new ConnectionIdentityProviderEnum(Value.PAGERDUTY_MCP, "pagerduty-mcp"); - public static final ConnectionIdentityProviderEnum BITBUCKET = new ConnectionIdentityProviderEnum(Value.BITBUCKET, "bitbucket"); @@ -244,18 +215,12 @@ public T visit(Visitor visitor) { return visitor.visitAd(); case BAIDU: return visitor.visitBaidu(); - case SUPABASE_MCP: - return visitor.visitSupabaseMcp(); case BITLY: return visitor.visitBitly(); case PAYPAL_SANDBOX: return visitor.visitPaypalSandbox(); case SAMLP: return visitor.visitSamlp(); - case GUSTO_MCP: - return visitor.visitGustoMcp(); - case GITLAB_MCP: - return visitor.visitGitlabMcp(); case DROPBOX: return visitor.visitDropbox(); case VKONTAKTE: @@ -264,16 +229,12 @@ public T visit(Visitor visitor) { return visitor.visitInstagram(); case PINGFEDERATE: return visitor.visitPingfederate(); - case XERO_MCP: - return visitor.visitXeroMcp(); case THIRTYSEVENSIGNALS: return visitor.visitThirtysevensignals(); case WAAD: return visitor.visitWaad(); case OIDC: return visitor.visitOidc(); - case FIGMA_MCP: - return visitor.visitFigmaMcp(); case SALESFORCE_COMMUNITY: return visitor.visitSalesforceCommunity(); case DACCOUNT: @@ -288,8 +249,12 @@ public T visit(Visitor visitor) { return visitor.visitBox(); case IP: return visitor.visitIp(); + case ATLASSIAN: + return visitor.visitAtlassian(); case ADFS: return visitor.visitAdfs(); + case GITLAB: + return visitor.visitGitlab(); case EMAIL: return visitor.visitEmail(); case YAHOO: @@ -306,8 +271,6 @@ public T visit(Visitor visitor) { return visitor.visitLinearMcp(); case LINKEDIN: return visitor.visitLinkedin(); - case ATLASSIAN_MCP: - return visitor.visitAtlassianMcp(); case GOOGLE_APPS: return visitor.visitGoogleApps(); case DWOLLA: @@ -326,32 +289,26 @@ public T visit(Visitor visitor) { return visitor.visitOkta(); case AUTH0: return visitor.visitAuth0(); - case HEROKU_MCP: - return visitor.visitHerokuMcp(); case GOOGLE_OAUTH2: return visitor.visitGoogleOauth2(); case WORDPRESS: return visitor.visitWordpress(); - case ASANA_MCP: - return visitor.visitAsanaMcp(); case EXACT: return visitor.visitExact(); + case ASANA: + return visitor.visitAsana(); case FITBIT: return visitor.visitFitbit(); case EVERNOTE: return visitor.visitEvernote(); - case SLACK_MCP: - return visitor.visitSlackMcp(); case SHAREPOINT: return visitor.visitSharepoint(); case SHOPIFY: return visitor.visitShopify(); - case VERCEL_MCP: - return visitor.visitVercelMcp(); case SALESFORCE_SANDBOX: return visitor.visitSalesforceSandbox(); - case INTERCOM_MCP: - return visitor.visitIntercomMcp(); + case SLACK: + return visitor.visitSlack(); case SENTRY_MCP: return visitor.visitSentryMcp(); case FACEBOOK: @@ -364,16 +321,12 @@ public T visit(Visitor visitor) { return visitor.visitAmazon(); case LINE: return visitor.visitLine(); - case DOCUSIGN_MCP: - return visitor.visitDocusignMcp(); case UNTAPPD: return visitor.visitUntappd(); case GITHUB: return visitor.visitGithub(); case SALESFORCE: return visitor.visitSalesforce(); - case PAGERDUTY_MCP: - return visitor.visitPagerdutyMcp(); case BITBUCKET: return visitor.visitBitbucket(); case OFFICE365: @@ -399,18 +352,12 @@ public static ConnectionIdentityProviderEnum valueOf(String value) { return AD; case "baidu": return BAIDU; - case "supabase-mcp": - return SUPABASE_MCP; case "bitly": return BITLY; case "paypal-sandbox": return PAYPAL_SANDBOX; case "samlp": return SAMLP; - case "gusto-mcp": - return GUSTO_MCP; - case "gitlab-mcp": - return GITLAB_MCP; case "dropbox": return DROPBOX; case "vkontakte": @@ -419,16 +366,12 @@ public static ConnectionIdentityProviderEnum valueOf(String value) { return INSTAGRAM; case "pingfederate": return PINGFEDERATE; - case "xero-mcp": - return XERO_MCP; case "thirtysevensignals": return THIRTYSEVENSIGNALS; case "waad": return WAAD; case "oidc": return OIDC; - case "figma-mcp": - return FIGMA_MCP; case "salesforce-community": return SALESFORCE_COMMUNITY; case "daccount": @@ -443,8 +386,12 @@ public static ConnectionIdentityProviderEnum valueOf(String value) { return BOX; case "ip": return IP; + case "atlassian": + return ATLASSIAN; case "adfs": return ADFS; + case "gitlab": + return GITLAB; case "email": return EMAIL; case "yahoo": @@ -461,8 +408,6 @@ public static ConnectionIdentityProviderEnum valueOf(String value) { return LINEAR_MCP; case "linkedin": return LINKEDIN; - case "atlassian-mcp": - return ATLASSIAN_MCP; case "google-apps": return GOOGLE_APPS; case "dwolla": @@ -481,32 +426,26 @@ public static ConnectionIdentityProviderEnum valueOf(String value) { return OKTA; case "auth0": return AUTH0; - case "heroku-mcp": - return HEROKU_MCP; case "google-oauth2": return GOOGLE_OAUTH2; case "wordpress": return WORDPRESS; - case "asana-mcp": - return ASANA_MCP; case "exact": return EXACT; + case "asana": + return ASANA; case "fitbit": return FITBIT; case "evernote": return EVERNOTE; - case "slack-mcp": - return SLACK_MCP; case "sharepoint": return SHAREPOINT; case "shopify": return SHOPIFY; - case "vercel-mcp": - return VERCEL_MCP; case "salesforce-sandbox": return SALESFORCE_SANDBOX; - case "intercom-mcp": - return INTERCOM_MCP; + case "slack": + return SLACK; case "sentry-mcp": return SENTRY_MCP; case "facebook": @@ -519,16 +458,12 @@ public static ConnectionIdentityProviderEnum valueOf(String value) { return AMAZON; case "line": return LINE; - case "docusign-mcp": - return DOCUSIGN_MCP; case "untappd": return UNTAPPD; case "github": return GITHUB; case "salesforce": return SALESFORCE; - case "pagerduty-mcp": - return PAGERDUTY_MCP; case "bitbucket": return BITBUCKET; case "office365": @@ -659,39 +594,21 @@ public enum Value { NOTION_MCP, - ASANA_MCP, + ASANA, - ATLASSIAN_MCP, + ATLASSIAN, CLOUDFLARE_MCP, - DOCUSIGN_MCP, - - FIGMA_MCP, - - GITLAB_MCP, - - GUSTO_MCP, - - HEROKU_MCP, + GITLAB, HUBSPOT_MCP, - INTERCOM_MCP, - LINEAR_MCP, - PAGERDUTY_MCP, - SENTRY_MCP, - SLACK_MCP, - - SUPABASE_MCP, - - VERCEL_MCP, - - XERO_MCP, + SLACK, UNKNOWN } @@ -809,39 +726,21 @@ public interface Visitor { T visitNotionMcp(); - T visitAsanaMcp(); + T visitAsana(); - T visitAtlassianMcp(); + T visitAtlassian(); T visitCloudflareMcp(); - T visitDocusignMcp(); - - T visitFigmaMcp(); - - T visitGitlabMcp(); - - T visitGustoMcp(); - - T visitHerokuMcp(); + T visitGitlab(); T visitHubspotMcp(); - T visitIntercomMcp(); - T visitLinearMcp(); - T visitPagerdutyMcp(); - T visitSentryMcp(); - T visitSlackMcp(); - - T visitSupabaseMcp(); - - T visitVercelMcp(); - - T visitXeroMcp(); + T visitSlack(); T visitUnknown(String unknownType); } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionStrategyEnum.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionStrategyEnum.java index da54adb42..2df97a46c 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionStrategyEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionStrategyEnum.java @@ -11,9 +11,6 @@ public final class ConnectionStrategyEnum { public static final ConnectionStrategyEnum BAIDU = new ConnectionStrategyEnum(Value.BAIDU, "baidu"); - public static final ConnectionStrategyEnum SUPABASE_MCP = - new ConnectionStrategyEnum(Value.SUPABASE_MCP, "supabase-mcp"); - public static final ConnectionStrategyEnum BITLY = new ConnectionStrategyEnum(Value.BITLY, "bitly"); public static final ConnectionStrategyEnum PAYPAL_SANDBOX = @@ -21,10 +18,6 @@ public final class ConnectionStrategyEnum { public static final ConnectionStrategyEnum SAMLP = new ConnectionStrategyEnum(Value.SAMLP, "samlp"); - public static final ConnectionStrategyEnum GUSTO_MCP = new ConnectionStrategyEnum(Value.GUSTO_MCP, "gusto-mcp"); - - public static final ConnectionStrategyEnum GITLAB_MCP = new ConnectionStrategyEnum(Value.GITLAB_MCP, "gitlab-mcp"); - public static final ConnectionStrategyEnum DROPBOX = new ConnectionStrategyEnum(Value.DROPBOX, "dropbox"); public static final ConnectionStrategyEnum VKONTAKTE = new ConnectionStrategyEnum(Value.VKONTAKTE, "vkontakte"); @@ -37,8 +30,6 @@ public final class ConnectionStrategyEnum { public static final ConnectionStrategyEnum PINGFEDERATE = new ConnectionStrategyEnum(Value.PINGFEDERATE, "pingfederate"); - public static final ConnectionStrategyEnum XERO_MCP = new ConnectionStrategyEnum(Value.XERO_MCP, "xero-mcp"); - public static final ConnectionStrategyEnum THIRTYSEVENSIGNALS = new ConnectionStrategyEnum(Value.THIRTYSEVENSIGNALS, "thirtysevensignals"); @@ -46,8 +37,6 @@ public final class ConnectionStrategyEnum { public static final ConnectionStrategyEnum OIDC = new ConnectionStrategyEnum(Value.OIDC, "oidc"); - public static final ConnectionStrategyEnum FIGMA_MCP = new ConnectionStrategyEnum(Value.FIGMA_MCP, "figma-mcp"); - public static final ConnectionStrategyEnum SALESFORCE_COMMUNITY = new ConnectionStrategyEnum(Value.SALESFORCE_COMMUNITY, "salesforce-community"); @@ -64,8 +53,12 @@ public final class ConnectionStrategyEnum { public static final ConnectionStrategyEnum IP = new ConnectionStrategyEnum(Value.IP, "ip"); + public static final ConnectionStrategyEnum ATLASSIAN = new ConnectionStrategyEnum(Value.ATLASSIAN, "atlassian"); + public static final ConnectionStrategyEnum ADFS = new ConnectionStrategyEnum(Value.ADFS, "adfs"); + public static final ConnectionStrategyEnum GITLAB = new ConnectionStrategyEnum(Value.GITLAB, "gitlab"); + public static final ConnectionStrategyEnum EMAIL = new ConnectionStrategyEnum(Value.EMAIL, "email"); public static final ConnectionStrategyEnum YAHOO = new ConnectionStrategyEnum(Value.YAHOO, "yahoo"); @@ -83,9 +76,6 @@ public final class ConnectionStrategyEnum { public static final ConnectionStrategyEnum LINKEDIN = new ConnectionStrategyEnum(Value.LINKEDIN, "linkedin"); - public static final ConnectionStrategyEnum ATLASSIAN_MCP = - new ConnectionStrategyEnum(Value.ATLASSIAN_MCP, "atlassian-mcp"); - public static final ConnectionStrategyEnum GOOGLE_APPS = new ConnectionStrategyEnum(Value.GOOGLE_APPS, "google-apps"); @@ -107,34 +97,27 @@ public final class ConnectionStrategyEnum { public static final ConnectionStrategyEnum AUTH0 = new ConnectionStrategyEnum(Value.AUTH0, "auth0"); - public static final ConnectionStrategyEnum HEROKU_MCP = new ConnectionStrategyEnum(Value.HEROKU_MCP, "heroku-mcp"); - public static final ConnectionStrategyEnum GOOGLE_OAUTH2 = new ConnectionStrategyEnum(Value.GOOGLE_OAUTH2, "google-oauth2"); public static final ConnectionStrategyEnum WORDPRESS = new ConnectionStrategyEnum(Value.WORDPRESS, "wordpress"); - public static final ConnectionStrategyEnum ASANA_MCP = new ConnectionStrategyEnum(Value.ASANA_MCP, "asana-mcp"); - public static final ConnectionStrategyEnum EXACT = new ConnectionStrategyEnum(Value.EXACT, "exact"); + public static final ConnectionStrategyEnum ASANA = new ConnectionStrategyEnum(Value.ASANA, "asana"); + public static final ConnectionStrategyEnum FITBIT = new ConnectionStrategyEnum(Value.FITBIT, "fitbit"); public static final ConnectionStrategyEnum EVERNOTE = new ConnectionStrategyEnum(Value.EVERNOTE, "evernote"); - public static final ConnectionStrategyEnum SLACK_MCP = new ConnectionStrategyEnum(Value.SLACK_MCP, "slack-mcp"); - public static final ConnectionStrategyEnum SHAREPOINT = new ConnectionStrategyEnum(Value.SHAREPOINT, "sharepoint"); public static final ConnectionStrategyEnum SHOPIFY = new ConnectionStrategyEnum(Value.SHOPIFY, "shopify"); - public static final ConnectionStrategyEnum VERCEL_MCP = new ConnectionStrategyEnum(Value.VERCEL_MCP, "vercel-mcp"); - public static final ConnectionStrategyEnum SALESFORCE_SANDBOX = new ConnectionStrategyEnum(Value.SALESFORCE_SANDBOX, "salesforce-sandbox"); - public static final ConnectionStrategyEnum INTERCOM_MCP = - new ConnectionStrategyEnum(Value.INTERCOM_MCP, "intercom-mcp"); + public static final ConnectionStrategyEnum SLACK = new ConnectionStrategyEnum(Value.SLACK, "slack"); public static final ConnectionStrategyEnum SENTRY_MCP = new ConnectionStrategyEnum(Value.SENTRY_MCP, "sentry-mcp"); @@ -148,18 +131,12 @@ public final class ConnectionStrategyEnum { public static final ConnectionStrategyEnum LINE = new ConnectionStrategyEnum(Value.LINE, "line"); - public static final ConnectionStrategyEnum DOCUSIGN_MCP = - new ConnectionStrategyEnum(Value.DOCUSIGN_MCP, "docusign-mcp"); - public static final ConnectionStrategyEnum UNTAPPD = new ConnectionStrategyEnum(Value.UNTAPPD, "untappd"); public static final ConnectionStrategyEnum GITHUB = new ConnectionStrategyEnum(Value.GITHUB, "github"); public static final ConnectionStrategyEnum SALESFORCE = new ConnectionStrategyEnum(Value.SALESFORCE, "salesforce"); - public static final ConnectionStrategyEnum PAGERDUTY_MCP = - new ConnectionStrategyEnum(Value.PAGERDUTY_MCP, "pagerduty-mcp"); - public static final ConnectionStrategyEnum BITBUCKET = new ConnectionStrategyEnum(Value.BITBUCKET, "bitbucket"); public static final ConnectionStrategyEnum OFFICE365 = new ConnectionStrategyEnum(Value.OFFICE365, "office365"); @@ -210,18 +187,12 @@ public T visit(Visitor visitor) { return visitor.visitAd(); case BAIDU: return visitor.visitBaidu(); - case SUPABASE_MCP: - return visitor.visitSupabaseMcp(); case BITLY: return visitor.visitBitly(); case PAYPAL_SANDBOX: return visitor.visitPaypalSandbox(); case SAMLP: return visitor.visitSamlp(); - case GUSTO_MCP: - return visitor.visitGustoMcp(); - case GITLAB_MCP: - return visitor.visitGitlabMcp(); case DROPBOX: return visitor.visitDropbox(); case VKONTAKTE: @@ -232,16 +203,12 @@ public T visit(Visitor visitor) { return visitor.visitAuth0Adldap(); case PINGFEDERATE: return visitor.visitPingfederate(); - case XERO_MCP: - return visitor.visitXeroMcp(); case THIRTYSEVENSIGNALS: return visitor.visitThirtysevensignals(); case WAAD: return visitor.visitWaad(); case OIDC: return visitor.visitOidc(); - case FIGMA_MCP: - return visitor.visitFigmaMcp(); case SALESFORCE_COMMUNITY: return visitor.visitSalesforceCommunity(); case DACCOUNT: @@ -256,8 +223,12 @@ public T visit(Visitor visitor) { return visitor.visitBox(); case IP: return visitor.visitIp(); + case ATLASSIAN: + return visitor.visitAtlassian(); case ADFS: return visitor.visitAdfs(); + case GITLAB: + return visitor.visitGitlab(); case EMAIL: return visitor.visitEmail(); case YAHOO: @@ -274,8 +245,6 @@ public T visit(Visitor visitor) { return visitor.visitLinearMcp(); case LINKEDIN: return visitor.visitLinkedin(); - case ATLASSIAN_MCP: - return visitor.visitAtlassianMcp(); case GOOGLE_APPS: return visitor.visitGoogleApps(); case DWOLLA: @@ -294,32 +263,26 @@ public T visit(Visitor visitor) { return visitor.visitOkta(); case AUTH0: return visitor.visitAuth0(); - case HEROKU_MCP: - return visitor.visitHerokuMcp(); case GOOGLE_OAUTH2: return visitor.visitGoogleOauth2(); case WORDPRESS: return visitor.visitWordpress(); - case ASANA_MCP: - return visitor.visitAsanaMcp(); case EXACT: return visitor.visitExact(); + case ASANA: + return visitor.visitAsana(); case FITBIT: return visitor.visitFitbit(); case EVERNOTE: return visitor.visitEvernote(); - case SLACK_MCP: - return visitor.visitSlackMcp(); case SHAREPOINT: return visitor.visitSharepoint(); case SHOPIFY: return visitor.visitShopify(); - case VERCEL_MCP: - return visitor.visitVercelMcp(); case SALESFORCE_SANDBOX: return visitor.visitSalesforceSandbox(); - case INTERCOM_MCP: - return visitor.visitIntercomMcp(); + case SLACK: + return visitor.visitSlack(); case SENTRY_MCP: return visitor.visitSentryMcp(); case FACEBOOK: @@ -332,16 +295,12 @@ public T visit(Visitor visitor) { return visitor.visitAmazon(); case LINE: return visitor.visitLine(); - case DOCUSIGN_MCP: - return visitor.visitDocusignMcp(); case UNTAPPD: return visitor.visitUntappd(); case GITHUB: return visitor.visitGithub(); case SALESFORCE: return visitor.visitSalesforce(); - case PAGERDUTY_MCP: - return visitor.visitPagerdutyMcp(); case BITBUCKET: return visitor.visitBitbucket(); case OFFICE365: @@ -367,18 +326,12 @@ public static ConnectionStrategyEnum valueOf(String value) { return AD; case "baidu": return BAIDU; - case "supabase-mcp": - return SUPABASE_MCP; case "bitly": return BITLY; case "paypal-sandbox": return PAYPAL_SANDBOX; case "samlp": return SAMLP; - case "gusto-mcp": - return GUSTO_MCP; - case "gitlab-mcp": - return GITLAB_MCP; case "dropbox": return DROPBOX; case "vkontakte": @@ -389,16 +342,12 @@ public static ConnectionStrategyEnum valueOf(String value) { return AUTH0ADLDAP; case "pingfederate": return PINGFEDERATE; - case "xero-mcp": - return XERO_MCP; case "thirtysevensignals": return THIRTYSEVENSIGNALS; case "waad": return WAAD; case "oidc": return OIDC; - case "figma-mcp": - return FIGMA_MCP; case "salesforce-community": return SALESFORCE_COMMUNITY; case "daccount": @@ -413,8 +362,12 @@ public static ConnectionStrategyEnum valueOf(String value) { return BOX; case "ip": return IP; + case "atlassian": + return ATLASSIAN; case "adfs": return ADFS; + case "gitlab": + return GITLAB; case "email": return EMAIL; case "yahoo": @@ -431,8 +384,6 @@ public static ConnectionStrategyEnum valueOf(String value) { return LINEAR_MCP; case "linkedin": return LINKEDIN; - case "atlassian-mcp": - return ATLASSIAN_MCP; case "google-apps": return GOOGLE_APPS; case "dwolla": @@ -451,32 +402,26 @@ public static ConnectionStrategyEnum valueOf(String value) { return OKTA; case "auth0": return AUTH0; - case "heroku-mcp": - return HEROKU_MCP; case "google-oauth2": return GOOGLE_OAUTH2; case "wordpress": return WORDPRESS; - case "asana-mcp": - return ASANA_MCP; case "exact": return EXACT; + case "asana": + return ASANA; case "fitbit": return FITBIT; case "evernote": return EVERNOTE; - case "slack-mcp": - return SLACK_MCP; case "sharepoint": return SHAREPOINT; case "shopify": return SHOPIFY; - case "vercel-mcp": - return VERCEL_MCP; case "salesforce-sandbox": return SALESFORCE_SANDBOX; - case "intercom-mcp": - return INTERCOM_MCP; + case "slack": + return SLACK; case "sentry-mcp": return SENTRY_MCP; case "facebook": @@ -489,16 +434,12 @@ public static ConnectionStrategyEnum valueOf(String value) { return AMAZON; case "line": return LINE; - case "docusign-mcp": - return DOCUSIGN_MCP; case "untappd": return UNTAPPD; case "github": return GITHUB; case "salesforce": return SALESFORCE; - case "pagerduty-mcp": - return PAGERDUTY_MCP; case "bitbucket": return BITBUCKET; case "office365": @@ -629,39 +570,21 @@ public enum Value { NOTION_MCP, - ASANA_MCP, + ASANA, - ATLASSIAN_MCP, + ATLASSIAN, CLOUDFLARE_MCP, - DOCUSIGN_MCP, - - FIGMA_MCP, - - GITLAB_MCP, - - GUSTO_MCP, - - HEROKU_MCP, + GITLAB, HUBSPOT_MCP, - INTERCOM_MCP, - LINEAR_MCP, - PAGERDUTY_MCP, - SENTRY_MCP, - SLACK_MCP, - - SUPABASE_MCP, - - VERCEL_MCP, - - XERO_MCP, + SLACK, AUTH0ADLDAP, @@ -781,39 +704,21 @@ public interface Visitor { T visitNotionMcp(); - T visitAsanaMcp(); + T visitAsana(); - T visitAtlassianMcp(); + T visitAtlassian(); T visitCloudflareMcp(); - T visitDocusignMcp(); - - T visitFigmaMcp(); - - T visitGitlabMcp(); - - T visitGustoMcp(); - - T visitHerokuMcp(); + T visitGitlab(); T visitHubspotMcp(); - T visitIntercomMcp(); - T visitLinearMcp(); - T visitPagerdutyMcp(); - T visitSentryMcp(); - T visitSlackMcp(); - - T visitSupabaseMcp(); - - T visitVercelMcp(); - - T visitXeroMcp(); + T visitSlack(); T visitAuth0Adldap(); diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateAnonymousSessions.java b/src/main/java/com/auth0/client/mgmt/types/CreateAnonymousSessions.java new file mode 100644 index 000000000..68189944a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateAnonymousSessions.java @@ -0,0 +1,127 @@ +/** + * 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; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateAnonymousSessions.Builder.class) +public final class CreateAnonymousSessions { + private final boolean active; + + private final Map additionalProperties; + + private CreateAnonymousSessions(boolean active, Map additionalProperties) { + this.active = active; + this.additionalProperties = additionalProperties; + } + + /** + * @return If set to true, this client is allowed to create anonymous sessions. + */ + @JsonProperty("active") + public boolean getActive() { + return active; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateAnonymousSessions && equalTo((CreateAnonymousSessions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateAnonymousSessions other) { + return active == other.active; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.active); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActiveStage builder() { + return new Builder(); + } + + public interface ActiveStage { + /** + *

If set to true, this client is allowed to create anonymous sessions.

+ */ + _FinalStage active(boolean active); + + Builder from(CreateAnonymousSessions other); + } + + public interface _FinalStage { + CreateAnonymousSessions build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActiveStage, _FinalStage { + private boolean active; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateAnonymousSessions other) { + active(other.getActive()); + return this; + } + + /** + *

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("active") + public _FinalStage active(boolean active) { + this.active = active; + return this; + } + + @java.lang.Override + public CreateAnonymousSessions build() { + return new CreateAnonymousSessions(active, 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/CreateClientRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateClientRequestContent.java index 6f72deb41..7b0dc5329 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateClientRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateClientRequestContent.java @@ -127,6 +127,8 @@ public final class CreateClientRequestContent { private final Optional identityAssertionAuthorizationGrant; + private final Optional anonymousSessions; + private final Optional thirdPartySecurityMode; private final Optional redirectionPolicy; @@ -193,6 +195,7 @@ private CreateClientRequestContent( Optional tokenQuota, Optional resourceServerIdentifier, Optional identityAssertionAuthorizationGrant, + Optional anonymousSessions, Optional thirdPartySecurityMode, Optional redirectionPolicy, Optional expressConfiguration, @@ -251,6 +254,7 @@ private CreateClientRequestContent( this.tokenQuota = tokenQuota; this.resourceServerIdentifier = resourceServerIdentifier; this.identityAssertionAuthorizationGrant = identityAssertionAuthorizationGrant; + this.anonymousSessions = anonymousSessions; this.thirdPartySecurityMode = thirdPartySecurityMode; this.redirectionPolicy = redirectionPolicy; this.expressConfiguration = expressConfiguration; @@ -628,6 +632,11 @@ public Optional getIdentityAssertionA return identityAssertionAuthorizationGrant; } + @JsonProperty("anonymous_sessions") + public Optional getAnonymousSessions() { + return anonymousSessions; + } + @JsonProperty("third_party_security_mode") public Optional getThirdPartySecurityMode() { return thirdPartySecurityMode; @@ -758,6 +767,7 @@ private boolean equalTo(CreateClientRequestContent other) { && tokenQuota.equals(other.tokenQuota) && resourceServerIdentifier.equals(other.resourceServerIdentifier) && identityAssertionAuthorizationGrant.equals(other.identityAssertionAuthorizationGrant) + && anonymousSessions.equals(other.anonymousSessions) && thirdPartySecurityMode.equals(other.thirdPartySecurityMode) && redirectionPolicy.equals(other.redirectionPolicy) && expressConfiguration.equals(other.expressConfiguration) @@ -820,6 +830,7 @@ public int hashCode() { this.tokenQuota, this.resourceServerIdentifier, this.identityAssertionAuthorizationGrant, + this.anonymousSessions, this.thirdPartySecurityMode, this.redirectionPolicy, this.expressConfiguration, @@ -1173,6 +1184,10 @@ _FinalStage identityAssertionAuthorizationGrant( _FinalStage identityAssertionAuthorizationGrant( CreateIdentityAssertionAuthorizationGrant identityAssertionAuthorizationGrant); + _FinalStage anonymousSessions(Optional anonymousSessions); + + _FinalStage anonymousSessions(CreateAnonymousSessions anonymousSessions); + _FinalStage thirdPartySecurityMode(Optional thirdPartySecurityMode); _FinalStage thirdPartySecurityMode(ClientThirdPartySecurityModeEnum thirdPartySecurityMode); @@ -1218,6 +1233,8 @@ public static final class Builder implements NameStage, _FinalStage { private Optional thirdPartySecurityMode = Optional.empty(); + private Optional anonymousSessions = Optional.empty(); + private Optional identityAssertionAuthorizationGrant = Optional.empty(); @@ -1377,6 +1394,7 @@ public Builder from(CreateClientRequestContent other) { tokenQuota(other.getTokenQuota()); resourceServerIdentifier(other.getResourceServerIdentifier()); identityAssertionAuthorizationGrant(other.getIdentityAssertionAuthorizationGrant()); + anonymousSessions(other.getAnonymousSessions()); thirdPartySecurityMode(other.getThirdPartySecurityMode()); redirectionPolicy(other.getRedirectionPolicy()); expressConfiguration(other.getExpressConfiguration()); @@ -1480,6 +1498,19 @@ public _FinalStage thirdPartySecurityMode(Optional anonymousSessions) { + this.anonymousSessions = anonymousSessions; + return this; + } + @java.lang.Override public _FinalStage identityAssertionAuthorizationGrant( CreateIdentityAssertionAuthorizationGrant identityAssertionAuthorizationGrant) { @@ -2543,6 +2574,7 @@ public CreateClientRequestContent build() { tokenQuota, resourceServerIdentifier, identityAssertionAuthorizationGrant, + anonymousSessions, thirdPartySecurityMode, redirectionPolicy, expressConfiguration, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateClientResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateClientResponseContent.java index f92e83692..133224091 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateClientResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateClientResponseContent.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 CreateClientResponseContent { 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 CreateClientResponseContent { private final Optional identityAssertionAuthorizationGrant; + private final Optional anonymousSessions; + private final Optional thirdPartySecurityMode; private final Optional redirectionPolicy; @@ -158,6 +165,8 @@ public final class CreateClientResponseContent { private CreateClientResponseContent( Optional clientId, + Optional createdAt, + Optional updatedAt, Optional tenant, Optional name, Optional description, @@ -214,6 +223,7 @@ private CreateClientResponseContent( Optional b2BIntegrationConfiguration, Optional myOrganizationConfiguration, Optional identityAssertionAuthorizationGrant, + Optional anonymousSessions, Optional thirdPartySecurityMode, Optional redirectionPolicy, Optional resourceServerIdentifier, @@ -224,6 +234,8 @@ private CreateClientResponseContent( Optional jwksUri, Map additionalProperties) { this.clientId = clientId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; this.tenant = tenant; this.name = name; this.description = description; @@ -280,6 +292,7 @@ private CreateClientResponseContent( this.b2BIntegrationConfiguration = b2BIntegrationConfiguration; this.myOrganizationConfiguration = myOrganizationConfiguration; this.identityAssertionAuthorizationGrant = identityAssertionAuthorizationGrant; + this.anonymousSessions = anonymousSessions; this.thirdPartySecurityMode = thirdPartySecurityMode; this.redirectionPolicy = redirectionPolicy; this.resourceServerIdentifier = resourceServerIdentifier; @@ -299,6 +312,22 @@ public Optional getClientId() { return clientId; } + /** + * @return The ISO 8601 timestamp of when this client was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The ISO 8601 timestamp of when this client was last updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + /** * @return Name of the tenant this client belongs to. */ @@ -703,6 +732,11 @@ public Optional getIdentityAssertionAuthori return identityAssertionAuthorizationGrant; } + @JsonProperty("anonymous_sessions") + public Optional getAnonymousSessions() { + return anonymousSessions; + } + @JsonProperty("third_party_security_mode") public Optional getThirdPartySecurityMode() { return thirdPartySecurityMode; @@ -813,6 +847,8 @@ public Map getAdditionalProperties() { private boolean equalTo(CreateClientResponseContent other) { return clientId.equals(other.clientId) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) && tenant.equals(other.tenant) && name.equals(other.name) && description.equals(other.description) @@ -870,6 +906,7 @@ private boolean equalTo(CreateClientResponseContent other) { && b2BIntegrationConfiguration.equals(other.b2BIntegrationConfiguration) && myOrganizationConfiguration.equals(other.myOrganizationConfiguration) && identityAssertionAuthorizationGrant.equals(other.identityAssertionAuthorizationGrant) + && anonymousSessions.equals(other.anonymousSessions) && thirdPartySecurityMode.equals(other.thirdPartySecurityMode) && redirectionPolicy.equals(other.redirectionPolicy) && resourceServerIdentifier.equals(other.resourceServerIdentifier) @@ -884,6 +921,8 @@ private boolean equalTo(CreateClientResponseContent other) { public int hashCode() { return Objects.hash( this.clientId, + this.createdAt, + this.updatedAt, this.tenant, this.name, this.description, @@ -940,6 +979,7 @@ public int hashCode() { this.b2BIntegrationConfiguration, this.myOrganizationConfiguration, this.identityAssertionAuthorizationGrant, + this.anonymousSessions, this.thirdPartySecurityMode, this.redirectionPolicy, this.resourceServerIdentifier, @@ -963,6 +1003,10 @@ public static Builder builder() { public static final class Builder { private Optional clientId = Optional.empty(); + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + private Optional tenant = Optional.empty(); private Optional name = Optional.empty(); @@ -1076,6 +1120,8 @@ public static final class Builder { private Optional identityAssertionAuthorizationGrant = Optional.empty(); + private Optional anonymousSessions = Optional.empty(); + private Optional thirdPartySecurityMode = Optional.empty(); private Optional redirectionPolicy = Optional.empty(); @@ -1100,6 +1146,8 @@ private Builder() {} public Builder from(CreateClientResponseContent other) { clientId(other.getClientId()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); tenant(other.getTenant()); name(other.getName()); description(other.getDescription()); @@ -1156,6 +1204,7 @@ public Builder from(CreateClientResponseContent other) { b2BIntegrationConfiguration(other.getB2BIntegrationConfiguration()); myOrganizationConfiguration(other.getMyOrganizationConfiguration()); identityAssertionAuthorizationGrant(other.getIdentityAssertionAuthorizationGrant()); + anonymousSessions(other.getAnonymousSessions()); thirdPartySecurityMode(other.getThirdPartySecurityMode()); redirectionPolicy(other.getRedirectionPolicy()); resourceServerIdentifier(other.getResourceServerIdentifier()); @@ -1181,6 +1230,34 @@ public Builder clientId(String clientId) { return this; } + /** + *

The ISO 8601 timestamp of when this client was created.

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

The ISO 8601 timestamp of when this client was last updated.

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

Name of the tenant this client belongs to.

*/ @@ -2065,6 +2142,17 @@ public Builder identityAssertionAuthorizationGrant( return this; } + @JsonSetter(value = "anonymous_sessions", nulls = Nulls.SKIP) + public Builder anonymousSessions(Optional anonymousSessions) { + this.anonymousSessions = anonymousSessions; + return this; + } + + public Builder anonymousSessions(AnonymousSessions anonymousSessions) { + this.anonymousSessions = Optional.ofNullable(anonymousSessions); + return this; + } + @JsonSetter(value = "third_party_security_mode", nulls = Nulls.SKIP) public Builder thirdPartySecurityMode(Optional thirdPartySecurityMode) { this.thirdPartySecurityMode = thirdPartySecurityMode; @@ -2168,6 +2256,8 @@ public Builder jwksUri(String jwksUri) { public CreateClientResponseContent build() { return new CreateClientResponseContent( clientId, + createdAt, + updatedAt, tenant, name, description, @@ -2224,6 +2314,7 @@ public CreateClientResponseContent build() { b2BIntegrationConfiguration, myOrganizationConfiguration, identityAssertionAuthorizationGrant, + anonymousSessions, thirdPartySecurityMode, redirectionPolicy, resourceServerIdentifier, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationTemplateRequestContent.java deleted file mode 100644 index 152e0d7ee..000000000 --- a/src/main/java/com/auth0/client/mgmt/types/CreateOrganizationTemplateRequestContent.java +++ /dev/null @@ -1,932 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.auth0.client.mgmt.types; - -import com.auth0.client.mgmt.core.NullableNonemptyFilter; -import com.auth0.client.mgmt.core.ObjectMappers; -import com.auth0.client.mgmt.core.OptionalNullable; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CreateOrganizationTemplateRequestContent.Builder.class) -public final class CreateOrganizationTemplateRequestContent { - private final String name; - - private final Optional isDefault; - - private final OrganizationDeletionBehaviorEnum organizationDeletionBehavior; - - private final Optional connectionDeletionBehavior; - - private final boolean enforcePermissionCeiling; - - private final boolean enforceSelfAssignmentRestriction; - - private final OptionalNullable connectionProfileId; - - private final OptionalNullable userAttributeProfileId; - - private final OptionalNullable> allowedStrategies; - - private final OptionalNullable invitationLandingClientId; - - private final OptionalNullable> adminRolesAssignment; - - private final OptionalNullable useForOrganizationDiscovery; - - private final OptionalNullable roleVisibilityPolicy; - - private final Map additionalProperties; - - private CreateOrganizationTemplateRequestContent( - String name, - Optional isDefault, - OrganizationDeletionBehaviorEnum organizationDeletionBehavior, - Optional connectionDeletionBehavior, - boolean enforcePermissionCeiling, - boolean enforceSelfAssignmentRestriction, - OptionalNullable connectionProfileId, - OptionalNullable userAttributeProfileId, - OptionalNullable> allowedStrategies, - OptionalNullable invitationLandingClientId, - OptionalNullable> adminRolesAssignment, - OptionalNullable useForOrganizationDiscovery, - OptionalNullable roleVisibilityPolicy, - Map additionalProperties) { - this.name = name; - this.isDefault = isDefault; - this.organizationDeletionBehavior = organizationDeletionBehavior; - this.connectionDeletionBehavior = connectionDeletionBehavior; - this.enforcePermissionCeiling = enforcePermissionCeiling; - this.enforceSelfAssignmentRestriction = enforceSelfAssignmentRestriction; - this.connectionProfileId = connectionProfileId; - this.userAttributeProfileId = userAttributeProfileId; - this.allowedStrategies = allowedStrategies; - this.invitationLandingClientId = invitationLandingClientId; - this.adminRolesAssignment = adminRolesAssignment; - this.useForOrganizationDiscovery = useForOrganizationDiscovery; - this.roleVisibilityPolicy = roleVisibilityPolicy; - this.additionalProperties = additionalProperties; - } - - /** - * @return The name of the organization template. - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * @return Whether this is the default template applied to new organizations. - */ - @JsonProperty("is_default") - public Optional getIsDefault() { - return isDefault; - } - - @JsonProperty("organization_deletion_behavior") - public OrganizationDeletionBehaviorEnum getOrganizationDeletionBehavior() { - return organizationDeletionBehavior; - } - - @JsonProperty("connection_deletion_behavior") - public Optional getConnectionDeletionBehavior() { - return connectionDeletionBehavior; - } - - /** - * @return Whether to enforce permission ceiling for organizations using this template. - */ - @JsonProperty("enforce_permission_ceiling") - public boolean getEnforcePermissionCeiling() { - return enforcePermissionCeiling; - } - - /** - * @return Whether to enforce self-assignment restrictions for organizations using this template. - */ - @JsonProperty("enforce_self_assignment_restriction") - public boolean getEnforceSelfAssignmentRestriction() { - return enforceSelfAssignmentRestriction; - } - - /** - * @return The connection profile to apply to new connections. - */ - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("connection_profile_id") - public OptionalNullable getConnectionProfileId() { - if (connectionProfileId == null) { - return OptionalNullable.absent(); - } - return connectionProfileId; - } - - /** - * @return The user attribute profile to apply to organizations. - */ - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("user_attribute_profile_id") - public OptionalNullable getUserAttributeProfileId() { - if (userAttributeProfileId == null) { - return OptionalNullable.absent(); - } - return userAttributeProfileId; - } - - /** - * @return List of allowed connection strategies for this template. - */ - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("allowed_strategies") - public OptionalNullable> getAllowedStrategies() { - if (allowedStrategies == null) { - return OptionalNullable.absent(); - } - return allowedStrategies; - } - - /** - * @return The client ID for the invitation landing page. - */ - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("invitation_landing_client_id") - public OptionalNullable getInvitationLandingClientId() { - if (invitationLandingClientId == null) { - return OptionalNullable.absent(); - } - return invitationLandingClientId; - } - - /** - * @return Default admin roles to assign to organization creators. - */ - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("admin_roles_assignment") - public OptionalNullable> getAdminRolesAssignment() { - if (adminRolesAssignment == null) { - return OptionalNullable.absent(); - } - return adminRolesAssignment; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("use_for_organization_discovery") - public OptionalNullable getUseForOrganizationDiscovery() { - if (useForOrganizationDiscovery == null) { - return OptionalNullable.absent(); - } - return useForOrganizationDiscovery; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("role_visibility_policy") - public OptionalNullable getRoleVisibilityPolicy() { - if (roleVisibilityPolicy == null) { - return OptionalNullable.absent(); - } - return roleVisibilityPolicy; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("connection_profile_id") - private OptionalNullable _getConnectionProfileId() { - return connectionProfileId; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("user_attribute_profile_id") - private OptionalNullable _getUserAttributeProfileId() { - return userAttributeProfileId; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("allowed_strategies") - private OptionalNullable> _getAllowedStrategies() { - return allowedStrategies; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("invitation_landing_client_id") - private OptionalNullable _getInvitationLandingClientId() { - return invitationLandingClientId; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("admin_roles_assignment") - private OptionalNullable> _getAdminRolesAssignment() { - return adminRolesAssignment; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("use_for_organization_discovery") - private OptionalNullable _getUseForOrganizationDiscovery() { - return useForOrganizationDiscovery; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("role_visibility_policy") - private OptionalNullable _getRoleVisibilityPolicy() { - return roleVisibilityPolicy; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CreateOrganizationTemplateRequestContent - && equalTo((CreateOrganizationTemplateRequestContent) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CreateOrganizationTemplateRequestContent other) { - return name.equals(other.name) - && isDefault.equals(other.isDefault) - && organizationDeletionBehavior.equals(other.organizationDeletionBehavior) - && connectionDeletionBehavior.equals(other.connectionDeletionBehavior) - && enforcePermissionCeiling == other.enforcePermissionCeiling - && enforceSelfAssignmentRestriction == other.enforceSelfAssignmentRestriction - && connectionProfileId.equals(other.connectionProfileId) - && userAttributeProfileId.equals(other.userAttributeProfileId) - && allowedStrategies.equals(other.allowedStrategies) - && invitationLandingClientId.equals(other.invitationLandingClientId) - && adminRolesAssignment.equals(other.adminRolesAssignment) - && useForOrganizationDiscovery.equals(other.useForOrganizationDiscovery) - && roleVisibilityPolicy.equals(other.roleVisibilityPolicy); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.name, - this.isDefault, - this.organizationDeletionBehavior, - this.connectionDeletionBehavior, - this.enforcePermissionCeiling, - this.enforceSelfAssignmentRestriction, - this.connectionProfileId, - this.userAttributeProfileId, - this.allowedStrategies, - this.invitationLandingClientId, - this.adminRolesAssignment, - this.useForOrganizationDiscovery, - this.roleVisibilityPolicy); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - /** - *

The name of the organization template.

- */ - OrganizationDeletionBehaviorStage name(@NotNull String name); - - Builder from(CreateOrganizationTemplateRequestContent other); - } - - public interface OrganizationDeletionBehaviorStage { - EnforcePermissionCeilingStage organizationDeletionBehavior( - @NotNull OrganizationDeletionBehaviorEnum organizationDeletionBehavior); - } - - public interface EnforcePermissionCeilingStage { - /** - *

Whether to enforce permission ceiling for organizations using this template.

- */ - EnforceSelfAssignmentRestrictionStage enforcePermissionCeiling(boolean enforcePermissionCeiling); - } - - public interface EnforceSelfAssignmentRestrictionStage { - /** - *

Whether to enforce self-assignment restrictions for organizations using this template.

- */ - _FinalStage enforceSelfAssignmentRestriction(boolean enforceSelfAssignmentRestriction); - } - - public interface _FinalStage { - CreateOrganizationTemplateRequestContent build(); - - _FinalStage additionalProperty(String key, Object value); - - _FinalStage additionalProperties(Map additionalProperties); - - /** - *

Whether this is the default template applied to new organizations.

- */ - _FinalStage isDefault(Optional isDefault); - - _FinalStage isDefault(Boolean isDefault); - - _FinalStage connectionDeletionBehavior(Optional connectionDeletionBehavior); - - _FinalStage connectionDeletionBehavior(ConnectionDeletionBehaviorEnum connectionDeletionBehavior); - - /** - *

The connection profile to apply to new connections.

- */ - _FinalStage connectionProfileId(@Nullable OptionalNullable connectionProfileId); - - _FinalStage connectionProfileId(String connectionProfileId); - - _FinalStage connectionProfileId(Optional connectionProfileId); - - _FinalStage connectionProfileId(com.auth0.client.mgmt.core.Nullable connectionProfileId); - - /** - *

The user attribute profile to apply to organizations.

- */ - _FinalStage userAttributeProfileId(@Nullable OptionalNullable userAttributeProfileId); - - _FinalStage userAttributeProfileId(String userAttributeProfileId); - - _FinalStage userAttributeProfileId(Optional userAttributeProfileId); - - _FinalStage userAttributeProfileId(com.auth0.client.mgmt.core.Nullable userAttributeProfileId); - - /** - *

List of allowed connection strategies for this template.

- */ - _FinalStage allowedStrategies( - @Nullable OptionalNullable> allowedStrategies); - - _FinalStage allowedStrategies(List allowedStrategies); - - _FinalStage allowedStrategies(Optional> allowedStrategies); - - _FinalStage allowedStrategies( - com.auth0.client.mgmt.core.Nullable> allowedStrategies); - - /** - *

The client ID for the invitation landing page.

- */ - _FinalStage invitationLandingClientId(@Nullable OptionalNullable invitationLandingClientId); - - _FinalStage invitationLandingClientId(String invitationLandingClientId); - - _FinalStage invitationLandingClientId(Optional invitationLandingClientId); - - _FinalStage invitationLandingClientId(com.auth0.client.mgmt.core.Nullable invitationLandingClientId); - - /** - *

Default admin roles to assign to organization creators.

- */ - _FinalStage adminRolesAssignment(@Nullable OptionalNullable> adminRolesAssignment); - - _FinalStage adminRolesAssignment(List adminRolesAssignment); - - _FinalStage adminRolesAssignment(Optional> adminRolesAssignment); - - _FinalStage adminRolesAssignment(com.auth0.client.mgmt.core.Nullable> adminRolesAssignment); - - _FinalStage useForOrganizationDiscovery( - @Nullable - OptionalNullable useForOrganizationDiscovery); - - _FinalStage useForOrganizationDiscovery( - OrganizationTemplateUseForOrganizationDiscovery useForOrganizationDiscovery); - - _FinalStage useForOrganizationDiscovery( - Optional useForOrganizationDiscovery); - - _FinalStage useForOrganizationDiscovery( - com.auth0.client.mgmt.core.Nullable - useForOrganizationDiscovery); - - _FinalStage roleVisibilityPolicy( - @Nullable OptionalNullable roleVisibilityPolicy); - - _FinalStage roleVisibilityPolicy(OrganizationTemplateRoleVisibilityPolicy roleVisibilityPolicy); - - _FinalStage roleVisibilityPolicy(Optional roleVisibilityPolicy); - - _FinalStage roleVisibilityPolicy( - com.auth0.client.mgmt.core.Nullable roleVisibilityPolicy); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements NameStage, - OrganizationDeletionBehaviorStage, - EnforcePermissionCeilingStage, - EnforceSelfAssignmentRestrictionStage, - _FinalStage { - private String name; - - private OrganizationDeletionBehaviorEnum organizationDeletionBehavior; - - private boolean enforcePermissionCeiling; - - private boolean enforceSelfAssignmentRestriction; - - private OptionalNullable roleVisibilityPolicy = - OptionalNullable.absent(); - - private OptionalNullable useForOrganizationDiscovery = - OptionalNullable.absent(); - - private OptionalNullable> adminRolesAssignment = OptionalNullable.absent(); - - private OptionalNullable invitationLandingClientId = OptionalNullable.absent(); - - private OptionalNullable> allowedStrategies = - OptionalNullable.absent(); - - private OptionalNullable userAttributeProfileId = OptionalNullable.absent(); - - private OptionalNullable connectionProfileId = OptionalNullable.absent(); - - private Optional connectionDeletionBehavior = Optional.empty(); - - private Optional isDefault = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CreateOrganizationTemplateRequestContent other) { - name(other.getName()); - isDefault(other.getIsDefault()); - organizationDeletionBehavior(other.getOrganizationDeletionBehavior()); - connectionDeletionBehavior(other.getConnectionDeletionBehavior()); - enforcePermissionCeiling(other.getEnforcePermissionCeiling()); - enforceSelfAssignmentRestriction(other.getEnforceSelfAssignmentRestriction()); - connectionProfileId(other.getConnectionProfileId()); - userAttributeProfileId(other.getUserAttributeProfileId()); - allowedStrategies(other.getAllowedStrategies()); - invitationLandingClientId(other.getInvitationLandingClientId()); - adminRolesAssignment(other.getAdminRolesAssignment()); - useForOrganizationDiscovery(other.getUseForOrganizationDiscovery()); - roleVisibilityPolicy(other.getRoleVisibilityPolicy()); - return this; - } - - /** - *

The name of the organization template.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public OrganizationDeletionBehaviorStage name(@NotNull String name) { - this.name = Objects.requireNonNull(name, "name must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("organization_deletion_behavior") - public EnforcePermissionCeilingStage organizationDeletionBehavior( - @NotNull OrganizationDeletionBehaviorEnum organizationDeletionBehavior) { - this.organizationDeletionBehavior = Objects.requireNonNull( - organizationDeletionBehavior, "organizationDeletionBehavior must not be null"); - return this; - } - - /** - *

Whether to enforce permission ceiling for organizations using this template.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("enforce_permission_ceiling") - public EnforceSelfAssignmentRestrictionStage enforcePermissionCeiling(boolean enforcePermissionCeiling) { - this.enforcePermissionCeiling = enforcePermissionCeiling; - return this; - } - - /** - *

Whether to enforce self-assignment restrictions for organizations using this template.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("enforce_self_assignment_restriction") - public _FinalStage enforceSelfAssignmentRestriction(boolean enforceSelfAssignmentRestriction) { - this.enforceSelfAssignmentRestriction = enforceSelfAssignmentRestriction; - return this; - } - - @java.lang.Override - public _FinalStage roleVisibilityPolicy( - com.auth0.client.mgmt.core.Nullable roleVisibilityPolicy) { - if (roleVisibilityPolicy.isNull()) { - this.roleVisibilityPolicy = OptionalNullable.ofNull(); - } else if (roleVisibilityPolicy.isEmpty()) { - this.roleVisibilityPolicy = OptionalNullable.absent(); - } else { - this.roleVisibilityPolicy = OptionalNullable.of(roleVisibilityPolicy.get()); - } - return this; - } - - @java.lang.Override - public _FinalStage roleVisibilityPolicy( - Optional roleVisibilityPolicy) { - if (roleVisibilityPolicy.isPresent()) { - this.roleVisibilityPolicy = OptionalNullable.of(roleVisibilityPolicy.get()); - } else { - this.roleVisibilityPolicy = OptionalNullable.absent(); - } - return this; - } - - @java.lang.Override - public _FinalStage roleVisibilityPolicy(OrganizationTemplateRoleVisibilityPolicy roleVisibilityPolicy) { - this.roleVisibilityPolicy = OptionalNullable.of(roleVisibilityPolicy); - return this; - } - - @java.lang.Override - @JsonSetter(value = "role_visibility_policy", nulls = Nulls.SKIP) - public _FinalStage roleVisibilityPolicy( - @Nullable OptionalNullable roleVisibilityPolicy) { - this.roleVisibilityPolicy = roleVisibilityPolicy; - return this; - } - - @java.lang.Override - public _FinalStage useForOrganizationDiscovery( - com.auth0.client.mgmt.core.Nullable - useForOrganizationDiscovery) { - if (useForOrganizationDiscovery.isNull()) { - this.useForOrganizationDiscovery = OptionalNullable.ofNull(); - } else if (useForOrganizationDiscovery.isEmpty()) { - this.useForOrganizationDiscovery = OptionalNullable.absent(); - } else { - this.useForOrganizationDiscovery = OptionalNullable.of(useForOrganizationDiscovery.get()); - } - return this; - } - - @java.lang.Override - public _FinalStage useForOrganizationDiscovery( - Optional useForOrganizationDiscovery) { - if (useForOrganizationDiscovery.isPresent()) { - this.useForOrganizationDiscovery = OptionalNullable.of(useForOrganizationDiscovery.get()); - } else { - this.useForOrganizationDiscovery = OptionalNullable.absent(); - } - return this; - } - - @java.lang.Override - public _FinalStage useForOrganizationDiscovery( - OrganizationTemplateUseForOrganizationDiscovery useForOrganizationDiscovery) { - this.useForOrganizationDiscovery = OptionalNullable.of(useForOrganizationDiscovery); - return this; - } - - @java.lang.Override - @JsonSetter(value = "use_for_organization_discovery", nulls = Nulls.SKIP) - public _FinalStage useForOrganizationDiscovery( - @Nullable - OptionalNullable useForOrganizationDiscovery) { - this.useForOrganizationDiscovery = useForOrganizationDiscovery; - return this; - } - - /** - *

Default admin roles to assign to organization creators.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage adminRolesAssignment( - com.auth0.client.mgmt.core.Nullable> adminRolesAssignment) { - if (adminRolesAssignment.isNull()) { - this.adminRolesAssignment = OptionalNullable.ofNull(); - } else if (adminRolesAssignment.isEmpty()) { - this.adminRolesAssignment = OptionalNullable.absent(); - } else { - this.adminRolesAssignment = OptionalNullable.of(adminRolesAssignment.get()); - } - return this; - } - - /** - *

Default admin roles to assign to organization creators.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage adminRolesAssignment(Optional> adminRolesAssignment) { - if (adminRolesAssignment.isPresent()) { - this.adminRolesAssignment = OptionalNullable.of(adminRolesAssignment.get()); - } else { - this.adminRolesAssignment = OptionalNullable.absent(); - } - return this; - } - - /** - *

Default admin roles to assign to organization creators.

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

Default admin roles to assign to organization creators.

- */ - @java.lang.Override - @JsonSetter(value = "admin_roles_assignment", nulls = Nulls.SKIP) - public _FinalStage adminRolesAssignment(@Nullable OptionalNullable> adminRolesAssignment) { - this.adminRolesAssignment = adminRolesAssignment; - return this; - } - - /** - *

The client ID for the invitation landing page.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage invitationLandingClientId( - com.auth0.client.mgmt.core.Nullable invitationLandingClientId) { - if (invitationLandingClientId.isNull()) { - this.invitationLandingClientId = OptionalNullable.ofNull(); - } else if (invitationLandingClientId.isEmpty()) { - this.invitationLandingClientId = OptionalNullable.absent(); - } else { - this.invitationLandingClientId = OptionalNullable.of(invitationLandingClientId.get()); - } - return this; - } - - /** - *

The client ID for the invitation landing page.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage invitationLandingClientId(Optional invitationLandingClientId) { - if (invitationLandingClientId.isPresent()) { - this.invitationLandingClientId = OptionalNullable.of(invitationLandingClientId.get()); - } else { - this.invitationLandingClientId = OptionalNullable.absent(); - } - return this; - } - - /** - *

The client ID for the invitation landing page.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage invitationLandingClientId(String invitationLandingClientId) { - this.invitationLandingClientId = OptionalNullable.of(invitationLandingClientId); - return this; - } - - /** - *

The client ID for the invitation landing page.

- */ - @java.lang.Override - @JsonSetter(value = "invitation_landing_client_id", nulls = Nulls.SKIP) - public _FinalStage invitationLandingClientId(@Nullable OptionalNullable invitationLandingClientId) { - this.invitationLandingClientId = invitationLandingClientId; - return this; - } - - /** - *

List of allowed connection strategies for this template.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage allowedStrategies( - com.auth0.client.mgmt.core.Nullable> allowedStrategies) { - if (allowedStrategies.isNull()) { - this.allowedStrategies = OptionalNullable.ofNull(); - } else if (allowedStrategies.isEmpty()) { - this.allowedStrategies = OptionalNullable.absent(); - } else { - this.allowedStrategies = OptionalNullable.of(allowedStrategies.get()); - } - return this; - } - - /** - *

List of allowed connection strategies for this template.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage allowedStrategies( - Optional> allowedStrategies) { - if (allowedStrategies.isPresent()) { - this.allowedStrategies = OptionalNullable.of(allowedStrategies.get()); - } else { - this.allowedStrategies = OptionalNullable.absent(); - } - return this; - } - - /** - *

List of allowed connection strategies for this template.

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

List of allowed connection strategies for this template.

- */ - @java.lang.Override - @JsonSetter(value = "allowed_strategies", nulls = Nulls.SKIP) - public _FinalStage allowedStrategies( - @Nullable OptionalNullable> allowedStrategies) { - this.allowedStrategies = allowedStrategies; - return this; - } - - /** - *

The user attribute profile to apply to organizations.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage userAttributeProfileId(com.auth0.client.mgmt.core.Nullable userAttributeProfileId) { - if (userAttributeProfileId.isNull()) { - this.userAttributeProfileId = OptionalNullable.ofNull(); - } else if (userAttributeProfileId.isEmpty()) { - this.userAttributeProfileId = OptionalNullable.absent(); - } else { - this.userAttributeProfileId = OptionalNullable.of(userAttributeProfileId.get()); - } - return this; - } - - /** - *

The user attribute profile to apply to organizations.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage userAttributeProfileId(Optional userAttributeProfileId) { - if (userAttributeProfileId.isPresent()) { - this.userAttributeProfileId = OptionalNullable.of(userAttributeProfileId.get()); - } else { - this.userAttributeProfileId = OptionalNullable.absent(); - } - return this; - } - - /** - *

The user attribute profile to apply to organizations.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage userAttributeProfileId(String userAttributeProfileId) { - this.userAttributeProfileId = OptionalNullable.of(userAttributeProfileId); - return this; - } - - /** - *

The user attribute profile to apply to organizations.

- */ - @java.lang.Override - @JsonSetter(value = "user_attribute_profile_id", nulls = Nulls.SKIP) - public _FinalStage userAttributeProfileId(@Nullable OptionalNullable userAttributeProfileId) { - this.userAttributeProfileId = userAttributeProfileId; - return this; - } - - /** - *

The connection profile to apply to new connections.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage connectionProfileId(com.auth0.client.mgmt.core.Nullable connectionProfileId) { - if (connectionProfileId.isNull()) { - this.connectionProfileId = OptionalNullable.ofNull(); - } else if (connectionProfileId.isEmpty()) { - this.connectionProfileId = OptionalNullable.absent(); - } else { - this.connectionProfileId = OptionalNullable.of(connectionProfileId.get()); - } - return this; - } - - /** - *

The connection profile to apply to new connections.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage connectionProfileId(Optional connectionProfileId) { - if (connectionProfileId.isPresent()) { - this.connectionProfileId = OptionalNullable.of(connectionProfileId.get()); - } else { - this.connectionProfileId = OptionalNullable.absent(); - } - return this; - } - - /** - *

The connection profile to apply to new connections.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage connectionProfileId(String connectionProfileId) { - this.connectionProfileId = OptionalNullable.of(connectionProfileId); - return this; - } - - /** - *

The connection profile to apply to new connections.

- */ - @java.lang.Override - @JsonSetter(value = "connection_profile_id", nulls = Nulls.SKIP) - public _FinalStage connectionProfileId(@Nullable OptionalNullable connectionProfileId) { - this.connectionProfileId = connectionProfileId; - return this; - } - - @java.lang.Override - public _FinalStage connectionDeletionBehavior(ConnectionDeletionBehaviorEnum connectionDeletionBehavior) { - this.connectionDeletionBehavior = Optional.ofNullable(connectionDeletionBehavior); - return this; - } - - @java.lang.Override - @JsonSetter(value = "connection_deletion_behavior", nulls = Nulls.SKIP) - public _FinalStage connectionDeletionBehavior( - Optional connectionDeletionBehavior) { - this.connectionDeletionBehavior = connectionDeletionBehavior; - return this; - } - - /** - *

Whether this is the default template applied to new organizations.

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

Whether this is the default template applied to new organizations.

- */ - @java.lang.Override - @JsonSetter(value = "is_default", nulls = Nulls.SKIP) - public _FinalStage isDefault(Optional isDefault) { - this.isDefault = isDefault; - return this; - } - - @java.lang.Override - public CreateOrganizationTemplateRequestContent build() { - return new CreateOrganizationTemplateRequestContent( - name, - isDefault, - organizationDeletionBehavior, - connectionDeletionBehavior, - enforcePermissionCeiling, - enforceSelfAssignmentRestriction, - connectionProfileId, - userAttributeProfileId, - allowedStrategies, - invitationLandingClientId, - adminRolesAssignment, - useForOrganizationDiscovery, - roleVisibilityPolicy, - 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/CreateResourceServerRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerRequestContent.java index 15d3d7897..d158bb5cf 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerRequestContent.java @@ -43,6 +43,8 @@ public final class CreateResourceServerRequestContent { private final Optional tokenLifetime; + private final OptionalNullable tokenLifetimeForAnonymousAccessTokens; + private final Optional tokenDialect; private final Optional skipConsentForVerifiableFirstPartyClients; @@ -73,6 +75,7 @@ private CreateResourceServerRequestContent( Optional allowOnlineAccess, Optional allowOnlineAccessWithEphemeralSessions, Optional tokenLifetime, + OptionalNullable tokenLifetimeForAnonymousAccessTokens, Optional tokenDialect, Optional skipConsentForVerifiableFirstPartyClients, Optional enforcePolicies, @@ -92,6 +95,7 @@ private CreateResourceServerRequestContent( this.allowOnlineAccess = allowOnlineAccess; this.allowOnlineAccessWithEphemeralSessions = allowOnlineAccessWithEphemeralSessions; this.tokenLifetime = tokenLifetime; + this.tokenLifetimeForAnonymousAccessTokens = tokenLifetimeForAnonymousAccessTokens; this.tokenDialect = tokenDialect; this.skipConsentForVerifiableFirstPartyClients = skipConsentForVerifiableFirstPartyClients; this.enforcePolicies = enforcePolicies; @@ -173,6 +177,18 @@ public Optional getTokenLifetime() { return tokenLifetime; } + /** + * @return Expiration value (in seconds) for anonymous-session access tokens issued for this API. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_lifetime_for_anonymous_access_tokens") + public OptionalNullable getTokenLifetimeForAnonymousAccessTokens() { + if (tokenLifetimeForAnonymousAccessTokens == null) { + return OptionalNullable.absent(); + } + return tokenLifetimeForAnonymousAccessTokens; + } + @JsonProperty("token_dialect") public Optional getTokenDialect() { return tokenDialect; @@ -244,6 +260,12 @@ public OptionalNullable getAuthorizationPolic return authorizationPolicy; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_lifetime_for_anonymous_access_tokens") + private OptionalNullable _getTokenLifetimeForAnonymousAccessTokens() { + return tokenLifetimeForAnonymousAccessTokens; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("token_encryption") private OptionalNullable _getTokenEncryption() { @@ -296,6 +318,7 @@ private boolean equalTo(CreateResourceServerRequestContent other) { && allowOnlineAccess.equals(other.allowOnlineAccess) && allowOnlineAccessWithEphemeralSessions.equals(other.allowOnlineAccessWithEphemeralSessions) && tokenLifetime.equals(other.tokenLifetime) + && tokenLifetimeForAnonymousAccessTokens.equals(other.tokenLifetimeForAnonymousAccessTokens) && tokenDialect.equals(other.tokenDialect) && skipConsentForVerifiableFirstPartyClients.equals(other.skipConsentForVerifiableFirstPartyClients) && enforcePolicies.equals(other.enforcePolicies) @@ -319,6 +342,7 @@ public int hashCode() { this.allowOnlineAccess, this.allowOnlineAccessWithEphemeralSessions, this.tokenLifetime, + this.tokenLifetimeForAnonymousAccessTokens, this.tokenDialect, this.skipConsentForVerifiableFirstPartyClients, this.enforcePolicies, @@ -408,6 +432,19 @@ public interface _FinalStage { _FinalStage tokenLifetime(Integer tokenLifetime); + /** + *

Expiration value (in seconds) for anonymous-session access tokens issued for this API.

+ */ + _FinalStage tokenLifetimeForAnonymousAccessTokens( + @Nullable OptionalNullable tokenLifetimeForAnonymousAccessTokens); + + _FinalStage tokenLifetimeForAnonymousAccessTokens(Integer tokenLifetimeForAnonymousAccessTokens); + + _FinalStage tokenLifetimeForAnonymousAccessTokens(Optional tokenLifetimeForAnonymousAccessTokens); + + _FinalStage tokenLifetimeForAnonymousAccessTokens( + com.auth0.client.mgmt.core.Nullable tokenLifetimeForAnonymousAccessTokens); + _FinalStage tokenDialect(Optional tokenDialect); _FinalStage tokenDialect(ResourceServerTokenDialectSchemaEnum tokenDialect); @@ -497,6 +534,8 @@ public static final class Builder implements IdentifierStage, _FinalStage { private Optional tokenDialect = Optional.empty(); + private OptionalNullable tokenLifetimeForAnonymousAccessTokens = OptionalNullable.absent(); + private Optional tokenLifetime = Optional.empty(); private Optional allowOnlineAccessWithEphemeralSessions = Optional.empty(); @@ -529,6 +568,7 @@ public Builder from(CreateResourceServerRequestContent other) { allowOnlineAccess(other.getAllowOnlineAccess()); allowOnlineAccessWithEphemeralSessions(other.getAllowOnlineAccessWithEphemeralSessions()); tokenLifetime(other.getTokenLifetime()); + tokenLifetimeForAnonymousAccessTokens(other.getTokenLifetimeForAnonymousAccessTokens()); tokenDialect(other.getTokenDialect()); skipConsentForVerifiableFirstPartyClients(other.getSkipConsentForVerifiableFirstPartyClients()); enforcePolicies(other.getEnforcePolicies()); @@ -804,6 +844,61 @@ public _FinalStage tokenDialect(Optional t return this; } + /** + *

Expiration value (in seconds) for anonymous-session access tokens issued for this API.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage tokenLifetimeForAnonymousAccessTokens( + com.auth0.client.mgmt.core.Nullable tokenLifetimeForAnonymousAccessTokens) { + if (tokenLifetimeForAnonymousAccessTokens.isNull()) { + this.tokenLifetimeForAnonymousAccessTokens = OptionalNullable.ofNull(); + } else if (tokenLifetimeForAnonymousAccessTokens.isEmpty()) { + this.tokenLifetimeForAnonymousAccessTokens = OptionalNullable.absent(); + } else { + this.tokenLifetimeForAnonymousAccessTokens = + OptionalNullable.of(tokenLifetimeForAnonymousAccessTokens.get()); + } + return this; + } + + /** + *

Expiration value (in seconds) for anonymous-session access tokens issued for this API.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage tokenLifetimeForAnonymousAccessTokens( + Optional tokenLifetimeForAnonymousAccessTokens) { + if (tokenLifetimeForAnonymousAccessTokens.isPresent()) { + this.tokenLifetimeForAnonymousAccessTokens = + OptionalNullable.of(tokenLifetimeForAnonymousAccessTokens.get()); + } else { + this.tokenLifetimeForAnonymousAccessTokens = OptionalNullable.absent(); + } + return this; + } + + /** + *

Expiration value (in seconds) for anonymous-session access tokens issued for this API.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage tokenLifetimeForAnonymousAccessTokens(Integer tokenLifetimeForAnonymousAccessTokens) { + this.tokenLifetimeForAnonymousAccessTokens = OptionalNullable.of(tokenLifetimeForAnonymousAccessTokens); + return this; + } + + /** + *

Expiration value (in seconds) for anonymous-session access tokens issued for this API.

+ */ + @java.lang.Override + @JsonSetter(value = "token_lifetime_for_anonymous_access_tokens", nulls = Nulls.SKIP) + public _FinalStage tokenLifetimeForAnonymousAccessTokens( + @Nullable OptionalNullable tokenLifetimeForAnonymousAccessTokens) { + this.tokenLifetimeForAnonymousAccessTokens = tokenLifetimeForAnonymousAccessTokens; + return this; + } + /** *

Expiration value (in seconds) for access tokens issued for this API from the token endpoint.

* @return Reference to {@code this} so that method calls can be chained together. @@ -970,6 +1065,7 @@ public CreateResourceServerRequestContent build() { allowOnlineAccess, allowOnlineAccessWithEphemeralSessions, tokenLifetime, + tokenLifetimeForAnonymousAccessTokens, tokenDialect, skipConsentForVerifiableFirstPartyClients, enforcePolicies, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerResponseContent.java index b3c1f681e..0745b328b 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateResourceServerResponseContent.java @@ -52,6 +52,8 @@ public final class CreateResourceServerResponseContent { private final Optional enforcePolicies; + private final Optional tokenLifetimeForAnonymousAccessTokens; + private final Optional tokenDialect; private final OptionalNullable tokenEncryption; @@ -85,6 +87,7 @@ private CreateResourceServerResponseContent( Optional tokenLifetime, Optional tokenLifetimeForWeb, Optional enforcePolicies, + Optional tokenLifetimeForAnonymousAccessTokens, Optional tokenDialect, OptionalNullable tokenEncryption, OptionalNullable consentPolicy, @@ -108,6 +111,7 @@ private CreateResourceServerResponseContent( this.tokenLifetime = tokenLifetime; this.tokenLifetimeForWeb = tokenLifetimeForWeb; this.enforcePolicies = enforcePolicies; + this.tokenLifetimeForAnonymousAccessTokens = tokenLifetimeForAnonymousAccessTokens; this.tokenDialect = tokenDialect; this.tokenEncryption = tokenEncryption; this.consentPolicy = consentPolicy; @@ -228,6 +232,14 @@ public Optional getEnforcePolicies() { return enforcePolicies; } + /** + * @return Expiration value (in seconds) for anonymous-session access tokens issued for this API. + */ + @JsonProperty("token_lifetime_for_anonymous_access_tokens") + public Optional getTokenLifetimeForAnonymousAccessTokens() { + return tokenLifetimeForAnonymousAccessTokens; + } + @JsonProperty("token_dialect") public Optional getTokenDialect() { return tokenDialect; @@ -348,6 +360,7 @@ private boolean equalTo(CreateResourceServerResponseContent other) { && tokenLifetime.equals(other.tokenLifetime) && tokenLifetimeForWeb.equals(other.tokenLifetimeForWeb) && enforcePolicies.equals(other.enforcePolicies) + && tokenLifetimeForAnonymousAccessTokens.equals(other.tokenLifetimeForAnonymousAccessTokens) && tokenDialect.equals(other.tokenDialect) && tokenEncryption.equals(other.tokenEncryption) && consentPolicy.equals(other.consentPolicy) @@ -375,6 +388,7 @@ public int hashCode() { this.tokenLifetime, this.tokenLifetimeForWeb, this.enforcePolicies, + this.tokenLifetimeForAnonymousAccessTokens, this.tokenDialect, this.tokenEncryption, this.consentPolicy, @@ -424,6 +438,8 @@ public static final class Builder { private Optional enforcePolicies = Optional.empty(); + private Optional tokenLifetimeForAnonymousAccessTokens = Optional.empty(); + private Optional tokenDialect = Optional.empty(); private OptionalNullable tokenEncryption = OptionalNullable.absent(); @@ -460,6 +476,7 @@ public Builder from(CreateResourceServerResponseContent other) { tokenLifetime(other.getTokenLifetime()); tokenLifetimeForWeb(other.getTokenLifetimeForWeb()); enforcePolicies(other.getEnforcePolicies()); + tokenLifetimeForAnonymousAccessTokens(other.getTokenLifetimeForAnonymousAccessTokens()); tokenDialect(other.getTokenDialect()); tokenEncryption(other.getTokenEncryption()); consentPolicy(other.getConsentPolicy()); @@ -667,6 +684,20 @@ public Builder enforcePolicies(Boolean enforcePolicies) { return this; } + /** + *

Expiration value (in seconds) for anonymous-session access tokens issued for this API.

+ */ + @JsonSetter(value = "token_lifetime_for_anonymous_access_tokens", nulls = Nulls.SKIP) + public Builder tokenLifetimeForAnonymousAccessTokens(Optional tokenLifetimeForAnonymousAccessTokens) { + this.tokenLifetimeForAnonymousAccessTokens = tokenLifetimeForAnonymousAccessTokens; + return this; + } + + public Builder tokenLifetimeForAnonymousAccessTokens(Integer tokenLifetimeForAnonymousAccessTokens) { + this.tokenLifetimeForAnonymousAccessTokens = Optional.ofNullable(tokenLifetimeForAnonymousAccessTokens); + return this; + } + @JsonSetter(value = "token_dialect", nulls = Nulls.SKIP) public Builder tokenDialect(Optional tokenDialect) { this.tokenDialect = tokenDialect; @@ -881,6 +912,7 @@ public CreateResourceServerResponseContent build() { tokenLifetime, tokenLifetimeForWeb, enforcePolicies, + tokenLifetimeForAnonymousAccessTokens, tokenDialect, tokenEncryption, consentPolicy, diff --git a/src/main/java/com/auth0/client/mgmt/types/GetClientResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetClientResponseContent.java index 365db0681..5c18236d8 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetClientResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetClientResponseContent.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 GetClientResponseContent { 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 GetClientResponseContent { private final Optional identityAssertionAuthorizationGrant; + private final Optional anonymousSessions; + private final Optional thirdPartySecurityMode; private final Optional redirectionPolicy; @@ -158,6 +165,8 @@ public final class GetClientResponseContent { private GetClientResponseContent( Optional clientId, + Optional createdAt, + Optional updatedAt, Optional tenant, Optional name, Optional description, @@ -214,6 +223,7 @@ private GetClientResponseContent( Optional b2BIntegrationConfiguration, Optional myOrganizationConfiguration, Optional identityAssertionAuthorizationGrant, + Optional anonymousSessions, Optional thirdPartySecurityMode, Optional redirectionPolicy, Optional resourceServerIdentifier, @@ -224,6 +234,8 @@ private GetClientResponseContent( Optional jwksUri, Map additionalProperties) { this.clientId = clientId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; this.tenant = tenant; this.name = name; this.description = description; @@ -280,6 +292,7 @@ private GetClientResponseContent( this.b2BIntegrationConfiguration = b2BIntegrationConfiguration; this.myOrganizationConfiguration = myOrganizationConfiguration; this.identityAssertionAuthorizationGrant = identityAssertionAuthorizationGrant; + this.anonymousSessions = anonymousSessions; this.thirdPartySecurityMode = thirdPartySecurityMode; this.redirectionPolicy = redirectionPolicy; this.resourceServerIdentifier = resourceServerIdentifier; @@ -299,6 +312,22 @@ public Optional getClientId() { return clientId; } + /** + * @return The ISO 8601 timestamp of when this client was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The ISO 8601 timestamp of when this client was last updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + /** * @return Name of the tenant this client belongs to. */ @@ -703,6 +732,11 @@ public Optional getIdentityAssertionAuthori return identityAssertionAuthorizationGrant; } + @JsonProperty("anonymous_sessions") + public Optional getAnonymousSessions() { + return anonymousSessions; + } + @JsonProperty("third_party_security_mode") public Optional getThirdPartySecurityMode() { return thirdPartySecurityMode; @@ -813,6 +847,8 @@ public Map getAdditionalProperties() { private boolean equalTo(GetClientResponseContent other) { return clientId.equals(other.clientId) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) && tenant.equals(other.tenant) && name.equals(other.name) && description.equals(other.description) @@ -870,6 +906,7 @@ private boolean equalTo(GetClientResponseContent other) { && b2BIntegrationConfiguration.equals(other.b2BIntegrationConfiguration) && myOrganizationConfiguration.equals(other.myOrganizationConfiguration) && identityAssertionAuthorizationGrant.equals(other.identityAssertionAuthorizationGrant) + && anonymousSessions.equals(other.anonymousSessions) && thirdPartySecurityMode.equals(other.thirdPartySecurityMode) && redirectionPolicy.equals(other.redirectionPolicy) && resourceServerIdentifier.equals(other.resourceServerIdentifier) @@ -884,6 +921,8 @@ private boolean equalTo(GetClientResponseContent other) { public int hashCode() { return Objects.hash( this.clientId, + this.createdAt, + this.updatedAt, this.tenant, this.name, this.description, @@ -940,6 +979,7 @@ public int hashCode() { this.b2BIntegrationConfiguration, this.myOrganizationConfiguration, this.identityAssertionAuthorizationGrant, + this.anonymousSessions, this.thirdPartySecurityMode, this.redirectionPolicy, this.resourceServerIdentifier, @@ -963,6 +1003,10 @@ public static Builder builder() { public static final class Builder { private Optional clientId = Optional.empty(); + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + private Optional tenant = Optional.empty(); private Optional name = Optional.empty(); @@ -1076,6 +1120,8 @@ public static final class Builder { private Optional identityAssertionAuthorizationGrant = Optional.empty(); + private Optional anonymousSessions = Optional.empty(); + private Optional thirdPartySecurityMode = Optional.empty(); private Optional redirectionPolicy = Optional.empty(); @@ -1100,6 +1146,8 @@ private Builder() {} public Builder from(GetClientResponseContent other) { clientId(other.getClientId()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); tenant(other.getTenant()); name(other.getName()); description(other.getDescription()); @@ -1156,6 +1204,7 @@ public Builder from(GetClientResponseContent other) { b2BIntegrationConfiguration(other.getB2BIntegrationConfiguration()); myOrganizationConfiguration(other.getMyOrganizationConfiguration()); identityAssertionAuthorizationGrant(other.getIdentityAssertionAuthorizationGrant()); + anonymousSessions(other.getAnonymousSessions()); thirdPartySecurityMode(other.getThirdPartySecurityMode()); redirectionPolicy(other.getRedirectionPolicy()); resourceServerIdentifier(other.getResourceServerIdentifier()); @@ -1181,6 +1230,34 @@ public Builder clientId(String clientId) { return this; } + /** + *

The ISO 8601 timestamp of when this client was created.

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

The ISO 8601 timestamp of when this client was last updated.

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

Name of the tenant this client belongs to.

*/ @@ -2065,6 +2142,17 @@ public Builder identityAssertionAuthorizationGrant( return this; } + @JsonSetter(value = "anonymous_sessions", nulls = Nulls.SKIP) + public Builder anonymousSessions(Optional anonymousSessions) { + this.anonymousSessions = anonymousSessions; + return this; + } + + public Builder anonymousSessions(AnonymousSessions anonymousSessions) { + this.anonymousSessions = Optional.ofNullable(anonymousSessions); + return this; + } + @JsonSetter(value = "third_party_security_mode", nulls = Nulls.SKIP) public Builder thirdPartySecurityMode(Optional thirdPartySecurityMode) { this.thirdPartySecurityMode = thirdPartySecurityMode; @@ -2168,6 +2256,8 @@ public Builder jwksUri(String jwksUri) { public GetClientResponseContent build() { return new GetClientResponseContent( clientId, + createdAt, + updatedAt, tenant, name, description, @@ -2224,6 +2314,7 @@ public GetClientResponseContent build() { b2BIntegrationConfiguration, myOrganizationConfiguration, identityAssertionAuthorizationGrant, + anonymousSessions, thirdPartySecurityMode, redirectionPolicy, resourceServerIdentifier, diff --git a/src/main/java/com/auth0/client/mgmt/types/GetEmailFactorSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetEmailFactorSettingsResponseContent.java new file mode 100644 index 000000000..e304ae3a7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetEmailFactorSettingsResponseContent.java @@ -0,0 +1,161 @@ +/** + * 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; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetEmailFactorSettingsResponseContent.Builder.class) +public final class GetEmailFactorSettingsResponseContent { + private final int otpLength; + + private final int otpExpirationTime; + + private final Map additionalProperties; + + private GetEmailFactorSettingsResponseContent( + 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 GetEmailFactorSettingsResponseContent + && equalTo((GetEmailFactorSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetEmailFactorSettingsResponseContent 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(GetEmailFactorSettingsResponseContent other); + } + + public interface OtpExpirationTimeStage { + /** + *

The OTP expiration time in seconds.

+ */ + _FinalStage otpExpirationTime(int otpExpirationTime); + } + + public interface _FinalStage { + GetEmailFactorSettingsResponseContent 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(GetEmailFactorSettingsResponseContent 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 GetEmailFactorSettingsResponseContent build() { + return new GetEmailFactorSettingsResponseContent(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/GetGuardianSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetGuardianSettingsResponseContent.java new file mode 100644 index 000000000..a2caffe00 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetGuardianSettingsResponseContent.java @@ -0,0 +1,246 @@ +/** + * 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; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetGuardianSettingsResponseContent.Builder.class) +public final class GetGuardianSettingsResponseContent { + private final boolean displayRememberMeCheckbox; + + private final boolean rememberMeDefaultValue; + + private final int mfaSessionInactivityTimeout; + + private final int mfaSessionOverallTimeout; + + private final Map additionalProperties; + + private GetGuardianSettingsResponseContent( + boolean displayRememberMeCheckbox, + boolean rememberMeDefaultValue, + int mfaSessionInactivityTimeout, + int mfaSessionOverallTimeout, + Map additionalProperties) { + this.displayRememberMeCheckbox = displayRememberMeCheckbox; + this.rememberMeDefaultValue = rememberMeDefaultValue; + this.mfaSessionInactivityTimeout = mfaSessionInactivityTimeout; + this.mfaSessionOverallTimeout = mfaSessionOverallTimeout; + this.additionalProperties = additionalProperties; + } + + /** + * @return Determines whether to display the "Remember Me" checkbox on the MFA prompt in Universal Login. + */ + @JsonProperty("display_remember_me_checkbox") + public boolean getDisplayRememberMeCheckbox() { + return displayRememberMeCheckbox; + } + + /** + * @return Determines the default state of the "Remember Me" checkbox on the MFA prompt in Universal Login. + */ + @JsonProperty("remember_me_default_value") + public boolean getRememberMeDefaultValue() { + return rememberMeDefaultValue; + } + + /** + * @return Duration of inactivity after which the user will be prompted for MFA. Represented as seconds. Minimum duration is 1 hour, maximum is 30 days, and cannot exceed the overall timeout. + */ + @JsonProperty("mfa_session_inactivity_timeout") + public int getMfaSessionInactivityTimeout() { + return mfaSessionInactivityTimeout; + } + + /** + * @return Maximum duration after which the user will be prompted for MFA regardless of activity. Represented as seconds. Minimum duration is 1 hour, maximum is 90 days. + */ + @JsonProperty("mfa_session_overall_timeout") + public int getMfaSessionOverallTimeout() { + return mfaSessionOverallTimeout; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetGuardianSettingsResponseContent + && equalTo((GetGuardianSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetGuardianSettingsResponseContent other) { + return displayRememberMeCheckbox == other.displayRememberMeCheckbox + && rememberMeDefaultValue == other.rememberMeDefaultValue + && mfaSessionInactivityTimeout == other.mfaSessionInactivityTimeout + && mfaSessionOverallTimeout == other.mfaSessionOverallTimeout; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.displayRememberMeCheckbox, + this.rememberMeDefaultValue, + this.mfaSessionInactivityTimeout, + this.mfaSessionOverallTimeout); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DisplayRememberMeCheckboxStage builder() { + return new Builder(); + } + + public interface DisplayRememberMeCheckboxStage { + /** + *

Determines whether to display the "Remember Me" checkbox on the MFA prompt in Universal Login.

+ */ + RememberMeDefaultValueStage displayRememberMeCheckbox(boolean displayRememberMeCheckbox); + + Builder from(GetGuardianSettingsResponseContent other); + } + + public interface RememberMeDefaultValueStage { + /** + *

Determines the default state of the "Remember Me" checkbox on the MFA prompt in Universal Login.

+ */ + MfaSessionInactivityTimeoutStage rememberMeDefaultValue(boolean rememberMeDefaultValue); + } + + public interface MfaSessionInactivityTimeoutStage { + /** + *

Duration of inactivity after which the user will be prompted for MFA. Represented as seconds. Minimum duration is 1 hour, maximum is 30 days, and cannot exceed the overall timeout.

+ */ + MfaSessionOverallTimeoutStage mfaSessionInactivityTimeout(int mfaSessionInactivityTimeout); + } + + public interface MfaSessionOverallTimeoutStage { + /** + *

Maximum duration after which the user will be prompted for MFA regardless of activity. Represented as seconds. Minimum duration is 1 hour, maximum is 90 days.

+ */ + _FinalStage mfaSessionOverallTimeout(int mfaSessionOverallTimeout); + } + + public interface _FinalStage { + GetGuardianSettingsResponseContent build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements DisplayRememberMeCheckboxStage, + RememberMeDefaultValueStage, + MfaSessionInactivityTimeoutStage, + MfaSessionOverallTimeoutStage, + _FinalStage { + private boolean displayRememberMeCheckbox; + + private boolean rememberMeDefaultValue; + + private int mfaSessionInactivityTimeout; + + private int mfaSessionOverallTimeout; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetGuardianSettingsResponseContent other) { + displayRememberMeCheckbox(other.getDisplayRememberMeCheckbox()); + rememberMeDefaultValue(other.getRememberMeDefaultValue()); + mfaSessionInactivityTimeout(other.getMfaSessionInactivityTimeout()); + mfaSessionOverallTimeout(other.getMfaSessionOverallTimeout()); + return this; + } + + /** + *

Determines whether to display the "Remember Me" checkbox on the MFA prompt in Universal Login.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("display_remember_me_checkbox") + public RememberMeDefaultValueStage displayRememberMeCheckbox(boolean displayRememberMeCheckbox) { + this.displayRememberMeCheckbox = displayRememberMeCheckbox; + return this; + } + + /** + *

Determines the default state of the "Remember Me" checkbox on the MFA prompt in Universal Login.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("remember_me_default_value") + public MfaSessionInactivityTimeoutStage rememberMeDefaultValue(boolean rememberMeDefaultValue) { + this.rememberMeDefaultValue = rememberMeDefaultValue; + return this; + } + + /** + *

Duration of inactivity after which the user will be prompted for MFA. Represented as seconds. Minimum duration is 1 hour, maximum is 30 days, and cannot exceed the overall timeout.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("mfa_session_inactivity_timeout") + public MfaSessionOverallTimeoutStage mfaSessionInactivityTimeout(int mfaSessionInactivityTimeout) { + this.mfaSessionInactivityTimeout = mfaSessionInactivityTimeout; + return this; + } + + /** + *

Maximum duration after which the user will be prompted for MFA regardless of activity. Represented as seconds. Minimum duration is 1 hour, maximum is 90 days.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("mfa_session_overall_timeout") + public _FinalStage mfaSessionOverallTimeout(int mfaSessionOverallTimeout) { + this.mfaSessionOverallTimeout = mfaSessionOverallTimeout; + return this; + } + + @java.lang.Override + public GetGuardianSettingsResponseContent build() { + return new GetGuardianSettingsResponseContent( + displayRememberMeCheckbox, + rememberMeDefaultValue, + mfaSessionInactivityTimeout, + mfaSessionOverallTimeout, + 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/GetPhoneFactorSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetPhoneFactorSettingsResponseContent.java new file mode 100644 index 000000000..6f365389e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetPhoneFactorSettingsResponseContent.java @@ -0,0 +1,161 @@ +/** + * 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; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetPhoneFactorSettingsResponseContent.Builder.class) +public final class GetPhoneFactorSettingsResponseContent { + private final int otpLength; + + private final int otpExpirationTime; + + private final Map additionalProperties; + + private GetPhoneFactorSettingsResponseContent( + 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 GetPhoneFactorSettingsResponseContent + && equalTo((GetPhoneFactorSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetPhoneFactorSettingsResponseContent 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(GetPhoneFactorSettingsResponseContent other); + } + + public interface OtpExpirationTimeStage { + /** + *

The OTP expiration time in seconds.

+ */ + _FinalStage otpExpirationTime(int otpExpirationTime); + } + + public interface _FinalStage { + GetPhoneFactorSettingsResponseContent 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(GetPhoneFactorSettingsResponseContent 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 GetPhoneFactorSettingsResponseContent build() { + return new GetPhoneFactorSettingsResponseContent(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/GetResourceServerResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetResourceServerResponseContent.java index 0d1e7a15d..6b0ce1bd1 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetResourceServerResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetResourceServerResponseContent.java @@ -52,6 +52,8 @@ public final class GetResourceServerResponseContent { private final Optional enforcePolicies; + private final Optional tokenLifetimeForAnonymousAccessTokens; + private final Optional tokenDialect; private final OptionalNullable tokenEncryption; @@ -85,6 +87,7 @@ private GetResourceServerResponseContent( Optional tokenLifetime, Optional tokenLifetimeForWeb, Optional enforcePolicies, + Optional tokenLifetimeForAnonymousAccessTokens, Optional tokenDialect, OptionalNullable tokenEncryption, OptionalNullable consentPolicy, @@ -108,6 +111,7 @@ private GetResourceServerResponseContent( this.tokenLifetime = tokenLifetime; this.tokenLifetimeForWeb = tokenLifetimeForWeb; this.enforcePolicies = enforcePolicies; + this.tokenLifetimeForAnonymousAccessTokens = tokenLifetimeForAnonymousAccessTokens; this.tokenDialect = tokenDialect; this.tokenEncryption = tokenEncryption; this.consentPolicy = consentPolicy; @@ -228,6 +232,14 @@ public Optional getEnforcePolicies() { return enforcePolicies; } + /** + * @return Expiration value (in seconds) for anonymous-session access tokens issued for this API. + */ + @JsonProperty("token_lifetime_for_anonymous_access_tokens") + public Optional getTokenLifetimeForAnonymousAccessTokens() { + return tokenLifetimeForAnonymousAccessTokens; + } + @JsonProperty("token_dialect") public Optional getTokenDialect() { return tokenDialect; @@ -347,6 +359,7 @@ private boolean equalTo(GetResourceServerResponseContent other) { && tokenLifetime.equals(other.tokenLifetime) && tokenLifetimeForWeb.equals(other.tokenLifetimeForWeb) && enforcePolicies.equals(other.enforcePolicies) + && tokenLifetimeForAnonymousAccessTokens.equals(other.tokenLifetimeForAnonymousAccessTokens) && tokenDialect.equals(other.tokenDialect) && tokenEncryption.equals(other.tokenEncryption) && consentPolicy.equals(other.consentPolicy) @@ -374,6 +387,7 @@ public int hashCode() { this.tokenLifetime, this.tokenLifetimeForWeb, this.enforcePolicies, + this.tokenLifetimeForAnonymousAccessTokens, this.tokenDialect, this.tokenEncryption, this.consentPolicy, @@ -423,6 +437,8 @@ public static final class Builder { private Optional enforcePolicies = Optional.empty(); + private Optional tokenLifetimeForAnonymousAccessTokens = Optional.empty(); + private Optional tokenDialect = Optional.empty(); private OptionalNullable tokenEncryption = OptionalNullable.absent(); @@ -459,6 +475,7 @@ public Builder from(GetResourceServerResponseContent other) { tokenLifetime(other.getTokenLifetime()); tokenLifetimeForWeb(other.getTokenLifetimeForWeb()); enforcePolicies(other.getEnforcePolicies()); + tokenLifetimeForAnonymousAccessTokens(other.getTokenLifetimeForAnonymousAccessTokens()); tokenDialect(other.getTokenDialect()); tokenEncryption(other.getTokenEncryption()); consentPolicy(other.getConsentPolicy()); @@ -666,6 +683,20 @@ public Builder enforcePolicies(Boolean enforcePolicies) { return this; } + /** + *

Expiration value (in seconds) for anonymous-session access tokens issued for this API.

+ */ + @JsonSetter(value = "token_lifetime_for_anonymous_access_tokens", nulls = Nulls.SKIP) + public Builder tokenLifetimeForAnonymousAccessTokens(Optional tokenLifetimeForAnonymousAccessTokens) { + this.tokenLifetimeForAnonymousAccessTokens = tokenLifetimeForAnonymousAccessTokens; + return this; + } + + public Builder tokenLifetimeForAnonymousAccessTokens(Integer tokenLifetimeForAnonymousAccessTokens) { + this.tokenLifetimeForAnonymousAccessTokens = Optional.ofNullable(tokenLifetimeForAnonymousAccessTokens); + return this; + } + @JsonSetter(value = "token_dialect", nulls = Nulls.SKIP) public Builder tokenDialect(Optional tokenDialect) { this.tokenDialect = tokenDialect; @@ -880,6 +911,7 @@ public GetResourceServerResponseContent build() { tokenLifetime, tokenLifetimeForWeb, enforcePolicies, + tokenLifetimeForAnonymousAccessTokens, tokenDialect, tokenEncryption, consentPolicy, diff --git a/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsRequestParameters.java index adc4985ed..be3edfa20 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsRequestParameters.java +++ b/src/main/java/com/auth0/client/mgmt/types/ListDeviceCredentialsRequestParameters.java @@ -147,7 +147,7 @@ public OptionalNullable getClientId() { } /** - * @return Type of credentials to retrieve. Must be public_key, refresh_token or rotating_refresh_token. The property will default to refresh_token when paging is requested + * @return Type of credentials to retrieve. Must be public_key, refresh_token or rotating_refresh_token. If none is provided a combined list of refresh_tokens and public_keys will be returned (and no rotating_refresh_token), in this case page, per_page and include_totals will be ignored. */ @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("type") @@ -525,7 +525,7 @@ public Builder clientId(com.auth0.client.mgmt.core.Nullable clientId) { } /** - *

Type of credentials to retrieve. Must be public_key, refresh_token or rotating_refresh_token. The property will default to refresh_token when paging is requested

+ *

Type of credentials to retrieve. Must be public_key, refresh_token or rotating_refresh_token. If none is provided a combined list of refresh_tokens and public_keys will be returned (and no rotating_refresh_token), in this case page, per_page and include_totals will be ignored.

*/ @JsonSetter(value = "type", nulls = Nulls.SKIP) public Builder type(@Nullable OptionalNullable type) { diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationTemplatesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListOrganizationTemplatesRequestParameters.java deleted file mode 100644 index 44c3bf070..000000000 --- a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationTemplatesRequestParameters.java +++ /dev/null @@ -1,204 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.auth0.client.mgmt.types; - -import com.auth0.client.mgmt.core.NullableNonemptyFilter; -import com.auth0.client.mgmt.core.ObjectMappers; -import com.auth0.client.mgmt.core.OptionalNullable; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.Nullable; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ListOrganizationTemplatesRequestParameters.Builder.class) -public final class ListOrganizationTemplatesRequestParameters { - private final OptionalNullable from; - - private final OptionalNullable take; - - private final Map additionalProperties; - - private ListOrganizationTemplatesRequestParameters( - OptionalNullable from, OptionalNullable take, Map additionalProperties) { - this.from = from; - this.take = take; - this.additionalProperties = additionalProperties; - } - - /** - * @return Optional Id from which to start selection. - */ - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("from") - public OptionalNullable getFrom() { - if (from == null) { - return OptionalNullable.absent(); - } - return from; - } - - /** - * @return Number of results per page. Defaults to 5. Values greater than 10 are capped at 10. - */ - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("take") - public OptionalNullable getTake() { - if (take == null) { - return OptionalNullable.absent(); - } - return take; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("from") - private OptionalNullable _getFrom() { - return from; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("take") - private OptionalNullable _getTake() { - return take; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ListOrganizationTemplatesRequestParameters - && equalTo((ListOrganizationTemplatesRequestParameters) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ListOrganizationTemplatesRequestParameters other) { - return from.equals(other.from) && take.equals(other.take); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.from, this.take); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private OptionalNullable from = OptionalNullable.absent(); - - private OptionalNullable take = OptionalNullable.absent(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ListOrganizationTemplatesRequestParameters other) { - from(other.getFrom()); - take(other.getTake()); - return this; - } - - /** - *

Optional Id from which to start selection.

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

Number of results per page. Defaults to 5. Values greater than 10 are capped at 10.

- */ - @JsonSetter(value = "take", nulls = Nulls.SKIP) - public Builder take(@Nullable OptionalNullable take) { - this.take = take; - return this; - } - - public Builder take(Integer take) { - this.take = OptionalNullable.of(take); - return this; - } - - public Builder take(Optional take) { - if (take.isPresent()) { - this.take = OptionalNullable.of(take.get()); - } else { - this.take = OptionalNullable.absent(); - } - return this; - } - - public Builder take(com.auth0.client.mgmt.core.Nullable take) { - if (take.isNull()) { - this.take = OptionalNullable.ofNull(); - } else if (take.isEmpty()) { - this.take = OptionalNullable.absent(); - } else { - this.take = OptionalNullable.of(take.get()); - } - return this; - } - - public ListOrganizationTemplatesRequestParameters build() { - return new ListOrganizationTemplatesRequestParameters(from, take, additionalProperties); - } - - public Builder additionalProperty(String key, Object value) { - this.additionalProperties.put(key, value); - return this; - } - - public Builder additionalProperties(Map additionalProperties) { - this.additionalProperties.putAll(additionalProperties); - return this; - } - } -} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListTemplateOrganizationsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListTemplateOrganizationsRequestParameters.java deleted file mode 100644 index 348ed51d5..000000000 --- a/src/main/java/com/auth0/client/mgmt/types/ListTemplateOrganizationsRequestParameters.java +++ /dev/null @@ -1,204 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.auth0.client.mgmt.types; - -import com.auth0.client.mgmt.core.NullableNonemptyFilter; -import com.auth0.client.mgmt.core.ObjectMappers; -import com.auth0.client.mgmt.core.OptionalNullable; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.Nullable; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ListTemplateOrganizationsRequestParameters.Builder.class) -public final class ListTemplateOrganizationsRequestParameters { - private final OptionalNullable from; - - private final OptionalNullable take; - - private final Map additionalProperties; - - private ListTemplateOrganizationsRequestParameters( - OptionalNullable from, OptionalNullable take, Map additionalProperties) { - this.from = from; - this.take = take; - this.additionalProperties = additionalProperties; - } - - /** - * @return Optional Id from which to start selection. - */ - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("from") - public OptionalNullable getFrom() { - if (from == null) { - return OptionalNullable.absent(); - } - return from; - } - - /** - * @return Number of results per page. Defaults to 5. Values greater than 10 are capped at 10. - */ - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("take") - public OptionalNullable getTake() { - if (take == null) { - return OptionalNullable.absent(); - } - return take; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("from") - private OptionalNullable _getFrom() { - return from; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("take") - private OptionalNullable _getTake() { - return take; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ListTemplateOrganizationsRequestParameters - && equalTo((ListTemplateOrganizationsRequestParameters) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ListTemplateOrganizationsRequestParameters other) { - return from.equals(other.from) && take.equals(other.take); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.from, this.take); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private OptionalNullable from = OptionalNullable.absent(); - - private OptionalNullable take = OptionalNullable.absent(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ListTemplateOrganizationsRequestParameters other) { - from(other.getFrom()); - take(other.getTake()); - return this; - } - - /** - *

Optional Id from which to start selection.

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

Number of results per page. Defaults to 5. Values greater than 10 are capped at 10.

- */ - @JsonSetter(value = "take", nulls = Nulls.SKIP) - public Builder take(@Nullable OptionalNullable take) { - this.take = take; - return this; - } - - public Builder take(Integer take) { - this.take = OptionalNullable.of(take); - return this; - } - - public Builder take(Optional take) { - if (take.isPresent()) { - this.take = OptionalNullable.of(take.get()); - } else { - this.take = OptionalNullable.absent(); - } - return this; - } - - public Builder take(com.auth0.client.mgmt.core.Nullable take) { - if (take.isNull()) { - this.take = OptionalNullable.ofNull(); - } else if (take.isEmpty()) { - this.take = OptionalNullable.absent(); - } else { - this.take = OptionalNullable.of(take.get()); - } - return this; - } - - public ListTemplateOrganizationsRequestParameters build() { - return new ListTemplateOrganizationsRequestParameters(from, take, additionalProperties); - } - - public Builder additionalProperty(String key, Object value) { - this.additionalProperties.put(key, value); - return this; - } - - public Builder additionalProperties(Map additionalProperties) { - this.additionalProperties.putAll(additionalProperties); - return this; - } - } -} diff --git a/src/main/java/com/auth0/client/mgmt/types/OauthScope.java b/src/main/java/com/auth0/client/mgmt/types/OauthScope.java index d38271b67..83fe96f95 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OauthScope.java +++ b/src/main/java/com/auth0/client/mgmt/types/OauthScope.java @@ -7,6 +7,9 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class OauthScope { + public static final OauthScope UPDATE_EXPERIMENTATION = + new OauthScope(Value.UPDATE_EXPERIMENTATION, "update:experimentation"); + public static final OauthScope DELETE_ACTIONS = new OauthScope(Value.DELETE_ACTIONS, "delete:actions"); public static final OauthScope READ_CONNECTIONS_KEYS = @@ -366,9 +369,6 @@ public final class OauthScope { public static final OauthScope DELETE_EMAIL_PROVIDER = new OauthScope(Value.DELETE_EMAIL_PROVIDER, "delete:email_provider"); - public static final OauthScope UPDATE_ORGANIZATION_TEMPLATES = - new OauthScope(Value.UPDATE_ORGANIZATION_TEMPLATES, "update:organization_templates"); - public static final OauthScope DELETE_CUSTOM_DOMAINS = new OauthScope(Value.DELETE_CUSTOM_DOMAINS, "delete:custom_domains"); @@ -586,9 +586,6 @@ public final class OauthScope { public static final OauthScope READ_PROMPTS = new OauthScope(Value.READ_PROMPTS, "read:prompts"); - public static final OauthScope CREATE_ORGANIZATION_TEMPLATES = - new OauthScope(Value.CREATE_ORGANIZATION_TEMPLATES, "create:organization_templates"); - public static final OauthScope UPDATE_USERS_APP_METADATA = new OauthScope(Value.UPDATE_USERS_APP_METADATA, "update:users_app_metadata"); @@ -706,6 +703,8 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { + case UPDATE_EXPERIMENTATION: + return visitor.visitUpdateExperimentation(); case DELETE_ACTIONS: return visitor.visitDeleteActions(); case READ_CONNECTIONS_KEYS: @@ -976,8 +975,6 @@ public T visit(Visitor visitor) { return visitor.visitCreateGuardianEnrollmentTickets(); case DELETE_EMAIL_PROVIDER: return visitor.visitDeleteEmailProvider(); - case UPDATE_ORGANIZATION_TEMPLATES: - return visitor.visitUpdateOrganizationTemplates(); case DELETE_CUSTOM_DOMAINS: return visitor.visitDeleteCustomDomains(); case CREATE_NETWORK_ACLS: @@ -1142,8 +1139,6 @@ public T visit(Visitor visitor) { return visitor.visitUpdateConnectionProfiles(); case READ_PROMPTS: return visitor.visitReadPrompts(); - case CREATE_ORGANIZATION_TEMPLATES: - return visitor.visitCreateOrganizationTemplates(); case UPDATE_USERS_APP_METADATA: return visitor.visitUpdateUsersAppMetadata(); case DELETE_NETWORK_ACLS: @@ -1215,6 +1210,8 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static OauthScope valueOf(String value) { switch (value) { + case "update:experimentation": + return UPDATE_EXPERIMENTATION; case "delete:actions": return DELETE_ACTIONS; case "read:connections_keys": @@ -1485,8 +1482,6 @@ public static OauthScope valueOf(String value) { return CREATE_GUARDIAN_ENROLLMENT_TICKETS; case "delete:email_provider": return DELETE_EMAIL_PROVIDER; - case "update:organization_templates": - return UPDATE_ORGANIZATION_TEMPLATES; case "delete:custom_domains": return DELETE_CUSTOM_DOMAINS; case "create:network_acls": @@ -1651,8 +1646,6 @@ public static OauthScope valueOf(String value) { return UPDATE_CONNECTION_PROFILES; case "read:prompts": return READ_PROMPTS; - case "create:organization_templates": - return CREATE_ORGANIZATION_TEMPLATES; case "update:users_app_metadata": return UPDATE_USERS_APP_METADATA; case "delete:network_acls": @@ -1889,6 +1882,8 @@ public enum Value { READ_EVENTS, + UPDATE_EXPERIMENTATION, + CREATE_FLOWS, READ_FLOWS, @@ -2209,12 +2204,8 @@ public enum Value { DELETE_ORGANIZATION_CLIENTS, - CREATE_ORGANIZATION_TEMPLATES, - READ_ORGANIZATION_TEMPLATES, - UPDATE_ORGANIZATION_TEMPLATES, - CREATE_NETWORK_ACL_KEYS, READ_NETWORK_ACL_KEYS, @@ -2393,6 +2384,8 @@ public interface Visitor { T visitReadEvents(); + T visitUpdateExperimentation(); + T visitCreateFlows(); T visitReadFlows(); @@ -2713,12 +2706,8 @@ public interface Visitor { T visitDeleteOrganizationClients(); - T visitCreateOrganizationTemplates(); - T visitReadOrganizationTemplates(); - T visitUpdateOrganizationTemplates(); - T visitCreateNetworkAclKeys(); T visitReadNetworkAclKeys(); diff --git a/src/main/java/com/auth0/client/mgmt/types/OrganizationSortFieldEnum.java b/src/main/java/com/auth0/client/mgmt/types/OrganizationSortFieldEnum.java new file mode 100644 index 000000000..a66c0762a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/OrganizationSortFieldEnum.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class OrganizationSortFieldEnum { + public static final OrganizationSortFieldEnum DISPLAY_NAME = + new OrganizationSortFieldEnum(Value.DISPLAY_NAME, "display_name"); + + public static final OrganizationSortFieldEnum CREATED_AT = + new OrganizationSortFieldEnum(Value.CREATED_AT, "created_at"); + + public static final OrganizationSortFieldEnum NAME = new OrganizationSortFieldEnum(Value.NAME, "name"); + + private final Value value; + + private final String string; + + OrganizationSortFieldEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof OrganizationSortFieldEnum + && this.string.equals(((OrganizationSortFieldEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DISPLAY_NAME: + return visitor.visitDisplayName(); + case CREATED_AT: + return visitor.visitCreatedAt(); + case NAME: + return visitor.visitName(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static OrganizationSortFieldEnum valueOf(String value) { + switch (value) { + case "display_name": + return DISPLAY_NAME; + case "created_at": + return CREATED_AT; + case "name": + return NAME; + default: + return new OrganizationSortFieldEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + NAME, + + DISPLAY_NAME, + + CREATED_AT, + + UNKNOWN + } + + public interface Visitor { + T visitName(); + + T visitDisplayName(); + + T visitCreatedAt(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServer.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServer.java index eb3e4ec51..d4444dd24 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServer.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServer.java @@ -52,6 +52,8 @@ public final class ResourceServer { private final Optional enforcePolicies; + private final Optional tokenLifetimeForAnonymousAccessTokens; + private final Optional tokenDialect; private final OptionalNullable tokenEncryption; @@ -85,6 +87,7 @@ private ResourceServer( Optional tokenLifetime, Optional tokenLifetimeForWeb, Optional enforcePolicies, + Optional tokenLifetimeForAnonymousAccessTokens, Optional tokenDialect, OptionalNullable tokenEncryption, OptionalNullable consentPolicy, @@ -108,6 +111,7 @@ private ResourceServer( this.tokenLifetime = tokenLifetime; this.tokenLifetimeForWeb = tokenLifetimeForWeb; this.enforcePolicies = enforcePolicies; + this.tokenLifetimeForAnonymousAccessTokens = tokenLifetimeForAnonymousAccessTokens; this.tokenDialect = tokenDialect; this.tokenEncryption = tokenEncryption; this.consentPolicy = consentPolicy; @@ -228,6 +232,14 @@ public Optional getEnforcePolicies() { return enforcePolicies; } + /** + * @return Expiration value (in seconds) for anonymous-session access tokens issued for this API. + */ + @JsonProperty("token_lifetime_for_anonymous_access_tokens") + public Optional getTokenLifetimeForAnonymousAccessTokens() { + return tokenLifetimeForAnonymousAccessTokens; + } + @JsonProperty("token_dialect") public Optional getTokenDialect() { return tokenDialect; @@ -347,6 +359,7 @@ private boolean equalTo(ResourceServer other) { && tokenLifetime.equals(other.tokenLifetime) && tokenLifetimeForWeb.equals(other.tokenLifetimeForWeb) && enforcePolicies.equals(other.enforcePolicies) + && tokenLifetimeForAnonymousAccessTokens.equals(other.tokenLifetimeForAnonymousAccessTokens) && tokenDialect.equals(other.tokenDialect) && tokenEncryption.equals(other.tokenEncryption) && consentPolicy.equals(other.consentPolicy) @@ -374,6 +387,7 @@ public int hashCode() { this.tokenLifetime, this.tokenLifetimeForWeb, this.enforcePolicies, + this.tokenLifetimeForAnonymousAccessTokens, this.tokenDialect, this.tokenEncryption, this.consentPolicy, @@ -423,6 +437,8 @@ public static final class Builder { private Optional enforcePolicies = Optional.empty(); + private Optional tokenLifetimeForAnonymousAccessTokens = Optional.empty(); + private Optional tokenDialect = Optional.empty(); private OptionalNullable tokenEncryption = OptionalNullable.absent(); @@ -459,6 +475,7 @@ public Builder from(ResourceServer other) { tokenLifetime(other.getTokenLifetime()); tokenLifetimeForWeb(other.getTokenLifetimeForWeb()); enforcePolicies(other.getEnforcePolicies()); + tokenLifetimeForAnonymousAccessTokens(other.getTokenLifetimeForAnonymousAccessTokens()); tokenDialect(other.getTokenDialect()); tokenEncryption(other.getTokenEncryption()); consentPolicy(other.getConsentPolicy()); @@ -666,6 +683,20 @@ public Builder enforcePolicies(Boolean enforcePolicies) { return this; } + /** + *

Expiration value (in seconds) for anonymous-session access tokens issued for this API.

+ */ + @JsonSetter(value = "token_lifetime_for_anonymous_access_tokens", nulls = Nulls.SKIP) + public Builder tokenLifetimeForAnonymousAccessTokens(Optional tokenLifetimeForAnonymousAccessTokens) { + this.tokenLifetimeForAnonymousAccessTokens = tokenLifetimeForAnonymousAccessTokens; + return this; + } + + public Builder tokenLifetimeForAnonymousAccessTokens(Integer tokenLifetimeForAnonymousAccessTokens) { + this.tokenLifetimeForAnonymousAccessTokens = Optional.ofNullable(tokenLifetimeForAnonymousAccessTokens); + return this; + } + @JsonSetter(value = "token_dialect", nulls = Nulls.SKIP) public Builder tokenDialect(Optional tokenDialect) { this.tokenDialect = tokenDialect; @@ -880,6 +911,7 @@ public ResourceServer build() { tokenLifetime, tokenLifetimeForWeb, enforcePolicies, + tokenLifetimeForAnonymousAccessTokens, tokenDialect, tokenEncryption, consentPolicy, diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerSearchResponse.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSearchResponse.java new file mode 100644 index 000000000..ce246b597 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSearchResponse.java @@ -0,0 +1,904 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ResourceServerSearchResponse.Builder.class) +public final class ResourceServerSearchResponse { + private final Optional id; + + private final Optional name; + + private final Optional isSystem; + + private final Optional identifier; + + private final Optional> scopes; + + private final Optional signingAlg; + + private final Optional allowOfflineAccess; + + private final Optional allowOnlineAccess; + + private final Optional allowOnlineAccessWithEphemeralSessions; + + private final Optional skipConsentForVerifiableFirstPartyClients; + + private final Optional tokenLifetime; + + private final Optional tokenLifetimeForWeb; + + private final Optional enforcePolicies; + + private final Optional tokenLifetimeForAnonymousAccessTokens; + + private final Optional tokenDialect; + + private final OptionalNullable tokenEncryption; + + private final OptionalNullable consentPolicy; + + private final OptionalNullable> authorizationDetails; + + private final OptionalNullable proofOfPossession; + + private final Optional subjectTypeAuthorization; + + private final OptionalNullable authorizationPolicy; + + private final Optional clientId; + + private final Map additionalProperties; + + private ResourceServerSearchResponse( + Optional id, + Optional name, + Optional isSystem, + Optional identifier, + Optional> scopes, + Optional signingAlg, + Optional allowOfflineAccess, + Optional allowOnlineAccess, + Optional allowOnlineAccessWithEphemeralSessions, + Optional skipConsentForVerifiableFirstPartyClients, + Optional tokenLifetime, + Optional tokenLifetimeForWeb, + Optional enforcePolicies, + Optional tokenLifetimeForAnonymousAccessTokens, + Optional tokenDialect, + OptionalNullable tokenEncryption, + OptionalNullable consentPolicy, + OptionalNullable> authorizationDetails, + OptionalNullable proofOfPossession, + Optional subjectTypeAuthorization, + OptionalNullable authorizationPolicy, + Optional clientId, + Map additionalProperties) { + this.id = id; + this.name = name; + this.isSystem = isSystem; + this.identifier = identifier; + this.scopes = scopes; + this.signingAlg = signingAlg; + this.allowOfflineAccess = allowOfflineAccess; + this.allowOnlineAccess = allowOnlineAccess; + this.allowOnlineAccessWithEphemeralSessions = allowOnlineAccessWithEphemeralSessions; + this.skipConsentForVerifiableFirstPartyClients = skipConsentForVerifiableFirstPartyClients; + this.tokenLifetime = tokenLifetime; + this.tokenLifetimeForWeb = tokenLifetimeForWeb; + this.enforcePolicies = enforcePolicies; + this.tokenLifetimeForAnonymousAccessTokens = tokenLifetimeForAnonymousAccessTokens; + this.tokenDialect = tokenDialect; + this.tokenEncryption = tokenEncryption; + this.consentPolicy = consentPolicy; + this.authorizationDetails = authorizationDetails; + this.proofOfPossession = proofOfPossession; + this.subjectTypeAuthorization = subjectTypeAuthorization; + this.authorizationPolicy = authorizationPolicy; + this.clientId = clientId; + this.additionalProperties = additionalProperties; + } + + /** + * @return ID of the API (resource server). + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Friendly name for this resource server. Can not contain < or > characters. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Whether this is an Auth0 system API (true) or a custom API (false). + */ + @JsonProperty("is_system") + public Optional getIsSystem() { + return isSystem; + } + + /** + * @return Unique identifier for the API used as the audience parameter on authorization calls. Can not be changed once set. + */ + @JsonProperty("identifier") + public Optional getIdentifier() { + return identifier; + } + + /** + * @return List of permissions (scopes) that this API uses. + */ + @JsonProperty("scopes") + public Optional> getScopes() { + return scopes; + } + + @JsonProperty("signing_alg") + public Optional getSigningAlg() { + return signingAlg; + } + + /** + * @return Whether refresh tokens can be issued for this API (true) or not (false). + */ + @JsonProperty("allow_offline_access") + public Optional getAllowOfflineAccess() { + return allowOfflineAccess; + } + + /** + * @return Whether Online Refresh Tokens can be issued for this API (true) or not (false). + */ + @JsonProperty("allow_online_access") + public Optional getAllowOnlineAccess() { + return allowOnlineAccess; + } + + /** + * @return Whether Online Refresh Tokens can be issued even when sessions are configured as ephemeral (true) or not (false). + */ + @JsonProperty("allow_online_access_with_ephemeral_sessions") + public Optional getAllowOnlineAccessWithEphemeralSessions() { + return allowOnlineAccessWithEphemeralSessions; + } + + /** + * @return Whether to skip user consent for applications flagged as first party (true) or not (false). + */ + @JsonProperty("skip_consent_for_verifiable_first_party_clients") + public Optional getSkipConsentForVerifiableFirstPartyClients() { + return skipConsentForVerifiableFirstPartyClients; + } + + /** + * @return Expiration value (in seconds) for access tokens issued for this API from the token endpoint. + */ + @JsonProperty("token_lifetime") + public Optional getTokenLifetime() { + return tokenLifetime; + } + + /** + * @return Expiration value (in seconds) for access tokens issued for this API via Implicit or Hybrid Flows. Cannot be greater than the token_lifetime value. + */ + @JsonProperty("token_lifetime_for_web") + public Optional getTokenLifetimeForWeb() { + return tokenLifetimeForWeb; + } + + /** + * @return Whether authorization polices are enforced (true) or unenforced (false). + */ + @JsonProperty("enforce_policies") + public Optional getEnforcePolicies() { + return enforcePolicies; + } + + /** + * @return Expiration value (in seconds) for anonymous-session access tokens issued for this API. + */ + @JsonProperty("token_lifetime_for_anonymous_access_tokens") + public Optional getTokenLifetimeForAnonymousAccessTokens() { + return tokenLifetimeForAnonymousAccessTokens; + } + + @JsonProperty("token_dialect") + public Optional getTokenDialect() { + return tokenDialect; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_encryption") + public OptionalNullable getTokenEncryption() { + if (tokenEncryption == null) { + return OptionalNullable.absent(); + } + return tokenEncryption; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("consent_policy") + public OptionalNullable getConsentPolicy() { + if (consentPolicy == null) { + return OptionalNullable.absent(); + } + return consentPolicy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("authorization_details") + public OptionalNullable> getAuthorizationDetails() { + if (authorizationDetails == null) { + return OptionalNullable.absent(); + } + return authorizationDetails; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("proof_of_possession") + public OptionalNullable getProofOfPossession() { + if (proofOfPossession == null) { + return OptionalNullable.absent(); + } + return proofOfPossession; + } + + @JsonProperty("subject_type_authorization") + public Optional getSubjectTypeAuthorization() { + return subjectTypeAuthorization; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("authorization_policy") + public OptionalNullable getAuthorizationPolicy() { + if (authorizationPolicy == null) { + return OptionalNullable.absent(); + } + return authorizationPolicy; + } + + /** + * @return The client ID of the client that this resource server is linked to + */ + @JsonProperty("client_id") + public Optional getClientId() { + return clientId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_encryption") + private OptionalNullable _getTokenEncryption() { + return tokenEncryption; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("consent_policy") + private OptionalNullable _getConsentPolicy() { + return consentPolicy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("authorization_details") + private OptionalNullable> _getAuthorizationDetails() { + return authorizationDetails; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("proof_of_possession") + private OptionalNullable _getProofOfPossession() { + return proofOfPossession; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("authorization_policy") + private OptionalNullable _getAuthorizationPolicy() { + return authorizationPolicy; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ResourceServerSearchResponse && equalTo((ResourceServerSearchResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ResourceServerSearchResponse other) { + return id.equals(other.id) + && name.equals(other.name) + && isSystem.equals(other.isSystem) + && identifier.equals(other.identifier) + && scopes.equals(other.scopes) + && signingAlg.equals(other.signingAlg) + && allowOfflineAccess.equals(other.allowOfflineAccess) + && allowOnlineAccess.equals(other.allowOnlineAccess) + && allowOnlineAccessWithEphemeralSessions.equals(other.allowOnlineAccessWithEphemeralSessions) + && skipConsentForVerifiableFirstPartyClients.equals(other.skipConsentForVerifiableFirstPartyClients) + && tokenLifetime.equals(other.tokenLifetime) + && tokenLifetimeForWeb.equals(other.tokenLifetimeForWeb) + && enforcePolicies.equals(other.enforcePolicies) + && tokenLifetimeForAnonymousAccessTokens.equals(other.tokenLifetimeForAnonymousAccessTokens) + && tokenDialect.equals(other.tokenDialect) + && tokenEncryption.equals(other.tokenEncryption) + && consentPolicy.equals(other.consentPolicy) + && authorizationDetails.equals(other.authorizationDetails) + && proofOfPossession.equals(other.proofOfPossession) + && subjectTypeAuthorization.equals(other.subjectTypeAuthorization) + && authorizationPolicy.equals(other.authorizationPolicy) + && clientId.equals(other.clientId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.isSystem, + this.identifier, + this.scopes, + this.signingAlg, + this.allowOfflineAccess, + this.allowOnlineAccess, + this.allowOnlineAccessWithEphemeralSessions, + this.skipConsentForVerifiableFirstPartyClients, + this.tokenLifetime, + this.tokenLifetimeForWeb, + this.enforcePolicies, + this.tokenLifetimeForAnonymousAccessTokens, + this.tokenDialect, + this.tokenEncryption, + this.consentPolicy, + this.authorizationDetails, + this.proofOfPossession, + this.subjectTypeAuthorization, + this.authorizationPolicy, + this.clientId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional isSystem = Optional.empty(); + + private Optional identifier = Optional.empty(); + + private Optional> scopes = Optional.empty(); + + private Optional signingAlg = Optional.empty(); + + private Optional allowOfflineAccess = Optional.empty(); + + private Optional allowOnlineAccess = Optional.empty(); + + private Optional allowOnlineAccessWithEphemeralSessions = Optional.empty(); + + private Optional skipConsentForVerifiableFirstPartyClients = Optional.empty(); + + private Optional tokenLifetime = Optional.empty(); + + private Optional tokenLifetimeForWeb = Optional.empty(); + + private Optional enforcePolicies = Optional.empty(); + + private Optional tokenLifetimeForAnonymousAccessTokens = Optional.empty(); + + private Optional tokenDialect = Optional.empty(); + + private OptionalNullable tokenEncryption = OptionalNullable.absent(); + + private OptionalNullable consentPolicy = OptionalNullable.absent(); + + private OptionalNullable> authorizationDetails = OptionalNullable.absent(); + + private OptionalNullable proofOfPossession = OptionalNullable.absent(); + + private Optional subjectTypeAuthorization = Optional.empty(); + + private OptionalNullable authorizationPolicy = OptionalNullable.absent(); + + private Optional clientId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ResourceServerSearchResponse other) { + id(other.getId()); + name(other.getName()); + isSystem(other.getIsSystem()); + identifier(other.getIdentifier()); + scopes(other.getScopes()); + signingAlg(other.getSigningAlg()); + allowOfflineAccess(other.getAllowOfflineAccess()); + allowOnlineAccess(other.getAllowOnlineAccess()); + allowOnlineAccessWithEphemeralSessions(other.getAllowOnlineAccessWithEphemeralSessions()); + skipConsentForVerifiableFirstPartyClients(other.getSkipConsentForVerifiableFirstPartyClients()); + tokenLifetime(other.getTokenLifetime()); + tokenLifetimeForWeb(other.getTokenLifetimeForWeb()); + enforcePolicies(other.getEnforcePolicies()); + tokenLifetimeForAnonymousAccessTokens(other.getTokenLifetimeForAnonymousAccessTokens()); + tokenDialect(other.getTokenDialect()); + tokenEncryption(other.getTokenEncryption()); + consentPolicy(other.getConsentPolicy()); + authorizationDetails(other.getAuthorizationDetails()); + proofOfPossession(other.getProofOfPossession()); + subjectTypeAuthorization(other.getSubjectTypeAuthorization()); + authorizationPolicy(other.getAuthorizationPolicy()); + clientId(other.getClientId()); + return this; + } + + /** + *

ID of the API (resource server).

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

Friendly name for this resource server. Can not contain < or > characters.

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

Whether this is an Auth0 system API (true) or a custom API (false).

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

Unique identifier for the API used as the audience parameter on authorization calls. Can not be changed once set.

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

List of permissions (scopes) that this API uses.

+ */ + @JsonSetter(value = "scopes", nulls = Nulls.SKIP) + public Builder scopes(Optional> scopes) { + this.scopes = scopes; + return this; + } + + public Builder scopes(List scopes) { + this.scopes = Optional.ofNullable(scopes); + return this; + } + + @JsonSetter(value = "signing_alg", nulls = Nulls.SKIP) + public Builder signingAlg(Optional signingAlg) { + this.signingAlg = signingAlg; + return this; + } + + public Builder signingAlg(SigningAlgorithmEnum signingAlg) { + this.signingAlg = Optional.ofNullable(signingAlg); + return this; + } + + /** + *

Whether refresh tokens can be issued for this API (true) or not (false).

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

Whether Online Refresh Tokens can be issued for this API (true) or not (false).

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

Whether Online Refresh Tokens can be issued even when sessions are configured as ephemeral (true) or not (false).

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

Whether to skip user consent for applications flagged as first party (true) or not (false).

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

Expiration value (in seconds) for access tokens issued for this API from the token endpoint.

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

Expiration value (in seconds) for access tokens issued for this API via Implicit or Hybrid Flows. Cannot be greater than the token_lifetime value.

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

Whether authorization polices are enforced (true) or unenforced (false).

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

Expiration value (in seconds) for anonymous-session access tokens issued for this API.

+ */ + @JsonSetter(value = "token_lifetime_for_anonymous_access_tokens", nulls = Nulls.SKIP) + public Builder tokenLifetimeForAnonymousAccessTokens(Optional tokenLifetimeForAnonymousAccessTokens) { + this.tokenLifetimeForAnonymousAccessTokens = tokenLifetimeForAnonymousAccessTokens; + return this; + } + + public Builder tokenLifetimeForAnonymousAccessTokens(Integer tokenLifetimeForAnonymousAccessTokens) { + this.tokenLifetimeForAnonymousAccessTokens = Optional.ofNullable(tokenLifetimeForAnonymousAccessTokens); + return this; + } + + @JsonSetter(value = "token_dialect", nulls = Nulls.SKIP) + public Builder tokenDialect(Optional tokenDialect) { + this.tokenDialect = tokenDialect; + return this; + } + + public Builder tokenDialect(ResourceServerTokenDialectResponseEnum tokenDialect) { + this.tokenDialect = Optional.ofNullable(tokenDialect); + return this; + } + + @JsonSetter(value = "token_encryption", nulls = Nulls.SKIP) + public Builder tokenEncryption(@Nullable OptionalNullable tokenEncryption) { + this.tokenEncryption = tokenEncryption; + return this; + } + + public Builder tokenEncryption(ResourceServerTokenEncryption tokenEncryption) { + this.tokenEncryption = OptionalNullable.of(tokenEncryption); + return this; + } + + public Builder tokenEncryption(Optional tokenEncryption) { + if (tokenEncryption.isPresent()) { + this.tokenEncryption = OptionalNullable.of(tokenEncryption.get()); + } else { + this.tokenEncryption = OptionalNullable.absent(); + } + return this; + } + + public Builder tokenEncryption( + com.auth0.client.mgmt.core.Nullable tokenEncryption) { + if (tokenEncryption.isNull()) { + this.tokenEncryption = OptionalNullable.ofNull(); + } else if (tokenEncryption.isEmpty()) { + this.tokenEncryption = OptionalNullable.absent(); + } else { + this.tokenEncryption = OptionalNullable.of(tokenEncryption.get()); + } + return this; + } + + @JsonSetter(value = "consent_policy", nulls = Nulls.SKIP) + public Builder consentPolicy(@Nullable OptionalNullable consentPolicy) { + this.consentPolicy = consentPolicy; + return this; + } + + public Builder consentPolicy(ResourceServerConsentPolicyEnum consentPolicy) { + this.consentPolicy = OptionalNullable.of(consentPolicy); + return this; + } + + public Builder consentPolicy(Optional consentPolicy) { + if (consentPolicy.isPresent()) { + this.consentPolicy = OptionalNullable.of(consentPolicy.get()); + } else { + this.consentPolicy = OptionalNullable.absent(); + } + return this; + } + + public Builder consentPolicy( + com.auth0.client.mgmt.core.Nullable consentPolicy) { + if (consentPolicy.isNull()) { + this.consentPolicy = OptionalNullable.ofNull(); + } else if (consentPolicy.isEmpty()) { + this.consentPolicy = OptionalNullable.absent(); + } else { + this.consentPolicy = OptionalNullable.of(consentPolicy.get()); + } + return this; + } + + @JsonSetter(value = "authorization_details", nulls = Nulls.SKIP) + public Builder authorizationDetails(@Nullable OptionalNullable> authorizationDetails) { + this.authorizationDetails = authorizationDetails; + return this; + } + + public Builder authorizationDetails(List authorizationDetails) { + this.authorizationDetails = OptionalNullable.of(authorizationDetails); + return this; + } + + public Builder authorizationDetails(Optional> authorizationDetails) { + if (authorizationDetails.isPresent()) { + this.authorizationDetails = OptionalNullable.of(authorizationDetails.get()); + } else { + this.authorizationDetails = OptionalNullable.absent(); + } + return this; + } + + public Builder authorizationDetails(com.auth0.client.mgmt.core.Nullable> authorizationDetails) { + if (authorizationDetails.isNull()) { + this.authorizationDetails = OptionalNullable.ofNull(); + } else if (authorizationDetails.isEmpty()) { + this.authorizationDetails = OptionalNullable.absent(); + } else { + this.authorizationDetails = OptionalNullable.of(authorizationDetails.get()); + } + return this; + } + + @JsonSetter(value = "proof_of_possession", nulls = Nulls.SKIP) + public Builder proofOfPossession( + @Nullable OptionalNullable proofOfPossession) { + this.proofOfPossession = proofOfPossession; + return this; + } + + public Builder proofOfPossession(ResourceServerProofOfPossession proofOfPossession) { + this.proofOfPossession = OptionalNullable.of(proofOfPossession); + return this; + } + + public Builder proofOfPossession(Optional proofOfPossession) { + if (proofOfPossession.isPresent()) { + this.proofOfPossession = OptionalNullable.of(proofOfPossession.get()); + } else { + this.proofOfPossession = OptionalNullable.absent(); + } + return this; + } + + public Builder proofOfPossession( + com.auth0.client.mgmt.core.Nullable proofOfPossession) { + if (proofOfPossession.isNull()) { + this.proofOfPossession = OptionalNullable.ofNull(); + } else if (proofOfPossession.isEmpty()) { + this.proofOfPossession = OptionalNullable.absent(); + } else { + this.proofOfPossession = OptionalNullable.of(proofOfPossession.get()); + } + return this; + } + + @JsonSetter(value = "subject_type_authorization", nulls = Nulls.SKIP) + public Builder subjectTypeAuthorization( + Optional subjectTypeAuthorization) { + this.subjectTypeAuthorization = subjectTypeAuthorization; + return this; + } + + public Builder subjectTypeAuthorization(ResourceServerSubjectTypeAuthorization subjectTypeAuthorization) { + this.subjectTypeAuthorization = Optional.ofNullable(subjectTypeAuthorization); + return this; + } + + @JsonSetter(value = "authorization_policy", nulls = Nulls.SKIP) + public Builder authorizationPolicy( + @Nullable OptionalNullable authorizationPolicy) { + this.authorizationPolicy = authorizationPolicy; + return this; + } + + public Builder authorizationPolicy(ResourceServerAuthorizationPolicy authorizationPolicy) { + this.authorizationPolicy = OptionalNullable.of(authorizationPolicy); + return this; + } + + public Builder authorizationPolicy(Optional authorizationPolicy) { + if (authorizationPolicy.isPresent()) { + this.authorizationPolicy = OptionalNullable.of(authorizationPolicy.get()); + } else { + this.authorizationPolicy = OptionalNullable.absent(); + } + return this; + } + + public Builder authorizationPolicy( + com.auth0.client.mgmt.core.Nullable authorizationPolicy) { + if (authorizationPolicy.isNull()) { + this.authorizationPolicy = OptionalNullable.ofNull(); + } else if (authorizationPolicy.isEmpty()) { + this.authorizationPolicy = OptionalNullable.absent(); + } else { + this.authorizationPolicy = OptionalNullable.of(authorizationPolicy.get()); + } + return this; + } + + /** + *

The client ID of the client that this resource server is linked to

+ */ + @JsonSetter(value = "client_id", nulls = Nulls.SKIP) + public Builder clientId(Optional clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = Optional.ofNullable(clientId); + return this; + } + + public ResourceServerSearchResponse build() { + return new ResourceServerSearchResponse( + id, + name, + isSystem, + identifier, + scopes, + signingAlg, + allowOfflineAccess, + allowOnlineAccess, + allowOnlineAccessWithEphemeralSessions, + skipConsentForVerifiableFirstPartyClients, + tokenLifetime, + tokenLifetimeForWeb, + enforcePolicies, + tokenLifetimeForAnonymousAccessTokens, + tokenDialect, + tokenEncryption, + consentPolicy, + authorizationDetails, + proofOfPossession, + subjectTypeAuthorization, + authorizationPolicy, + clientId, + additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerSortFieldEnum.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSortFieldEnum.java new file mode 100644 index 000000000..e3af23f61 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSortFieldEnum.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ResourceServerSortFieldEnum { + public static final ResourceServerSortFieldEnum UPDATED_AT = + new ResourceServerSortFieldEnum(Value.UPDATED_AT, "updated_at"); + + public static final ResourceServerSortFieldEnum IDENTIFIER = + new ResourceServerSortFieldEnum(Value.IDENTIFIER, "identifier"); + + public static final ResourceServerSortFieldEnum NAME = new ResourceServerSortFieldEnum(Value.NAME, "name"); + + private final Value value; + + private final String string; + + ResourceServerSortFieldEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ResourceServerSortFieldEnum + && this.string.equals(((ResourceServerSortFieldEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case UPDATED_AT: + return visitor.visitUpdatedAt(); + case IDENTIFIER: + return visitor.visitIdentifier(); + case NAME: + return visitor.visitName(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ResourceServerSortFieldEnum valueOf(String value) { + switch (value) { + case "updated_at": + return UPDATED_AT; + case "identifier": + return IDENTIFIER; + case "name": + return NAME; + default: + return new ResourceServerSortFieldEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + IDENTIFIER, + + NAME, + + UPDATED_AT, + + UNKNOWN + } + + public interface Visitor { + T visitIdentifier(); + + T visitName(); + + T visitUpdatedAt(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorization.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorization.java index cfcde84b1..5af4e648e 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorization.java +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorization.java @@ -24,14 +24,18 @@ public final class ResourceServerSubjectTypeAuthorization { private final Optional client; + private final Optional anonymousUser; + private final Map additionalProperties; private ResourceServerSubjectTypeAuthorization( Optional user, Optional client, + Optional anonymousUser, Map additionalProperties) { this.user = user; this.client = client; + this.anonymousUser = anonymousUser; this.additionalProperties = additionalProperties; } @@ -45,6 +49,11 @@ public Optional getClient() { return client; } + @JsonProperty("anonymous_user") + public Optional getAnonymousUser() { + return anonymousUser; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -58,12 +67,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(ResourceServerSubjectTypeAuthorization other) { - return user.equals(other.user) && client.equals(other.client); + return user.equals(other.user) && client.equals(other.client) && anonymousUser.equals(other.anonymousUser); } @java.lang.Override public int hashCode() { - return Objects.hash(this.user, this.client); + return Objects.hash(this.user, this.client, this.anonymousUser); } @java.lang.Override @@ -81,6 +90,8 @@ public static final class Builder { private Optional client = Optional.empty(); + private Optional anonymousUser = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -89,6 +100,7 @@ private Builder() {} public Builder from(ResourceServerSubjectTypeAuthorization other) { user(other.getUser()); client(other.getClient()); + anonymousUser(other.getAnonymousUser()); return this; } @@ -114,8 +126,19 @@ public Builder client(ResourceServerSubjectTypeAuthorizationClient client) { return this; } + @JsonSetter(value = "anonymous_user", nulls = Nulls.SKIP) + public Builder anonymousUser(Optional anonymousUser) { + this.anonymousUser = anonymousUser; + return this; + } + + public Builder anonymousUser(ResourceServerSubjectTypeAuthorizationAnonymousUser anonymousUser) { + this.anonymousUser = Optional.ofNullable(anonymousUser); + return this; + } + public ResourceServerSubjectTypeAuthorization build() { - return new ResourceServerSubjectTypeAuthorization(user, client, additionalProperties); + return new ResourceServerSubjectTypeAuthorization(user, client, anonymousUser, additionalProperties); } public Builder additionalProperty(String key, Object value) { diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationAnonymousUser.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationAnonymousUser.java new file mode 100644 index 000000000..a71d4cca4 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationAnonymousUser.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ResourceServerSubjectTypeAuthorizationAnonymousUser.Builder.class) +public final class ResourceServerSubjectTypeAuthorizationAnonymousUser { + private final Optional policy; + + private final Map additionalProperties; + + private ResourceServerSubjectTypeAuthorizationAnonymousUser( + Optional policy, + Map additionalProperties) { + this.policy = policy; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("policy") + public Optional getPolicy() { + return policy; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ResourceServerSubjectTypeAuthorizationAnonymousUser + && equalTo((ResourceServerSubjectTypeAuthorizationAnonymousUser) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ResourceServerSubjectTypeAuthorizationAnonymousUser other) { + return policy.equals(other.policy); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.policy); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional policy = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ResourceServerSubjectTypeAuthorizationAnonymousUser other) { + policy(other.getPolicy()); + return this; + } + + @JsonSetter(value = "policy", nulls = Nulls.SKIP) + public Builder policy(Optional policy) { + this.policy = policy; + return this; + } + + public Builder policy(ResourceServerSubjectTypeAuthorizationAnonymousUserPolicyEnum policy) { + this.policy = Optional.ofNullable(policy); + return this; + } + + public ResourceServerSubjectTypeAuthorizationAnonymousUser build() { + return new ResourceServerSubjectTypeAuthorizationAnonymousUser(policy, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationAnonymousUserPolicyEnum.java b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationAnonymousUserPolicyEnum.java new file mode 100644 index 000000000..f4c259bba --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ResourceServerSubjectTypeAuthorizationAnonymousUserPolicyEnum.java @@ -0,0 +1,88 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ResourceServerSubjectTypeAuthorizationAnonymousUserPolicyEnum { + public static final ResourceServerSubjectTypeAuthorizationAnonymousUserPolicyEnum DENY_ALL = + new ResourceServerSubjectTypeAuthorizationAnonymousUserPolicyEnum(Value.DENY_ALL, "deny_all"); + + public static final ResourceServerSubjectTypeAuthorizationAnonymousUserPolicyEnum REQUIRE_CLIENT_GRANT = + new ResourceServerSubjectTypeAuthorizationAnonymousUserPolicyEnum( + Value.REQUIRE_CLIENT_GRANT, "require_client_grant"); + + private final Value value; + + private final String string; + + ResourceServerSubjectTypeAuthorizationAnonymousUserPolicyEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ResourceServerSubjectTypeAuthorizationAnonymousUserPolicyEnum + && this.string.equals( + ((ResourceServerSubjectTypeAuthorizationAnonymousUserPolicyEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DENY_ALL: + return visitor.visitDenyAll(); + case REQUIRE_CLIENT_GRANT: + return visitor.visitRequireClientGrant(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ResourceServerSubjectTypeAuthorizationAnonymousUserPolicyEnum valueOf(String value) { + switch (value) { + case "deny_all": + return DENY_ALL; + case "require_client_grant": + return REQUIRE_CLIENT_GRANT; + default: + return new ResourceServerSubjectTypeAuthorizationAnonymousUserPolicyEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + DENY_ALL, + + REQUIRE_CLIENT_GRANT, + + UNKNOWN + } + + public interface Visitor { + T visitDenyAll(); + + T visitRequireClientGrant(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/RotateClientSecretResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/RotateClientSecretResponseContent.java index f6c2c7bcb..d64634483 100644 --- a/src/main/java/com/auth0/client/mgmt/types/RotateClientSecretResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/RotateClientSecretResponseContent.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 RotateClientSecretResponseContent { 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 RotateClientSecretResponseContent { private final Optional identityAssertionAuthorizationGrant; + private final Optional anonymousSessions; + private final Optional thirdPartySecurityMode; private final Optional redirectionPolicy; @@ -158,6 +165,8 @@ public final class RotateClientSecretResponseContent { private RotateClientSecretResponseContent( Optional clientId, + Optional createdAt, + Optional updatedAt, Optional tenant, Optional name, Optional description, @@ -214,6 +223,7 @@ private RotateClientSecretResponseContent( Optional b2BIntegrationConfiguration, Optional myOrganizationConfiguration, Optional identityAssertionAuthorizationGrant, + Optional anonymousSessions, Optional thirdPartySecurityMode, Optional redirectionPolicy, Optional resourceServerIdentifier, @@ -224,6 +234,8 @@ private RotateClientSecretResponseContent( Optional jwksUri, Map additionalProperties) { this.clientId = clientId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; this.tenant = tenant; this.name = name; this.description = description; @@ -280,6 +292,7 @@ private RotateClientSecretResponseContent( this.b2BIntegrationConfiguration = b2BIntegrationConfiguration; this.myOrganizationConfiguration = myOrganizationConfiguration; this.identityAssertionAuthorizationGrant = identityAssertionAuthorizationGrant; + this.anonymousSessions = anonymousSessions; this.thirdPartySecurityMode = thirdPartySecurityMode; this.redirectionPolicy = redirectionPolicy; this.resourceServerIdentifier = resourceServerIdentifier; @@ -299,6 +312,22 @@ public Optional getClientId() { return clientId; } + /** + * @return The ISO 8601 timestamp of when this client was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The ISO 8601 timestamp of when this client was last updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + /** * @return Name of the tenant this client belongs to. */ @@ -703,6 +732,11 @@ public Optional getIdentityAssertionAuthori return identityAssertionAuthorizationGrant; } + @JsonProperty("anonymous_sessions") + public Optional getAnonymousSessions() { + return anonymousSessions; + } + @JsonProperty("third_party_security_mode") public Optional getThirdPartySecurityMode() { return thirdPartySecurityMode; @@ -813,6 +847,8 @@ public Map getAdditionalProperties() { private boolean equalTo(RotateClientSecretResponseContent other) { return clientId.equals(other.clientId) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) && tenant.equals(other.tenant) && name.equals(other.name) && description.equals(other.description) @@ -870,6 +906,7 @@ private boolean equalTo(RotateClientSecretResponseContent other) { && b2BIntegrationConfiguration.equals(other.b2BIntegrationConfiguration) && myOrganizationConfiguration.equals(other.myOrganizationConfiguration) && identityAssertionAuthorizationGrant.equals(other.identityAssertionAuthorizationGrant) + && anonymousSessions.equals(other.anonymousSessions) && thirdPartySecurityMode.equals(other.thirdPartySecurityMode) && redirectionPolicy.equals(other.redirectionPolicy) && resourceServerIdentifier.equals(other.resourceServerIdentifier) @@ -884,6 +921,8 @@ private boolean equalTo(RotateClientSecretResponseContent other) { public int hashCode() { return Objects.hash( this.clientId, + this.createdAt, + this.updatedAt, this.tenant, this.name, this.description, @@ -940,6 +979,7 @@ public int hashCode() { this.b2BIntegrationConfiguration, this.myOrganizationConfiguration, this.identityAssertionAuthorizationGrant, + this.anonymousSessions, this.thirdPartySecurityMode, this.redirectionPolicy, this.resourceServerIdentifier, @@ -963,6 +1003,10 @@ public static Builder builder() { public static final class Builder { private Optional clientId = Optional.empty(); + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + private Optional tenant = Optional.empty(); private Optional name = Optional.empty(); @@ -1076,6 +1120,8 @@ public static final class Builder { private Optional identityAssertionAuthorizationGrant = Optional.empty(); + private Optional anonymousSessions = Optional.empty(); + private Optional thirdPartySecurityMode = Optional.empty(); private Optional redirectionPolicy = Optional.empty(); @@ -1100,6 +1146,8 @@ private Builder() {} public Builder from(RotateClientSecretResponseContent other) { clientId(other.getClientId()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); tenant(other.getTenant()); name(other.getName()); description(other.getDescription()); @@ -1156,6 +1204,7 @@ public Builder from(RotateClientSecretResponseContent other) { b2BIntegrationConfiguration(other.getB2BIntegrationConfiguration()); myOrganizationConfiguration(other.getMyOrganizationConfiguration()); identityAssertionAuthorizationGrant(other.getIdentityAssertionAuthorizationGrant()); + anonymousSessions(other.getAnonymousSessions()); thirdPartySecurityMode(other.getThirdPartySecurityMode()); redirectionPolicy(other.getRedirectionPolicy()); resourceServerIdentifier(other.getResourceServerIdentifier()); @@ -1181,6 +1230,34 @@ public Builder clientId(String clientId) { return this; } + /** + *

The ISO 8601 timestamp of when this client was created.

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

The ISO 8601 timestamp of when this client was last updated.

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

Name of the tenant this client belongs to.

*/ @@ -2065,6 +2142,17 @@ public Builder identityAssertionAuthorizationGrant( return this; } + @JsonSetter(value = "anonymous_sessions", nulls = Nulls.SKIP) + public Builder anonymousSessions(Optional anonymousSessions) { + this.anonymousSessions = anonymousSessions; + return this; + } + + public Builder anonymousSessions(AnonymousSessions anonymousSessions) { + this.anonymousSessions = Optional.ofNullable(anonymousSessions); + return this; + } + @JsonSetter(value = "third_party_security_mode", nulls = Nulls.SKIP) public Builder thirdPartySecurityMode(Optional thirdPartySecurityMode) { this.thirdPartySecurityMode = thirdPartySecurityMode; @@ -2168,6 +2256,8 @@ public Builder jwksUri(String jwksUri) { public RotateClientSecretResponseContent build() { return new RotateClientSecretResponseContent( clientId, + createdAt, + updatedAt, tenant, name, description, @@ -2224,6 +2314,7 @@ public RotateClientSecretResponseContent build() { b2BIntegrationConfiguration, myOrganizationConfiguration, identityAssertionAuthorizationGrant, + anonymousSessions, thirdPartySecurityMode, redirectionPolicy, resourceServerIdentifier, diff --git a/src/main/java/com/auth0/client/mgmt/types/SearchOrganization.java b/src/main/java/com/auth0/client/mgmt/types/SearchOrganization.java new file mode 100644 index 000000000..3f00222d6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SearchOrganization.java @@ -0,0 +1,317 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SearchOrganization.Builder.class) +public final class SearchOrganization { + private final Optional id; + + private final Optional name; + + private final Optional displayName; + + private final Optional branding; + + private final Optional>> metadata; + + private final Optional tokenQuota; + + private final Optional thirdPartyClientAccess; + + private final Optional isAppEntitlementActive; + + private final Map additionalProperties; + + private SearchOrganization( + Optional id, + Optional name, + Optional displayName, + Optional branding, + Optional>> metadata, + Optional tokenQuota, + Optional thirdPartyClientAccess, + Optional isAppEntitlementActive, + Map additionalProperties) { + this.id = id; + this.name = name; + this.displayName = displayName; + this.branding = branding; + this.metadata = metadata; + this.tokenQuota = tokenQuota; + this.thirdPartyClientAccess = thirdPartyClientAccess; + this.isAppEntitlementActive = isAppEntitlementActive; + this.additionalProperties = additionalProperties; + } + + /** + * @return Organization identifier. + */ + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The name of this organization. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Friendly name of this organization. + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("branding") + public Optional getBranding() { + return branding; + } + + @JsonProperty("metadata") + public Optional>> getMetadata() { + return metadata; + } + + @JsonProperty("token_quota") + public Optional getTokenQuota() { + return tokenQuota; + } + + @JsonProperty("third_party_client_access") + public Optional getThirdPartyClientAccess() { + return thirdPartyClientAccess; + } + + /** + * @return Whether app entitlement is active for this organization. + */ + @JsonProperty("is_app_entitlement_active") + public Optional getIsAppEntitlementActive() { + return isAppEntitlementActive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SearchOrganization && equalTo((SearchOrganization) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SearchOrganization other) { + return id.equals(other.id) + && name.equals(other.name) + && displayName.equals(other.displayName) + && branding.equals(other.branding) + && metadata.equals(other.metadata) + && tokenQuota.equals(other.tokenQuota) + && thirdPartyClientAccess.equals(other.thirdPartyClientAccess) + && isAppEntitlementActive.equals(other.isAppEntitlementActive); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.name, + this.displayName, + this.branding, + this.metadata, + this.tokenQuota, + this.thirdPartyClientAccess, + this.isAppEntitlementActive); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional branding = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional tokenQuota = Optional.empty(); + + private Optional thirdPartyClientAccess = Optional.empty(); + + private Optional isAppEntitlementActive = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SearchOrganization other) { + id(other.getId()); + name(other.getName()); + displayName(other.getDisplayName()); + branding(other.getBranding()); + metadata(other.getMetadata()); + tokenQuota(other.getTokenQuota()); + thirdPartyClientAccess(other.getThirdPartyClientAccess()); + isAppEntitlementActive(other.getIsAppEntitlementActive()); + return this; + } + + /** + *

Organization identifier.

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

The name of this organization.

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

Friendly name of this organization.

+ */ + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "branding", nulls = Nulls.SKIP) + public Builder branding(Optional branding) { + this.branding = branding; + return this; + } + + public Builder branding(OrganizationBranding branding) { + this.branding = Optional.ofNullable(branding); + return this; + } + + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @JsonSetter(value = "token_quota", nulls = Nulls.SKIP) + public Builder tokenQuota(Optional tokenQuota) { + this.tokenQuota = tokenQuota; + return this; + } + + public Builder tokenQuota(TokenQuota tokenQuota) { + this.tokenQuota = Optional.ofNullable(tokenQuota); + return this; + } + + @JsonSetter(value = "third_party_client_access", nulls = Nulls.SKIP) + public Builder thirdPartyClientAccess(Optional thirdPartyClientAccess) { + this.thirdPartyClientAccess = thirdPartyClientAccess; + return this; + } + + public Builder thirdPartyClientAccess(OrganizationThirdPartyClientAccessEnum thirdPartyClientAccess) { + this.thirdPartyClientAccess = Optional.ofNullable(thirdPartyClientAccess); + return this; + } + + /** + *

Whether app entitlement is active for this organization.

+ */ + @JsonSetter(value = "is_app_entitlement_active", nulls = Nulls.SKIP) + public Builder isAppEntitlementActive(Optional isAppEntitlementActive) { + this.isAppEntitlementActive = isAppEntitlementActive; + return this; + } + + public Builder isAppEntitlementActive(Boolean isAppEntitlementActive) { + this.isAppEntitlementActive = Optional.ofNullable(isAppEntitlementActive); + return this; + } + + public SearchOrganization build() { + return new SearchOrganization( + id, + name, + displayName, + branding, + metadata, + tokenQuota, + thirdPartyClientAccess, + isAppEntitlementActive, + additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListTemplateOrganizationsPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SearchOrganizationsPaginatedResponseContent.java similarity index 61% rename from src/main/java/com/auth0/client/mgmt/types/ListTemplateOrganizationsPaginatedResponseContent.java rename to src/main/java/com/auth0/client/mgmt/types/SearchOrganizationsPaginatedResponseContent.java index dc5373db1..8ee873851 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListTemplateOrganizationsPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SearchOrganizationsPaginatedResponseContent.java @@ -20,44 +20,39 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ListTemplateOrganizationsPaginatedResponseContent.Builder.class) -public final class ListTemplateOrganizationsPaginatedResponseContent { - private final Optional next; +@JsonDeserialize(builder = SearchOrganizationsPaginatedResponseContent.Builder.class) +public final class SearchOrganizationsPaginatedResponseContent { + private final List organizations; - private final List organizations; + private final Optional next; private final Map additionalProperties; - private ListTemplateOrganizationsPaginatedResponseContent( - Optional next, - List organizations, - Map additionalProperties) { - this.next = next; + private SearchOrganizationsPaginatedResponseContent( + List organizations, Optional next, Map additionalProperties) { this.organizations = organizations; + this.next = next; this.additionalProperties = additionalProperties; } + @JsonProperty("organizations") + public List getOrganizations() { + return organizations; + } + /** - * @return A cursor to be used as the "from" query parameter for the next page of results. + * @return Cursor for retrieving the next page of results. Absent when no more results are available. */ @JsonProperty("next") public Optional getNext() { return next; } - /** - * @return The list of organizations assigned to this template. - */ - @JsonProperty("organizations") - public List getOrganizations() { - return organizations; - } - @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof ListTemplateOrganizationsPaginatedResponseContent - && equalTo((ListTemplateOrganizationsPaginatedResponseContent) other); + return other instanceof SearchOrganizationsPaginatedResponseContent + && equalTo((SearchOrganizationsPaginatedResponseContent) other); } @JsonAnyGetter @@ -65,13 +60,13 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(ListTemplateOrganizationsPaginatedResponseContent other) { - return next.equals(other.next) && organizations.equals(other.organizations); + private boolean equalTo(SearchOrganizationsPaginatedResponseContent other) { + return organizations.equals(other.organizations) && next.equals(other.next); } @java.lang.Override public int hashCode() { - return Objects.hash(this.next, this.organizations); + return Objects.hash(this.organizations, this.next); } @java.lang.Override @@ -85,40 +80,23 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional next = Optional.empty(); + private List organizations = new ArrayList<>(); - private List organizations = new ArrayList<>(); + private Optional next = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - public Builder from(ListTemplateOrganizationsPaginatedResponseContent other) { - next(other.getNext()); + public Builder from(SearchOrganizationsPaginatedResponseContent other) { organizations(other.getOrganizations()); + next(other.getNext()); return this; } - /** - *

A cursor to be used as the "from" query parameter for the next page of results.

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

The list of organizations assigned to this template.

- */ @JsonSetter(value = "organizations", nulls = Nulls.SKIP) - public Builder organizations(List organizations) { + public Builder organizations(List organizations) { this.organizations.clear(); if (organizations != null) { this.organizations.addAll(organizations); @@ -126,20 +104,34 @@ public Builder organizations(List orga return this; } - public Builder addOrganizations(OrganizationTemplateAssignedOrganization organizations) { + public Builder addOrganizations(SearchOrganization organizations) { this.organizations.add(organizations); return this; } - public Builder addAllOrganizations(List organizations) { + public Builder addAllOrganizations(List organizations) { if (organizations != null) { this.organizations.addAll(organizations); } return this; } - public ListTemplateOrganizationsPaginatedResponseContent build() { - return new ListTemplateOrganizationsPaginatedResponseContent(next, organizations, additionalProperties); + /** + *

Cursor for retrieving the next page of results. Absent when no more results are available.

+ */ + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + public SearchOrganizationsPaginatedResponseContent build() { + return new SearchOrganizationsPaginatedResponseContent(organizations, next, additionalProperties); } public Builder additionalProperty(String key, Object value) { diff --git a/src/main/java/com/auth0/client/mgmt/types/SearchOrganizationsRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/SearchOrganizationsRequestParameters.java new file mode 100644 index 000000000..951e20c41 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SearchOrganizationsRequestParameters.java @@ -0,0 +1,387 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SearchOrganizationsRequestParameters.Builder.class) +public final class SearchOrganizationsRequestParameters { + private final OptionalNullable q; + + private final OptionalNullable parser; + + private final OptionalNullable take; + + private final OptionalNullable from; + + private final OptionalNullable sort; + + private final Map additionalProperties; + + private SearchOrganizationsRequestParameters( + OptionalNullable q, + OptionalNullable parser, + OptionalNullable take, + OptionalNullable from, + OptionalNullable sort, + Map additionalProperties) { + this.q = q; + this.parser = parser; + this.take = take; + this.from = from; + this.sort = sort; + this.additionalProperties = additionalProperties; + } + + /** + * @return Filter expression in SCIM or Lucene syntax (depending on parser parameter, default: Lucene). Lucene examples: name:acme*, display_name:*auth*. SCIM examples: name eq "Auth0", display_name sw "auth" and created_at gt "2024-01-01". SCIM operators: eq, ne, sw, ew, co, pr, gt, ge, lt, le, and, or. Supported Fields:
  • id - Organization ID (case-sensitive, exact match)
  • name - Organization name (supports contains, starts-with, ends-with operators; sortable)
  • display_name - Organization display name (supports contains, starts-with, ends-with operators; sortable)
  • created_at - Creation timestamp (supports date range operators; sortable)
  • metadata.{key} - Filter by organization metadata key-value pairs
Maximum 5 filter operations per query. Results are eventually consistent and may not reflect recent updates. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("q") + public OptionalNullable getQ() { + if (q == null) { + return OptionalNullable.absent(); + } + return q; + } + + /** + * @return Query parser to use for the filter expression. Use "scim" for SCIM filter syntax or "lucene" for Lucene query syntax (default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("parser") + public OptionalNullable getParser() { + if (parser == null) { + return OptionalNullable.absent(); + } + return parser; + } + + /** + * @return Maximum number of results to return per page (1-100). Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + public OptionalNullable getTake() { + if (take == null) { + return OptionalNullable.absent(); + } + return take; + } + + /** + * @return Cursor for the next page of results. Use the value from the next field in the previous response. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Field name to sort results by in ascending order only. Defaults to insertion order (oldest first) if not provided. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sort") + public OptionalNullable getSort() { + if (sort == null) { + return OptionalNullable.absent(); + } + return sort; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("q") + private OptionalNullable _getQ() { + return q; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("parser") + private OptionalNullable _getParser() { + return parser; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + private OptionalNullable _getTake() { + return take; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sort") + private OptionalNullable _getSort() { + return sort; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SearchOrganizationsRequestParameters + && equalTo((SearchOrganizationsRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SearchOrganizationsRequestParameters other) { + return q.equals(other.q) + && parser.equals(other.parser) + && take.equals(other.take) + && from.equals(other.from) + && sort.equals(other.sort); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.q, this.parser, this.take, this.from, this.sort); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable q = OptionalNullable.absent(); + + private OptionalNullable parser = OptionalNullable.absent(); + + private OptionalNullable take = OptionalNullable.absent(); + + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable sort = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SearchOrganizationsRequestParameters other) { + q(other.getQ()); + parser(other.getParser()); + take(other.getTake()); + from(other.getFrom()); + sort(other.getSort()); + return this; + } + + /** + *

Filter expression in SCIM or Lucene syntax (depending on parser parameter, default: Lucene). Lucene examples: name:acme*, display_name:*auth*. SCIM examples: name eq "Auth0", display_name sw "auth" and created_at gt "2024-01-01". SCIM operators: eq, ne, sw, ew, co, pr, gt, ge, lt, le, and, or. Supported Fields:

  • id - Organization ID (case-sensitive, exact match)
  • name - Organization name (supports contains, starts-with, ends-with operators; sortable)
  • display_name - Organization display name (supports contains, starts-with, ends-with operators; sortable)
  • created_at - Creation timestamp (supports date range operators; sortable)
  • metadata.{key} - Filter by organization metadata key-value pairs
Maximum 5 filter operations per query. Results are eventually consistent and may not reflect recent updates.

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

Query parser to use for the filter expression. Use "scim" for SCIM filter syntax or "lucene" for Lucene query syntax (default).

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

Maximum number of results to return per page (1-100). Defaults to 50.

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

Cursor for the next page of results. Use the value from the next field in the previous response.

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

Field name to sort results by in ascending order only. Defaults to insertion order (oldest first) if not provided.

+ */ + @JsonSetter(value = "sort", nulls = Nulls.SKIP) + public Builder sort(@Nullable OptionalNullable sort) { + this.sort = sort; + return this; + } + + public Builder sort(OrganizationSortFieldEnum sort) { + this.sort = OptionalNullable.of(sort); + return this; + } + + public Builder sort(Optional sort) { + if (sort.isPresent()) { + this.sort = OptionalNullable.of(sort.get()); + } else { + this.sort = OptionalNullable.absent(); + } + return this; + } + + public Builder sort(com.auth0.client.mgmt.core.Nullable sort) { + if (sort.isNull()) { + this.sort = OptionalNullable.ofNull(); + } else if (sort.isEmpty()) { + this.sort = OptionalNullable.absent(); + } else { + this.sort = OptionalNullable.of(sort.get()); + } + return this; + } + + public SearchOrganizationsRequestParameters build() { + return new SearchOrganizationsRequestParameters(q, parser, take, from, sort, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SearchParserEnum.java b/src/main/java/com/auth0/client/mgmt/types/SearchParserEnum.java new file mode 100644 index 000000000..cc70fe540 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SearchParserEnum.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SearchParserEnum { + public static final SearchParserEnum SCIM = new SearchParserEnum(Value.SCIM, "scim"); + + public static final SearchParserEnum LUCENE = new SearchParserEnum(Value.LUCENE, "lucene"); + + private final Value value; + + private final String string; + + SearchParserEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SearchParserEnum && this.string.equals(((SearchParserEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SCIM: + return visitor.visitScim(); + case LUCENE: + return visitor.visitLucene(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SearchParserEnum valueOf(String value) { + switch (value) { + case "scim": + return SCIM; + case "lucene": + return LUCENE; + default: + return new SearchParserEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + SCIM, + + LUCENE, + + UNKNOWN + } + + public interface Visitor { + T visitScim(); + + T visitLucene(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/SearchResourceServersRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/SearchResourceServersRequestParameters.java new file mode 100644 index 000000000..1166f805c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SearchResourceServersRequestParameters.java @@ -0,0 +1,508 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.NullableNonemptyFilter; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.Nullable; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SearchResourceServersRequestParameters.Builder.class) +public final class SearchResourceServersRequestParameters { + private final OptionalNullable q; + + private final OptionalNullable parser; + + private final OptionalNullable fields; + + private final OptionalNullable includeFields; + + private final OptionalNullable take; + + private final OptionalNullable from; + + private final OptionalNullable sort; + + private final Map additionalProperties; + + private SearchResourceServersRequestParameters( + OptionalNullable q, + OptionalNullable parser, + OptionalNullable fields, + OptionalNullable includeFields, + OptionalNullable take, + OptionalNullable from, + OptionalNullable sort, + Map additionalProperties) { + this.q = q; + this.parser = parser; + this.fields = fields; + this.includeFields = includeFields; + this.take = take; + this.from = from; + this.sort = sort; + this.additionalProperties = additionalProperties; + } + + /** + * @return Filter expression in SCIM or Lucene syntax (depending on parser parameter). SCIM examples: name eq "My API", identifier sw "https://". SCIM operators: eq, ne, sw, ew, co, pr, gt, ge, lt, le, and, or. Supported Fields:
  • id - Filter by resource server ID
  • identifier - Filter by resource server identifier
  • name - Filter by resource server name
  • updated_at - Filter by last update date
Maximum 5 filter operations per query. Results are eventually consistent and may not reflect recent updates. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("q") + public OptionalNullable getQ() { + if (q == null) { + return OptionalNullable.absent(); + } + return q; + } + + /** + * @return Query parser to use for the filter expression. Use "scim" for SCIM filter syntax or "lucene" for Lucene query syntax (default). + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("parser") + public OptionalNullable getParser() { + if (parser == null) { + return OptionalNullable.absent(); + } + return parser; + } + + /** + * @return Comma-separated list of fields to include or exclude in the response. Works with the include_fields parameter to control projection mode. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + public OptionalNullable getFields() { + if (fields == null) { + return OptionalNullable.absent(); + } + return fields; + } + + /** + * @return Controls field projection mode. Set to true to include only fields specified in the fields parameter. Set to false to exclude fields specified in the fields parameter. Defaults to true if not specified. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + public OptionalNullable getIncludeFields() { + if (includeFields == null) { + return OptionalNullable.absent(); + } + return includeFields; + } + + /** + * @return Maximum number of results to return per page (1-100). Defaults to 50. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + public OptionalNullable getTake() { + if (take == null) { + return OptionalNullable.absent(); + } + return take; + } + + /** + * @return Cursor for the next page of results. Use the value from the next field in the previous response. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Field name to sort results by in ascending order only. Defaults to insertion order (oldest first) if not provided. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sort") + public OptionalNullable getSort() { + if (sort == null) { + return OptionalNullable.absent(); + } + return sort; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("q") + private OptionalNullable _getQ() { + return q; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("parser") + private OptionalNullable _getParser() { + return parser; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private OptionalNullable _getFields() { + return fields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("include_fields") + private OptionalNullable _getIncludeFields() { + return includeFields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("take") + private OptionalNullable _getTake() { + return take; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from") + private OptionalNullable _getFrom() { + return from; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sort") + private OptionalNullable _getSort() { + return sort; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SearchResourceServersRequestParameters + && equalTo((SearchResourceServersRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SearchResourceServersRequestParameters other) { + return q.equals(other.q) + && parser.equals(other.parser) + && fields.equals(other.fields) + && includeFields.equals(other.includeFields) + && take.equals(other.take) + && from.equals(other.from) + && sort.equals(other.sort); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.q, this.parser, this.fields, this.includeFields, this.take, this.from, this.sort); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private OptionalNullable q = OptionalNullable.absent(); + + private OptionalNullable parser = OptionalNullable.absent(); + + private OptionalNullable fields = OptionalNullable.absent(); + + private OptionalNullable includeFields = OptionalNullable.absent(); + + private OptionalNullable take = OptionalNullable.absent(); + + private OptionalNullable from = OptionalNullable.absent(); + + private OptionalNullable sort = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SearchResourceServersRequestParameters other) { + q(other.getQ()); + parser(other.getParser()); + fields(other.getFields()); + includeFields(other.getIncludeFields()); + take(other.getTake()); + from(other.getFrom()); + sort(other.getSort()); + return this; + } + + /** + *

Filter expression in SCIM or Lucene syntax (depending on parser parameter). SCIM examples: name eq "My API", identifier sw "https://". SCIM operators: eq, ne, sw, ew, co, pr, gt, ge, lt, le, and, or. Supported Fields:

  • id - Filter by resource server ID
  • identifier - Filter by resource server identifier
  • name - Filter by resource server name
  • updated_at - Filter by last update date
Maximum 5 filter operations per query. Results are eventually consistent and may not reflect recent updates.

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

Query parser to use for the filter expression. Use "scim" for SCIM filter syntax or "lucene" for Lucene query syntax (default).

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

Comma-separated list of fields to include or exclude in the response. Works with the include_fields parameter to control projection mode.

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

Controls field projection mode. Set to true to include only fields specified in the fields parameter. Set to false to exclude fields specified in the fields parameter. Defaults to true if not specified.

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

Maximum number of results to return per page (1-100). Defaults to 50.

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

Cursor for the next page of results. Use the value from the next field in the previous response.

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

Field name to sort results by in ascending order only. Defaults to insertion order (oldest first) if not provided.

+ */ + @JsonSetter(value = "sort", nulls = Nulls.SKIP) + public Builder sort(@Nullable OptionalNullable sort) { + this.sort = sort; + return this; + } + + public Builder sort(ResourceServerSortFieldEnum sort) { + this.sort = OptionalNullable.of(sort); + return this; + } + + public Builder sort(Optional sort) { + if (sort.isPresent()) { + this.sort = OptionalNullable.of(sort.get()); + } else { + this.sort = OptionalNullable.absent(); + } + return this; + } + + public Builder sort(com.auth0.client.mgmt.core.Nullable sort) { + if (sort.isNull()) { + this.sort = OptionalNullable.ofNull(); + } else if (sort.isEmpty()) { + this.sort = OptionalNullable.absent(); + } else { + this.sort = OptionalNullable.of(sort.get()); + } + return this; + } + + public SearchResourceServersRequestParameters build() { + return new SearchResourceServersRequestParameters( + q, parser, fields, includeFields, take, from, sort, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationTemplatesPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SearchResourceServersResponseContent.java similarity index 53% rename from src/main/java/com/auth0/client/mgmt/types/ListOrganizationTemplatesPaginatedResponseContent.java rename to src/main/java/com/auth0/client/mgmt/types/SearchResourceServersResponseContent.java index 1b7ea9d98..080a5602f 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ListOrganizationTemplatesPaginatedResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/SearchResourceServersResponseContent.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -19,41 +20,44 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ListOrganizationTemplatesPaginatedResponseContent.Builder.class) -public final class ListOrganizationTemplatesPaginatedResponseContent { - private final Optional next; +@JsonDeserialize(builder = SearchResourceServersResponseContent.Builder.class) +public final class SearchResourceServersResponseContent { + private final List resourceServers; - private final Optional> organizationTemplates; + private final Optional next; private final Map additionalProperties; - private ListOrganizationTemplatesPaginatedResponseContent( + private SearchResourceServersResponseContent( + List resourceServers, Optional next, - Optional> organizationTemplates, Map additionalProperties) { + this.resourceServers = resourceServers; this.next = next; - this.organizationTemplates = organizationTemplates; this.additionalProperties = additionalProperties; } /** - * @return A cursor to be used as the "from" query parameter for the next page of results. + * @return Array of resource server objects matching the search criteria. + */ + @JsonProperty("resource_servers") + public List getResourceServers() { + return resourceServers; + } + + /** + * @return Cursor for retrieving the next page of results. Omitted if there are no more results. */ @JsonProperty("next") public Optional getNext() { return next; } - @JsonProperty("organization_templates") - public Optional> getOrganizationTemplates() { - return organizationTemplates; - } - @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof ListOrganizationTemplatesPaginatedResponseContent - && equalTo((ListOrganizationTemplatesPaginatedResponseContent) other); + return other instanceof SearchResourceServersResponseContent + && equalTo((SearchResourceServersResponseContent) other); } @JsonAnyGetter @@ -61,13 +65,13 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(ListOrganizationTemplatesPaginatedResponseContent other) { - return next.equals(other.next) && organizationTemplates.equals(other.organizationTemplates); + private boolean equalTo(SearchResourceServersResponseContent other) { + return resourceServers.equals(other.resourceServers) && next.equals(other.next); } @java.lang.Override public int hashCode() { - return Objects.hash(this.next, this.organizationTemplates); + return Objects.hash(this.resourceServers, this.next); } @java.lang.Override @@ -81,49 +85,61 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional next = Optional.empty(); + private List resourceServers = new ArrayList<>(); - private Optional> organizationTemplates = Optional.empty(); + private Optional next = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - public Builder from(ListOrganizationTemplatesPaginatedResponseContent other) { + public Builder from(SearchResourceServersResponseContent other) { + resourceServers(other.getResourceServers()); next(other.getNext()); - organizationTemplates(other.getOrganizationTemplates()); return this; } /** - *

A cursor to be used as the "from" query parameter for the next page of results.

+ *

Array of resource server objects matching the search criteria.

*/ - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; + @JsonSetter(value = "resource_servers", nulls = Nulls.SKIP) + public Builder resourceServers(List resourceServers) { + this.resourceServers.clear(); + if (resourceServers != null) { + this.resourceServers.addAll(resourceServers); + } return this; } - public Builder next(String next) { - this.next = Optional.ofNullable(next); + public Builder addResourceServers(ResourceServerSearchResponse resourceServers) { + this.resourceServers.add(resourceServers); + return this; + } + + public Builder addAllResourceServers(List resourceServers) { + if (resourceServers != null) { + this.resourceServers.addAll(resourceServers); + } return this; } - @JsonSetter(value = "organization_templates", nulls = Nulls.SKIP) - public Builder organizationTemplates(Optional> organizationTemplates) { - this.organizationTemplates = organizationTemplates; + /** + *

Cursor for retrieving the next page of results. Omitted if there are no more results.

+ */ + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; return this; } - public Builder organizationTemplates(List organizationTemplates) { - this.organizationTemplates = Optional.ofNullable(organizationTemplates); + public Builder next(String next) { + this.next = Optional.ofNullable(next); return this; } - public ListOrganizationTemplatesPaginatedResponseContent build() { - return new ListOrganizationTemplatesPaginatedResponseContent( - next, organizationTemplates, additionalProperties); + public SearchResourceServersResponseContent build() { + return new SearchResourceServersResponseContent(resourceServers, next, additionalProperties); } public Builder additionalProperty(String key, Object value) { diff --git a/src/main/java/com/auth0/client/mgmt/types/SetEmailFactorSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetEmailFactorSettingsResponseContent.java new file mode 100644 index 000000000..914e4ad33 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetEmailFactorSettingsResponseContent.java @@ -0,0 +1,161 @@ +/** + * 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; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetEmailFactorSettingsResponseContent.Builder.class) +public final class SetEmailFactorSettingsResponseContent { + private final int otpLength; + + private final int otpExpirationTime; + + private final Map additionalProperties; + + private SetEmailFactorSettingsResponseContent( + 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 SetEmailFactorSettingsResponseContent + && equalTo((SetEmailFactorSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetEmailFactorSettingsResponseContent 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(SetEmailFactorSettingsResponseContent other); + } + + public interface OtpExpirationTimeStage { + /** + *

The OTP expiration time in seconds.

+ */ + _FinalStage otpExpirationTime(int otpExpirationTime); + } + + public interface _FinalStage { + SetEmailFactorSettingsResponseContent 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(SetEmailFactorSettingsResponseContent 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 SetEmailFactorSettingsResponseContent build() { + return new SetEmailFactorSettingsResponseContent(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/SetGuardianSettingsRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianSettingsRequestContent.java new file mode 100644 index 000000000..90c378223 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianSettingsRequestContent.java @@ -0,0 +1,245 @@ +/** + * 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; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianSettingsRequestContent.Builder.class) +public final class SetGuardianSettingsRequestContent { + private final boolean displayRememberMeCheckbox; + + private final boolean rememberMeDefaultValue; + + private final int mfaSessionInactivityTimeout; + + private final int mfaSessionOverallTimeout; + + private final Map additionalProperties; + + private SetGuardianSettingsRequestContent( + boolean displayRememberMeCheckbox, + boolean rememberMeDefaultValue, + int mfaSessionInactivityTimeout, + int mfaSessionOverallTimeout, + Map additionalProperties) { + this.displayRememberMeCheckbox = displayRememberMeCheckbox; + this.rememberMeDefaultValue = rememberMeDefaultValue; + this.mfaSessionInactivityTimeout = mfaSessionInactivityTimeout; + this.mfaSessionOverallTimeout = mfaSessionOverallTimeout; + this.additionalProperties = additionalProperties; + } + + /** + * @return Determines whether to display the "Remember Me" checkbox on the MFA prompt in Universal Login. + */ + @JsonProperty("display_remember_me_checkbox") + public boolean getDisplayRememberMeCheckbox() { + return displayRememberMeCheckbox; + } + + /** + * @return Determines the default state of the "Remember Me" checkbox on the MFA prompt in Universal Login. + */ + @JsonProperty("remember_me_default_value") + public boolean getRememberMeDefaultValue() { + return rememberMeDefaultValue; + } + + /** + * @return Duration of inactivity after which the user will be prompted for MFA. Represented as seconds. Minimum duration is 1 hour, maximum is 30 days, and cannot exceed the overall timeout. + */ + @JsonProperty("mfa_session_inactivity_timeout") + public int getMfaSessionInactivityTimeout() { + return mfaSessionInactivityTimeout; + } + + /** + * @return Maximum duration after which the user will be prompted for MFA regardless of activity. Represented as seconds. Minimum duration is 1 hour, maximum is 90 days. + */ + @JsonProperty("mfa_session_overall_timeout") + public int getMfaSessionOverallTimeout() { + return mfaSessionOverallTimeout; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianSettingsRequestContent && equalTo((SetGuardianSettingsRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianSettingsRequestContent other) { + return displayRememberMeCheckbox == other.displayRememberMeCheckbox + && rememberMeDefaultValue == other.rememberMeDefaultValue + && mfaSessionInactivityTimeout == other.mfaSessionInactivityTimeout + && mfaSessionOverallTimeout == other.mfaSessionOverallTimeout; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.displayRememberMeCheckbox, + this.rememberMeDefaultValue, + this.mfaSessionInactivityTimeout, + this.mfaSessionOverallTimeout); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DisplayRememberMeCheckboxStage builder() { + return new Builder(); + } + + public interface DisplayRememberMeCheckboxStage { + /** + *

Determines whether to display the "Remember Me" checkbox on the MFA prompt in Universal Login.

+ */ + RememberMeDefaultValueStage displayRememberMeCheckbox(boolean displayRememberMeCheckbox); + + Builder from(SetGuardianSettingsRequestContent other); + } + + public interface RememberMeDefaultValueStage { + /** + *

Determines the default state of the "Remember Me" checkbox on the MFA prompt in Universal Login.

+ */ + MfaSessionInactivityTimeoutStage rememberMeDefaultValue(boolean rememberMeDefaultValue); + } + + public interface MfaSessionInactivityTimeoutStage { + /** + *

Duration of inactivity after which the user will be prompted for MFA. Represented as seconds. Minimum duration is 1 hour, maximum is 30 days, and cannot exceed the overall timeout.

+ */ + MfaSessionOverallTimeoutStage mfaSessionInactivityTimeout(int mfaSessionInactivityTimeout); + } + + public interface MfaSessionOverallTimeoutStage { + /** + *

Maximum duration after which the user will be prompted for MFA regardless of activity. Represented as seconds. Minimum duration is 1 hour, maximum is 90 days.

+ */ + _FinalStage mfaSessionOverallTimeout(int mfaSessionOverallTimeout); + } + + public interface _FinalStage { + SetGuardianSettingsRequestContent build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements DisplayRememberMeCheckboxStage, + RememberMeDefaultValueStage, + MfaSessionInactivityTimeoutStage, + MfaSessionOverallTimeoutStage, + _FinalStage { + private boolean displayRememberMeCheckbox; + + private boolean rememberMeDefaultValue; + + private int mfaSessionInactivityTimeout; + + private int mfaSessionOverallTimeout; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SetGuardianSettingsRequestContent other) { + displayRememberMeCheckbox(other.getDisplayRememberMeCheckbox()); + rememberMeDefaultValue(other.getRememberMeDefaultValue()); + mfaSessionInactivityTimeout(other.getMfaSessionInactivityTimeout()); + mfaSessionOverallTimeout(other.getMfaSessionOverallTimeout()); + return this; + } + + /** + *

Determines whether to display the "Remember Me" checkbox on the MFA prompt in Universal Login.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("display_remember_me_checkbox") + public RememberMeDefaultValueStage displayRememberMeCheckbox(boolean displayRememberMeCheckbox) { + this.displayRememberMeCheckbox = displayRememberMeCheckbox; + return this; + } + + /** + *

Determines the default state of the "Remember Me" checkbox on the MFA prompt in Universal Login.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("remember_me_default_value") + public MfaSessionInactivityTimeoutStage rememberMeDefaultValue(boolean rememberMeDefaultValue) { + this.rememberMeDefaultValue = rememberMeDefaultValue; + return this; + } + + /** + *

Duration of inactivity after which the user will be prompted for MFA. Represented as seconds. Minimum duration is 1 hour, maximum is 30 days, and cannot exceed the overall timeout.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("mfa_session_inactivity_timeout") + public MfaSessionOverallTimeoutStage mfaSessionInactivityTimeout(int mfaSessionInactivityTimeout) { + this.mfaSessionInactivityTimeout = mfaSessionInactivityTimeout; + return this; + } + + /** + *

Maximum duration after which the user will be prompted for MFA regardless of activity. Represented as seconds. Minimum duration is 1 hour, maximum is 90 days.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("mfa_session_overall_timeout") + public _FinalStage mfaSessionOverallTimeout(int mfaSessionOverallTimeout) { + this.mfaSessionOverallTimeout = mfaSessionOverallTimeout; + return this; + } + + @java.lang.Override + public SetGuardianSettingsRequestContent build() { + return new SetGuardianSettingsRequestContent( + displayRememberMeCheckbox, + rememberMeDefaultValue, + mfaSessionInactivityTimeout, + mfaSessionOverallTimeout, + 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/SetGuardianSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetGuardianSettingsResponseContent.java new file mode 100644 index 000000000..f84a3cfec --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetGuardianSettingsResponseContent.java @@ -0,0 +1,246 @@ +/** + * 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; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetGuardianSettingsResponseContent.Builder.class) +public final class SetGuardianSettingsResponseContent { + private final boolean displayRememberMeCheckbox; + + private final boolean rememberMeDefaultValue; + + private final int mfaSessionInactivityTimeout; + + private final int mfaSessionOverallTimeout; + + private final Map additionalProperties; + + private SetGuardianSettingsResponseContent( + boolean displayRememberMeCheckbox, + boolean rememberMeDefaultValue, + int mfaSessionInactivityTimeout, + int mfaSessionOverallTimeout, + Map additionalProperties) { + this.displayRememberMeCheckbox = displayRememberMeCheckbox; + this.rememberMeDefaultValue = rememberMeDefaultValue; + this.mfaSessionInactivityTimeout = mfaSessionInactivityTimeout; + this.mfaSessionOverallTimeout = mfaSessionOverallTimeout; + this.additionalProperties = additionalProperties; + } + + /** + * @return Determines whether to display the "Remember Me" checkbox on the MFA prompt in Universal Login. + */ + @JsonProperty("display_remember_me_checkbox") + public boolean getDisplayRememberMeCheckbox() { + return displayRememberMeCheckbox; + } + + /** + * @return Determines the default state of the "Remember Me" checkbox on the MFA prompt in Universal Login. + */ + @JsonProperty("remember_me_default_value") + public boolean getRememberMeDefaultValue() { + return rememberMeDefaultValue; + } + + /** + * @return Duration of inactivity after which the user will be prompted for MFA. Represented as seconds. Minimum duration is 1 hour, maximum is 30 days, and cannot exceed the overall timeout. + */ + @JsonProperty("mfa_session_inactivity_timeout") + public int getMfaSessionInactivityTimeout() { + return mfaSessionInactivityTimeout; + } + + /** + * @return Maximum duration after which the user will be prompted for MFA regardless of activity. Represented as seconds. Minimum duration is 1 hour, maximum is 90 days. + */ + @JsonProperty("mfa_session_overall_timeout") + public int getMfaSessionOverallTimeout() { + return mfaSessionOverallTimeout; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SetGuardianSettingsResponseContent + && equalTo((SetGuardianSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetGuardianSettingsResponseContent other) { + return displayRememberMeCheckbox == other.displayRememberMeCheckbox + && rememberMeDefaultValue == other.rememberMeDefaultValue + && mfaSessionInactivityTimeout == other.mfaSessionInactivityTimeout + && mfaSessionOverallTimeout == other.mfaSessionOverallTimeout; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.displayRememberMeCheckbox, + this.rememberMeDefaultValue, + this.mfaSessionInactivityTimeout, + this.mfaSessionOverallTimeout); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DisplayRememberMeCheckboxStage builder() { + return new Builder(); + } + + public interface DisplayRememberMeCheckboxStage { + /** + *

Determines whether to display the "Remember Me" checkbox on the MFA prompt in Universal Login.

+ */ + RememberMeDefaultValueStage displayRememberMeCheckbox(boolean displayRememberMeCheckbox); + + Builder from(SetGuardianSettingsResponseContent other); + } + + public interface RememberMeDefaultValueStage { + /** + *

Determines the default state of the "Remember Me" checkbox on the MFA prompt in Universal Login.

+ */ + MfaSessionInactivityTimeoutStage rememberMeDefaultValue(boolean rememberMeDefaultValue); + } + + public interface MfaSessionInactivityTimeoutStage { + /** + *

Duration of inactivity after which the user will be prompted for MFA. Represented as seconds. Minimum duration is 1 hour, maximum is 30 days, and cannot exceed the overall timeout.

+ */ + MfaSessionOverallTimeoutStage mfaSessionInactivityTimeout(int mfaSessionInactivityTimeout); + } + + public interface MfaSessionOverallTimeoutStage { + /** + *

Maximum duration after which the user will be prompted for MFA regardless of activity. Represented as seconds. Minimum duration is 1 hour, maximum is 90 days.

+ */ + _FinalStage mfaSessionOverallTimeout(int mfaSessionOverallTimeout); + } + + public interface _FinalStage { + SetGuardianSettingsResponseContent build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements DisplayRememberMeCheckboxStage, + RememberMeDefaultValueStage, + MfaSessionInactivityTimeoutStage, + MfaSessionOverallTimeoutStage, + _FinalStage { + private boolean displayRememberMeCheckbox; + + private boolean rememberMeDefaultValue; + + private int mfaSessionInactivityTimeout; + + private int mfaSessionOverallTimeout; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SetGuardianSettingsResponseContent other) { + displayRememberMeCheckbox(other.getDisplayRememberMeCheckbox()); + rememberMeDefaultValue(other.getRememberMeDefaultValue()); + mfaSessionInactivityTimeout(other.getMfaSessionInactivityTimeout()); + mfaSessionOverallTimeout(other.getMfaSessionOverallTimeout()); + return this; + } + + /** + *

Determines whether to display the "Remember Me" checkbox on the MFA prompt in Universal Login.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("display_remember_me_checkbox") + public RememberMeDefaultValueStage displayRememberMeCheckbox(boolean displayRememberMeCheckbox) { + this.displayRememberMeCheckbox = displayRememberMeCheckbox; + return this; + } + + /** + *

Determines the default state of the "Remember Me" checkbox on the MFA prompt in Universal Login.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("remember_me_default_value") + public MfaSessionInactivityTimeoutStage rememberMeDefaultValue(boolean rememberMeDefaultValue) { + this.rememberMeDefaultValue = rememberMeDefaultValue; + return this; + } + + /** + *

Duration of inactivity after which the user will be prompted for MFA. Represented as seconds. Minimum duration is 1 hour, maximum is 30 days, and cannot exceed the overall timeout.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("mfa_session_inactivity_timeout") + public MfaSessionOverallTimeoutStage mfaSessionInactivityTimeout(int mfaSessionInactivityTimeout) { + this.mfaSessionInactivityTimeout = mfaSessionInactivityTimeout; + return this; + } + + /** + *

Maximum duration after which the user will be prompted for MFA regardless of activity. Represented as seconds. Minimum duration is 1 hour, maximum is 90 days.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("mfa_session_overall_timeout") + public _FinalStage mfaSessionOverallTimeout(int mfaSessionOverallTimeout) { + this.mfaSessionOverallTimeout = mfaSessionOverallTimeout; + return this; + } + + @java.lang.Override + public SetGuardianSettingsResponseContent build() { + return new SetGuardianSettingsResponseContent( + displayRememberMeCheckbox, + rememberMeDefaultValue, + mfaSessionInactivityTimeout, + mfaSessionOverallTimeout, + 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/SetPhoneFactorSettingsResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/SetPhoneFactorSettingsResponseContent.java new file mode 100644 index 000000000..81050564c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/SetPhoneFactorSettingsResponseContent.java @@ -0,0 +1,161 @@ +/** + * 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; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SetPhoneFactorSettingsResponseContent.Builder.class) +public final class SetPhoneFactorSettingsResponseContent { + private final int otpLength; + + private final int otpExpirationTime; + + private final Map additionalProperties; + + private SetPhoneFactorSettingsResponseContent( + 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 SetPhoneFactorSettingsResponseContent + && equalTo((SetPhoneFactorSettingsResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SetPhoneFactorSettingsResponseContent 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(SetPhoneFactorSettingsResponseContent other); + } + + public interface OtpExpirationTimeStage { + /** + *

The OTP expiration time in seconds.

+ */ + _FinalStage otpExpirationTime(int otpExpirationTime); + } + + public interface _FinalStage { + SetPhoneFactorSettingsResponseContent 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(SetPhoneFactorSettingsResponseContent 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 SetPhoneFactorSettingsResponseContent build() { + return new SetPhoneFactorSettingsResponseContent(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/TenantSettingsSessions.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsSessions.java index 0795c4c35..33e7c95e2 100644 --- a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsSessions.java +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsSessions.java @@ -3,7 +3,9 @@ */ package com.auth0.client.mgmt.types; +import com.auth0.client.mgmt.core.NullableNonemptyFilter; import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -16,17 +18,23 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; +import org.jetbrains.annotations.Nullable; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TenantSettingsSessions.Builder.class) public final class TenantSettingsSessions { private final Optional oidcLogoutPromptEnabled; + private final OptionalNullable anonymous; + private final Map additionalProperties; private TenantSettingsSessions( - Optional oidcLogoutPromptEnabled, Map additionalProperties) { + Optional oidcLogoutPromptEnabled, + OptionalNullable anonymous, + Map additionalProperties) { this.oidcLogoutPromptEnabled = oidcLogoutPromptEnabled; + this.anonymous = anonymous; this.additionalProperties = additionalProperties; } @@ -38,6 +46,21 @@ public Optional getOidcLogoutPromptEnabled() { return oidcLogoutPromptEnabled; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("anonymous") + public OptionalNullable getAnonymous() { + if (anonymous == null) { + return OptionalNullable.absent(); + } + return anonymous; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("anonymous") + private OptionalNullable _getAnonymous() { + return anonymous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -50,12 +73,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(TenantSettingsSessions other) { - return oidcLogoutPromptEnabled.equals(other.oidcLogoutPromptEnabled); + return oidcLogoutPromptEnabled.equals(other.oidcLogoutPromptEnabled) && anonymous.equals(other.anonymous); } @java.lang.Override public int hashCode() { - return Objects.hash(this.oidcLogoutPromptEnabled); + return Objects.hash(this.oidcLogoutPromptEnabled, this.anonymous); } @java.lang.Override @@ -71,6 +94,8 @@ public static Builder builder() { public static final class Builder { private Optional oidcLogoutPromptEnabled = Optional.empty(); + private OptionalNullable anonymous = OptionalNullable.absent(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -78,6 +103,7 @@ private Builder() {} public Builder from(TenantSettingsSessions other) { oidcLogoutPromptEnabled(other.getOidcLogoutPromptEnabled()); + anonymous(other.getAnonymous()); return this; } @@ -95,8 +121,39 @@ public Builder oidcLogoutPromptEnabled(Boolean oidcLogoutPromptEnabled) { return this; } + @JsonSetter(value = "anonymous", nulls = Nulls.SKIP) + public Builder anonymous(@Nullable OptionalNullable anonymous) { + this.anonymous = anonymous; + return this; + } + + public Builder anonymous(TenantSettingsSessionsAnonymous anonymous) { + this.anonymous = OptionalNullable.of(anonymous); + return this; + } + + public Builder anonymous(Optional anonymous) { + if (anonymous.isPresent()) { + this.anonymous = OptionalNullable.of(anonymous.get()); + } else { + this.anonymous = OptionalNullable.absent(); + } + return this; + } + + public Builder anonymous(com.auth0.client.mgmt.core.Nullable anonymous) { + if (anonymous.isNull()) { + this.anonymous = OptionalNullable.ofNull(); + } else if (anonymous.isEmpty()) { + this.anonymous = OptionalNullable.absent(); + } else { + this.anonymous = OptionalNullable.of(anonymous.get()); + } + return this; + } + public TenantSettingsSessions build() { - return new TenantSettingsSessions(oidcLogoutPromptEnabled, additionalProperties); + return new TenantSettingsSessions(oidcLogoutPromptEnabled, anonymous, additionalProperties); } public Builder additionalProperty(String key, Object value) { diff --git a/src/main/java/com/auth0/client/mgmt/types/TenantSettingsSessionsAnonymous.java b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsSessionsAnonymous.java new file mode 100644 index 000000000..a38217929 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/TenantSettingsSessionsAnonymous.java @@ -0,0 +1,142 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TenantSettingsSessionsAnonymous.Builder.class) +public final class TenantSettingsSessionsAnonymous { + private final Optional lifetimeInMinutes; + + private final Optional activateCookie; + + private final Map additionalProperties; + + private TenantSettingsSessionsAnonymous( + Optional lifetimeInMinutes, + Optional activateCookie, + Map additionalProperties) { + this.lifetimeInMinutes = lifetimeInMinutes; + this.activateCookie = activateCookie; + this.additionalProperties = additionalProperties; + } + + /** + * @return Anonymous session lifetime, in minutes. Defaults to 43200 (30 days); maximum 525600 (1 year). + */ + @JsonProperty("lifetime_in_minutes") + public Optional getLifetimeInMinutes() { + return lifetimeInMinutes; + } + + /** + * @return Whether anonymous session requests return the auth0_anon cookie. Defaults to enabled; set to false to stop issuing the cookie. + */ + @JsonProperty("activate_cookie") + public Optional getActivateCookie() { + return activateCookie; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TenantSettingsSessionsAnonymous && equalTo((TenantSettingsSessionsAnonymous) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TenantSettingsSessionsAnonymous other) { + return lifetimeInMinutes.equals(other.lifetimeInMinutes) && activateCookie.equals(other.activateCookie); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.lifetimeInMinutes, this.activateCookie); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional lifetimeInMinutes = Optional.empty(); + + private Optional activateCookie = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TenantSettingsSessionsAnonymous other) { + lifetimeInMinutes(other.getLifetimeInMinutes()); + activateCookie(other.getActivateCookie()); + return this; + } + + /** + *

Anonymous session lifetime, in minutes. Defaults to 43200 (30 days); maximum 525600 (1 year).

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

Whether anonymous session requests return the auth0_anon cookie. Defaults to enabled; set to false to stop issuing the cookie.

+ */ + @JsonSetter(value = "activate_cookie", nulls = Nulls.SKIP) + public Builder activateCookie(Optional activateCookie) { + this.activateCookie = activateCookie; + return this; + } + + public Builder activateCookie(Boolean activateCookie) { + this.activateCookie = Optional.ofNullable(activateCookie); + return this; + } + + public TenantSettingsSessionsAnonymous build() { + return new TenantSettingsSessionsAnonymous(lifetimeInMinutes, activateCookie, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateAnonymousSessions.java b/src/main/java/com/auth0/client/mgmt/types/UpdateAnonymousSessions.java new file mode 100644 index 000000000..66128e82b --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateAnonymousSessions.java @@ -0,0 +1,127 @@ +/** + * 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; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateAnonymousSessions.Builder.class) +public final class UpdateAnonymousSessions { + private final boolean active; + + private final Map additionalProperties; + + private UpdateAnonymousSessions(boolean active, Map additionalProperties) { + this.active = active; + this.additionalProperties = additionalProperties; + } + + /** + * @return If set to true, this client is allowed to create anonymous sessions. + */ + @JsonProperty("active") + public boolean getActive() { + return active; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateAnonymousSessions && equalTo((UpdateAnonymousSessions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateAnonymousSessions other) { + return active == other.active; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.active); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActiveStage builder() { + return new Builder(); + } + + public interface ActiveStage { + /** + *

If set to true, this client is allowed to create anonymous sessions.

+ */ + _FinalStage active(boolean active); + + Builder from(UpdateAnonymousSessions other); + } + + public interface _FinalStage { + UpdateAnonymousSessions build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActiveStage, _FinalStage { + private boolean active; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdateAnonymousSessions other) { + active(other.getActive()); + return this; + } + + /** + *

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("active") + public _FinalStage active(boolean active) { + this.active = active; + return this; + } + + @java.lang.Override + public UpdateAnonymousSessions build() { + return new UpdateAnonymousSessions(active, 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/UpdateClientRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateClientRequestContent.java index 1e9016127..2e8d201bd 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateClientRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateClientRequestContent.java @@ -84,6 +84,8 @@ public final class UpdateClientRequestContent { private final OptionalNullable identityAssertionAuthorizationGrant; + private final OptionalNullable anonymousSessions; + private final Optional formTemplate; private final Optional addons; @@ -171,6 +173,7 @@ private UpdateClientRequestContent( Optional customLoginPagePreview, OptionalNullable tokenQuota, OptionalNullable identityAssertionAuthorizationGrant, + OptionalNullable anonymousSessions, Optional formTemplate, Optional addons, Optional> clientMetadata, @@ -229,6 +232,7 @@ private UpdateClientRequestContent( this.customLoginPagePreview = customLoginPagePreview; this.tokenQuota = tokenQuota; this.identityAssertionAuthorizationGrant = identityAssertionAuthorizationGrant; + this.anonymousSessions = anonymousSessions; this.formTemplate = formTemplate; this.addons = addons; this.clientMetadata = clientMetadata; @@ -502,6 +506,15 @@ public OptionalNullable getIdentityAs return identityAssertionAuthorizationGrant; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("anonymous_sessions") + public OptionalNullable getAnonymousSessions() { + if (anonymousSessions == null) { + return OptionalNullable.absent(); + } + return anonymousSessions; + } + /** * @return Form template for WS-Federation protocol */ @@ -759,6 +772,12 @@ private OptionalNullable _getIdentity return identityAssertionAuthorizationGrant; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("anonymous_sessions") + private OptionalNullable _getAnonymousSessions() { + return anonymousSessions; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("native_social_login") private OptionalNullable _getNativeSocialLogin() { @@ -891,6 +910,7 @@ private boolean equalTo(UpdateClientRequestContent other) { && customLoginPagePreview.equals(other.customLoginPagePreview) && tokenQuota.equals(other.tokenQuota) && identityAssertionAuthorizationGrant.equals(other.identityAssertionAuthorizationGrant) + && anonymousSessions.equals(other.anonymousSessions) && formTemplate.equals(other.formTemplate) && addons.equals(other.addons) && clientMetadata.equals(other.clientMetadata) @@ -954,6 +974,7 @@ public int hashCode() { this.customLoginPagePreview, this.tokenQuota, this.identityAssertionAuthorizationGrant, + this.anonymousSessions, this.formTemplate, this.addons, this.clientMetadata, @@ -1056,6 +1077,8 @@ public static final class Builder { private OptionalNullable identityAssertionAuthorizationGrant = OptionalNullable.absent(); + private OptionalNullable anonymousSessions = OptionalNullable.absent(); + private Optional formTemplate = Optional.empty(); private Optional addons = Optional.empty(); @@ -1151,6 +1174,7 @@ public Builder from(UpdateClientRequestContent other) { customLoginPagePreview(other.getCustomLoginPagePreview()); tokenQuota(other.getTokenQuota()); identityAssertionAuthorizationGrant(other.getIdentityAssertionAuthorizationGrant()); + anonymousSessions(other.getAnonymousSessions()); formTemplate(other.getFormTemplate()); addons(other.getAddons()); clientMetadata(other.getClientMetadata()); @@ -1713,6 +1737,38 @@ public Builder identityAssertionAuthorizationGrant( return this; } + @JsonSetter(value = "anonymous_sessions", nulls = Nulls.SKIP) + public Builder anonymousSessions(@Nullable OptionalNullable anonymousSessions) { + this.anonymousSessions = anonymousSessions; + return this; + } + + public Builder anonymousSessions(UpdateAnonymousSessions anonymousSessions) { + this.anonymousSessions = OptionalNullable.of(anonymousSessions); + return this; + } + + public Builder anonymousSessions(Optional anonymousSessions) { + if (anonymousSessions.isPresent()) { + this.anonymousSessions = OptionalNullable.of(anonymousSessions.get()); + } else { + this.anonymousSessions = OptionalNullable.absent(); + } + return this; + } + + public Builder anonymousSessions( + com.auth0.client.mgmt.core.Nullable anonymousSessions) { + if (anonymousSessions.isNull()) { + this.anonymousSessions = OptionalNullable.ofNull(); + } else if (anonymousSessions.isEmpty()) { + this.anonymousSessions = OptionalNullable.absent(); + } else { + this.anonymousSessions = OptionalNullable.of(anonymousSessions.get()); + } + return this; + } + /** *

Form template for WS-Federation protocol

*/ @@ -2407,6 +2463,7 @@ public UpdateClientRequestContent build() { customLoginPagePreview, tokenQuota, identityAssertionAuthorizationGrant, + anonymousSessions, formTemplate, addons, clientMetadata, diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateClientResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateClientResponseContent.java index 7ccfb1964..2d9ecb582 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateClientResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateClientResponseContent.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 UpdateClientResponseContent { 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 UpdateClientResponseContent { private final Optional identityAssertionAuthorizationGrant; + private final Optional anonymousSessions; + private final Optional thirdPartySecurityMode; private final Optional redirectionPolicy; @@ -158,6 +165,8 @@ public final class UpdateClientResponseContent { private UpdateClientResponseContent( Optional clientId, + Optional createdAt, + Optional updatedAt, Optional tenant, Optional name, Optional description, @@ -214,6 +223,7 @@ private UpdateClientResponseContent( Optional b2BIntegrationConfiguration, Optional myOrganizationConfiguration, Optional identityAssertionAuthorizationGrant, + Optional anonymousSessions, Optional thirdPartySecurityMode, Optional redirectionPolicy, Optional resourceServerIdentifier, @@ -224,6 +234,8 @@ private UpdateClientResponseContent( Optional jwksUri, Map additionalProperties) { this.clientId = clientId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; this.tenant = tenant; this.name = name; this.description = description; @@ -280,6 +292,7 @@ private UpdateClientResponseContent( this.b2BIntegrationConfiguration = b2BIntegrationConfiguration; this.myOrganizationConfiguration = myOrganizationConfiguration; this.identityAssertionAuthorizationGrant = identityAssertionAuthorizationGrant; + this.anonymousSessions = anonymousSessions; this.thirdPartySecurityMode = thirdPartySecurityMode; this.redirectionPolicy = redirectionPolicy; this.resourceServerIdentifier = resourceServerIdentifier; @@ -299,6 +312,22 @@ public Optional getClientId() { return clientId; } + /** + * @return The ISO 8601 timestamp of when this client was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The ISO 8601 timestamp of when this client was last updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + /** * @return Name of the tenant this client belongs to. */ @@ -703,6 +732,11 @@ public Optional getIdentityAssertionAuthori return identityAssertionAuthorizationGrant; } + @JsonProperty("anonymous_sessions") + public Optional getAnonymousSessions() { + return anonymousSessions; + } + @JsonProperty("third_party_security_mode") public Optional getThirdPartySecurityMode() { return thirdPartySecurityMode; @@ -813,6 +847,8 @@ public Map getAdditionalProperties() { private boolean equalTo(UpdateClientResponseContent other) { return clientId.equals(other.clientId) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt) && tenant.equals(other.tenant) && name.equals(other.name) && description.equals(other.description) @@ -870,6 +906,7 @@ private boolean equalTo(UpdateClientResponseContent other) { && b2BIntegrationConfiguration.equals(other.b2BIntegrationConfiguration) && myOrganizationConfiguration.equals(other.myOrganizationConfiguration) && identityAssertionAuthorizationGrant.equals(other.identityAssertionAuthorizationGrant) + && anonymousSessions.equals(other.anonymousSessions) && thirdPartySecurityMode.equals(other.thirdPartySecurityMode) && redirectionPolicy.equals(other.redirectionPolicy) && resourceServerIdentifier.equals(other.resourceServerIdentifier) @@ -884,6 +921,8 @@ private boolean equalTo(UpdateClientResponseContent other) { public int hashCode() { return Objects.hash( this.clientId, + this.createdAt, + this.updatedAt, this.tenant, this.name, this.description, @@ -940,6 +979,7 @@ public int hashCode() { this.b2BIntegrationConfiguration, this.myOrganizationConfiguration, this.identityAssertionAuthorizationGrant, + this.anonymousSessions, this.thirdPartySecurityMode, this.redirectionPolicy, this.resourceServerIdentifier, @@ -963,6 +1003,10 @@ public static Builder builder() { public static final class Builder { private Optional clientId = Optional.empty(); + private Optional createdAt = Optional.empty(); + + private Optional updatedAt = Optional.empty(); + private Optional tenant = Optional.empty(); private Optional name = Optional.empty(); @@ -1076,6 +1120,8 @@ public static final class Builder { private Optional identityAssertionAuthorizationGrant = Optional.empty(); + private Optional anonymousSessions = Optional.empty(); + private Optional thirdPartySecurityMode = Optional.empty(); private Optional redirectionPolicy = Optional.empty(); @@ -1100,6 +1146,8 @@ private Builder() {} public Builder from(UpdateClientResponseContent other) { clientId(other.getClientId()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); tenant(other.getTenant()); name(other.getName()); description(other.getDescription()); @@ -1156,6 +1204,7 @@ public Builder from(UpdateClientResponseContent other) { b2BIntegrationConfiguration(other.getB2BIntegrationConfiguration()); myOrganizationConfiguration(other.getMyOrganizationConfiguration()); identityAssertionAuthorizationGrant(other.getIdentityAssertionAuthorizationGrant()); + anonymousSessions(other.getAnonymousSessions()); thirdPartySecurityMode(other.getThirdPartySecurityMode()); redirectionPolicy(other.getRedirectionPolicy()); resourceServerIdentifier(other.getResourceServerIdentifier()); @@ -1181,6 +1230,34 @@ public Builder clientId(String clientId) { return this; } + /** + *

The ISO 8601 timestamp of when this client was created.

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

The ISO 8601 timestamp of when this client was last updated.

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

Name of the tenant this client belongs to.

*/ @@ -2065,6 +2142,17 @@ public Builder identityAssertionAuthorizationGrant( return this; } + @JsonSetter(value = "anonymous_sessions", nulls = Nulls.SKIP) + public Builder anonymousSessions(Optional anonymousSessions) { + this.anonymousSessions = anonymousSessions; + return this; + } + + public Builder anonymousSessions(AnonymousSessions anonymousSessions) { + this.anonymousSessions = Optional.ofNullable(anonymousSessions); + return this; + } + @JsonSetter(value = "third_party_security_mode", nulls = Nulls.SKIP) public Builder thirdPartySecurityMode(Optional thirdPartySecurityMode) { this.thirdPartySecurityMode = thirdPartySecurityMode; @@ -2168,6 +2256,8 @@ public Builder jwksUri(String jwksUri) { public UpdateClientResponseContent build() { return new UpdateClientResponseContent( clientId, + createdAt, + updatedAt, tenant, name, description, @@ -2224,6 +2314,7 @@ public UpdateClientResponseContent build() { b2BIntegrationConfiguration, myOrganizationConfiguration, identityAssertionAuthorizationGrant, + anonymousSessions, thirdPartySecurityMode, redirectionPolicy, resourceServerIdentifier, diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationTemplateRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationTemplateRequestContent.java deleted file mode 100644 index 80acc177f..000000000 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateOrganizationTemplateRequestContent.java +++ /dev/null @@ -1,706 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.auth0.client.mgmt.types; - -import com.auth0.client.mgmt.core.NullableNonemptyFilter; -import com.auth0.client.mgmt.core.ObjectMappers; -import com.auth0.client.mgmt.core.OptionalNullable; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.Nullable; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = UpdateOrganizationTemplateRequestContent.Builder.class) -public final class UpdateOrganizationTemplateRequestContent { - private final Optional name; - - private final Optional isDefault; - - private final Optional organizationDeletionBehavior; - - private final Optional connectionDeletionBehavior; - - private final Optional enforcePermissionCeiling; - - private final Optional enforceSelfAssignmentRestriction; - - private final OptionalNullable connectionProfileId; - - private final OptionalNullable userAttributeProfileId; - - private final OptionalNullable> allowedStrategies; - - private final OptionalNullable invitationLandingClientId; - - private final OptionalNullable> adminRolesAssignment; - - private final OptionalNullable useForOrganizationDiscovery; - - private final OptionalNullable roleVisibilityPolicy; - - private final Map additionalProperties; - - private UpdateOrganizationTemplateRequestContent( - Optional name, - Optional isDefault, - Optional organizationDeletionBehavior, - Optional connectionDeletionBehavior, - Optional enforcePermissionCeiling, - Optional enforceSelfAssignmentRestriction, - OptionalNullable connectionProfileId, - OptionalNullable userAttributeProfileId, - OptionalNullable> allowedStrategies, - OptionalNullable invitationLandingClientId, - OptionalNullable> adminRolesAssignment, - OptionalNullable useForOrganizationDiscovery, - OptionalNullable roleVisibilityPolicy, - Map additionalProperties) { - this.name = name; - this.isDefault = isDefault; - this.organizationDeletionBehavior = organizationDeletionBehavior; - this.connectionDeletionBehavior = connectionDeletionBehavior; - this.enforcePermissionCeiling = enforcePermissionCeiling; - this.enforceSelfAssignmentRestriction = enforceSelfAssignmentRestriction; - this.connectionProfileId = connectionProfileId; - this.userAttributeProfileId = userAttributeProfileId; - this.allowedStrategies = allowedStrategies; - this.invitationLandingClientId = invitationLandingClientId; - this.adminRolesAssignment = adminRolesAssignment; - this.useForOrganizationDiscovery = useForOrganizationDiscovery; - this.roleVisibilityPolicy = roleVisibilityPolicy; - this.additionalProperties = additionalProperties; - } - - /** - * @return The name of the organization template. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return Whether this is the default template applied to new organizations. - */ - @JsonProperty("is_default") - public Optional getIsDefault() { - return isDefault; - } - - @JsonProperty("organization_deletion_behavior") - public Optional getOrganizationDeletionBehavior() { - return organizationDeletionBehavior; - } - - @JsonProperty("connection_deletion_behavior") - public Optional getConnectionDeletionBehavior() { - return connectionDeletionBehavior; - } - - /** - * @return Whether to enforce permission ceiling for organizations using this template. - */ - @JsonProperty("enforce_permission_ceiling") - public Optional getEnforcePermissionCeiling() { - return enforcePermissionCeiling; - } - - /** - * @return Whether to enforce self-assignment restrictions for organizations using this template. - */ - @JsonProperty("enforce_self_assignment_restriction") - public Optional getEnforceSelfAssignmentRestriction() { - return enforceSelfAssignmentRestriction; - } - - /** - * @return The connection profile to apply to new connections. - */ - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("connection_profile_id") - public OptionalNullable getConnectionProfileId() { - if (connectionProfileId == null) { - return OptionalNullable.absent(); - } - return connectionProfileId; - } - - /** - * @return The user attribute profile to apply to organizations. - */ - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("user_attribute_profile_id") - public OptionalNullable getUserAttributeProfileId() { - if (userAttributeProfileId == null) { - return OptionalNullable.absent(); - } - return userAttributeProfileId; - } - - /** - * @return List of allowed connection strategies for this template. - */ - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("allowed_strategies") - public OptionalNullable> getAllowedStrategies() { - if (allowedStrategies == null) { - return OptionalNullable.absent(); - } - return allowedStrategies; - } - - /** - * @return The client ID for the invitation landing page. - */ - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("invitation_landing_client_id") - public OptionalNullable getInvitationLandingClientId() { - if (invitationLandingClientId == null) { - return OptionalNullable.absent(); - } - return invitationLandingClientId; - } - - /** - * @return Default admin roles to assign to organization creators. - */ - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("admin_roles_assignment") - public OptionalNullable> getAdminRolesAssignment() { - if (adminRolesAssignment == null) { - return OptionalNullable.absent(); - } - return adminRolesAssignment; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("use_for_organization_discovery") - public OptionalNullable getUseForOrganizationDiscovery() { - if (useForOrganizationDiscovery == null) { - return OptionalNullable.absent(); - } - return useForOrganizationDiscovery; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("role_visibility_policy") - public OptionalNullable getRoleVisibilityPolicy() { - if (roleVisibilityPolicy == null) { - return OptionalNullable.absent(); - } - return roleVisibilityPolicy; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("connection_profile_id") - private OptionalNullable _getConnectionProfileId() { - return connectionProfileId; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("user_attribute_profile_id") - private OptionalNullable _getUserAttributeProfileId() { - return userAttributeProfileId; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("allowed_strategies") - private OptionalNullable> _getAllowedStrategies() { - return allowedStrategies; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("invitation_landing_client_id") - private OptionalNullable _getInvitationLandingClientId() { - return invitationLandingClientId; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("admin_roles_assignment") - private OptionalNullable> _getAdminRolesAssignment() { - return adminRolesAssignment; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("use_for_organization_discovery") - private OptionalNullable _getUseForOrganizationDiscovery() { - return useForOrganizationDiscovery; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("role_visibility_policy") - private OptionalNullable _getRoleVisibilityPolicy() { - return roleVisibilityPolicy; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof UpdateOrganizationTemplateRequestContent - && equalTo((UpdateOrganizationTemplateRequestContent) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(UpdateOrganizationTemplateRequestContent other) { - return name.equals(other.name) - && isDefault.equals(other.isDefault) - && organizationDeletionBehavior.equals(other.organizationDeletionBehavior) - && connectionDeletionBehavior.equals(other.connectionDeletionBehavior) - && enforcePermissionCeiling.equals(other.enforcePermissionCeiling) - && enforceSelfAssignmentRestriction.equals(other.enforceSelfAssignmentRestriction) - && connectionProfileId.equals(other.connectionProfileId) - && userAttributeProfileId.equals(other.userAttributeProfileId) - && allowedStrategies.equals(other.allowedStrategies) - && invitationLandingClientId.equals(other.invitationLandingClientId) - && adminRolesAssignment.equals(other.adminRolesAssignment) - && useForOrganizationDiscovery.equals(other.useForOrganizationDiscovery) - && roleVisibilityPolicy.equals(other.roleVisibilityPolicy); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.name, - this.isDefault, - this.organizationDeletionBehavior, - this.connectionDeletionBehavior, - this.enforcePermissionCeiling, - this.enforceSelfAssignmentRestriction, - this.connectionProfileId, - this.userAttributeProfileId, - this.allowedStrategies, - this.invitationLandingClientId, - this.adminRolesAssignment, - this.useForOrganizationDiscovery, - this.roleVisibilityPolicy); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional name = Optional.empty(); - - private Optional isDefault = Optional.empty(); - - private Optional organizationDeletionBehavior = Optional.empty(); - - private Optional connectionDeletionBehavior = Optional.empty(); - - private Optional enforcePermissionCeiling = Optional.empty(); - - private Optional enforceSelfAssignmentRestriction = Optional.empty(); - - private OptionalNullable connectionProfileId = OptionalNullable.absent(); - - private OptionalNullable userAttributeProfileId = OptionalNullable.absent(); - - private OptionalNullable> allowedStrategies = - OptionalNullable.absent(); - - private OptionalNullable invitationLandingClientId = OptionalNullable.absent(); - - private OptionalNullable> adminRolesAssignment = OptionalNullable.absent(); - - private OptionalNullable useForOrganizationDiscovery = - OptionalNullable.absent(); - - private OptionalNullable roleVisibilityPolicy = - OptionalNullable.absent(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(UpdateOrganizationTemplateRequestContent other) { - name(other.getName()); - isDefault(other.getIsDefault()); - organizationDeletionBehavior(other.getOrganizationDeletionBehavior()); - connectionDeletionBehavior(other.getConnectionDeletionBehavior()); - enforcePermissionCeiling(other.getEnforcePermissionCeiling()); - enforceSelfAssignmentRestriction(other.getEnforceSelfAssignmentRestriction()); - connectionProfileId(other.getConnectionProfileId()); - userAttributeProfileId(other.getUserAttributeProfileId()); - allowedStrategies(other.getAllowedStrategies()); - invitationLandingClientId(other.getInvitationLandingClientId()); - adminRolesAssignment(other.getAdminRolesAssignment()); - useForOrganizationDiscovery(other.getUseForOrganizationDiscovery()); - roleVisibilityPolicy(other.getRoleVisibilityPolicy()); - return this; - } - - /** - *

The name of the organization template.

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

Whether this is the default template applied to new organizations.

- */ - @JsonSetter(value = "is_default", nulls = Nulls.SKIP) - public Builder isDefault(Optional isDefault) { - this.isDefault = isDefault; - return this; - } - - public Builder isDefault(Boolean isDefault) { - this.isDefault = Optional.ofNullable(isDefault); - return this; - } - - @JsonSetter(value = "organization_deletion_behavior", nulls = Nulls.SKIP) - public Builder organizationDeletionBehavior( - Optional organizationDeletionBehavior) { - this.organizationDeletionBehavior = organizationDeletionBehavior; - return this; - } - - public Builder organizationDeletionBehavior(OrganizationDeletionBehaviorEnum organizationDeletionBehavior) { - this.organizationDeletionBehavior = Optional.ofNullable(organizationDeletionBehavior); - return this; - } - - @JsonSetter(value = "connection_deletion_behavior", nulls = Nulls.SKIP) - public Builder connectionDeletionBehavior(Optional connectionDeletionBehavior) { - this.connectionDeletionBehavior = connectionDeletionBehavior; - return this; - } - - public Builder connectionDeletionBehavior(ConnectionDeletionBehaviorEnum connectionDeletionBehavior) { - this.connectionDeletionBehavior = Optional.ofNullable(connectionDeletionBehavior); - return this; - } - - /** - *

Whether to enforce permission ceiling for organizations using this template.

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

Whether to enforce self-assignment restrictions for organizations using this template.

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

The connection profile to apply to new connections.

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

The user attribute profile to apply to organizations.

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

List of allowed connection strategies for this template.

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

The client ID for the invitation landing page.

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

Default admin roles to assign to organization creators.

- */ - @JsonSetter(value = "admin_roles_assignment", nulls = Nulls.SKIP) - public Builder adminRolesAssignment(@Nullable OptionalNullable> adminRolesAssignment) { - this.adminRolesAssignment = adminRolesAssignment; - return this; - } - - public Builder adminRolesAssignment(List adminRolesAssignment) { - this.adminRolesAssignment = OptionalNullable.of(adminRolesAssignment); - return this; - } - - public Builder adminRolesAssignment(Optional> adminRolesAssignment) { - if (adminRolesAssignment.isPresent()) { - this.adminRolesAssignment = OptionalNullable.of(adminRolesAssignment.get()); - } else { - this.adminRolesAssignment = OptionalNullable.absent(); - } - return this; - } - - public Builder adminRolesAssignment(com.auth0.client.mgmt.core.Nullable> adminRolesAssignment) { - if (adminRolesAssignment.isNull()) { - this.adminRolesAssignment = OptionalNullable.ofNull(); - } else if (adminRolesAssignment.isEmpty()) { - this.adminRolesAssignment = OptionalNullable.absent(); - } else { - this.adminRolesAssignment = OptionalNullable.of(adminRolesAssignment.get()); - } - return this; - } - - @JsonSetter(value = "use_for_organization_discovery", nulls = Nulls.SKIP) - public Builder useForOrganizationDiscovery( - @Nullable - OptionalNullable useForOrganizationDiscovery) { - this.useForOrganizationDiscovery = useForOrganizationDiscovery; - return this; - } - - public Builder useForOrganizationDiscovery( - OrganizationTemplateUseForOrganizationDiscovery useForOrganizationDiscovery) { - this.useForOrganizationDiscovery = OptionalNullable.of(useForOrganizationDiscovery); - return this; - } - - public Builder useForOrganizationDiscovery( - Optional useForOrganizationDiscovery) { - if (useForOrganizationDiscovery.isPresent()) { - this.useForOrganizationDiscovery = OptionalNullable.of(useForOrganizationDiscovery.get()); - } else { - this.useForOrganizationDiscovery = OptionalNullable.absent(); - } - return this; - } - - public Builder useForOrganizationDiscovery( - com.auth0.client.mgmt.core.Nullable - useForOrganizationDiscovery) { - if (useForOrganizationDiscovery.isNull()) { - this.useForOrganizationDiscovery = OptionalNullable.ofNull(); - } else if (useForOrganizationDiscovery.isEmpty()) { - this.useForOrganizationDiscovery = OptionalNullable.absent(); - } else { - this.useForOrganizationDiscovery = OptionalNullable.of(useForOrganizationDiscovery.get()); - } - return this; - } - - @JsonSetter(value = "role_visibility_policy", nulls = Nulls.SKIP) - public Builder roleVisibilityPolicy( - @Nullable OptionalNullable roleVisibilityPolicy) { - this.roleVisibilityPolicy = roleVisibilityPolicy; - return this; - } - - public Builder roleVisibilityPolicy(OrganizationTemplateRoleVisibilityPolicy roleVisibilityPolicy) { - this.roleVisibilityPolicy = OptionalNullable.of(roleVisibilityPolicy); - return this; - } - - public Builder roleVisibilityPolicy(Optional roleVisibilityPolicy) { - if (roleVisibilityPolicy.isPresent()) { - this.roleVisibilityPolicy = OptionalNullable.of(roleVisibilityPolicy.get()); - } else { - this.roleVisibilityPolicy = OptionalNullable.absent(); - } - return this; - } - - public Builder roleVisibilityPolicy( - com.auth0.client.mgmt.core.Nullable roleVisibilityPolicy) { - if (roleVisibilityPolicy.isNull()) { - this.roleVisibilityPolicy = OptionalNullable.ofNull(); - } else if (roleVisibilityPolicy.isEmpty()) { - this.roleVisibilityPolicy = OptionalNullable.absent(); - } else { - this.roleVisibilityPolicy = OptionalNullable.of(roleVisibilityPolicy.get()); - } - return this; - } - - public UpdateOrganizationTemplateRequestContent build() { - return new UpdateOrganizationTemplateRequestContent( - name, - isDefault, - organizationDeletionBehavior, - connectionDeletionBehavior, - enforcePermissionCeiling, - enforceSelfAssignmentRestriction, - connectionProfileId, - userAttributeProfileId, - allowedStrategies, - invitationLandingClientId, - adminRolesAssignment, - useForOrganizationDiscovery, - roleVisibilityPolicy, - additionalProperties); - } - - public Builder additionalProperty(String key, Object value) { - this.additionalProperties.put(key, value); - return this; - } - - public Builder additionalProperties(Map additionalProperties) { - this.additionalProperties.putAll(additionalProperties); - return this; - } - } -} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerRequestContent.java index ace054220..7c70ac6f3 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerRequestContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerRequestContent.java @@ -42,6 +42,8 @@ public final class UpdateResourceServerRequestContent { private final Optional tokenLifetime; + private final OptionalNullable tokenLifetimeForAnonymousAccessTokens; + private final Optional tokenDialect; private final Optional enforcePolicies; @@ -70,6 +72,7 @@ private UpdateResourceServerRequestContent( Optional allowOnlineAccess, Optional allowOnlineAccessWithEphemeralSessions, Optional tokenLifetime, + OptionalNullable tokenLifetimeForAnonymousAccessTokens, Optional tokenDialect, Optional enforcePolicies, OptionalNullable tokenEncryption, @@ -88,6 +91,7 @@ private UpdateResourceServerRequestContent( this.allowOnlineAccess = allowOnlineAccess; this.allowOnlineAccessWithEphemeralSessions = allowOnlineAccessWithEphemeralSessions; this.tokenLifetime = tokenLifetime; + this.tokenLifetimeForAnonymousAccessTokens = tokenLifetimeForAnonymousAccessTokens; this.tokenDialect = tokenDialect; this.enforcePolicies = enforcePolicies; this.tokenEncryption = tokenEncryption; @@ -168,6 +172,18 @@ public Optional getTokenLifetime() { return tokenLifetime; } + /** + * @return Expiration value (in seconds) for anonymous-session access tokens issued for this API. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_lifetime_for_anonymous_access_tokens") + public OptionalNullable getTokenLifetimeForAnonymousAccessTokens() { + if (tokenLifetimeForAnonymousAccessTokens == null) { + return OptionalNullable.absent(); + } + return tokenLifetimeForAnonymousAccessTokens; + } + @JsonProperty("token_dialect") public Optional getTokenDialect() { return tokenDialect; @@ -231,6 +247,12 @@ public OptionalNullable getAuthorizationPolic return authorizationPolicy; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token_lifetime_for_anonymous_access_tokens") + private OptionalNullable _getTokenLifetimeForAnonymousAccessTokens() { + return tokenLifetimeForAnonymousAccessTokens; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("token_encryption") private OptionalNullable _getTokenEncryption() { @@ -283,6 +305,7 @@ private boolean equalTo(UpdateResourceServerRequestContent other) { && allowOnlineAccess.equals(other.allowOnlineAccess) && allowOnlineAccessWithEphemeralSessions.equals(other.allowOnlineAccessWithEphemeralSessions) && tokenLifetime.equals(other.tokenLifetime) + && tokenLifetimeForAnonymousAccessTokens.equals(other.tokenLifetimeForAnonymousAccessTokens) && tokenDialect.equals(other.tokenDialect) && enforcePolicies.equals(other.enforcePolicies) && tokenEncryption.equals(other.tokenEncryption) @@ -305,6 +328,7 @@ public int hashCode() { this.allowOnlineAccess, this.allowOnlineAccessWithEphemeralSessions, this.tokenLifetime, + this.tokenLifetimeForAnonymousAccessTokens, this.tokenDialect, this.enforcePolicies, this.tokenEncryption, @@ -344,6 +368,8 @@ public static final class Builder { private Optional tokenLifetime = Optional.empty(); + private OptionalNullable tokenLifetimeForAnonymousAccessTokens = OptionalNullable.absent(); + private Optional tokenDialect = Optional.empty(); private Optional enforcePolicies = Optional.empty(); @@ -375,6 +401,7 @@ public Builder from(UpdateResourceServerRequestContent other) { allowOnlineAccess(other.getAllowOnlineAccess()); allowOnlineAccessWithEphemeralSessions(other.getAllowOnlineAccessWithEphemeralSessions()); tokenLifetime(other.getTokenLifetime()); + tokenLifetimeForAnonymousAccessTokens(other.getTokenLifetimeForAnonymousAccessTokens()); tokenDialect(other.getTokenDialect()); enforcePolicies(other.getEnforcePolicies()); tokenEncryption(other.getTokenEncryption()); @@ -512,6 +539,44 @@ public Builder tokenLifetime(Integer tokenLifetime) { return this; } + /** + *

Expiration value (in seconds) for anonymous-session access tokens issued for this API.

+ */ + @JsonSetter(value = "token_lifetime_for_anonymous_access_tokens", nulls = Nulls.SKIP) + public Builder tokenLifetimeForAnonymousAccessTokens( + @Nullable OptionalNullable tokenLifetimeForAnonymousAccessTokens) { + this.tokenLifetimeForAnonymousAccessTokens = tokenLifetimeForAnonymousAccessTokens; + return this; + } + + public Builder tokenLifetimeForAnonymousAccessTokens(Integer tokenLifetimeForAnonymousAccessTokens) { + this.tokenLifetimeForAnonymousAccessTokens = OptionalNullable.of(tokenLifetimeForAnonymousAccessTokens); + return this; + } + + public Builder tokenLifetimeForAnonymousAccessTokens(Optional tokenLifetimeForAnonymousAccessTokens) { + if (tokenLifetimeForAnonymousAccessTokens.isPresent()) { + this.tokenLifetimeForAnonymousAccessTokens = + OptionalNullable.of(tokenLifetimeForAnonymousAccessTokens.get()); + } else { + this.tokenLifetimeForAnonymousAccessTokens = OptionalNullable.absent(); + } + return this; + } + + public Builder tokenLifetimeForAnonymousAccessTokens( + com.auth0.client.mgmt.core.Nullable tokenLifetimeForAnonymousAccessTokens) { + if (tokenLifetimeForAnonymousAccessTokens.isNull()) { + this.tokenLifetimeForAnonymousAccessTokens = OptionalNullable.ofNull(); + } else if (tokenLifetimeForAnonymousAccessTokens.isEmpty()) { + this.tokenLifetimeForAnonymousAccessTokens = OptionalNullable.absent(); + } else { + this.tokenLifetimeForAnonymousAccessTokens = + OptionalNullable.of(tokenLifetimeForAnonymousAccessTokens.get()); + } + return this; + } + @JsonSetter(value = "token_dialect", nulls = Nulls.SKIP) public Builder tokenDialect(Optional tokenDialect) { this.tokenDialect = tokenDialect; @@ -721,6 +786,7 @@ public UpdateResourceServerRequestContent build() { allowOnlineAccess, allowOnlineAccessWithEphemeralSessions, tokenLifetime, + tokenLifetimeForAnonymousAccessTokens, tokenDialect, enforcePolicies, tokenEncryption, diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerResponseContent.java index 6d6e75fd5..db00cae37 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateResourceServerResponseContent.java @@ -52,6 +52,8 @@ public final class UpdateResourceServerResponseContent { private final Optional enforcePolicies; + private final Optional tokenLifetimeForAnonymousAccessTokens; + private final Optional tokenDialect; private final OptionalNullable tokenEncryption; @@ -85,6 +87,7 @@ private UpdateResourceServerResponseContent( Optional tokenLifetime, Optional tokenLifetimeForWeb, Optional enforcePolicies, + Optional tokenLifetimeForAnonymousAccessTokens, Optional tokenDialect, OptionalNullable tokenEncryption, OptionalNullable consentPolicy, @@ -108,6 +111,7 @@ private UpdateResourceServerResponseContent( this.tokenLifetime = tokenLifetime; this.tokenLifetimeForWeb = tokenLifetimeForWeb; this.enforcePolicies = enforcePolicies; + this.tokenLifetimeForAnonymousAccessTokens = tokenLifetimeForAnonymousAccessTokens; this.tokenDialect = tokenDialect; this.tokenEncryption = tokenEncryption; this.consentPolicy = consentPolicy; @@ -228,6 +232,14 @@ public Optional getEnforcePolicies() { return enforcePolicies; } + /** + * @return Expiration value (in seconds) for anonymous-session access tokens issued for this API. + */ + @JsonProperty("token_lifetime_for_anonymous_access_tokens") + public Optional getTokenLifetimeForAnonymousAccessTokens() { + return tokenLifetimeForAnonymousAccessTokens; + } + @JsonProperty("token_dialect") public Optional getTokenDialect() { return tokenDialect; @@ -348,6 +360,7 @@ private boolean equalTo(UpdateResourceServerResponseContent other) { && tokenLifetime.equals(other.tokenLifetime) && tokenLifetimeForWeb.equals(other.tokenLifetimeForWeb) && enforcePolicies.equals(other.enforcePolicies) + && tokenLifetimeForAnonymousAccessTokens.equals(other.tokenLifetimeForAnonymousAccessTokens) && tokenDialect.equals(other.tokenDialect) && tokenEncryption.equals(other.tokenEncryption) && consentPolicy.equals(other.consentPolicy) @@ -375,6 +388,7 @@ public int hashCode() { this.tokenLifetime, this.tokenLifetimeForWeb, this.enforcePolicies, + this.tokenLifetimeForAnonymousAccessTokens, this.tokenDialect, this.tokenEncryption, this.consentPolicy, @@ -424,6 +438,8 @@ public static final class Builder { private Optional enforcePolicies = Optional.empty(); + private Optional tokenLifetimeForAnonymousAccessTokens = Optional.empty(); + private Optional tokenDialect = Optional.empty(); private OptionalNullable tokenEncryption = OptionalNullable.absent(); @@ -460,6 +476,7 @@ public Builder from(UpdateResourceServerResponseContent other) { tokenLifetime(other.getTokenLifetime()); tokenLifetimeForWeb(other.getTokenLifetimeForWeb()); enforcePolicies(other.getEnforcePolicies()); + tokenLifetimeForAnonymousAccessTokens(other.getTokenLifetimeForAnonymousAccessTokens()); tokenDialect(other.getTokenDialect()); tokenEncryption(other.getTokenEncryption()); consentPolicy(other.getConsentPolicy()); @@ -667,6 +684,20 @@ public Builder enforcePolicies(Boolean enforcePolicies) { return this; } + /** + *

Expiration value (in seconds) for anonymous-session access tokens issued for this API.

+ */ + @JsonSetter(value = "token_lifetime_for_anonymous_access_tokens", nulls = Nulls.SKIP) + public Builder tokenLifetimeForAnonymousAccessTokens(Optional tokenLifetimeForAnonymousAccessTokens) { + this.tokenLifetimeForAnonymousAccessTokens = tokenLifetimeForAnonymousAccessTokens; + return this; + } + + public Builder tokenLifetimeForAnonymousAccessTokens(Integer tokenLifetimeForAnonymousAccessTokens) { + this.tokenLifetimeForAnonymousAccessTokens = Optional.ofNullable(tokenLifetimeForAnonymousAccessTokens); + return this; + } + @JsonSetter(value = "token_dialect", nulls = Nulls.SKIP) public Builder tokenDialect(Optional tokenDialect) { this.tokenDialect = tokenDialect; @@ -881,6 +912,7 @@ public UpdateResourceServerResponseContent build() { tokenLifetime, tokenLifetimeForWeb, enforcePolicies, + tokenLifetimeForAnonymousAccessTokens, tokenDialect, tokenEncryption, consentPolicy, diff --git a/src/test/java/com/auth0/client/mgmt/ExperimentationExperimentsWireTest.java b/src/test/java/com/auth0/client/mgmt/ExperimentationExperimentsWireTest.java new file mode 100644 index 000000000..74c6c5a07 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/ExperimentationExperimentsWireTest.java @@ -0,0 +1,150 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.experimentation.types.AdvanceRampRequestContent; +import com.auth0.client.mgmt.types.AdvanceRampResponseContent; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ExperimentationExperimentsWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testAdvanceRamp() throws Exception { + server.enqueue(new MockResponse() + .setResponseCode(200) + .setBody("{\"experiment_id\":\"experiment_id\",\"from_level\":1,\"to_level\":1,\"current_level\":1}")); + AdvanceRampResponseContent response = client.experimentation() + .experiments() + .advanceRamp( + "id", AdvanceRampRequestContent.builder().targetLevel(1).build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"target_level\": 1\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"experiment_id\": \"experiment_id\",\n" + + " \"from_level\": 1,\n" + + " \"to_level\": 1,\n" + + " \"current_level\": 1\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). + */ + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null) { + if (!entry.getValue().isNull()) return false; + } else if (!jsonEquals(entry.getValue(), actualValue)) return false; + } + return true; + } + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/GuardianFactorsEmailWireTest.java b/src/test/java/com/auth0/client/mgmt/GuardianFactorsEmailWireTest.java new file mode 100644 index 000000000..349765601 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/GuardianFactorsEmailWireTest.java @@ -0,0 +1,190 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +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.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class GuardianFactorsEmailWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"otp_length\":1,\"otp_expiration_time\":1}")); + GetEmailFactorSettingsResponseContent response = + client.guardian().factors().email().get(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"otp_length\": 1,\n" + " \"otp_expiration_time\": 1\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSet() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"otp_length\":1,\"otp_expiration_time\":1}")); + SetEmailFactorSettingsResponseContent response = client.guardian() + .factors() + .email() + .set(SetEmailFactorSettingsRequestContent.builder() + .otpLength(1) + .otpExpirationTime(1) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"otp_length\": 1,\n" + " \"otp_expiration_time\": 1\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"otp_length\": 1,\n" + " \"otp_expiration_time\": 1\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). + */ + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null) { + if (!entry.getValue().isNull()) return false; + } else if (!jsonEquals(entry.getValue(), actualValue)) return false; + } + return true; + } + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/GuardianFactorsPhoneWireTest.java b/src/test/java/com/auth0/client/mgmt/GuardianFactorsPhoneWireTest.java index 84b437165..825b1d9c6 100644 --- a/src/test/java/com/auth0/client/mgmt/GuardianFactorsPhoneWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/GuardianFactorsPhoneWireTest.java @@ -5,16 +5,19 @@ 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.GuardianFactorPhoneFactorMessageTypeEnum; import com.auth0.client.mgmt.types.GuardianFactorsProviderSmsProviderEnum; 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.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import java.util.Arrays; @@ -428,6 +431,128 @@ else if (actualResponseNode.has("kind")) } } + @Test + public void testGet() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"otp_length\":1,\"otp_expiration_time\":1}")); + GetPhoneFactorSettingsResponseContent response = + client.guardian().factors().phone().get(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"otp_length\": 1,\n" + " \"otp_expiration_time\": 1\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSet() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"otp_length\":1,\"otp_expiration_time\":1}")); + SetPhoneFactorSettingsResponseContent response = client.guardian() + .factors() + .phone() + .set(SetPhoneFactorSettingsRequestContent.builder() + .otpLength(1) + .otpExpirationTime(1) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"otp_length\": 1,\n" + " \"otp_expiration_time\": 1\n" + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + "{\n" + " \"otp_length\": 1,\n" + " \"otp_expiration_time\": 1\n" + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + @Test public void testGetTemplates() throws Exception { server.enqueue( diff --git a/src/test/java/com/auth0/client/mgmt/GuardianWireTest.java b/src/test/java/com/auth0/client/mgmt/GuardianWireTest.java new file mode 100644 index 000000000..a928db039 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/GuardianWireTest.java @@ -0,0 +1,215 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +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.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class GuardianWireTest { + private MockWebServer server; + private ManagementApi client; + private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; + + @BeforeEach + public void setup() throws Exception { + server = new MockWebServer(); + server.start(); + client = ManagementApi.builder() + .url(server.url("/").toString()) + .token("test-token") + .build(); + } + + @AfterEach + public void teardown() throws Exception { + server.shutdown(); + } + + @Test + public void testGet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"display_remember_me_checkbox\":true,\"remember_me_default_value\":true,\"mfa_session_inactivity_timeout\":1,\"mfa_session_overall_timeout\":1}")); + GetGuardianSettingsResponseContent response = client.guardian().get(); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"display_remember_me_checkbox\": true,\n" + + " \"remember_me_default_value\": true,\n" + + " \"mfa_session_inactivity_timeout\": 1,\n" + + " \"mfa_session_overall_timeout\": 1\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + @Test + public void testSet() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"display_remember_me_checkbox\":true,\"remember_me_default_value\":true,\"mfa_session_inactivity_timeout\":1,\"mfa_session_overall_timeout\":1}")); + SetGuardianSettingsResponseContent response = client.guardian() + .set(SetGuardianSettingsRequestContent.builder() + .displayRememberMeCheckbox(true) + .rememberMeDefaultValue(true) + .mfaSessionInactivityTimeout(1) + .mfaSessionOverallTimeout(1) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PUT", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"display_remember_me_checkbox\": true,\n" + + " \"remember_me_default_value\": true,\n" + + " \"mfa_session_inactivity_timeout\": 1,\n" + + " \"mfa_session_overall_timeout\": 1\n" + + "}"; + JsonNode actualJson = objectMapper.readTree(actualRequestBody); + JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); + Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); + if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { + String discriminator = null; + if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); + else if (actualJson.has("_type")) + discriminator = actualJson.get("_type").asText(); + else if (actualJson.has("kind")) + discriminator = actualJson.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualJson.isNull()) { + Assertions.assertTrue( + actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), + "request should be a valid JSON value"); + } + + if (actualJson.isArray()) { + Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); + } + if (actualJson.isObject()) { + Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); + } + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + String actualResponseJson = objectMapper.writeValueAsString(response); + String expectedResponseBody = "" + + "{\n" + + " \"display_remember_me_checkbox\": true,\n" + + " \"remember_me_default_value\": true,\n" + + " \"mfa_session_inactivity_timeout\": 1,\n" + + " \"mfa_session_overall_timeout\": 1\n" + + "}"; + JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); + JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); + Assertions.assertTrue( + jsonEquals(expectedResponseNode, actualResponseNode), + "Response body structure does not match expected"); + if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { + String discriminator = null; + if (actualResponseNode.has("type")) + discriminator = actualResponseNode.get("type").asText(); + else if (actualResponseNode.has("_type")) + discriminator = actualResponseNode.get("_type").asText(); + else if (actualResponseNode.has("kind")) + discriminator = actualResponseNode.get("kind").asText(); + Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); + Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); + } + + if (!actualResponseNode.isNull()) { + Assertions.assertTrue( + actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), + "response should be a valid JSON value"); + } + + if (actualResponseNode.isArray()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); + } + if (actualResponseNode.isObject()) { + Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); + } + } + + /** + * Compares two JsonNodes with numeric equivalence and null safety. + * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. + * Allows 'actual' to have extra fields (e.g., default values added during serialization). + */ + private boolean jsonEquals(JsonNode expected, JsonNode actual) { + if (expected == null && actual == null) return true; + if (expected == null || actual == null) return false; + if (expected.equals(actual)) return true; + if (expected.isNumber() && actual.isNumber()) + return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; + if (expected.isObject() && actual.isObject()) { + java.util.Iterator> iter = expected.fields(); + while (iter.hasNext()) { + java.util.Map.Entry entry = iter.next(); + JsonNode actualValue = actual.get(entry.getKey()); + if (actualValue == null) { + if (!entry.getValue().isNull()) return false; + } else if (!jsonEquals(entry.getValue(), actualValue)) return false; + } + return true; + } + if (expected.isArray() && actual.isArray()) { + if (expected.size() != actual.size()) return false; + for (int i = 0; i < expected.size(); i++) { + if (!jsonEquals(expected.get(i), actual.get(i))) return false; + } + return true; + } + return false; + } +} diff --git a/src/test/java/com/auth0/client/mgmt/OrganizationTemplatesWireTest.java b/src/test/java/com/auth0/client/mgmt/OrganizationTemplatesWireTest.java deleted file mode 100644 index 64c0aeb5d..000000000 --- a/src/test/java/com/auth0/client/mgmt/OrganizationTemplatesWireTest.java +++ /dev/null @@ -1,434 +0,0 @@ -package com.auth0.client.mgmt; - -import com.auth0.client.mgmt.core.ObjectMappers; -import com.auth0.client.mgmt.core.SyncPagingIterable; -import com.auth0.client.mgmt.types.CreateOrganizationTemplateRequestContent; -import com.auth0.client.mgmt.types.ListOrganizationTemplatesRequestParameters; -import com.auth0.client.mgmt.types.ListTemplateOrganizationsRequestParameters; -import com.auth0.client.mgmt.types.OrganizationDeletionBehaviorEnum; -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.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import okhttp3.mockwebserver.MockResponse; -import okhttp3.mockwebserver.MockWebServer; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -public class OrganizationTemplatesWireTest { - private MockWebServer server; - private ManagementApi client; - private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; - - @BeforeEach - public void setup() throws Exception { - server = new MockWebServer(); - server.start(); - client = ManagementApi.builder() - .url(server.url("/").toString()) - .token("test-token") - .build(); - } - - @AfterEach - public void teardown() throws Exception { - server.shutdown(); - } - - @Test - public void testList() throws Exception { - server.enqueue( - new MockResponse() - .setResponseCode(200) - .setBody( - "{\"next\":\"next\",\"organization_templates\":[{\"id\":\"id\",\"name\":\"name\",\"is_default\":true,\"organization_deletion_behavior\":\"allow\",\"connection_deletion_behavior\":\"allow\",\"enforce_permission_ceiling\":true,\"enforce_self_assignment_restriction\":true,\"connection_profile_id\":\"connection_profile_id\",\"user_attribute_profile_id\":\"user_attribute_profile_id\",\"allowed_strategies\":[\"adfs\"],\"invitation_landing_client_id\":\"invitation_landing_client_id\",\"admin_roles_assignment\":[\"admin_roles_assignment\"],\"use_for_organization_discovery\":{\"default_value\":true},\"role_visibility_policy\":{\"default_value\":\"write\"},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}]}")); - SyncPagingIterable response = client.organizationTemplates() - .list(ListOrganizationTemplatesRequestParameters.builder() - .from("from") - .take(1) - .build()); - RecordedRequest request = server.takeRequest(); - Assertions.assertNotNull(request); - Assertions.assertEquals("GET", request.getMethod()); - - // Validate response body - Assertions.assertNotNull(response, "Response should not be null"); - // Pagination response validated via MockWebServer - // The SDK correctly parses the response into a SyncPagingIterable - } - - @Test - public void testCreate() throws Exception { - server.enqueue( - new MockResponse() - .setResponseCode(200) - .setBody( - "{\"id\":\"id\",\"name\":\"name\",\"is_default\":true,\"organization_deletion_behavior\":\"allow\",\"connection_deletion_behavior\":\"allow\",\"enforce_permission_ceiling\":true,\"enforce_self_assignment_restriction\":true,\"connection_profile_id\":\"connection_profile_id\",\"user_attribute_profile_id\":\"user_attribute_profile_id\",\"allowed_strategies\":[\"adfs\"],\"invitation_landing_client_id\":\"invitation_landing_client_id\",\"admin_roles_assignment\":[\"admin_roles_assignment\"],\"use_for_organization_discovery\":{\"default_value\":true,\"allowed_values\":[true]},\"role_visibility_policy\":{\"default_value\":\"write\",\"overrides\":[{\"role_id\":\"role_id\",\"access\":\"write\"}]},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}")); - OrganizationTemplate response = client.organizationTemplates() - .create(CreateOrganizationTemplateRequestContent.builder() - .name("name") - .organizationDeletionBehavior(OrganizationDeletionBehaviorEnum.ALLOW) - .enforcePermissionCeiling(true) - .enforceSelfAssignmentRestriction(true) - .build()); - RecordedRequest request = server.takeRequest(); - Assertions.assertNotNull(request); - Assertions.assertEquals("POST", request.getMethod()); - // Validate request body - String actualRequestBody = request.getBody().readUtf8(); - String expectedRequestBody = "" - + "{\n" - + " \"name\": \"name\",\n" - + " \"organization_deletion_behavior\": \"allow\",\n" - + " \"enforce_permission_ceiling\": true,\n" - + " \"enforce_self_assignment_restriction\": true\n" - + "}"; - JsonNode actualJson = objectMapper.readTree(actualRequestBody); - JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); - Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); - if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { - String discriminator = null; - if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); - else if (actualJson.has("_type")) - discriminator = actualJson.get("_type").asText(); - else if (actualJson.has("kind")) - discriminator = actualJson.get("kind").asText(); - Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); - Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); - } - - if (!actualJson.isNull()) { - Assertions.assertTrue( - actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), - "request should be a valid JSON value"); - } - - if (actualJson.isArray()) { - Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); - } - if (actualJson.isObject()) { - Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); - } - - // Validate response body - Assertions.assertNotNull(response, "Response should not be null"); - String actualResponseJson = objectMapper.writeValueAsString(response); - String expectedResponseBody = "" - + "{\n" - + " \"id\": \"id\",\n" - + " \"name\": \"name\",\n" - + " \"is_default\": true,\n" - + " \"organization_deletion_behavior\": \"allow\",\n" - + " \"connection_deletion_behavior\": \"allow\",\n" - + " \"enforce_permission_ceiling\": true,\n" - + " \"enforce_self_assignment_restriction\": true,\n" - + " \"connection_profile_id\": \"connection_profile_id\",\n" - + " \"user_attribute_profile_id\": \"user_attribute_profile_id\",\n" - + " \"allowed_strategies\": [\n" - + " \"adfs\"\n" - + " ],\n" - + " \"invitation_landing_client_id\": \"invitation_landing_client_id\",\n" - + " \"admin_roles_assignment\": [\n" - + " \"admin_roles_assignment\"\n" - + " ],\n" - + " \"use_for_organization_discovery\": {\n" - + " \"default_value\": true,\n" - + " \"allowed_values\": [\n" - + " true\n" - + " ]\n" - + " },\n" - + " \"role_visibility_policy\": {\n" - + " \"default_value\": \"write\",\n" - + " \"overrides\": [\n" - + " {\n" - + " \"role_id\": \"role_id\",\n" - + " \"access\": \"write\"\n" - + " }\n" - + " ]\n" - + " },\n" - + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" - + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" - + "}"; - JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); - JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); - Assertions.assertTrue( - jsonEquals(expectedResponseNode, actualResponseNode), - "Response body structure does not match expected"); - if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { - String discriminator = null; - if (actualResponseNode.has("type")) - discriminator = actualResponseNode.get("type").asText(); - else if (actualResponseNode.has("_type")) - discriminator = actualResponseNode.get("_type").asText(); - else if (actualResponseNode.has("kind")) - discriminator = actualResponseNode.get("kind").asText(); - Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); - Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); - } - - if (!actualResponseNode.isNull()) { - Assertions.assertTrue( - actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), - "response should be a valid JSON value"); - } - - if (actualResponseNode.isArray()) { - Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); - } - if (actualResponseNode.isObject()) { - Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); - } - } - - @Test - public void testGet() throws Exception { - server.enqueue( - new MockResponse() - .setResponseCode(200) - .setBody( - "{\"id\":\"id\",\"name\":\"name\",\"is_default\":true,\"organization_deletion_behavior\":\"allow\",\"connection_deletion_behavior\":\"allow\",\"enforce_permission_ceiling\":true,\"enforce_self_assignment_restriction\":true,\"connection_profile_id\":\"connection_profile_id\",\"user_attribute_profile_id\":\"user_attribute_profile_id\",\"allowed_strategies\":[\"adfs\"],\"invitation_landing_client_id\":\"invitation_landing_client_id\",\"admin_roles_assignment\":[\"admin_roles_assignment\"],\"use_for_organization_discovery\":{\"default_value\":true,\"allowed_values\":[true]},\"role_visibility_policy\":{\"default_value\":\"write\",\"overrides\":[{\"role_id\":\"role_id\",\"access\":\"write\"}]},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}")); - OrganizationTemplate response = client.organizationTemplates().get("id"); - RecordedRequest request = server.takeRequest(); - Assertions.assertNotNull(request); - Assertions.assertEquals("GET", request.getMethod()); - - // Validate response body - Assertions.assertNotNull(response, "Response should not be null"); - String actualResponseJson = objectMapper.writeValueAsString(response); - String expectedResponseBody = "" - + "{\n" - + " \"id\": \"id\",\n" - + " \"name\": \"name\",\n" - + " \"is_default\": true,\n" - + " \"organization_deletion_behavior\": \"allow\",\n" - + " \"connection_deletion_behavior\": \"allow\",\n" - + " \"enforce_permission_ceiling\": true,\n" - + " \"enforce_self_assignment_restriction\": true,\n" - + " \"connection_profile_id\": \"connection_profile_id\",\n" - + " \"user_attribute_profile_id\": \"user_attribute_profile_id\",\n" - + " \"allowed_strategies\": [\n" - + " \"adfs\"\n" - + " ],\n" - + " \"invitation_landing_client_id\": \"invitation_landing_client_id\",\n" - + " \"admin_roles_assignment\": [\n" - + " \"admin_roles_assignment\"\n" - + " ],\n" - + " \"use_for_organization_discovery\": {\n" - + " \"default_value\": true,\n" - + " \"allowed_values\": [\n" - + " true\n" - + " ]\n" - + " },\n" - + " \"role_visibility_policy\": {\n" - + " \"default_value\": \"write\",\n" - + " \"overrides\": [\n" - + " {\n" - + " \"role_id\": \"role_id\",\n" - + " \"access\": \"write\"\n" - + " }\n" - + " ]\n" - + " },\n" - + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" - + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" - + "}"; - JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); - JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); - Assertions.assertTrue( - jsonEquals(expectedResponseNode, actualResponseNode), - "Response body structure does not match expected"); - if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { - String discriminator = null; - if (actualResponseNode.has("type")) - discriminator = actualResponseNode.get("type").asText(); - else if (actualResponseNode.has("_type")) - discriminator = actualResponseNode.get("_type").asText(); - else if (actualResponseNode.has("kind")) - discriminator = actualResponseNode.get("kind").asText(); - Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); - Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); - } - - if (!actualResponseNode.isNull()) { - Assertions.assertTrue( - actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), - "response should be a valid JSON value"); - } - - if (actualResponseNode.isArray()) { - Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); - } - if (actualResponseNode.isObject()) { - Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); - } - } - - @Test - public void testUpdate() throws Exception { - server.enqueue( - new MockResponse() - .setResponseCode(200) - .setBody( - "{\"id\":\"id\",\"name\":\"name\",\"is_default\":true,\"organization_deletion_behavior\":\"allow\",\"connection_deletion_behavior\":\"allow\",\"enforce_permission_ceiling\":true,\"enforce_self_assignment_restriction\":true,\"connection_profile_id\":\"connection_profile_id\",\"user_attribute_profile_id\":\"user_attribute_profile_id\",\"allowed_strategies\":[\"adfs\"],\"invitation_landing_client_id\":\"invitation_landing_client_id\",\"admin_roles_assignment\":[\"admin_roles_assignment\"],\"use_for_organization_discovery\":{\"default_value\":true,\"allowed_values\":[true]},\"role_visibility_policy\":{\"default_value\":\"write\",\"overrides\":[{\"role_id\":\"role_id\",\"access\":\"write\"}]},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}")); - OrganizationTemplate response = client.organizationTemplates() - .update("id", UpdateOrganizationTemplateRequestContent.builder().build()); - RecordedRequest request = server.takeRequest(); - Assertions.assertNotNull(request); - Assertions.assertEquals("PATCH", request.getMethod()); - // Validate request body - String actualRequestBody = request.getBody().readUtf8(); - String expectedRequestBody = "" + "{}"; - JsonNode actualJson = objectMapper.readTree(actualRequestBody); - JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); - Assertions.assertTrue(jsonEquals(expectedJson, actualJson), "Request body structure does not match expected"); - if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { - String discriminator = null; - if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); - else if (actualJson.has("_type")) - discriminator = actualJson.get("_type").asText(); - else if (actualJson.has("kind")) - discriminator = actualJson.get("kind").asText(); - Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); - Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); - } - - if (!actualJson.isNull()) { - Assertions.assertTrue( - actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), - "request should be a valid JSON value"); - } - - if (actualJson.isArray()) { - Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); - } - if (actualJson.isObject()) { - Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); - } - - // Validate response body - Assertions.assertNotNull(response, "Response should not be null"); - String actualResponseJson = objectMapper.writeValueAsString(response); - String expectedResponseBody = "" - + "{\n" - + " \"id\": \"id\",\n" - + " \"name\": \"name\",\n" - + " \"is_default\": true,\n" - + " \"organization_deletion_behavior\": \"allow\",\n" - + " \"connection_deletion_behavior\": \"allow\",\n" - + " \"enforce_permission_ceiling\": true,\n" - + " \"enforce_self_assignment_restriction\": true,\n" - + " \"connection_profile_id\": \"connection_profile_id\",\n" - + " \"user_attribute_profile_id\": \"user_attribute_profile_id\",\n" - + " \"allowed_strategies\": [\n" - + " \"adfs\"\n" - + " ],\n" - + " \"invitation_landing_client_id\": \"invitation_landing_client_id\",\n" - + " \"admin_roles_assignment\": [\n" - + " \"admin_roles_assignment\"\n" - + " ],\n" - + " \"use_for_organization_discovery\": {\n" - + " \"default_value\": true,\n" - + " \"allowed_values\": [\n" - + " true\n" - + " ]\n" - + " },\n" - + " \"role_visibility_policy\": {\n" - + " \"default_value\": \"write\",\n" - + " \"overrides\": [\n" - + " {\n" - + " \"role_id\": \"role_id\",\n" - + " \"access\": \"write\"\n" - + " }\n" - + " ]\n" - + " },\n" - + " \"created_at\": \"2024-01-15T09:30:00Z\",\n" - + " \"updated_at\": \"2024-01-15T09:30:00Z\"\n" - + "}"; - JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); - JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); - Assertions.assertTrue( - jsonEquals(expectedResponseNode, actualResponseNode), - "Response body structure does not match expected"); - if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { - String discriminator = null; - if (actualResponseNode.has("type")) - discriminator = actualResponseNode.get("type").asText(); - else if (actualResponseNode.has("_type")) - discriminator = actualResponseNode.get("_type").asText(); - else if (actualResponseNode.has("kind")) - discriminator = actualResponseNode.get("kind").asText(); - Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); - Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); - } - - if (!actualResponseNode.isNull()) { - Assertions.assertTrue( - actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), - "response should be a valid JSON value"); - } - - if (actualResponseNode.isArray()) { - Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); - } - if (actualResponseNode.isObject()) { - Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); - } - } - - @Test - public void testListOrganizations() throws Exception { - server.enqueue(new MockResponse() - .setResponseCode(200) - .setBody("{\"next\":\"next\",\"organizations\":[{\"id\":\"id\"}]}")); - SyncPagingIterable response = client.organizationTemplates() - .listOrganizations( - "id", - ListTemplateOrganizationsRequestParameters.builder() - .from("from") - .take(1) - .build()); - RecordedRequest request = server.takeRequest(); - Assertions.assertNotNull(request); - Assertions.assertEquals("GET", request.getMethod()); - - // Validate response body - Assertions.assertNotNull(response, "Response should not be null"); - // Pagination response validated via MockWebServer - // The SDK correctly parses the response into a SyncPagingIterable - } - - /** - * Compares two JsonNodes with numeric equivalence and null safety. - * For objects, checks that all fields in 'expected' exist in 'actual' with matching values. - * Allows 'actual' to have extra fields (e.g., default values added during serialization). - */ - private boolean jsonEquals(JsonNode expected, JsonNode actual) { - if (expected == null && actual == null) return true; - if (expected == null || actual == null) return false; - if (expected.equals(actual)) return true; - if (expected.isNumber() && actual.isNumber()) - return Math.abs(expected.doubleValue() - actual.doubleValue()) < 1e-10; - if (expected.isObject() && actual.isObject()) { - java.util.Iterator> iter = expected.fields(); - while (iter.hasNext()) { - java.util.Map.Entry entry = iter.next(); - JsonNode actualValue = actual.get(entry.getKey()); - if (actualValue == null) { - if (!entry.getValue().isNull()) return false; - } else if (!jsonEquals(entry.getValue(), actualValue)) return false; - } - return true; - } - if (expected.isArray() && actual.isArray()) { - if (expected.size() != actual.size()) return false; - for (int i = 0; i < expected.size(); i++) { - if (!jsonEquals(expected.get(i), actual.get(i))) return false; - } - return true; - } - return false; - } -} diff --git a/src/test/java/com/auth0/client/mgmt/OrganizationsWireTest.java b/src/test/java/com/auth0/client/mgmt/OrganizationsWireTest.java index b1a342862..3315878ac 100644 --- a/src/test/java/com/auth0/client/mgmt/OrganizationsWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/OrganizationsWireTest.java @@ -8,6 +8,10 @@ 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.OrganizationSortFieldEnum; +import com.auth0.client.mgmt.types.SearchOrganization; +import com.auth0.client.mgmt.types.SearchOrganizationsRequestParameters; +import com.auth0.client.mgmt.types.SearchParserEnum; import com.auth0.client.mgmt.types.UpdateOrganizationRequestContent; import com.auth0.client.mgmt.types.UpdateOrganizationResponseContent; import com.fasterxml.jackson.databind.JsonNode; @@ -251,6 +255,31 @@ else if (actualResponseNode.has("kind")) } } + @Test + public void testSearch() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"organizations\":[{\"id\":\"id\",\"name\":\"name\",\"display_name\":\"display_name\",\"token_quota\":{\"client_credentials\":{}},\"third_party_client_access\":\"block\",\"is_app_entitlement_active\":true}],\"next\":\"next\"}")); + SyncPagingIterable response = client.organizations() + .search(SearchOrganizationsRequestParameters.builder() + .q("q") + .parser(SearchParserEnum.SCIM) + .take(1) + .from("from") + .sort(OrganizationSortFieldEnum.NAME) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + @Test public void testGet() throws Exception { server.enqueue( diff --git a/src/test/java/com/auth0/client/mgmt/ResourceServersWireTest.java b/src/test/java/com/auth0/client/mgmt/ResourceServersWireTest.java index 9e142aa87..8af38c25e 100644 --- a/src/test/java/com/auth0/client/mgmt/ResourceServersWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/ResourceServersWireTest.java @@ -8,6 +8,10 @@ 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.ResourceServerSortFieldEnum; +import com.auth0.client.mgmt.types.SearchParserEnum; +import com.auth0.client.mgmt.types.SearchResourceServersRequestParameters; import com.auth0.client.mgmt.types.UpdateResourceServerRequestContent; import com.auth0.client.mgmt.types.UpdateResourceServerResponseContent; import com.fasterxml.jackson.databind.JsonNode; @@ -47,7 +51,7 @@ public void testList() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"resource_servers\":[{\"id\":\"id\",\"name\":\"name\",\"is_system\":true,\"identifier\":\"identifier\",\"scopes\":[{\"value\":\"value\"}],\"signing_alg\":\"HS256\",\"signing_secret\":\"signing_secret\",\"allow_offline_access\":true,\"allow_online_access\":true,\"allow_online_access_with_ephemeral_sessions\":true,\"skip_consent_for_verifiable_first_party_clients\":true,\"token_lifetime\":1,\"token_lifetime_for_web\":1,\"enforce_policies\":true,\"token_dialect\":\"access_token\",\"token_encryption\":{\"format\":\"compact-nested-jwe\",\"encryption_key\":{\"alg\":\"RSA-OAEP-256\",\"pem\":\"pem\"}},\"consent_policy\":\"transactional-authorization-with-mfa\",\"proof_of_possession\":{\"mechanism\":\"mtls\",\"required\":true},\"authorization_policy\":{\"policy_id\":\"policy_id\"},\"client_id\":\"client_id\"}]}")); + "{\"start\":1.1,\"limit\":1.1,\"total\":1.1,\"resource_servers\":[{\"id\":\"id\",\"name\":\"name\",\"is_system\":true,\"identifier\":\"identifier\",\"scopes\":[{\"value\":\"value\"}],\"signing_alg\":\"HS256\",\"signing_secret\":\"signing_secret\",\"allow_offline_access\":true,\"allow_online_access\":true,\"allow_online_access_with_ephemeral_sessions\":true,\"skip_consent_for_verifiable_first_party_clients\":true,\"token_lifetime\":1,\"token_lifetime_for_web\":1,\"enforce_policies\":true,\"token_lifetime_for_anonymous_access_tokens\":1,\"token_dialect\":\"access_token\",\"token_encryption\":{\"format\":\"compact-nested-jwe\",\"encryption_key\":{\"alg\":\"RSA-OAEP-256\",\"pem\":\"pem\"}},\"consent_policy\":\"transactional-authorization-with-mfa\",\"proof_of_possession\":{\"mechanism\":\"mtls\",\"required\":true},\"authorization_policy\":{\"policy_id\":\"policy_id\"},\"client_id\":\"client_id\"}]}")); SyncPagingIterable response = client.resourceServers() .list(ListResourceServerRequestParameters.builder() .page(1) @@ -144,6 +148,33 @@ else if (actualResponseNode.has("kind")) } } + @Test + public void testSearch() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"resource_servers\":[{\"id\":\"id\",\"name\":\"name\",\"is_system\":true,\"identifier\":\"identifier\",\"scopes\":[{\"value\":\"value\"}],\"signing_alg\":\"HS256\",\"allow_offline_access\":true,\"allow_online_access\":true,\"allow_online_access_with_ephemeral_sessions\":true,\"skip_consent_for_verifiable_first_party_clients\":true,\"token_lifetime\":1,\"token_lifetime_for_web\":1,\"enforce_policies\":true,\"token_lifetime_for_anonymous_access_tokens\":1,\"token_dialect\":\"access_token\",\"token_encryption\":{\"format\":\"compact-nested-jwe\",\"encryption_key\":{\"alg\":\"RSA-OAEP-256\",\"pem\":\"pem\"}},\"consent_policy\":\"transactional-authorization-with-mfa\",\"proof_of_possession\":{\"mechanism\":\"mtls\",\"required\":true},\"authorization_policy\":{\"policy_id\":\"policy_id\"},\"client_id\":\"client_id\"}],\"next\":\"next\"}")); + SyncPagingIterable response = client.resourceServers() + .search(SearchResourceServersRequestParameters.builder() + .q("q") + .parser(SearchParserEnum.SCIM) + .fields("fields") + .includeFields(true) + .take(1) + .from("from") + .sort(ResourceServerSortFieldEnum.IDENTIFIER) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("GET", request.getMethod()); + + // Validate response body + Assertions.assertNotNull(response, "Response should not be null"); + // Pagination response validated via MockWebServer + // The SDK correctly parses the response into a SyncPagingIterable + } + @Test public void testGet() throws Exception { server.enqueue(new MockResponse() diff --git a/src/test/resources/wire-tests/ClientsWireTest_testCreate_response.json b/src/test/resources/wire-tests/ClientsWireTest_testCreate_response.json index 2474555ab..f4654f5df 100644 --- a/src/test/resources/wire-tests/ClientsWireTest_testCreate_response.json +++ b/src/test/resources/wire-tests/ClientsWireTest_testCreate_response.json @@ -1,5 +1,7 @@ { "client_id": "client_id", + "created_at": "2024-01-15T09:30:00Z", + "updated_at": "2024-01-15T09:30:00Z", "tenant": "tenant", "name": "name", "description": "description", @@ -404,6 +406,9 @@ "identity_assertion_authorization_grant": { "active": true }, + "anonymous_sessions": { + "active": true + }, "third_party_security_mode": "strict", "redirection_policy": "allow_always", "resource_server_identifier": "resource_server_identifier", diff --git a/src/test/resources/wire-tests/ClientsWireTest_testGet_response.json b/src/test/resources/wire-tests/ClientsWireTest_testGet_response.json index 2474555ab..f4654f5df 100644 --- a/src/test/resources/wire-tests/ClientsWireTest_testGet_response.json +++ b/src/test/resources/wire-tests/ClientsWireTest_testGet_response.json @@ -1,5 +1,7 @@ { "client_id": "client_id", + "created_at": "2024-01-15T09:30:00Z", + "updated_at": "2024-01-15T09:30:00Z", "tenant": "tenant", "name": "name", "description": "description", @@ -404,6 +406,9 @@ "identity_assertion_authorization_grant": { "active": true }, + "anonymous_sessions": { + "active": true + }, "third_party_security_mode": "strict", "redirection_policy": "allow_always", "resource_server_identifier": "resource_server_identifier", diff --git a/src/test/resources/wire-tests/ClientsWireTest_testList_response.json b/src/test/resources/wire-tests/ClientsWireTest_testList_response.json index 101ff9565..0f0f82de2 100644 --- a/src/test/resources/wire-tests/ClientsWireTest_testList_response.json +++ b/src/test/resources/wire-tests/ClientsWireTest_testList_response.json @@ -5,6 +5,8 @@ "clients": [ { "client_id": "client_id", + "created_at": "2024-01-15T09:30:00Z", + "updated_at": "2024-01-15T09:30:00Z", "tenant": "tenant", "name": "name", "description": "description", @@ -100,6 +102,9 @@ "identity_assertion_authorization_grant": { "active": true }, + "anonymous_sessions": { + "active": true + }, "third_party_security_mode": "strict", "redirection_policy": "allow_always", "resource_server_identifier": "resource_server_identifier", diff --git a/src/test/resources/wire-tests/ClientsWireTest_testRotateSecret_response.json b/src/test/resources/wire-tests/ClientsWireTest_testRotateSecret_response.json index 2474555ab..f4654f5df 100644 --- a/src/test/resources/wire-tests/ClientsWireTest_testRotateSecret_response.json +++ b/src/test/resources/wire-tests/ClientsWireTest_testRotateSecret_response.json @@ -1,5 +1,7 @@ { "client_id": "client_id", + "created_at": "2024-01-15T09:30:00Z", + "updated_at": "2024-01-15T09:30:00Z", "tenant": "tenant", "name": "name", "description": "description", @@ -404,6 +406,9 @@ "identity_assertion_authorization_grant": { "active": true }, + "anonymous_sessions": { + "active": true + }, "third_party_security_mode": "strict", "redirection_policy": "allow_always", "resource_server_identifier": "resource_server_identifier", diff --git a/src/test/resources/wire-tests/ClientsWireTest_testUpdate_response.json b/src/test/resources/wire-tests/ClientsWireTest_testUpdate_response.json index 2474555ab..f4654f5df 100644 --- a/src/test/resources/wire-tests/ClientsWireTest_testUpdate_response.json +++ b/src/test/resources/wire-tests/ClientsWireTest_testUpdate_response.json @@ -1,5 +1,7 @@ { "client_id": "client_id", + "created_at": "2024-01-15T09:30:00Z", + "updated_at": "2024-01-15T09:30:00Z", "tenant": "tenant", "name": "name", "description": "description", @@ -404,6 +406,9 @@ "identity_assertion_authorization_grant": { "active": true }, + "anonymous_sessions": { + "active": true + }, "third_party_security_mode": "strict", "redirection_policy": "allow_always", "resource_server_identifier": "resource_server_identifier", diff --git a/src/test/resources/wire-tests/ResourceServersWireTest_testCreate_response.json b/src/test/resources/wire-tests/ResourceServersWireTest_testCreate_response.json index ab2361d4b..6284f84fb 100644 --- a/src/test/resources/wire-tests/ResourceServersWireTest_testCreate_response.json +++ b/src/test/resources/wire-tests/ResourceServersWireTest_testCreate_response.json @@ -18,6 +18,7 @@ "token_lifetime": 1, "token_lifetime_for_web": 1, "enforce_policies": true, + "token_lifetime_for_anonymous_access_tokens": 1, "token_dialect": "access_token", "token_encryption": { "format": "compact-nested-jwe", @@ -45,6 +46,9 @@ }, "client": { "policy": "deny_all" + }, + "anonymous_user": { + "policy": "deny_all" } }, "authorization_policy": { diff --git a/src/test/resources/wire-tests/ResourceServersWireTest_testGet_response.json b/src/test/resources/wire-tests/ResourceServersWireTest_testGet_response.json index ab2361d4b..6284f84fb 100644 --- a/src/test/resources/wire-tests/ResourceServersWireTest_testGet_response.json +++ b/src/test/resources/wire-tests/ResourceServersWireTest_testGet_response.json @@ -18,6 +18,7 @@ "token_lifetime": 1, "token_lifetime_for_web": 1, "enforce_policies": true, + "token_lifetime_for_anonymous_access_tokens": 1, "token_dialect": "access_token", "token_encryption": { "format": "compact-nested-jwe", @@ -45,6 +46,9 @@ }, "client": { "policy": "deny_all" + }, + "anonymous_user": { + "policy": "deny_all" } }, "authorization_policy": { diff --git a/src/test/resources/wire-tests/ResourceServersWireTest_testUpdate_response.json b/src/test/resources/wire-tests/ResourceServersWireTest_testUpdate_response.json index ab2361d4b..6284f84fb 100644 --- a/src/test/resources/wire-tests/ResourceServersWireTest_testUpdate_response.json +++ b/src/test/resources/wire-tests/ResourceServersWireTest_testUpdate_response.json @@ -18,6 +18,7 @@ "token_lifetime": 1, "token_lifetime_for_web": 1, "enforce_policies": true, + "token_lifetime_for_anonymous_access_tokens": 1, "token_dialect": "access_token", "token_encryption": { "format": "compact-nested-jwe", @@ -45,6 +46,9 @@ }, "client": { "policy": "deny_all" + }, + "anonymous_user": { + "policy": "deny_all" } }, "authorization_policy": { diff --git a/src/test/resources/wire-tests/TenantsSettingsWireTest_testGet_response.json b/src/test/resources/wire-tests/TenantsSettingsWireTest_testGet_response.json index d11d4f7b3..ca4589cbf 100644 --- a/src/test/resources/wire-tests/TenantsSettingsWireTest_testGet_response.json +++ b/src/test/resources/wire-tests/TenantsSettingsWireTest_testGet_response.json @@ -95,7 +95,11 @@ "mode": "persistent" }, "sessions": { - "oidc_logout_prompt_enabled": true + "oidc_logout_prompt_enabled": true, + "anonymous": { + "lifetime_in_minutes": 1, + "activate_cookie": true + } }, "oidc_logout": { "rp_logout_end_session_endpoint_discovery": true diff --git a/src/test/resources/wire-tests/TenantsSettingsWireTest_testUpdate_response.json b/src/test/resources/wire-tests/TenantsSettingsWireTest_testUpdate_response.json index d11d4f7b3..ca4589cbf 100644 --- a/src/test/resources/wire-tests/TenantsSettingsWireTest_testUpdate_response.json +++ b/src/test/resources/wire-tests/TenantsSettingsWireTest_testUpdate_response.json @@ -95,7 +95,11 @@ "mode": "persistent" }, "sessions": { - "oidc_logout_prompt_enabled": true + "oidc_logout_prompt_enabled": true, + "anonymous": { + "lifetime_in_minutes": 1, + "activate_cookie": true + } }, "oidc_logout": { "rp_logout_end_session_endpoint_discovery": true