diff --git a/reference.md b/reference.md index 4c230e4f..1050c61d 100644 --- a/reference.md +++ b/reference.md @@ -375,7 +375,7 @@ client.actions().delete(
-Update an existing action. If this action is currently bound to a trigger, updating it will not affect any user flows until the action is deployed. +Update an existing action. If this action is currently bound to a trigger, updating it will **not** affect any user flows until the action is deployed.
@@ -3239,25 +3239,23 @@ client.connectionProfiles().update(
-Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. +Retrieves detailed list of all [connections](https://auth0.com/docs/authenticate/identity-providers) that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. This endpoint supports two types of pagination: - + +- Offset pagination +- Checkpoint pagination Checkpoint pagination must be used if you need to retrieve more than 1000 connections. -

Checkpoint Pagination

+**Checkpoint Pagination** To search by checkpoint, use the following parameters: - -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. +- `from`: Optional id from which to start selection. +- `take`: The total amount 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.
@@ -3373,9 +3371,9 @@ client.connections().list(
-Creates a new connection according to the JSON object received in body. +Creates a new connection according to the JSON object received in `body`. -Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results. +**Note:** If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results.
@@ -3515,7 +3513,7 @@ client.connections().create(
-Retrieve details for a specified connection along with options that can be used for identity provider configuration. +Retrieve details for a specified [connection](https://auth0.com/docs/authenticate/identity-providers) along with options that can be used for identity provider configuration.
@@ -3596,9 +3594,9 @@ client.connections().get(
-Removes a specific connection from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. +Removes a specific [connection](https://auth0.com/docs/authenticate/identity-providers) from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. -Note: If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent create connection requests, if they use an identical connection name. +**Note:** If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent [create connection](https://auth0.com/docs/api/management/v2/connections/post-connections) requests, if they use an identical connection name.
@@ -3652,9 +3650,9 @@ client.connections().delete("id");
-Update details for a specific connection, including option properties for identity provider configuration. +Update details for a specific [connection](https://auth0.com/docs/authenticate/identity-providers), including option properties for identity provider configuration. -Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option. +**Note**: If you use the `options` parameter, the entire `options` object is overridden. To avoid partial data or other issues, ensure all parameters are present when using this option.
@@ -3785,7 +3783,7 @@ client.connections().update(
-Retrieves the status of an ad/ldap connection referenced by its ID. 200 OK http status code response is returned when the connection is online, otherwise a 404 status code is returned along with an error message +Retrieves the status of an ad/ldap connection referenced by its `ID`. `200 OK` http status code response is returned when the connection is online, otherwise a `404` status code is returned along with an error message
@@ -3840,7 +3838,7 @@ client.connections().checkStatus("id");
-Retrieve details on custom domains. +Retrieve details on [custom domains](https://auth0.com/docs/custom-domains).
@@ -3944,7 +3942,6 @@ Optional attributes that can be updated: - custom_client_ip_header - tls_policy - TLS Policies: - recommended - for modern usage this includes TLS 1.2 only @@ -4268,23 +4265,31 @@ These are the attributes that can be updated: - custom_client_ip_header - tls_policy -
Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
To update the custom_client_ip_header for a domain, the body to +**Updating CUSTOM_CLIENT_IP_HEADER for a custom domain** + +To update the `custom_client_ip_header` for a domain, the body to send should be: -
{ "custom_client_ip_header": "cf-connecting-ip" }
-
Updating TLS_POLICY for a custom domain
To update the tls_policy for a domain, the body to send should be: -
{ "tls_policy": "recommended" }
+```json +{ "custom_client_ip_header": "cf-connecting-ip" } +``` + +**Updating TLS_POLICY for a custom domain** +To update the `tls_policy` for a domain, the body to send should be: + +```json +{ "tls_policy": "recommended" } +``` TLS Policies: - recommended - for modern usage this includes TLS 1.2 only - Some considerations: - The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally. -- The compatible TLS policy is no longer supported. +- The `compatible` TLS policy is no longer supported. @@ -4431,12 +4436,12 @@ client.customDomains().test("id"); Run the verification process on a custom domain. -Note: Check the status field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests. +Note: Check the `status` field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests. -For self_managed_certs, when the custom domain is verified for the first time, the response will also include the cname_api_key which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests. +For `self_managed_certs`, when the custom domain is verified for the first time, the response will also include the `cname_api_key` which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests. -Learn more about verifying custom domains that use Auth0 Managed certificates. -Learn more about verifying custom domains that use Self Managed certificates. +[Learn more](https://auth0.com/docs/custom-domains#step-2-verify-ownership) about verifying custom domains that use Auth0 Managed certificates. +[Learn more](https://auth0.com/docs/custom-domains/self-managed-certificates#step-2-verify-ownership) about verifying custom domains that use Self Managed certificates. @@ -6816,7 +6821,7 @@ client.groups().delete("id");
-Retrieve all hooks. Accepts a list of fields to include or exclude in the result. +Retrieve all [hooks](https://auth0.com/docs/hooks). Accepts a list of fields to include or exclude in the result.
@@ -7025,7 +7030,7 @@ client.hooks().create(
-Retrieve a hook by its ID. Accepts a list of fields to include in the result. +Retrieve [a hook](https://auth0.com/docs/hooks) by its ID. Accepts a list of fields to include in the result.
@@ -8110,33 +8115,30 @@ client.logStreams().update( Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). -Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint"). +Set custom search criteria using the `q` parameter, or search from a specific log ID (_"search from checkpoint"_). -For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes. +For more information on all possible event types, their respective acronyms, and descriptions, see [Log Event Type Codes](https://auth0.com/docs/logs/log-event-type-codes). -
To set custom search criteria, use the following parameters:
+**To set custom search criteria, use the following parameters:** - +- **q:** Search Criteria using [Query String Syntax](https://auth0.com/docs/logs/log-search-query-syntax) +- **page:** Page index of the results to return. First page is 0. +- **per_page:** Number of results per page. +- **sort:** Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1` +- **fields:** Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields. +- **include_fields:** Whether specified fields are to be included (true) or excluded (false). +- **include_totals:** Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). **Deprecated:** this field is deprecated and should be removed from use. See [Search Engine V3 Breaking Changes](https://auth0.com/docs/product-lifecycle/deprecations-and-migrations/migrate-to-tenant-log-search-v3#pagination) -For more information on the list of fields that can be used in fields and sort, see Searchable Fields. +For more information on the list of fields that can be used in `fields` and `sort`, see [Searchable Fields](https://auth0.com/docs/logs/log-search-query-syntax#searchable-fields). -Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method. +Auth0 [limits the number of logs](https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#limitations) you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the [get logs by checkpoint method](https://auth0.com/docs/logs/retrieve-log-events-using-mgmt-api#retrieve-logs-by-checkpoint). -
To search from a checkpoint log ID, use the following parameters:
- +**To search from a checkpoint log ID, use the following parameters:** + +- **from:** Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the `take` parameter. If you use `from` at the same time as `q`, `from` takes precedence and `q` is ignored. +- **take:** Number of entries to retrieve when using the `from` parameter. -Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed. +**Important:** When fetching logs from a checkpoint log ID, any parameter other than `from` and `take` will be ignored, and date ordering is not guaranteed. @@ -9365,6 +9367,318 @@ client.prompts().updateSettings( + + + + +## RateLimitPolicies +
client.rateLimitPolicies.list() -> SyncPagingIterable<RateLimitPolicy> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.rateLimitPolicies().list( + ListRateLimitPoliciesRequestParameters + .builder() + .resource( + OptionalNullable.of(RateLimitPolicyResourceEnum.OAUTH_AUTHENTICATION_API) + ) + .consumer( + OptionalNullable.of(RateLimitPolicyConsumerEnum.CLIENT) + ) + .consumerSelector( + OptionalNullable.of("consumer_selector") + ) + .take( + OptionalNullable.of(1) + ) + .from( + OptionalNullable.of("from") + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**resource:** `Optional` — The API protected by the Rate Limit Policy. + +
+
+ +
+
+ +**consumer:** `Optional` — The consumer to which the rate limit policy applies. + +
+
+ +
+
+ +**consumerSelector:** `Optional` — Identifier or category within the consumer to which the policy applies. Supported values: `client_id:` to target a specific client by ID, `client_id:` to target a CIMD client by URI, `cimd_clients` to target all CIMD clients, `third_party_clients` to target all third-party clients, or `default` to apply the policy to any consumer identifier not otherwise explicitly targeted. + +
+
+ +
+
+ +**take:** `Optional` — Number of results per page. Defaults to 50. + +
+
+ +
+
+ +**from:** `Optional` — Cursor for pagination. + +
+
+
+
+ + +
+
+
+ +
client.rateLimitPolicies.create(request) -> CreateRateLimitPolicyResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.rateLimitPolicies().create( + CreateRateLimitPolicyRequestContent + .builder() + .resource(RateLimitPolicyResourceEnum.OAUTH_AUTHENTICATION_API) + .consumer(RateLimitPolicyConsumerEnum.CLIENT) + .consumerSelector("consumer_selector") + .configuration( + RateLimitPolicyConfiguration.of( + RateLimitPolicyConfigurationZero + .builder() + .action(RateLimitPolicyConfigurationZeroAction.ALLOW) + .build() + ) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**resource:** `RateLimitPolicyResourceEnum` + +
+
+ +
+
+ +**consumer:** `RateLimitPolicyConsumerEnum` + +
+
+ +
+
+ +**consumerSelector:** `String` — Identifier or category within the consumer to which the policy applies. Supported values: `client_id:` to target a specific client by ID, `client_id:` to target a CIMD client by URI, `cimd_clients` to target all CIMD clients, `third_party_clients` to target all third-party clients, or `default` to apply the policy to any consumer identifier not otherwise explicitly targeted. + +
+
+ +
+
+ +**configuration:** `RateLimitPolicyConfiguration` + +
+
+
+
+ + +
+
+
+ +
client.rateLimitPolicies.get(id) -> GetRateLimitPolicyResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.rateLimitPolicies().get("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Unique identifier for the Rate Limit Policy. + +
+
+
+
+ + +
+
+
+ +
client.rateLimitPolicies.delete(id) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.rateLimitPolicies().delete("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Unique identifier for the Rate Limit Policy. + +
+
+
+
+ + +
+
+
+ +
client.rateLimitPolicies.update(id, request) -> UpdateRateLimitPolicyResponseContent +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.rateLimitPolicies().update( + "id", + PatchRateLimitPolicyRequestContent + .builder() + .configuration( + PatchRateLimitPolicyConfigurationRequestContent.of( + PatchRateLimitPolicyConfigurationRequestContentZero + .builder() + .action(PatchRateLimitPolicyConfigurationRequestContentZeroAction.ALLOW) + .build() + ) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Unique identifier for the Rate Limit Policy. + +
+
+ +
+
+ +**configuration:** `PatchRateLimitPolicyConfigurationRequestContent` + +
+
+
+
+ +
@@ -10376,7 +10690,7 @@ client.resourceServers().update( Retrieve detailed list of user roles created in your tenant. -Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access. +**Note**: The returned list does not include standard roles available for tenant members, such as Admin or Support Access. @@ -10470,9 +10784,9 @@ client.roles().list(
-Create a user role for Role-Based Access Control. +Create a user role for [Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/rbac). -Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions. +**Note**: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.
@@ -10539,7 +10853,7 @@ client.roles().create(
-Retrieve details about a specific user role specified by ID. +Retrieve details about a specific [user role](https://auth0.com/docs/manage-users/access-control/rbac) specified by ID.
@@ -10593,7 +10907,7 @@ client.roles().get("id");
-Delete a specific user role from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone. +Delete a specific [user role](https://auth0.com/docs/manage-users/access-control/rbac) from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone.
@@ -10647,7 +10961,7 @@ client.roles().delete("id");
-Modify the details of a specific user role specified by ID. +Modify the details of a specific [user role](https://auth0.com/docs/manage-users/access-control/rbac) specified by ID.
@@ -10723,7 +11037,7 @@ client.roles().update(
-Retrieve a filtered list of rules. Accepts a list of fields to include or exclude. +Retrieve a filtered list of [rules](https://auth0.com/docs/rules). Accepts a list of fields to include or exclude.
@@ -10839,9 +11153,9 @@ client.rules().list(
-Create a new rule. +Create a [new rule](https://auth0.com/docs/rules#create-a-new-rule-using-the-management-api). -Note: Changing a rule's stage of execution from the default login_success can change the rule's function signature to have user omitted. +Note: Changing a rule's stage of execution from the default `login_success` can change the rule's function signature to have user omitted.
@@ -10925,7 +11239,7 @@ client.rules().create(
-Retrieve rule details. Accepts a list of fields to include or exclude in the result. +Retrieve [rule](https://auth0.com/docs/rules) details. Accepts a list of fields to include or exclude in the result.
@@ -12829,7 +13143,7 @@ client.userAttributeProfiles().list(
-Create a User Attribute Profile +Create a User Attribute Profile.
@@ -13008,7 +13322,7 @@ client.userAttributeProfiles().getTemplate("id");
-Retrieve details about a single User Attribute Profile specified by ID. +Retrieve details about a single User Attribute Profile specified by ID.
@@ -13474,14 +13788,18 @@ Retrieve details of users. It is possible to: - Sort the users to be returned - Select the fields to be returned - Specify the number of users to retrieve per page and the page index - -The q query parameter can be used to get users that match the specified criteria using query string syntax. -Learn more about searching for users. -Read about best practices when working with the API endpoints for retrieving users. -Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the export job, or the User Import / Export extension. +The `q` query parameter can be used to get users that match the specified criteria [using query string syntax.](https://auth0.com/docs/users/search/v3/query-syntax) + +[Learn more about searching for users.](https://auth0.com/docs/users/search/v3) + +Read about [best practices](https://auth0.com/docs/users/search/best-practices) when working with the API endpoints for retrieving users. + + + +Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the [export job](https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports), or the [User Import / Export](https://auth0.com/docs/extensions/user-import-export) extension. @@ -13641,9 +13959,9 @@ client.users().list(
-Create a new user for a given database or passwordless connection. +Create a new user for a given [database](https://auth0.com/docs/connections/database) or [passwordless](https://auth0.com/docs/connections/passwordless) connection. -Note: connection is required but other parameters such as email and password are dependent upon the type of connection. +Note: `connection` is required but other parameters such as `email` and `password` are dependent upon the type of connection.
@@ -13915,7 +14233,7 @@ client.users().listUsersByEmail(
-Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see Retrieve Users with the Get Users Endpoint. +Retrieve user details. A list of fields to include or exclude may also be specified. For more information, see [Retrieve Users with the Get Users Endpoint](https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-endpoint).
@@ -13996,7 +14314,7 @@ client.users().get(
-Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see Delete Users. +Delete a user by user ID. This action cannot be undone. For Auth0 Dashboard instructions, see [Delete Users](https://auth0.com/docs/manage-users/user-accounts/delete-users).
@@ -14054,64 +14372,84 @@ Update a user. These are the attributes that can be updated at the root level: - +- app_metadata +- blocked +- email +- email_verified +- family_name +- given_name +- name +- nickname +- password +- phone_number +- phone_verified +- picture +- username +- user_metadata +- verify_email Some considerations: - -
Updating a field (non-metadata property)
+- The properties of the new object will replace the old ones. +- The metadata fields are an exception to this rule (`user_metadata` and `app_metadata`). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level. +- If you are updating `email`, `email_verified`, `phone_number`, `phone_verified`, `username` or `password` of a secondary identity, you need to specify the `connection` property too. +- If you are updating `email` or `phone_number` you can specify, optionally, the `client_id` property. +- Updating `email_verified` is not supported for enterprise and passwordless sms connections. +- Updating the `blocked` to `false` does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state. +- Supported attributes can be unset by supplying `null` as the value. + +**Updating a field (non-metadata property)** + To mark the email address of a user as verified, the body to send should be: -
{ "email_verified": true }
-
Updating a user metadata root property
Let's assume that our test user has the following user_metadata: -
{ "user_metadata" : { "profileCode": 1479 } }
+```json +{ "email_verified": true } +``` + +**Updating a user metadata root property** + +Let's assume that our test user has the following `user_metadata`: + +```json +{ "user_metadata" : { "profileCode": 1479 } } +``` + +To add the field `addresses` the body to send should be: -To add the field addresses the body to send should be: -
{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
+```json +{ "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }} +``` + +The modified object ends up with the following `user_metadata` property: -The modified object ends up with the following user_metadata property:
{
+```json
+{
   "user_metadata": {
     "profileCode": 1479,
     "addresses": { "work_address": "100 Industrial Way" }
   }
-}
+} +``` + +**Updating an inner user metadata property** + +If there's existing user metadata to which we want to add `"home_address": "742 Evergreen Terrace"` (using the `addresses` property) we should send the whole `addresses` object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: -
Updating an inner user metadata property
If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: -
{
+```json
+{
   "user_metadata": {
     "addresses": {
       "work_address": "100 Industrial Way",
       "home_address": "742 Evergreen Terrace"
     }
   }
-}
+} +``` + +The modified object ends up with the following `user_metadata` property: -The modified object ends up with the following user_metadata property: -
{
+```json
+{
   "user_metadata": {
     "profileCode": 1479,
     "addresses": {
@@ -14119,7 +14457,8 @@ The modified object ends up with the following user_metadata proper
       "home_address": "742 Evergreen Terrace"
     }
   }
-}
+} +``` @@ -14322,7 +14661,7 @@ client.users().update(
-Remove an existing multi-factor authentication (MFA) recovery code and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate. +Remove an existing multi-factor authentication (MFA) [recovery code](https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa) and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate.
@@ -16447,28 +16786,28 @@ client.branding().templates().getUniversalLogin(); Update the Universal Login branding template. -

When content-type header is set to application/json:

-
+When `content-type` header is set to `application/json`:
+
+```json
 {
-  "template": "<!DOCTYPE html>{% assign resolved_dir = dir | default: "auto" %}<html lang="{{locale}}" dir="{{resolved_dir}}"><head>{%- auth0:head -%}</head><body class="_widget-auto-layout">{%- auth0:widget -%}</body></html>"
+  "template": "{% assign resolved_dir = dir | default: \"auto\" %}{%- auth0:head -%}{%- auth0:widget -%}"
 }
-
+``` -

- When content-type header is set to text/html: -

-
-<!DOCTYPE html>
+When `content-type` header is set to `text/html`:
+
+```html
+
 {% assign resolved_dir = dir | default: "auto" %}
-<html lang="{{locale}}" dir="{{resolved_dir}}">
-  <head>
+
+  
     {%- auth0:head -%}
-  </head>
-  <body class="_widget-auto-layout">
+  
+  
     {%- auth0:widget -%}
-  </body>
-</html>
-
+ + +``` @@ -19088,7 +19427,7 @@ client.connections().scimConfiguration().list(
-Retrieves a scim configuration by its connectionId. +Retrieves a scim configuration by its `connectionId`.
@@ -19207,7 +19546,7 @@ client.connections().scimConfiguration().create(
-Deletes a scim configuration by its connectionId. +Deletes a scim configuration by its `connectionId`.
@@ -19261,7 +19600,7 @@ client.connections().scimConfiguration().delete("id");
-Update a scim configuration by its connectionId. +Update a scim configuration by its `connectionId`.
@@ -19344,7 +19683,7 @@ client.connections().scimConfiguration().update(
-Retrieves a scim configuration's default mapping by its connectionId. +Retrieves a scim configuration's default mapping by its `connectionId`.
@@ -19399,9 +19738,9 @@ client.connections().scimConfiguration().getDefaultMapping("id");
-Retrieve all clients that have the specified connection enabled. +Retrieve all clients that have the specified [connection](https://auth0.com/docs/authenticate/identity-providers) enabled. -Note: The first time you call this endpoint, 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 further results are remaining. +**Note**: The first time you call this endpoint, 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 further results are remaining.
@@ -19849,7 +20188,7 @@ client.connections().directoryProvisioning().synchronizations().create("id");
-Retrieves all scim tokens by its connection id. +Retrieves all scim tokens by its connection `id`.
@@ -19978,7 +20317,7 @@ client.connections().scimConfiguration().tokens().create(
-Deletes a scim token by its connection id and tokenId. +Deletes a scim token by its connection `id` and `tokenId`.
@@ -21245,6 +21584,228 @@ client.groups().members().get( + + + + +## Groups Roles +
client.groups.roles.list(id) -> SyncPagingIterable&lt;Role&gt; +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists the roles assigned to a group. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.groups().roles().list( + "id", + ListGroupRolesRequestParameters + .builder() + .from( + OptionalNullable.of("from") + ) + .take( + OptionalNullable.of(1) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Unique identifier for the group (service-generated). + +
+
+ +
+
+ +**from:** `Optional` — Optional Id from which to start selection. + +
+
+ +
+
+ +**take:** `Optional` — Number of results per page. Defaults to 50. + +
+
+
+
+ + +
+
+
+ +
client.groups.roles.create(id, request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Assign one or more roles to a specified group. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.groups().roles().create( + "id", + CreateGroupRolesRequestParameters + .builder() + .roles( + Arrays.asList("roles") + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Unique identifier for the group (service-generated). + +
+
+ +
+
+ +**roles:** `List` — Array of role IDs to assign to the group. + +
+
+
+
+ + +
+
+
+ +
client.groups.roles.delete(id, request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Unassign one or more roles from a specified group. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.groups().roles().delete( + "id", + DeleteGroupRolesRequestContent + .builder() + .roles( + Arrays.asList("roles") + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — Unique identifier for the group (service-generated). + +
+
+ +
+
+ +**roles:** `List` — Array of role IDs to remove from the group. + +
+
+
+
+ +
@@ -21262,10 +21823,7 @@ client.groups().members().get(
-Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket, to a given user. -Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.
- -Note: Users cannot enroll in Email as a factor through custom enrollment tickets. +Create a [multi-factor authentication (MFA) enrollment ticket](https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/create-custom-enrollment-tickets), and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.
@@ -21418,7 +21976,7 @@ client.guardian().enrollments().get("id");
-Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review Reset User Multi-Factor Authentication and Recovery Codes. +Remove a specific multi-factor authentication (MFA) enrollment from a user's account. This allows the user to re-enroll with MFA. For more information, review [Reset User Multi-Factor Authentication and Recovery Codes](https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa).
@@ -21581,15 +22139,14 @@ client.guardian().factors().set(
-Retrieve the multi-factor authentication (MFA) policies configured for your tenant. +Retrieve the [multi-factor authentication (MFA) policies](https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa) configured for your tenant. The following policies are supported: - -Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details. +- `all-applications` policy prompts with MFA for all logins. +- `confidence-score` policy prompts with MFA only for low confidence logins. + +**Note**: The `confidence-score` policy is part of the [Adaptive MFA feature](https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa). Adaptive MFA requires an add-on for the Enterprise plan; review [Auth0 Pricing](https://auth0.com/pricing) for more details.
@@ -21628,15 +22185,14 @@ client.guardian().policies().list();
-Set multi-factor authentication (MFA) policies for your tenant. +Set [multi-factor authentication (MFA) policies](https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa) for your tenant. The following policies are supported: - -Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details. +- `all-applications` policy prompts with MFA for all logins. +- `confidence-score` policy prompts with MFA only for low confidence logins. + +**Note**: The `confidence-score` policy is part of the [Adaptive MFA feature](https://auth0.com/docs/secure/multi-factor-authentication/adaptive-mfa). Adaptive MFA requires an add-on for the Enterprise plan; review [Auth0 Pricing](https://auth0.com/pricing) for more details.
@@ -22525,7 +23081,7 @@ client.guardian().factors().pushNotification().updateFcmv1Provider(
-Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review Configure Push Notifications for MFA. +Retrieve configuration details for an AWS SNS push notification provider that has been enabled for MFA. To learn more, review [Configure Push Notifications for MFA](https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-push-notifications-for-mfa).
@@ -22564,7 +23120,7 @@ client.guardian().factors().pushNotification().getSnsProvider();
-Configure the AWS SNS push notification provider configuration (subscription required). +Configure the [AWS SNS push notification provider configuration](https://auth0.com/docs/multifactor-authentication/developer/sns-configuration) (subscription required).
@@ -22654,7 +23210,7 @@ client.guardian().factors().pushNotification().setSnsProvider(
-Configure the AWS SNS push notification provider configuration (subscription required). +Configure the [AWS SNS push notification provider configuration](https://auth0.com/docs/multifactor-authentication/developer/sns-configuration) (subscription required).
@@ -23356,7 +23912,7 @@ client.guardian().factors().duo().settings().update(
-Retrieve a hook's secrets by the ID of the hook. +Retrieve a hook's secrets by the ID of the hook.
@@ -23410,7 +23966,7 @@ client.hooks().secrets().get("id");
-Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets. +Add one or more secrets to an existing hook. Accepts an object of key-value pairs, where the key is the name of the secret. A hook can have a maximum of 20 secrets.
@@ -23477,7 +24033,7 @@ client.hooks().secrets().create(
-Delete one or more existing secrets for a given hook. Accepts an array of secret names to delete. +Delete one or more existing secrets for a given hook. Accepts an array of secret names to delete.
@@ -23542,7 +24098,7 @@ client.hooks().secrets().delete(
-Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret. +Update one or more existing secrets for an existing hook. Accepts an object of key-value pairs, where the key is the name of the existing secret.
@@ -23738,7 +24294,7 @@ client.jobs().usersImports().create(
-Send an email to the specified user that asks them to click a link to verify their email address. +Send an email to the specified user that asks them to click a link to [verify their email address](https://auth0.com/docs/email/custom#verification-email). Note: You must have the `Status` toggle enabled for the verification email template for the email to be sent.
@@ -27122,7 +27678,7 @@ client.prompts().rendering().list(
-Learn more about configuring render settings for advanced customization. +Learn more about [configuring render settings](https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens) for advanced customization.
@@ -27251,7 +27807,7 @@ client.prompts().rendering().get(PromptGroupNameEnum.LOGIN, ScreenGroupNameEnum.
-Learn more about configuring render settings for advanced customization. +Learn more about [configuring render settings](https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens) for advanced customization.
@@ -27919,7 +28475,7 @@ client.roles().permissions().list(
-Add one or more permissions to a specified user role. +Add one or more [permissions](https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions) to a specified user role.
@@ -27995,7 +28551,7 @@ client.roles().permissions().add(
-Remove one or more permissions from a specified user role. +Remove one or more [permissions](https://auth0.com/docs/manage-users/access-control/configure-core-rbac/manage-permissions) from a specified user role.
@@ -28072,25 +28628,23 @@ client.roles().permissions().delete(
-Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. +Retrieve list of users associated with a specific role. For Dashboard instructions, review [View Users Assigned to Roles](https://auth0.com/docs/manage-users/access-control/configure-core-rbac/roles/view-users-assigned-to-roles). This endpoint supports two types of pagination: -
    -
  • Offset pagination
  • -
  • Checkpoint pagination
  • -
+ +- Offset pagination +- Checkpoint pagination Checkpoint pagination must be used if you need to retrieve more than 1000 organization members. -

Checkpoint Pagination

+**Checkpoint Pagination** To search by checkpoint, use the following parameters: -
    -
  • from: Optional id from which to start selection.
  • -
  • take: The total amount 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. +- `from`: Optional id from which to start selection. +- `take`: The total amount 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.
@@ -28171,9 +28725,9 @@ client.roles().users().list(
-Assign one or more users to an existing user role. To learn more, review Role-Based Access Control. +Assign one or more users to an existing user role. To learn more, review [Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/rbac). -Note: New roles cannot be created through this action. +**Note**: New roles cannot be created through this action.
@@ -29611,7 +30165,7 @@ client.users().authenticationMethods().update(
-Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review Manage Authentication Methods with Management API. +Remove all authenticators registered to a given user ID, such as OTP, email, phone, and push-notification. This action cannot be undone. For more information, review [Manage Authentication Methods with Management API](https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authentication-methods-with-management-api).
@@ -29748,7 +30302,7 @@ client.users().connectedAccounts().list(
-Retrieve the first multi-factor authentication enrollment that a specific user has confirmed. +Retrieve the first [multi-factor authentication](https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors) enrollment that a specific user has confirmed.
@@ -30014,30 +30568,31 @@ Link two user accounts together forming a primary and secondary relationship. On Note: There are two ways of invoking the endpoint: - +- With the authenticated primary account's JWT in the Authorization header, which has the `update:current_user_identities` scope: + + ```http + POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + Authorization: "Bearer PRIMARY_ACCOUNT_JWT" + { + "link_with": "SECONDARY_ACCOUNT_JWT" + } + ``` + + In this case, only the `link_with` param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. + +- With a token generated by the API V2 containing the `update:users` scope: + + ```http + POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities + Authorization: "Bearer YOUR_API_V2_TOKEN" + { + "provider": "SECONDARY_ACCOUNT_PROVIDER", + "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)", + "user_id": "SECONDARY_ACCOUNT_USER_ID" + } + ``` + + In this case you need to send `provider` and `user_id` in the body. Optionally you can also send the `connection_id` param which is suitable for identifying a particular database connection for the 'auth0' provider.
@@ -30130,7 +30685,7 @@ client.users().identities().link( Unlink a specific secondary account from a target user. This action requires the ID of both the target user and the secondary account. -Unlinking the secondary account removes it from the identities array of the target user and creates a new standalone profile for the secondary account. To learn more, review Unlink User Accounts. +Unlinking the secondary account removes it from the identities array of the target user and creates a new standalone profile for the secondary account. To learn more, review [Unlink User Accounts](https://auth0.com/docs/manage-users/user-accounts/user-account-linking/unlink-user-accounts). @@ -30311,7 +30866,7 @@ client.users().logs().list(
-Invalidate all remembered browsers across all authentication factors for a user. +Invalidate all remembered browsers across all [authentication factors](https://auth0.com/docs/multifactor-authentication) for a user.
@@ -30365,7 +30920,7 @@ client.users().multifactor().invalidateRememberBrowser("id");
-Remove a multifactor authentication configuration from a user's account. This forces the user to manually reconfigure the multi-factor provider. +Remove a [multifactor](https://auth0.com/docs/multifactor-authentication) authentication configuration from a user's account. This forces the user to manually reconfigure the multi-factor provider.
@@ -30428,7 +30983,7 @@ client.users().multifactor().deleteProvider("id", UserMultifactorProviderEnum.DU
-Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review Auth0 Organizations. +Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review [Auth0 Organizations](https://auth0.com/docs/manage-users/organizations).
@@ -30848,7 +31403,7 @@ client.users().riskAssessments().clear( Retrieve detailed list of all user roles currently assigned to a user. -Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member. +**Note**: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: [Get user roles assigned to an Organization member](https://auth0.com/docs/api/management/v2/organizations/get-organization-member-roles). @@ -30940,9 +31495,9 @@ client.users().roles().list(
-Assign one or more existing user roles to a user. For more information, review Role-Based Access Control. +Assign one or more existing user roles to a user. For more information, review [Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/rbac). -Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member. +**Note**: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: [Assign user roles to an Organization member](https://auth0.com/docs/api/management/v2/organizations/post-organization-member-roles).
@@ -31014,7 +31569,7 @@ client.users().roles().assign( Remove one or more specified user roles assigned to a user. -Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member. +**Note**: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: [Delete user roles from an Organization member](https://auth0.com/docs/api/management/v2/organizations/delete-organization-member-roles). diff --git a/src/main/java/com/auth0/client/mgmt/AsyncConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncConnectionsClient.java index 298fa3dc..025ee1b2 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncConnectionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncConnectionsClient.java @@ -58,18 +58,18 @@ public AsyncRawConnectionsClient withRawResponse() { /** * Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. *

This endpoint supports two types of pagination:

- *

*

Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

- *

Checkpoint Pagination

+ *

Checkpoint Pagination

*

To search by checkpoint, use the following parameters:

- *

+ *

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.

*/ public CompletableFuture> list() { return this.rawClient.list().thenApply(response -> response.body()); @@ -78,18 +78,18 @@ public CompletableFuture> list() { /** * Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. *

This endpoint supports two types of pagination:

- *

*

Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

- *

Checkpoint Pagination

+ *

Checkpoint Pagination

*

To search by checkpoint, use the following parameters:

- *

+ *

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.

*/ public CompletableFuture> list(RequestOptions requestOptions) { return this.rawClient.list(requestOptions).thenApply(response -> response.body()); @@ -98,18 +98,18 @@ public CompletableFuture> list(RequestOpti /** * Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. *

This endpoint supports two types of pagination:

- *

    + *
      *
    • Offset pagination
    • *
    • Checkpoint pagination
    • - *

    + *
*

Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

- *

Checkpoint Pagination

+ *

Checkpoint Pagination

*

To search by checkpoint, use the following parameters:

- *

    + *
      *
    • from: Optional id from which to start selection.
    • *
    • take: The total amount 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.

    + *
+ *

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.

*/ public CompletableFuture> list(ListConnectionsQueryParameters request) { return this.rawClient.list(request).thenApply(response -> response.body()); @@ -118,18 +118,18 @@ public CompletableFuture> list(ListConnect /** * Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. *

This endpoint supports two types of pagination:

- *

    + *
      *
    • Offset pagination
    • *
    • Checkpoint pagination
    • - *

    + *
*

Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

- *

Checkpoint Pagination

+ *

Checkpoint Pagination

*

To search by checkpoint, use the following parameters:

- *

    + *
      *
    • from: Optional id from which to start selection.
    • *
    • take: The total amount 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.

    + *
+ *

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.

*/ public CompletableFuture> list( ListConnectionsQueryParameters request, RequestOptions requestOptions) { @@ -138,7 +138,7 @@ public CompletableFuture> list( /** * Creates a new connection according to the JSON object received in body. - *

Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results.

+ *

Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results.

*/ public CompletableFuture create(CreateConnectionRequestContent request) { return this.rawClient.create(request).thenApply(response -> response.body()); @@ -146,7 +146,7 @@ public CompletableFuture create(CreateConnectio /** * Creates a new connection according to the JSON object received in body. - *

Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results.

+ *

Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results.

*/ public CompletableFuture create( CreateConnectionRequestContent request, RequestOptions requestOptions) { @@ -184,7 +184,7 @@ public CompletableFuture get( /** * Removes a specific connection from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. - *

Note: If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent create connection requests, if they use an identical connection name.

+ *

Note: If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent create connection requests, if they use an identical connection name.

*/ public CompletableFuture delete(String id) { return this.rawClient.delete(id).thenApply(response -> response.body()); @@ -192,7 +192,7 @@ public CompletableFuture delete(String id) { /** * Removes a specific connection from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. - *

Note: If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent create connection requests, if they use an identical connection name.

+ *

Note: If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent create connection requests, if they use an identical connection name.

*/ public CompletableFuture delete(String id, RequestOptions requestOptions) { return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); @@ -200,7 +200,7 @@ public CompletableFuture delete(String id, RequestOptions requestOptions) /** * Update details for a specific connection, including option properties for identity provider configuration. - *

Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

+ *

Note: If you use the options parameter, the entire options object is overridden. To avoid partial data or other issues, ensure all parameters are present when using this option.

*/ public CompletableFuture update(String id) { return this.rawClient.update(id).thenApply(response -> response.body()); @@ -208,7 +208,7 @@ public CompletableFuture update(String id) { /** * Update details for a specific connection, including option properties for identity provider configuration. - *

Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

+ *

Note: If you use the options parameter, the entire options object is overridden. To avoid partial data or other issues, ensure all parameters are present when using this option.

*/ public CompletableFuture update(String id, RequestOptions requestOptions) { return this.rawClient.update(id, requestOptions).thenApply(response -> response.body()); @@ -216,7 +216,7 @@ public CompletableFuture update(String id, Requ /** * Update details for a specific connection, including option properties for identity provider configuration. - *

Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

+ *

Note: If you use the options parameter, the entire options object is overridden. To avoid partial data or other issues, ensure all parameters are present when using this option.

*/ public CompletableFuture update( String id, UpdateConnectionRequestContent request) { @@ -225,7 +225,7 @@ public CompletableFuture update( /** * Update details for a specific connection, including option properties for identity provider configuration. - *

Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

+ *

Note: If you use the options parameter, the entire options object is overridden. To avoid partial data or other issues, ensure all parameters are present when using this option.

*/ public CompletableFuture update( String id, UpdateConnectionRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/AsyncCustomDomainsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncCustomDomainsClient.java index ebde78fa..b3cd7e66 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncCustomDomainsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncCustomDomainsClient.java @@ -168,11 +168,15 @@ public CompletableFuture delete(String id, RequestOptions requestOptions) *
  • custom_client_ip_header
  • *
  • tls_policy
  • * - *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
    To update the custom_client_ip_header for a domain, the body to - * send should be: - *
    { "custom_client_ip_header": "cf-connecting-ip" }

    - *

    Updating TLS_POLICY for a custom domain
    To update the tls_policy for a domain, the body to send should be: - *
    { "tls_policy": "recommended" }

    + *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain

    + *

    To update the custom_client_ip_header for a domain, the body to + * send should be:

    + *
    { "custom_client_ip_header": "cf-connecting-ip" }
    +     * 
    + *

    Updating TLS_POLICY for a custom domain

    + *

    To update the tls_policy for a domain, the body to send should be:

    + *
    { "tls_policy": "recommended" }
    +     * 
    *

    TLS Policies:

    *
      *
    • recommended - for modern usage this includes TLS 1.2 only
    • @@ -194,11 +198,15 @@ public CompletableFuture update(String id) { *
    • custom_client_ip_header
    • *
    • tls_policy
    • *
    - *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
    To update the custom_client_ip_header for a domain, the body to - * send should be: - *
    { "custom_client_ip_header": "cf-connecting-ip" }

    - *

    Updating TLS_POLICY for a custom domain
    To update the tls_policy for a domain, the body to send should be: - *
    { "tls_policy": "recommended" }

    + *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain

    + *

    To update the custom_client_ip_header for a domain, the body to + * send should be:

    + *
    { "custom_client_ip_header": "cf-connecting-ip" }
    +     * 
    + *

    Updating TLS_POLICY for a custom domain

    + *

    To update the tls_policy for a domain, the body to send should be:

    + *
    { "tls_policy": "recommended" }
    +     * 
    *

    TLS Policies:

    *
      *
    • recommended - for modern usage this includes TLS 1.2 only
    • @@ -220,11 +228,15 @@ public CompletableFuture update(String id, Re *
    • custom_client_ip_header
    • *
    • tls_policy
    • *
    - *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
    To update the custom_client_ip_header for a domain, the body to - * send should be: - *
    { "custom_client_ip_header": "cf-connecting-ip" }

    - *

    Updating TLS_POLICY for a custom domain
    To update the tls_policy for a domain, the body to send should be: - *
    { "tls_policy": "recommended" }

    + *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain

    + *

    To update the custom_client_ip_header for a domain, the body to + * send should be:

    + *
    { "custom_client_ip_header": "cf-connecting-ip" }
    +     * 
    + *

    Updating TLS_POLICY for a custom domain

    + *

    To update the tls_policy for a domain, the body to send should be:

    + *
    { "tls_policy": "recommended" }
    +     * 
    *

    TLS Policies:

    *
      *
    • recommended - for modern usage this includes TLS 1.2 only
    • @@ -247,11 +259,15 @@ public CompletableFuture update( *
    • custom_client_ip_header
    • *
    • tls_policy
    • *
    - *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
    To update the custom_client_ip_header for a domain, the body to - * send should be: - *
    { "custom_client_ip_header": "cf-connecting-ip" }

    - *

    Updating TLS_POLICY for a custom domain
    To update the tls_policy for a domain, the body to send should be: - *
    { "tls_policy": "recommended" }

    + *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain

    + *

    To update the custom_client_ip_header for a domain, the body to + * send should be:

    + *
    { "custom_client_ip_header": "cf-connecting-ip" }
    +     * 
    + *

    Updating TLS_POLICY for a custom domain

    + *

    To update the tls_policy for a domain, the body to send should be:

    + *
    { "tls_policy": "recommended" }
    +     * 
    *

    TLS Policies:

    *
      *
    • recommended - for modern usage this includes TLS 1.2 only
    • diff --git a/src/main/java/com/auth0/client/mgmt/AsyncGroupsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncGroupsClient.java index bb9f12e4..7bfd7bf6 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncGroupsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncGroupsClient.java @@ -8,6 +8,7 @@ import com.auth0.client.mgmt.core.Suppliers; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.groups.AsyncMembersClient; +import com.auth0.client.mgmt.groups.AsyncRolesClient; import com.auth0.client.mgmt.types.GetGroupResponseContent; import com.auth0.client.mgmt.types.Group; import com.auth0.client.mgmt.types.ListGroupsRequestParameters; @@ -21,10 +22,13 @@ public class AsyncGroupsClient { protected final Supplier membersClient; + protected final Supplier rolesClient; + public AsyncGroupsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; this.rawClient = new AsyncRawGroupsClient(clientOptions); this.membersClient = Suppliers.memoize(() -> new AsyncMembersClient(clientOptions)); + this.rolesClient = Suppliers.memoize(() -> new AsyncRolesClient(clientOptions)); } /** @@ -94,4 +98,8 @@ public CompletableFuture delete(String id, RequestOptions requestOptions) public AsyncMembersClient members() { return this.membersClient.get(); } + + public AsyncRolesClient roles() { + return this.rolesClient.get(); + } } diff --git a/src/main/java/com/auth0/client/mgmt/AsyncLogsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncLogsClient.java index ba700065..9549b466 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncLogsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncLogsClient.java @@ -30,25 +30,25 @@ public AsyncRawLogsClient withRawResponse() { /** * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). - *

      Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

      + *

      Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

      *

      For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes.

      - *

      To set custom search criteria, use the following parameters:

      - *

        - *
      • q: Search Criteria using Query String Syntax
      • - *
      • page: Page index of the results to return. First page is 0.
      • - *
      • per_page: Number of results per page.
      • - *
      • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
      • - *
      • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
      • - *
      • include_fields: Whether specified fields are to be included (true) or excluded (false).
      • - *
      • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
      • - *

      + *

      To set custom search criteria, use the following parameters:

      + *
        + *
      • q: Search Criteria using Query String Syntax
      • + *
      • page: Page index of the results to return. First page is 0.
      • + *
      • per_page: Number of results per page.
      • + *
      • sort: Field to use for sorting appended with :1 for ascending and :-1 for descending. e.g. date:-1
      • + *
      • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
      • + *
      • include_fields: Whether specified fields are to be included (true) or excluded (false).
      • + *
      • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
      • + *
      *

      For more information on the list of fields that can be used in fields and sort, see Searchable Fields.

      *

      Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method.

      - *

      To search from a checkpoint log ID, use the following parameters:
      + *

      To search from a checkpoint log ID, use the following parameters:

      *
        - *
      • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
      • - *
      • take: Number of entries to retrieve when using the from parameter.
      • - *

      + *
    • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
    • + *
    • take: Number of entries to retrieve when using the from parameter.
    • + *
    *

    Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed.

    */ public CompletableFuture> list() { @@ -57,25 +57,25 @@ public CompletableFuture> list() { /** * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). - *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    + *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    *

    For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes.

    - *

    To set custom search criteria, use the following parameters:

    - *

      - *
    • q: Search Criteria using Query String Syntax
    • - *
    • page: Page index of the results to return. First page is 0.
    • - *
    • per_page: Number of results per page.
    • - *
    • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
    • - *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • - *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • - *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • - *

    + *

    To set custom search criteria, use the following parameters:

    + *
      + *
    • q: Search Criteria using Query String Syntax
    • + *
    • page: Page index of the results to return. First page is 0.
    • + *
    • per_page: Number of results per page.
    • + *
    • sort: Field to use for sorting appended with :1 for ascending and :-1 for descending. e.g. date:-1
    • + *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • + *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • + *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • + *
    *

    For more information on the list of fields that can be used in fields and sort, see Searchable Fields.

    *

    Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method.

    - *

    To search from a checkpoint log ID, use the following parameters:
    + *

    To search from a checkpoint log ID, use the following parameters:

    *
      - *
    • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
    • - *
    • take: Number of entries to retrieve when using the from parameter.
    • - *

    + *
  • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
  • + *
  • take: Number of entries to retrieve when using the from parameter.
  • + * *

    Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed.

    */ public CompletableFuture> list(RequestOptions requestOptions) { @@ -84,25 +84,25 @@ public CompletableFuture> list(RequestOptions requestOpt /** * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). - *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    + *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    *

    For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes.

    - *

    To set custom search criteria, use the following parameters:

    - *

      - *
    • q: Search Criteria using Query String Syntax
    • - *
    • page: Page index of the results to return. First page is 0.
    • - *
    • per_page: Number of results per page.
    • - *
    • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
    • - *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • - *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • - *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • - *

    + *

    To set custom search criteria, use the following parameters:

    + *
      + *
    • q: Search Criteria using Query String Syntax
    • + *
    • page: Page index of the results to return. First page is 0.
    • + *
    • per_page: Number of results per page.
    • + *
    • sort: Field to use for sorting appended with :1 for ascending and :-1 for descending. e.g. date:-1
    • + *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • + *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • + *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • + *
    *

    For more information on the list of fields that can be used in fields and sort, see Searchable Fields.

    *

    Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method.

    - *

    To search from a checkpoint log ID, use the following parameters:
    + *

    To search from a checkpoint log ID, use the following parameters:

    *
      - *
    • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
    • - *
    • take: Number of entries to retrieve when using the from parameter.
    • - *

    + *
  • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
  • + *
  • take: Number of entries to retrieve when using the from parameter.
  • + * *

    Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed.

    */ public CompletableFuture> list(ListLogsRequestParameters request) { @@ -111,25 +111,25 @@ public CompletableFuture> list(ListLogsRequestParameters /** * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). - *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    + *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    *

    For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes.

    - *

    To set custom search criteria, use the following parameters:

    - *

      - *
    • q: Search Criteria using Query String Syntax
    • - *
    • page: Page index of the results to return. First page is 0.
    • - *
    • per_page: Number of results per page.
    • - *
    • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
    • - *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • - *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • - *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • - *

    + *

    To set custom search criteria, use the following parameters:

    + *
      + *
    • q: Search Criteria using Query String Syntax
    • + *
    • page: Page index of the results to return. First page is 0.
    • + *
    • per_page: Number of results per page.
    • + *
    • sort: Field to use for sorting appended with :1 for ascending and :-1 for descending. e.g. date:-1
    • + *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • + *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • + *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • + *
    *

    For more information on the list of fields that can be used in fields and sort, see Searchable Fields.

    *

    Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method.

    - *

    To search from a checkpoint log ID, use the following parameters:
    + *

    To search from a checkpoint log ID, use the following parameters:

    *
      - *
    • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
    • - *
    • take: Number of entries to retrieve when using the from parameter.
    • - *

    + *
  • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
  • + *
  • take: Number of entries to retrieve when using the from parameter.
  • + * *

    Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed.

    */ public CompletableFuture> list( diff --git a/src/main/java/com/auth0/client/mgmt/AsyncManagementApi.java b/src/main/java/com/auth0/client/mgmt/AsyncManagementApi.java index 57bb605a..46b51ca6 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncManagementApi.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncManagementApi.java @@ -62,6 +62,8 @@ public class AsyncManagementApi { protected final Supplier promptsClient; + protected final Supplier rateLimitPoliciesClient; + protected final Supplier refreshTokensClient; protected final Supplier resourceServersClient; @@ -130,6 +132,7 @@ public AsyncManagementApi(ClientOptions clientOptions) { this.networkAclsClient = Suppliers.memoize(() -> new AsyncNetworkAclsClient(clientOptions)); this.organizationsClient = Suppliers.memoize(() -> new AsyncOrganizationsClient(clientOptions)); this.promptsClient = Suppliers.memoize(() -> new AsyncPromptsClient(clientOptions)); + this.rateLimitPoliciesClient = Suppliers.memoize(() -> new AsyncRateLimitPoliciesClient(clientOptions)); this.refreshTokensClient = Suppliers.memoize(() -> new AsyncRefreshTokensClient(clientOptions)); this.resourceServersClient = Suppliers.memoize(() -> new AsyncResourceServersClient(clientOptions)); this.rolesClient = Suppliers.memoize(() -> new AsyncRolesClient(clientOptions)); @@ -242,6 +245,10 @@ public AsyncPromptsClient prompts() { return this.promptsClient.get(); } + public AsyncRateLimitPoliciesClient rateLimitPolicies() { + return this.rateLimitPoliciesClient.get(); + } + public AsyncRefreshTokensClient refreshTokens() { return this.refreshTokensClient.get(); } diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRateLimitPoliciesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRateLimitPoliciesClient.java new file mode 100644 index 00000000..cefac49c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRateLimitPoliciesClient.java @@ -0,0 +1,86 @@ +/** + * 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.CreateRateLimitPolicyRequestContent; +import com.auth0.client.mgmt.types.CreateRateLimitPolicyResponseContent; +import com.auth0.client.mgmt.types.GetRateLimitPolicyResponseContent; +import com.auth0.client.mgmt.types.ListRateLimitPoliciesRequestParameters; +import com.auth0.client.mgmt.types.PatchRateLimitPolicyRequestContent; +import com.auth0.client.mgmt.types.RateLimitPolicy; +import com.auth0.client.mgmt.types.UpdateRateLimitPolicyResponseContent; +import java.util.concurrent.CompletableFuture; + +public class AsyncRateLimitPoliciesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawRateLimitPoliciesClient rawClient; + + public AsyncRateLimitPoliciesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawRateLimitPoliciesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawRateLimitPoliciesClient withRawResponse() { + return this.rawClient; + } + + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + public CompletableFuture> list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture> list(ListRateLimitPoliciesRequestParameters request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + public CompletableFuture> list( + ListRateLimitPoliciesRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture create(CreateRateLimitPolicyRequestContent request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + public CompletableFuture create( + CreateRateLimitPolicyRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture update( + String id, PatchRateLimitPolicyRequestContent request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + public CompletableFuture update( + String id, PatchRateLimitPolicyRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawConnectionsClient.java index 98739c0e..0497fcb8 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawConnectionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawConnectionsClient.java @@ -55,18 +55,18 @@ public AsyncRawConnectionsClient(ClientOptions clientOptions) { /** * Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public CompletableFuture>> list() { return list(ListConnectionsQueryParameters.builder().build()); @@ -75,18 +75,18 @@ public CompletableFutureconnections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public CompletableFuture>> list( RequestOptions requestOptions) { @@ -96,18 +96,18 @@ public CompletableFutureconnections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public CompletableFuture>> list( ListConnectionsQueryParameters request) { @@ -117,18 +117,18 @@ public CompletableFutureconnections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public CompletableFuture>> list( ListConnectionsQueryParameters request, RequestOptions requestOptions) { @@ -248,7 +248,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Creates a new connection according to the JSON object received in body. - *

    Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results.

    + *

    Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results.

    */ public CompletableFuture> create( CreateConnectionRequestContent request) { @@ -257,7 +257,7 @@ public CompletableFuturebody. - *

    Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results.

    + *

    Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results.

    */ public CompletableFuture> create( CreateConnectionRequestContent request, RequestOptions requestOptions) { @@ -467,7 +467,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Removes a specific connection from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. - *

    Note: If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent create connection requests, if they use an identical connection name.

    + *

    Note: If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent create connection requests, if they use an identical connection name.

    */ public CompletableFuture> delete(String id) { return delete(id, null); @@ -475,7 +475,7 @@ public CompletableFuture> delete(String id) { /** * Removes a specific connection from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. - *

    Note: If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent create connection requests, if they use an identical connection name.

    + *

    Note: If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent create connection requests, if they use an identical connection name.

    */ public CompletableFuture> delete(String id, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) @@ -552,7 +552,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Update details for a specific connection, including option properties for identity provider configuration. - *

    Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    + *

    Note: If you use the options parameter, the entire options object is overridden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    */ public CompletableFuture> update(String id) { return update(id, UpdateConnectionRequestContent.builder().build()); @@ -560,7 +560,7 @@ public CompletableFutureconnection, including option properties for identity provider configuration. - *

    Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    + *

    Note: If you use the options parameter, the entire options object is overridden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    */ public CompletableFuture> update( String id, RequestOptions requestOptions) { @@ -569,7 +569,7 @@ public CompletableFutureconnection, including option properties for identity provider configuration. - *

    Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    + *

    Note: If you use the options parameter, the entire options object is overridden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    */ public CompletableFuture> update( String id, UpdateConnectionRequestContent request) { @@ -578,7 +578,7 @@ public CompletableFutureconnection, including option properties for identity provider configuration. - *

    Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    + *

    Note: If you use the options parameter, the entire options object is overridden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    */ public CompletableFuture> update( String id, UpdateConnectionRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawCustomDomainsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawCustomDomainsClient.java index ae9aed4e..640a4e39 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawCustomDomainsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawCustomDomainsClient.java @@ -636,11 +636,15 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { *
  • custom_client_ip_header
  • *
  • tls_policy
  • * - *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
    To update the custom_client_ip_header for a domain, the body to - * send should be: - *
    { "custom_client_ip_header": "cf-connecting-ip" }

    - *

    Updating TLS_POLICY for a custom domain
    To update the tls_policy for a domain, the body to send should be: - *
    { "tls_policy": "recommended" }

    + *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain

    + *

    To update the custom_client_ip_header for a domain, the body to + * send should be:

    + *
    { "custom_client_ip_header": "cf-connecting-ip" }
    +     * 
    + *

    Updating TLS_POLICY for a custom domain

    + *

    To update the tls_policy for a domain, the body to send should be:

    + *
    { "tls_policy": "recommended" }
    +     * 
    *

    TLS Policies:

    *
      *
    • recommended - for modern usage this includes TLS 1.2 only
    • @@ -662,11 +666,15 @@ public CompletableFuturecustom_client_ip_header *
    • tls_policy
    • *
    - *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
    To update the custom_client_ip_header for a domain, the body to - * send should be: - *
    { "custom_client_ip_header": "cf-connecting-ip" }

    - *

    Updating TLS_POLICY for a custom domain
    To update the tls_policy for a domain, the body to send should be: - *
    { "tls_policy": "recommended" }

    + *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain

    + *

    To update the custom_client_ip_header for a domain, the body to + * send should be:

    + *
    { "custom_client_ip_header": "cf-connecting-ip" }
    +     * 
    + *

    Updating TLS_POLICY for a custom domain

    + *

    To update the tls_policy for a domain, the body to send should be:

    + *
    { "tls_policy": "recommended" }
    +     * 
    *

    TLS Policies:

    *
      *
    • recommended - for modern usage this includes TLS 1.2 only
    • @@ -689,11 +697,15 @@ public CompletableFuturecustom_client_ip_header *
    • tls_policy
    • *
    - *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
    To update the custom_client_ip_header for a domain, the body to - * send should be: - *
    { "custom_client_ip_header": "cf-connecting-ip" }

    - *

    Updating TLS_POLICY for a custom domain
    To update the tls_policy for a domain, the body to send should be: - *
    { "tls_policy": "recommended" }

    + *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain

    + *

    To update the custom_client_ip_header for a domain, the body to + * send should be:

    + *
    { "custom_client_ip_header": "cf-connecting-ip" }
    +     * 
    + *

    Updating TLS_POLICY for a custom domain

    + *

    To update the tls_policy for a domain, the body to send should be:

    + *
    { "tls_policy": "recommended" }
    +     * 
    *

    TLS Policies:

    *
      *
    • recommended - for modern usage this includes TLS 1.2 only
    • @@ -716,11 +728,15 @@ public CompletableFuturecustom_client_ip_header *
    • tls_policy
    • *
    - *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
    To update the custom_client_ip_header for a domain, the body to - * send should be: - *
    { "custom_client_ip_header": "cf-connecting-ip" }

    - *

    Updating TLS_POLICY for a custom domain
    To update the tls_policy for a domain, the body to send should be: - *
    { "tls_policy": "recommended" }

    + *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain

    + *

    To update the custom_client_ip_header for a domain, the body to + * send should be:

    + *
    { "custom_client_ip_header": "cf-connecting-ip" }
    +     * 
    + *

    Updating TLS_POLICY for a custom domain

    + *

    To update the tls_policy for a domain, the body to send should be:

    + *
    { "tls_policy": "recommended" }
    +     * 
    *

    TLS Policies:

    *
      *
    • recommended - for modern usage this includes TLS 1.2 only
    • diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawLogsClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawLogsClient.java index c75f04cc..1ab0e67d 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawLogsClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawLogsClient.java @@ -45,25 +45,25 @@ public AsyncRawLogsClient(ClientOptions clientOptions) { /** * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). - *

      Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

      + *

      Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

      *

      For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes.

      - *

      To set custom search criteria, use the following parameters:

      - *

        - *
      • q: Search Criteria using Query String Syntax
      • - *
      • page: Page index of the results to return. First page is 0.
      • - *
      • per_page: Number of results per page.
      • - *
      • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
      • - *
      • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
      • - *
      • include_fields: Whether specified fields are to be included (true) or excluded (false).
      • - *
      • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
      • - *

      + *

      To set custom search criteria, use the following parameters:

      + *
        + *
      • q: Search Criteria using Query String Syntax
      • + *
      • page: Page index of the results to return. First page is 0.
      • + *
      • per_page: Number of results per page.
      • + *
      • sort: Field to use for sorting appended with :1 for ascending and :-1 for descending. e.g. date:-1
      • + *
      • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
      • + *
      • include_fields: Whether specified fields are to be included (true) or excluded (false).
      • + *
      • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
      • + *
      *

      For more information on the list of fields that can be used in fields and sort, see Searchable Fields.

      *

      Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method.

      - *

      To search from a checkpoint log ID, use the following parameters:
      + *

      To search from a checkpoint log ID, use the following parameters:

      *
        - *
      • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
      • - *
      • take: Number of entries to retrieve when using the from parameter.
      • - *

      + *
    • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
    • + *
    • take: Number of entries to retrieve when using the from parameter.
    • + *
    *

    Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed.

    */ public CompletableFuture>> list() { @@ -72,25 +72,25 @@ public CompletableFuture>> lis /** * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). - *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    + *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    *

    For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes.

    - *

    To set custom search criteria, use the following parameters:

    - *

      - *
    • q: Search Criteria using Query String Syntax
    • - *
    • page: Page index of the results to return. First page is 0.
    • - *
    • per_page: Number of results per page.
    • - *
    • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
    • - *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • - *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • - *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • - *

    + *

    To set custom search criteria, use the following parameters:

    + *
      + *
    • q: Search Criteria using Query String Syntax
    • + *
    • page: Page index of the results to return. First page is 0.
    • + *
    • per_page: Number of results per page.
    • + *
    • sort: Field to use for sorting appended with :1 for ascending and :-1 for descending. e.g. date:-1
    • + *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • + *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • + *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • + *
    *

    For more information on the list of fields that can be used in fields and sort, see Searchable Fields.

    *

    Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method.

    - *

    To search from a checkpoint log ID, use the following parameters:
    + *

    To search from a checkpoint log ID, use the following parameters:

    *
      - *
    • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
    • - *
    • take: Number of entries to retrieve when using the from parameter.
    • - *

    + *
  • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
  • + *
  • take: Number of entries to retrieve when using the from parameter.
  • + * *

    Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed.

    */ public CompletableFuture>> list(RequestOptions requestOptions) { @@ -99,25 +99,25 @@ public CompletableFuture>> lis /** * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). - *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    + *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    *

    For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes.

    - *

    To set custom search criteria, use the following parameters:

    - *

      - *
    • q: Search Criteria using Query String Syntax
    • - *
    • page: Page index of the results to return. First page is 0.
    • - *
    • per_page: Number of results per page.
    • - *
    • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
    • - *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • - *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • - *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • - *

    + *

    To set custom search criteria, use the following parameters:

    + *
      + *
    • q: Search Criteria using Query String Syntax
    • + *
    • page: Page index of the results to return. First page is 0.
    • + *
    • per_page: Number of results per page.
    • + *
    • sort: Field to use for sorting appended with :1 for ascending and :-1 for descending. e.g. date:-1
    • + *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • + *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • + *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • + *
    *

    For more information on the list of fields that can be used in fields and sort, see Searchable Fields.

    *

    Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method.

    - *

    To search from a checkpoint log ID, use the following parameters:
    + *

    To search from a checkpoint log ID, use the following parameters:

    *
      - *
    • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
    • - *
    • take: Number of entries to retrieve when using the from parameter.
    • - *

    + *
  • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
  • + *
  • take: Number of entries to retrieve when using the from parameter.
  • + * *

    Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed.

    */ public CompletableFuture>> list( @@ -127,25 +127,25 @@ public CompletableFuture>> lis /** * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). - *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    + *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    *

    For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes.

    - *

    To set custom search criteria, use the following parameters:

    - *

      - *
    • q: Search Criteria using Query String Syntax
    • - *
    • page: Page index of the results to return. First page is 0.
    • - *
    • per_page: Number of results per page.
    • - *
    • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
    • - *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • - *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • - *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • - *

    + *

    To set custom search criteria, use the following parameters:

    + *
      + *
    • q: Search Criteria using Query String Syntax
    • + *
    • page: Page index of the results to return. First page is 0.
    • + *
    • per_page: Number of results per page.
    • + *
    • sort: Field to use for sorting appended with :1 for ascending and :-1 for descending. e.g. date:-1
    • + *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • + *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • + *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • + *
    *

    For more information on the list of fields that can be used in fields and sort, see Searchable Fields.

    *

    Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method.

    - *

    To search from a checkpoint log ID, use the following parameters:
    + *

    To search from a checkpoint log ID, use the following parameters:

    *
      - *
    • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
    • - *
    • take: Number of entries to retrieve when using the from parameter.
    • - *

    + *
  • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
  • + *
  • take: Number of entries to retrieve when using the from parameter.
  • + * *

    Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed.

    */ public CompletableFuture>> list( diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawRateLimitPoliciesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawRateLimitPoliciesClient.java new file mode 100644 index 00000000..6cc104b2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawRateLimitPoliciesClient.java @@ -0,0 +1,530 @@ +/** + * 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.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.CreateRateLimitPolicyRequestContent; +import com.auth0.client.mgmt.types.CreateRateLimitPolicyResponseContent; +import com.auth0.client.mgmt.types.GetRateLimitPolicyResponseContent; +import com.auth0.client.mgmt.types.ListRateLimitPoliciesPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListRateLimitPoliciesRequestParameters; +import com.auth0.client.mgmt.types.PatchRateLimitPolicyRequestContent; +import com.auth0.client.mgmt.types.RateLimitPolicy; +import com.auth0.client.mgmt.types.UpdateRateLimitPolicyResponseContent; +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 AsyncRawRateLimitPoliciesClient { + protected final ClientOptions clientOptions; + + public AsyncRawRateLimitPoliciesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public CompletableFuture>> list() { + return list(ListRateLimitPoliciesRequestParameters.builder().build()); + } + + public CompletableFuture>> list( + RequestOptions requestOptions) { + return list(ListRateLimitPoliciesRequestParameters.builder().build(), requestOptions); + } + + public CompletableFuture>> list( + ListRateLimitPoliciesRequestParameters request) { + return list(request, null); + } + + public CompletableFuture>> list( + ListRateLimitPoliciesRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rate-limit-policies"); + if (!request.getResource().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "resource", request.getResource().orElse(null), false); + } + if (!request.getConsumer().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "consumer", request.getConsumer().orElse(null), false); + } + if (!request.getConsumerSelector().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "consumer_selector", request.getConsumerSelector().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 (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListRateLimitPoliciesPaginatedResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListRateLimitPoliciesPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListRateLimitPoliciesRequestParameters nextRequest = + ListRateLimitPoliciesRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = + parsedResponse.getRateLimitPolicies().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 (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> create( + CreateRateLimitPolicyRequestContent request) { + return create(request, null); + } + + public CompletableFuture> create( + CreateRateLimitPolicyRequestContent request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rate-limit-policies"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateRateLimitPolicyResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> get(String id) { + return get(id, null); + } + + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rate-limit-policies") + .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); + } + 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, GetRateLimitPolicyResponseContent.class), + response)); + return; + } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> delete(String id) { + return delete(id, null); + } + + public CompletableFuture> delete(String id, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rate-limit-policies") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> update( + String id, PatchRateLimitPolicyRequestContent request) { + return update(id, request, null); + } + + public CompletableFuture> update( + String id, PatchRateLimitPolicyRequestContent request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rate-limit-policies") + .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); + } + 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, UpdateRateLimitPolicyResponseContent.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 (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/AsyncRawRolesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawRolesClient.java index b28cfbd0..f400749a 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawRolesClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawRolesClient.java @@ -52,7 +52,7 @@ public AsyncRawRolesClient(ClientOptions clientOptions) { /** * Retrieve detailed list of user roles created in your tenant. - *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    + *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    */ public CompletableFuture>> list() { return list(ListRolesRequestParameters.builder().build()); @@ -60,7 +60,7 @@ public CompletableFuture>> li /** * Retrieve detailed list of user roles created in your tenant. - *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    + *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    */ public CompletableFuture>> list(RequestOptions requestOptions) { return list(ListRolesRequestParameters.builder().build(), requestOptions); @@ -68,7 +68,7 @@ public CompletableFuture>> li /** * Retrieve detailed list of user roles created in your tenant. - *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    + *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    */ public CompletableFuture>> list( ListRolesRequestParameters request) { @@ -77,7 +77,7 @@ public CompletableFuture>> li /** * Retrieve detailed list of user roles created in your tenant. - *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    + *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    */ public CompletableFuture>> list( ListRolesRequestParameters request, RequestOptions requestOptions) { @@ -183,7 +183,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Create a user role for Role-Based Access Control. - *

    Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

    + *

    Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

    */ public CompletableFuture> create( CreateRoleRequestContent request) { @@ -192,7 +192,7 @@ public CompletableFuture> c /** * Create a user role for Role-Based Access Control. - *

    Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

    + *

    Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

    */ public CompletableFuture> create( CreateRoleRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawUserAttributeProfilesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawUserAttributeProfilesClient.java index a4ed7207..4641f3e7 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawUserAttributeProfilesClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawUserAttributeProfilesClient.java @@ -181,7 +181,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * Create a User Attribute Profile + * Create a User Attribute Profile. */ public CompletableFuture> create( CreateUserAttributeProfileRequestContent request) { @@ -189,7 +189,7 @@ public CompletableFuture> create( CreateUserAttributeProfileRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRawUsersClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRawUsersClient.java index 5eabcf36..fdca458b 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRawUsersClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRawUsersClient.java @@ -64,7 +64,6 @@ public AsyncRawUsersClient(ClientOptions clientOptions) { *
  • Select the fields to be returned
  • *
  • Specify the number of users to retrieve per page and the page index
  • * - *

    <!-- only v3 is available -->

    *

    The q query parameter can be used to get users that match the specified criteria using query string syntax.

    *

    Learn more about searching for users.

    *

    Read about best practices when working with the API endpoints for retrieving users.

    @@ -82,7 +81,6 @@ public CompletableFutureSelect the fields to be returned *
  • Specify the number of users to retrieve per page and the page index
  • * - *

    <!-- only v3 is available -->

    *

    The q query parameter can be used to get users that match the specified criteria using query string syntax.

    *

    Learn more about searching for users.

    *

    Read about best practices when working with the API endpoints for retrieving users.

    @@ -101,7 +99,6 @@ public CompletableFutureSelect the fields to be returned *
  • Specify the number of users to retrieve per page and the page index
  • * - *

    <!-- only v3 is available -->

    *

    The q query parameter can be used to get users that match the specified criteria using query string syntax.

    *

    Learn more about searching for users.

    *

    Read about best practices when working with the API endpoints for retrieving users.

    @@ -120,7 +117,6 @@ public CompletableFutureSelect the fields to be returned *
  • Specify the number of users to retrieve per page and the page index
  • * - *

    <!-- only v3 is available -->

    *

    The q query parameter can be used to get users that match the specified criteria using query string syntax.

    *

    Learn more about searching for users.

    *

    Read about best practices when working with the API endpoints for retrieving users.

    @@ -661,57 +657,65 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Update a user. *

    These are the attributes that can be updated at the root level:

    - *

      - *
    • app_metadata
    • - *
    • blocked
    • - *
    • email
    • - *
    • email_verified
    • - *
    • family_name
    • - *
    • given_name
    • - *
    • name
    • - *
    • nickname
    • - *
    • password
    • - *
    • phone_number
    • - *
    • phone_verified
    • - *
    • picture
    • - *
    • username
    • - *
    • user_metadata
    • - *
    • verify_email
    • - *

    + *
      + *
    • app_metadata
    • + *
    • blocked
    • + *
    • email
    • + *
    • email_verified
    • + *
    • family_name
    • + *
    • given_name
    • + *
    • name
    • + *
    • nickname
    • + *
    • password
    • + *
    • phone_number
    • + *
    • phone_verified
    • + *
    • picture
    • + *
    • username
    • + *
    • user_metadata
    • + *
    • verify_email
    • + *
    *

    Some considerations:

    - *

      - *
    • The properties of the new object will replace the old ones.
    • - *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • - *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • - *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • - *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • - *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • - *
    • Supported attributes can be unset by supplying null as the value.
    • - *

    - *

    Updating a field (non-metadata property)
    - * To mark the email address of a user as verified, the body to send should be: - *
    { "email_verified": true }

    - *

    Updating a user metadata root property
    Let's assume that our test user has the following user_metadata: - *
    { "user_metadata" : { "profileCode": 1479 } }

    + *
      + *
    • The properties of the new object will replace the old ones.
    • + *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • + *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • + *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • + *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • + *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • + *
    • Supported attributes can be unset by supplying null as the value.
    • + *
    + *

    Updating a field (non-metadata property)

    + *

    To mark the email address of a user as verified, the body to send should be:

    + *
    { "email_verified": true }
    +     * 
    + *

    Updating a user metadata root property

    + *

    Let's assume that our test user has the following user_metadata:

    + *
    { "user_metadata" : { "profileCode": 1479 } }
    +     * 
    *

    To add the field addresses the body to send should be:

    - *

    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}

    - *

    The modified object ends up with the following user_metadata property:

    {
    -     * "user_metadata": {
    -     * "profileCode": 1479,
    -     * "addresses": { "work_address": "100 Industrial Way" }
    +     * 
    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
    +     * 
    + *

    The modified object ends up with the following user_metadata property:

    + *
    {
    +     *   "user_metadata": {
    +     *     "profileCode": 1479,
    +     *     "addresses": { "work_address": "100 Industrial Way" }
    +     *   }
          * }
    -     * }

    - *

    Updating an inner user metadata property
    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: - *
    {
    +     * 
    + *

    Updating an inner user metadata property

    + *

    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be:

    + *
    {
          *   "user_metadata": {
          *     "addresses": {
          *       "work_address": "100 Industrial Way",
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    *

    The modified object ends up with the following user_metadata property:

    - *

    {
    +     * 
    {
          *   "user_metadata": {
          *     "profileCode": 1479,
          *     "addresses": {
    @@ -719,7 +723,8 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    */ public CompletableFuture> update(String id) { return update(id, UpdateUserRequestContent.builder().build()); @@ -728,57 +733,65 @@ public CompletableFuture> u /** * Update a user. *

    These are the attributes that can be updated at the root level:

    - *

      - *
    • app_metadata
    • - *
    • blocked
    • - *
    • email
    • - *
    • email_verified
    • - *
    • family_name
    • - *
    • given_name
    • - *
    • name
    • - *
    • nickname
    • - *
    • password
    • - *
    • phone_number
    • - *
    • phone_verified
    • - *
    • picture
    • - *
    • username
    • - *
    • user_metadata
    • - *
    • verify_email
    • - *

    + *
      + *
    • app_metadata
    • + *
    • blocked
    • + *
    • email
    • + *
    • email_verified
    • + *
    • family_name
    • + *
    • given_name
    • + *
    • name
    • + *
    • nickname
    • + *
    • password
    • + *
    • phone_number
    • + *
    • phone_verified
    • + *
    • picture
    • + *
    • username
    • + *
    • user_metadata
    • + *
    • verify_email
    • + *
    *

    Some considerations:

    - *

      - *
    • The properties of the new object will replace the old ones.
    • - *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • - *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • - *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • - *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • - *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • - *
    • Supported attributes can be unset by supplying null as the value.
    • - *

    - *

    Updating a field (non-metadata property)
    - * To mark the email address of a user as verified, the body to send should be: - *
    { "email_verified": true }

    - *

    Updating a user metadata root property
    Let's assume that our test user has the following user_metadata: - *
    { "user_metadata" : { "profileCode": 1479 } }

    + *
      + *
    • The properties of the new object will replace the old ones.
    • + *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • + *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • + *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • + *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • + *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • + *
    • Supported attributes can be unset by supplying null as the value.
    • + *
    + *

    Updating a field (non-metadata property)

    + *

    To mark the email address of a user as verified, the body to send should be:

    + *
    { "email_verified": true }
    +     * 
    + *

    Updating a user metadata root property

    + *

    Let's assume that our test user has the following user_metadata:

    + *
    { "user_metadata" : { "profileCode": 1479 } }
    +     * 
    *

    To add the field addresses the body to send should be:

    - *

    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}

    - *

    The modified object ends up with the following user_metadata property:

    {
    -     * "user_metadata": {
    -     * "profileCode": 1479,
    -     * "addresses": { "work_address": "100 Industrial Way" }
    +     * 
    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
    +     * 
    + *

    The modified object ends up with the following user_metadata property:

    + *
    {
    +     *   "user_metadata": {
    +     *     "profileCode": 1479,
    +     *     "addresses": { "work_address": "100 Industrial Way" }
    +     *   }
          * }
    -     * }

    - *

    Updating an inner user metadata property
    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: - *
    {
    +     * 
    + *

    Updating an inner user metadata property

    + *

    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be:

    + *
    {
          *   "user_metadata": {
          *     "addresses": {
          *       "work_address": "100 Industrial Way",
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    *

    The modified object ends up with the following user_metadata property:

    - *

    {
    +     * 
    {
          *   "user_metadata": {
          *     "profileCode": 1479,
          *     "addresses": {
    @@ -786,7 +799,8 @@ public CompletableFuture> u
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    */ public CompletableFuture> update( String id, RequestOptions requestOptions) { @@ -796,57 +810,65 @@ public CompletableFuture> u /** * Update a user. *

    These are the attributes that can be updated at the root level:

    - *

      - *
    • app_metadata
    • - *
    • blocked
    • - *
    • email
    • - *
    • email_verified
    • - *
    • family_name
    • - *
    • given_name
    • - *
    • name
    • - *
    • nickname
    • - *
    • password
    • - *
    • phone_number
    • - *
    • phone_verified
    • - *
    • picture
    • - *
    • username
    • - *
    • user_metadata
    • - *
    • verify_email
    • - *

    + *
      + *
    • app_metadata
    • + *
    • blocked
    • + *
    • email
    • + *
    • email_verified
    • + *
    • family_name
    • + *
    • given_name
    • + *
    • name
    • + *
    • nickname
    • + *
    • password
    • + *
    • phone_number
    • + *
    • phone_verified
    • + *
    • picture
    • + *
    • username
    • + *
    • user_metadata
    • + *
    • verify_email
    • + *
    *

    Some considerations:

    - *

      - *
    • The properties of the new object will replace the old ones.
    • - *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • - *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • - *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • - *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • - *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • - *
    • Supported attributes can be unset by supplying null as the value.
    • - *

    - *

    Updating a field (non-metadata property)
    - * To mark the email address of a user as verified, the body to send should be: - *
    { "email_verified": true }

    - *

    Updating a user metadata root property
    Let's assume that our test user has the following user_metadata: - *
    { "user_metadata" : { "profileCode": 1479 } }

    + *
      + *
    • The properties of the new object will replace the old ones.
    • + *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • + *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • + *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • + *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • + *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • + *
    • Supported attributes can be unset by supplying null as the value.
    • + *
    + *

    Updating a field (non-metadata property)

    + *

    To mark the email address of a user as verified, the body to send should be:

    + *
    { "email_verified": true }
    +     * 
    + *

    Updating a user metadata root property

    + *

    Let's assume that our test user has the following user_metadata:

    + *
    { "user_metadata" : { "profileCode": 1479 } }
    +     * 
    *

    To add the field addresses the body to send should be:

    - *

    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}

    - *

    The modified object ends up with the following user_metadata property:

    {
    -     * "user_metadata": {
    -     * "profileCode": 1479,
    -     * "addresses": { "work_address": "100 Industrial Way" }
    +     * 
    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
    +     * 
    + *

    The modified object ends up with the following user_metadata property:

    + *
    {
    +     *   "user_metadata": {
    +     *     "profileCode": 1479,
    +     *     "addresses": { "work_address": "100 Industrial Way" }
    +     *   }
          * }
    -     * }

    - *

    Updating an inner user metadata property
    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: - *
    {
    +     * 
    + *

    Updating an inner user metadata property

    + *

    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be:

    + *
    {
          *   "user_metadata": {
          *     "addresses": {
          *       "work_address": "100 Industrial Way",
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    *

    The modified object ends up with the following user_metadata property:

    - *

    {
    +     * 
    {
          *   "user_metadata": {
          *     "profileCode": 1479,
          *     "addresses": {
    @@ -854,7 +876,8 @@ public CompletableFuture> u
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    */ public CompletableFuture> update( String id, UpdateUserRequestContent request) { @@ -864,57 +887,65 @@ public CompletableFuture> u /** * Update a user. *

    These are the attributes that can be updated at the root level:

    - *

      - *
    • app_metadata
    • - *
    • blocked
    • - *
    • email
    • - *
    • email_verified
    • - *
    • family_name
    • - *
    • given_name
    • - *
    • name
    • - *
    • nickname
    • - *
    • password
    • - *
    • phone_number
    • - *
    • phone_verified
    • - *
    • picture
    • - *
    • username
    • - *
    • user_metadata
    • - *
    • verify_email
    • - *

    + *
      + *
    • app_metadata
    • + *
    • blocked
    • + *
    • email
    • + *
    • email_verified
    • + *
    • family_name
    • + *
    • given_name
    • + *
    • name
    • + *
    • nickname
    • + *
    • password
    • + *
    • phone_number
    • + *
    • phone_verified
    • + *
    • picture
    • + *
    • username
    • + *
    • user_metadata
    • + *
    • verify_email
    • + *
    *

    Some considerations:

    - *

      - *
    • The properties of the new object will replace the old ones.
    • - *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • - *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • - *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • - *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • - *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • - *
    • Supported attributes can be unset by supplying null as the value.
    • - *

    - *

    Updating a field (non-metadata property)
    - * To mark the email address of a user as verified, the body to send should be: - *
    { "email_verified": true }

    - *

    Updating a user metadata root property
    Let's assume that our test user has the following user_metadata: - *
    { "user_metadata" : { "profileCode": 1479 } }

    + *
      + *
    • The properties of the new object will replace the old ones.
    • + *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • + *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • + *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • + *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • + *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • + *
    • Supported attributes can be unset by supplying null as the value.
    • + *
    + *

    Updating a field (non-metadata property)

    + *

    To mark the email address of a user as verified, the body to send should be:

    + *
    { "email_verified": true }
    +     * 
    + *

    Updating a user metadata root property

    + *

    Let's assume that our test user has the following user_metadata:

    + *
    { "user_metadata" : { "profileCode": 1479 } }
    +     * 
    *

    To add the field addresses the body to send should be:

    - *

    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}

    - *

    The modified object ends up with the following user_metadata property:

    {
    -     * "user_metadata": {
    -     * "profileCode": 1479,
    -     * "addresses": { "work_address": "100 Industrial Way" }
    +     * 
    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
    +     * 
    + *

    The modified object ends up with the following user_metadata property:

    + *
    {
    +     *   "user_metadata": {
    +     *     "profileCode": 1479,
    +     *     "addresses": { "work_address": "100 Industrial Way" }
    +     *   }
          * }
    -     * }

    - *

    Updating an inner user metadata property
    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: - *
    {
    +     * 
    + *

    Updating an inner user metadata property

    + *

    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be:

    + *
    {
          *   "user_metadata": {
          *     "addresses": {
          *       "work_address": "100 Industrial Way",
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    *

    The modified object ends up with the following user_metadata property:

    - *

    {
    +     * 
    {
          *   "user_metadata": {
          *     "profileCode": 1479,
          *     "addresses": {
    @@ -922,7 +953,8 @@ public CompletableFuture> u
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    */ public CompletableFuture> update( String id, UpdateUserRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/AsyncRolesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncRolesClient.java index 0b9b10e2..a68f520d 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncRolesClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncRolesClient.java @@ -44,7 +44,7 @@ public AsyncRawRolesClient withRawResponse() { /** * Retrieve detailed list of user roles created in your tenant. - *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    + *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    */ public CompletableFuture> list() { return this.rawClient.list().thenApply(response -> response.body()); @@ -52,7 +52,7 @@ public CompletableFuture> list() { /** * Retrieve detailed list of user roles created in your tenant. - *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    + *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    */ public CompletableFuture> list(RequestOptions requestOptions) { return this.rawClient.list(requestOptions).thenApply(response -> response.body()); @@ -60,7 +60,7 @@ public CompletableFuture> list(RequestOptions requestOp /** * Retrieve detailed list of user roles created in your tenant. - *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    + *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    */ public CompletableFuture> list(ListRolesRequestParameters request) { return this.rawClient.list(request).thenApply(response -> response.body()); @@ -68,7 +68,7 @@ public CompletableFuture> list(ListRolesRequestParamete /** * Retrieve detailed list of user roles created in your tenant. - *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    + *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    */ public CompletableFuture> list( ListRolesRequestParameters request, RequestOptions requestOptions) { @@ -77,7 +77,7 @@ public CompletableFuture> list( /** * Create a user role for Role-Based Access Control. - *

    Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

    + *

    Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

    */ public CompletableFuture create(CreateRoleRequestContent request) { return this.rawClient.create(request).thenApply(response -> response.body()); @@ -85,7 +85,7 @@ public CompletableFuture create(CreateRoleRequestCont /** * Create a user role for Role-Based Access Control. - *

    Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

    + *

    Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

    */ public CompletableFuture create( CreateRoleRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/AsyncUserAttributeProfilesClient.java b/src/main/java/com/auth0/client/mgmt/AsyncUserAttributeProfilesClient.java index 763f717d..6bd54625 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncUserAttributeProfilesClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncUserAttributeProfilesClient.java @@ -65,7 +65,7 @@ public CompletableFuture> list( } /** - * Create a User Attribute Profile + * Create a User Attribute Profile. */ public CompletableFuture create( CreateUserAttributeProfileRequestContent request) { @@ -73,7 +73,7 @@ public CompletableFuture create( } /** - * Create a User Attribute Profile + * Create a User Attribute Profile. */ public CompletableFuture create( CreateUserAttributeProfileRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/AsyncUsersClient.java b/src/main/java/com/auth0/client/mgmt/AsyncUsersClient.java index 38eb2359..93023174 100644 --- a/src/main/java/com/auth0/client/mgmt/AsyncUsersClient.java +++ b/src/main/java/com/auth0/client/mgmt/AsyncUsersClient.java @@ -108,7 +108,6 @@ public AsyncRawUsersClient withRawResponse() { *
  • Select the fields to be returned
  • *
  • Specify the number of users to retrieve per page and the page index
  • * - *

    <!-- only v3 is available -->

    *

    The q query parameter can be used to get users that match the specified criteria using query string syntax.

    *

    Learn more about searching for users.

    *

    Read about best practices when working with the API endpoints for retrieving users.

    @@ -126,7 +125,6 @@ public CompletableFuture> list() { *
  • Select the fields to be returned
  • *
  • Specify the number of users to retrieve per page and the page index
  • * - *

    <!-- only v3 is available -->

    *

    The q query parameter can be used to get users that match the specified criteria using query string syntax.

    *

    Learn more about searching for users.

    *

    Read about best practices when working with the API endpoints for retrieving users.

    @@ -144,7 +142,6 @@ public CompletableFuture> list(RequestOpt *
  • Select the fields to be returned
  • *
  • Specify the number of users to retrieve per page and the page index
  • * - *

    <!-- only v3 is available -->

    *

    The q query parameter can be used to get users that match the specified criteria using query string syntax.

    *

    Learn more about searching for users.

    *

    Read about best practices when working with the API endpoints for retrieving users.

    @@ -162,7 +159,6 @@ public CompletableFuture> list(ListUsersR *
  • Select the fields to be returned
  • *
  • Specify the number of users to retrieve per page and the page index
  • * - *

    <!-- only v3 is available -->

    *

    The q query parameter can be used to get users that match the specified criteria using query string syntax.

    *

    Learn more about searching for users.

    *

    Read about best practices when working with the API endpoints for retrieving users.

    @@ -255,57 +251,65 @@ public CompletableFuture delete(String id, RequestOptions requestOptions) /** * Update a user. *

    These are the attributes that can be updated at the root level:

    - *

      - *
    • app_metadata
    • - *
    • blocked
    • - *
    • email
    • - *
    • email_verified
    • - *
    • family_name
    • - *
    • given_name
    • - *
    • name
    • - *
    • nickname
    • - *
    • password
    • - *
    • phone_number
    • - *
    • phone_verified
    • - *
    • picture
    • - *
    • username
    • - *
    • user_metadata
    • - *
    • verify_email
    • - *

    + *
      + *
    • app_metadata
    • + *
    • blocked
    • + *
    • email
    • + *
    • email_verified
    • + *
    • family_name
    • + *
    • given_name
    • + *
    • name
    • + *
    • nickname
    • + *
    • password
    • + *
    • phone_number
    • + *
    • phone_verified
    • + *
    • picture
    • + *
    • username
    • + *
    • user_metadata
    • + *
    • verify_email
    • + *
    *

    Some considerations:

    - *

      - *
    • The properties of the new object will replace the old ones.
    • - *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • - *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • - *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • - *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • - *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • - *
    • Supported attributes can be unset by supplying null as the value.
    • - *

    - *

    Updating a field (non-metadata property)
    - * To mark the email address of a user as verified, the body to send should be: - *
    { "email_verified": true }

    - *

    Updating a user metadata root property
    Let's assume that our test user has the following user_metadata: - *
    { "user_metadata" : { "profileCode": 1479 } }

    + *
      + *
    • The properties of the new object will replace the old ones.
    • + *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • + *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • + *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • + *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • + *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • + *
    • Supported attributes can be unset by supplying null as the value.
    • + *
    + *

    Updating a field (non-metadata property)

    + *

    To mark the email address of a user as verified, the body to send should be:

    + *
    { "email_verified": true }
    +     * 
    + *

    Updating a user metadata root property

    + *

    Let's assume that our test user has the following user_metadata:

    + *
    { "user_metadata" : { "profileCode": 1479 } }
    +     * 
    *

    To add the field addresses the body to send should be:

    - *

    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}

    - *

    The modified object ends up with the following user_metadata property:

    {
    -     * "user_metadata": {
    -     * "profileCode": 1479,
    -     * "addresses": { "work_address": "100 Industrial Way" }
    +     * 
    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
    +     * 
    + *

    The modified object ends up with the following user_metadata property:

    + *
    {
    +     *   "user_metadata": {
    +     *     "profileCode": 1479,
    +     *     "addresses": { "work_address": "100 Industrial Way" }
    +     *   }
          * }
    -     * }

    - *

    Updating an inner user metadata property
    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: - *
    {
    +     * 
    + *

    Updating an inner user metadata property

    + *

    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be:

    + *
    {
          *   "user_metadata": {
          *     "addresses": {
          *       "work_address": "100 Industrial Way",
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    *

    The modified object ends up with the following user_metadata property:

    - *

    {
    +     * 
    {
          *   "user_metadata": {
          *     "profileCode": 1479,
          *     "addresses": {
    @@ -313,7 +317,8 @@ public CompletableFuture delete(String id, RequestOptions requestOptions)
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    */ public CompletableFuture update(String id) { return this.rawClient.update(id).thenApply(response -> response.body()); @@ -322,57 +327,65 @@ public CompletableFuture update(String id) { /** * Update a user. *

    These are the attributes that can be updated at the root level:

    - *

      - *
    • app_metadata
    • - *
    • blocked
    • - *
    • email
    • - *
    • email_verified
    • - *
    • family_name
    • - *
    • given_name
    • - *
    • name
    • - *
    • nickname
    • - *
    • password
    • - *
    • phone_number
    • - *
    • phone_verified
    • - *
    • picture
    • - *
    • username
    • - *
    • user_metadata
    • - *
    • verify_email
    • - *

    + *
      + *
    • app_metadata
    • + *
    • blocked
    • + *
    • email
    • + *
    • email_verified
    • + *
    • family_name
    • + *
    • given_name
    • + *
    • name
    • + *
    • nickname
    • + *
    • password
    • + *
    • phone_number
    • + *
    • phone_verified
    • + *
    • picture
    • + *
    • username
    • + *
    • user_metadata
    • + *
    • verify_email
    • + *
    *

    Some considerations:

    - *

      - *
    • The properties of the new object will replace the old ones.
    • - *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • - *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • - *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • - *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • - *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • - *
    • Supported attributes can be unset by supplying null as the value.
    • - *

    - *

    Updating a field (non-metadata property)
    - * To mark the email address of a user as verified, the body to send should be: - *
    { "email_verified": true }

    - *

    Updating a user metadata root property
    Let's assume that our test user has the following user_metadata: - *
    { "user_metadata" : { "profileCode": 1479 } }

    + *
      + *
    • The properties of the new object will replace the old ones.
    • + *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • + *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • + *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • + *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • + *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • + *
    • Supported attributes can be unset by supplying null as the value.
    • + *
    + *

    Updating a field (non-metadata property)

    + *

    To mark the email address of a user as verified, the body to send should be:

    + *
    { "email_verified": true }
    +     * 
    + *

    Updating a user metadata root property

    + *

    Let's assume that our test user has the following user_metadata:

    + *
    { "user_metadata" : { "profileCode": 1479 } }
    +     * 
    *

    To add the field addresses the body to send should be:

    - *

    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}

    - *

    The modified object ends up with the following user_metadata property:

    {
    -     * "user_metadata": {
    -     * "profileCode": 1479,
    -     * "addresses": { "work_address": "100 Industrial Way" }
    +     * 
    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
    +     * 
    + *

    The modified object ends up with the following user_metadata property:

    + *
    {
    +     *   "user_metadata": {
    +     *     "profileCode": 1479,
    +     *     "addresses": { "work_address": "100 Industrial Way" }
    +     *   }
          * }
    -     * }

    - *

    Updating an inner user metadata property
    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: - *
    {
    +     * 
    + *

    Updating an inner user metadata property

    + *

    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be:

    + *
    {
          *   "user_metadata": {
          *     "addresses": {
          *       "work_address": "100 Industrial Way",
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    *

    The modified object ends up with the following user_metadata property:

    - *

    {
    +     * 
    {
          *   "user_metadata": {
          *     "profileCode": 1479,
          *     "addresses": {
    @@ -380,7 +393,8 @@ public CompletableFuture update(String id) {
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    */ public CompletableFuture update(String id, RequestOptions requestOptions) { return this.rawClient.update(id, requestOptions).thenApply(response -> response.body()); @@ -389,57 +403,65 @@ public CompletableFuture update(String id, RequestOpt /** * Update a user. *

    These are the attributes that can be updated at the root level:

    - *

      - *
    • app_metadata
    • - *
    • blocked
    • - *
    • email
    • - *
    • email_verified
    • - *
    • family_name
    • - *
    • given_name
    • - *
    • name
    • - *
    • nickname
    • - *
    • password
    • - *
    • phone_number
    • - *
    • phone_verified
    • - *
    • picture
    • - *
    • username
    • - *
    • user_metadata
    • - *
    • verify_email
    • - *

    + *
      + *
    • app_metadata
    • + *
    • blocked
    • + *
    • email
    • + *
    • email_verified
    • + *
    • family_name
    • + *
    • given_name
    • + *
    • name
    • + *
    • nickname
    • + *
    • password
    • + *
    • phone_number
    • + *
    • phone_verified
    • + *
    • picture
    • + *
    • username
    • + *
    • user_metadata
    • + *
    • verify_email
    • + *
    *

    Some considerations:

    - *

      - *
    • The properties of the new object will replace the old ones.
    • - *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • - *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • - *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • - *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • - *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • - *
    • Supported attributes can be unset by supplying null as the value.
    • - *

    - *

    Updating a field (non-metadata property)
    - * To mark the email address of a user as verified, the body to send should be: - *
    { "email_verified": true }

    - *

    Updating a user metadata root property
    Let's assume that our test user has the following user_metadata: - *
    { "user_metadata" : { "profileCode": 1479 } }

    + *
      + *
    • The properties of the new object will replace the old ones.
    • + *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • + *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • + *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • + *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • + *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • + *
    • Supported attributes can be unset by supplying null as the value.
    • + *
    + *

    Updating a field (non-metadata property)

    + *

    To mark the email address of a user as verified, the body to send should be:

    + *
    { "email_verified": true }
    +     * 
    + *

    Updating a user metadata root property

    + *

    Let's assume that our test user has the following user_metadata:

    + *
    { "user_metadata" : { "profileCode": 1479 } }
    +     * 
    *

    To add the field addresses the body to send should be:

    - *

    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}

    - *

    The modified object ends up with the following user_metadata property:

    {
    -     * "user_metadata": {
    -     * "profileCode": 1479,
    -     * "addresses": { "work_address": "100 Industrial Way" }
    +     * 
    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
    +     * 
    + *

    The modified object ends up with the following user_metadata property:

    + *
    {
    +     *   "user_metadata": {
    +     *     "profileCode": 1479,
    +     *     "addresses": { "work_address": "100 Industrial Way" }
    +     *   }
          * }
    -     * }

    - *

    Updating an inner user metadata property
    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: - *
    {
    +     * 
    + *

    Updating an inner user metadata property

    + *

    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be:

    + *
    {
          *   "user_metadata": {
          *     "addresses": {
          *       "work_address": "100 Industrial Way",
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    *

    The modified object ends up with the following user_metadata property:

    - *

    {
    +     * 
    {
          *   "user_metadata": {
          *     "profileCode": 1479,
          *     "addresses": {
    @@ -447,7 +469,8 @@ public CompletableFuture update(String id, RequestOpt
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    */ public CompletableFuture update(String id, UpdateUserRequestContent request) { return this.rawClient.update(id, request).thenApply(response -> response.body()); @@ -456,57 +479,65 @@ public CompletableFuture update(String id, UpdateUser /** * Update a user. *

    These are the attributes that can be updated at the root level:

    - *

      - *
    • app_metadata
    • - *
    • blocked
    • - *
    • email
    • - *
    • email_verified
    • - *
    • family_name
    • - *
    • given_name
    • - *
    • name
    • - *
    • nickname
    • - *
    • password
    • - *
    • phone_number
    • - *
    • phone_verified
    • - *
    • picture
    • - *
    • username
    • - *
    • user_metadata
    • - *
    • verify_email
    • - *

    + *
      + *
    • app_metadata
    • + *
    • blocked
    • + *
    • email
    • + *
    • email_verified
    • + *
    • family_name
    • + *
    • given_name
    • + *
    • name
    • + *
    • nickname
    • + *
    • password
    • + *
    • phone_number
    • + *
    • phone_verified
    • + *
    • picture
    • + *
    • username
    • + *
    • user_metadata
    • + *
    • verify_email
    • + *
    *

    Some considerations:

    - *

      - *
    • The properties of the new object will replace the old ones.
    • - *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • - *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • - *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • - *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • - *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • - *
    • Supported attributes can be unset by supplying null as the value.
    • - *

    - *

    Updating a field (non-metadata property)
    - * To mark the email address of a user as verified, the body to send should be: - *
    { "email_verified": true }

    - *

    Updating a user metadata root property
    Let's assume that our test user has the following user_metadata: - *
    { "user_metadata" : { "profileCode": 1479 } }

    + *
      + *
    • The properties of the new object will replace the old ones.
    • + *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • + *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • + *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • + *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • + *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • + *
    • Supported attributes can be unset by supplying null as the value.
    • + *
    + *

    Updating a field (non-metadata property)

    + *

    To mark the email address of a user as verified, the body to send should be:

    + *
    { "email_verified": true }
    +     * 
    + *

    Updating a user metadata root property

    + *

    Let's assume that our test user has the following user_metadata:

    + *
    { "user_metadata" : { "profileCode": 1479 } }
    +     * 
    *

    To add the field addresses the body to send should be:

    - *

    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}

    - *

    The modified object ends up with the following user_metadata property:

    {
    -     * "user_metadata": {
    -     * "profileCode": 1479,
    -     * "addresses": { "work_address": "100 Industrial Way" }
    +     * 
    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
    +     * 
    + *

    The modified object ends up with the following user_metadata property:

    + *
    {
    +     *   "user_metadata": {
    +     *     "profileCode": 1479,
    +     *     "addresses": { "work_address": "100 Industrial Way" }
    +     *   }
          * }
    -     * }

    - *

    Updating an inner user metadata property
    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: - *
    {
    +     * 
    + *

    Updating an inner user metadata property

    + *

    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be:

    + *
    {
          *   "user_metadata": {
          *     "addresses": {
          *       "work_address": "100 Industrial Way",
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    *

    The modified object ends up with the following user_metadata property:

    - *

    {
    +     * 
    {
          *   "user_metadata": {
          *     "profileCode": 1479,
          *     "addresses": {
    @@ -514,7 +545,8 @@ public CompletableFuture update(String id, UpdateUser
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    */ public CompletableFuture update( String id, UpdateUserRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/ConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/ConnectionsClient.java index 574ea327..4e71232c 100644 --- a/src/main/java/com/auth0/client/mgmt/ConnectionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/ConnectionsClient.java @@ -57,18 +57,18 @@ public RawConnectionsClient withRawResponse() { /** * Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public SyncPagingIterable list() { return this.rawClient.list().body(); @@ -77,18 +77,18 @@ public SyncPagingIterable list() { /** * Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public SyncPagingIterable list(RequestOptions requestOptions) { return this.rawClient.list(requestOptions).body(); @@ -97,18 +97,18 @@ public SyncPagingIterable list(RequestOptions requestOptions) /** * Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public SyncPagingIterable list(ListConnectionsQueryParameters request) { return this.rawClient.list(request).body(); @@ -117,18 +117,18 @@ public SyncPagingIterable list(ListConnectionsQueryParameters /** * Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public SyncPagingIterable list( ListConnectionsQueryParameters request, RequestOptions requestOptions) { @@ -137,7 +137,7 @@ public SyncPagingIterable list( /** * Creates a new connection according to the JSON object received in body. - *

    Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results.

    + *

    Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results.

    */ public CreateConnectionResponseContent create(CreateConnectionRequestContent request) { return this.rawClient.create(request).body(); @@ -145,7 +145,7 @@ public CreateConnectionResponseContent create(CreateConnectionRequestContent req /** * Creates a new connection according to the JSON object received in body. - *

    Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results.

    + *

    Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results.

    */ public CreateConnectionResponseContent create( CreateConnectionRequestContent request, RequestOptions requestOptions) { @@ -183,7 +183,7 @@ public GetConnectionResponseContent get( /** * Removes a specific connection from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. - *

    Note: If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent create connection requests, if they use an identical connection name.

    + *

    Note: If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent create connection requests, if they use an identical connection name.

    */ public void delete(String id) { this.rawClient.delete(id).body(); @@ -191,7 +191,7 @@ public void delete(String id) { /** * Removes a specific connection from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. - *

    Note: If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent create connection requests, if they use an identical connection name.

    + *

    Note: If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent create connection requests, if they use an identical connection name.

    */ public void delete(String id, RequestOptions requestOptions) { this.rawClient.delete(id, requestOptions).body(); @@ -199,7 +199,7 @@ public void delete(String id, RequestOptions requestOptions) { /** * Update details for a specific connection, including option properties for identity provider configuration. - *

    Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    + *

    Note: If you use the options parameter, the entire options object is overridden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    */ public UpdateConnectionResponseContent update(String id) { return this.rawClient.update(id).body(); @@ -207,7 +207,7 @@ public UpdateConnectionResponseContent update(String id) { /** * Update details for a specific connection, including option properties for identity provider configuration. - *

    Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    + *

    Note: If you use the options parameter, the entire options object is overridden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    */ public UpdateConnectionResponseContent update(String id, RequestOptions requestOptions) { return this.rawClient.update(id, requestOptions).body(); @@ -215,7 +215,7 @@ public UpdateConnectionResponseContent update(String id, RequestOptions requestO /** * Update details for a specific connection, including option properties for identity provider configuration. - *

    Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    + *

    Note: If you use the options parameter, the entire options object is overridden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    */ public UpdateConnectionResponseContent update(String id, UpdateConnectionRequestContent request) { return this.rawClient.update(id, request).body(); @@ -223,7 +223,7 @@ public UpdateConnectionResponseContent update(String id, UpdateConnectionRequest /** * Update details for a specific connection, including option properties for identity provider configuration. - *

    Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    + *

    Note: If you use the options parameter, the entire options object is overridden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    */ public UpdateConnectionResponseContent update( String id, UpdateConnectionRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/CustomDomainsClient.java b/src/main/java/com/auth0/client/mgmt/CustomDomainsClient.java index 03f7868b..b412e812 100644 --- a/src/main/java/com/auth0/client/mgmt/CustomDomainsClient.java +++ b/src/main/java/com/auth0/client/mgmt/CustomDomainsClient.java @@ -165,11 +165,15 @@ public void delete(String id, RequestOptions requestOptions) { *
  • custom_client_ip_header
  • *
  • tls_policy
  • * - *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
    To update the custom_client_ip_header for a domain, the body to - * send should be: - *
    { "custom_client_ip_header": "cf-connecting-ip" }

    - *

    Updating TLS_POLICY for a custom domain
    To update the tls_policy for a domain, the body to send should be: - *
    { "tls_policy": "recommended" }

    + *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain

    + *

    To update the custom_client_ip_header for a domain, the body to + * send should be:

    + *
    { "custom_client_ip_header": "cf-connecting-ip" }
    +     * 
    + *

    Updating TLS_POLICY for a custom domain

    + *

    To update the tls_policy for a domain, the body to send should be:

    + *
    { "tls_policy": "recommended" }
    +     * 
    *

    TLS Policies:

    *
      *
    • recommended - for modern usage this includes TLS 1.2 only
    • @@ -191,11 +195,15 @@ public UpdateCustomDomainResponseContent update(String id) { *
    • custom_client_ip_header
    • *
    • tls_policy
    • *
    - *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
    To update the custom_client_ip_header for a domain, the body to - * send should be: - *
    { "custom_client_ip_header": "cf-connecting-ip" }

    - *

    Updating TLS_POLICY for a custom domain
    To update the tls_policy for a domain, the body to send should be: - *
    { "tls_policy": "recommended" }

    + *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain

    + *

    To update the custom_client_ip_header for a domain, the body to + * send should be:

    + *
    { "custom_client_ip_header": "cf-connecting-ip" }
    +     * 
    + *

    Updating TLS_POLICY for a custom domain

    + *

    To update the tls_policy for a domain, the body to send should be:

    + *
    { "tls_policy": "recommended" }
    +     * 
    *

    TLS Policies:

    *
      *
    • recommended - for modern usage this includes TLS 1.2 only
    • @@ -217,11 +225,15 @@ public UpdateCustomDomainResponseContent update(String id, RequestOptions reques *
    • custom_client_ip_header
    • *
    • tls_policy
    • *
    - *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
    To update the custom_client_ip_header for a domain, the body to - * send should be: - *
    { "custom_client_ip_header": "cf-connecting-ip" }

    - *

    Updating TLS_POLICY for a custom domain
    To update the tls_policy for a domain, the body to send should be: - *
    { "tls_policy": "recommended" }

    + *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain

    + *

    To update the custom_client_ip_header for a domain, the body to + * send should be:

    + *
    { "custom_client_ip_header": "cf-connecting-ip" }
    +     * 
    + *

    Updating TLS_POLICY for a custom domain

    + *

    To update the tls_policy for a domain, the body to send should be:

    + *
    { "tls_policy": "recommended" }
    +     * 
    *

    TLS Policies:

    *
      *
    • recommended - for modern usage this includes TLS 1.2 only
    • @@ -243,11 +255,15 @@ public UpdateCustomDomainResponseContent update(String id, UpdateCustomDomainReq *
    • custom_client_ip_header
    • *
    • tls_policy
    • *
    - *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
    To update the custom_client_ip_header for a domain, the body to - * send should be: - *
    { "custom_client_ip_header": "cf-connecting-ip" }

    - *

    Updating TLS_POLICY for a custom domain
    To update the tls_policy for a domain, the body to send should be: - *
    { "tls_policy": "recommended" }

    + *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain

    + *

    To update the custom_client_ip_header for a domain, the body to + * send should be:

    + *
    { "custom_client_ip_header": "cf-connecting-ip" }
    +     * 
    + *

    Updating TLS_POLICY for a custom domain

    + *

    To update the tls_policy for a domain, the body to send should be:

    + *
    { "tls_policy": "recommended" }
    +     * 
    *

    TLS Policies:

    *
      *
    • recommended - for modern usage this includes TLS 1.2 only
    • diff --git a/src/main/java/com/auth0/client/mgmt/GroupsClient.java b/src/main/java/com/auth0/client/mgmt/GroupsClient.java index 6754aaa3..e292da1d 100644 --- a/src/main/java/com/auth0/client/mgmt/GroupsClient.java +++ b/src/main/java/com/auth0/client/mgmt/GroupsClient.java @@ -8,6 +8,7 @@ import com.auth0.client.mgmt.core.Suppliers; import com.auth0.client.mgmt.core.SyncPagingIterable; import com.auth0.client.mgmt.groups.MembersClient; +import com.auth0.client.mgmt.groups.RolesClient; import com.auth0.client.mgmt.types.GetGroupResponseContent; import com.auth0.client.mgmt.types.Group; import com.auth0.client.mgmt.types.ListGroupsRequestParameters; @@ -20,10 +21,13 @@ public class GroupsClient { protected final Supplier membersClient; + protected final Supplier rolesClient; + public GroupsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; this.rawClient = new RawGroupsClient(clientOptions); this.membersClient = Suppliers.memoize(() -> new MembersClient(clientOptions)); + this.rolesClient = Suppliers.memoize(() -> new RolesClient(clientOptions)); } /** @@ -92,4 +96,8 @@ public void delete(String id, RequestOptions requestOptions) { public MembersClient members() { return this.membersClient.get(); } + + public RolesClient roles() { + return this.rolesClient.get(); + } } diff --git a/src/main/java/com/auth0/client/mgmt/LogsClient.java b/src/main/java/com/auth0/client/mgmt/LogsClient.java index e268fda5..8393b6d9 100644 --- a/src/main/java/com/auth0/client/mgmt/LogsClient.java +++ b/src/main/java/com/auth0/client/mgmt/LogsClient.java @@ -29,25 +29,25 @@ public RawLogsClient withRawResponse() { /** * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). - *

      Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

      + *

      Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

      *

      For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes.

      - *

      To set custom search criteria, use the following parameters:

      - *

        - *
      • q: Search Criteria using Query String Syntax
      • - *
      • page: Page index of the results to return. First page is 0.
      • - *
      • per_page: Number of results per page.
      • - *
      • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
      • - *
      • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
      • - *
      • include_fields: Whether specified fields are to be included (true) or excluded (false).
      • - *
      • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
      • - *

      + *

      To set custom search criteria, use the following parameters:

      + *
        + *
      • q: Search Criteria using Query String Syntax
      • + *
      • page: Page index of the results to return. First page is 0.
      • + *
      • per_page: Number of results per page.
      • + *
      • sort: Field to use for sorting appended with :1 for ascending and :-1 for descending. e.g. date:-1
      • + *
      • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
      • + *
      • include_fields: Whether specified fields are to be included (true) or excluded (false).
      • + *
      • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
      • + *
      *

      For more information on the list of fields that can be used in fields and sort, see Searchable Fields.

      *

      Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method.

      - *

      To search from a checkpoint log ID, use the following parameters:
      + *

      To search from a checkpoint log ID, use the following parameters:

      *
        - *
      • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
      • - *
      • take: Number of entries to retrieve when using the from parameter.
      • - *

      + *
    • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
    • + *
    • take: Number of entries to retrieve when using the from parameter.
    • + *
    *

    Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed.

    */ public SyncPagingIterable list() { @@ -56,25 +56,25 @@ public SyncPagingIterable list() { /** * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). - *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    + *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    *

    For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes.

    - *

    To set custom search criteria, use the following parameters:

    - *

      - *
    • q: Search Criteria using Query String Syntax
    • - *
    • page: Page index of the results to return. First page is 0.
    • - *
    • per_page: Number of results per page.
    • - *
    • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
    • - *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • - *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • - *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • - *

    + *

    To set custom search criteria, use the following parameters:

    + *
      + *
    • q: Search Criteria using Query String Syntax
    • + *
    • page: Page index of the results to return. First page is 0.
    • + *
    • per_page: Number of results per page.
    • + *
    • sort: Field to use for sorting appended with :1 for ascending and :-1 for descending. e.g. date:-1
    • + *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • + *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • + *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • + *
    *

    For more information on the list of fields that can be used in fields and sort, see Searchable Fields.

    *

    Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method.

    - *

    To search from a checkpoint log ID, use the following parameters:
    + *

    To search from a checkpoint log ID, use the following parameters:

    *
      - *
    • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
    • - *
    • take: Number of entries to retrieve when using the from parameter.
    • - *

    + *
  • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
  • + *
  • take: Number of entries to retrieve when using the from parameter.
  • + * *

    Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed.

    */ public SyncPagingIterable list(RequestOptions requestOptions) { @@ -83,25 +83,25 @@ public SyncPagingIterable list(RequestOptions requestOptions) { /** * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). - *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    + *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    *

    For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes.

    - *

    To set custom search criteria, use the following parameters:

    - *

      - *
    • q: Search Criteria using Query String Syntax
    • - *
    • page: Page index of the results to return. First page is 0.
    • - *
    • per_page: Number of results per page.
    • - *
    • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
    • - *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • - *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • - *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • - *

    + *

    To set custom search criteria, use the following parameters:

    + *
      + *
    • q: Search Criteria using Query String Syntax
    • + *
    • page: Page index of the results to return. First page is 0.
    • + *
    • per_page: Number of results per page.
    • + *
    • sort: Field to use for sorting appended with :1 for ascending and :-1 for descending. e.g. date:-1
    • + *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • + *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • + *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • + *
    *

    For more information on the list of fields that can be used in fields and sort, see Searchable Fields.

    *

    Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method.

    - *

    To search from a checkpoint log ID, use the following parameters:
    + *

    To search from a checkpoint log ID, use the following parameters:

    *
      - *
    • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
    • - *
    • take: Number of entries to retrieve when using the from parameter.
    • - *

    + *
  • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
  • + *
  • take: Number of entries to retrieve when using the from parameter.
  • + * *

    Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed.

    */ public SyncPagingIterable list(ListLogsRequestParameters request) { @@ -110,25 +110,25 @@ public SyncPagingIterable list(ListLogsRequestParameters request) { /** * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). - *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    + *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    *

    For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes.

    - *

    To set custom search criteria, use the following parameters:

    - *

      - *
    • q: Search Criteria using Query String Syntax
    • - *
    • page: Page index of the results to return. First page is 0.
    • - *
    • per_page: Number of results per page.
    • - *
    • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
    • - *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • - *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • - *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • - *

    + *

    To set custom search criteria, use the following parameters:

    + *
      + *
    • q: Search Criteria using Query String Syntax
    • + *
    • page: Page index of the results to return. First page is 0.
    • + *
    • per_page: Number of results per page.
    • + *
    • sort: Field to use for sorting appended with :1 for ascending and :-1 for descending. e.g. date:-1
    • + *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • + *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • + *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • + *
    *

    For more information on the list of fields that can be used in fields and sort, see Searchable Fields.

    *

    Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method.

    - *

    To search from a checkpoint log ID, use the following parameters:
    + *

    To search from a checkpoint log ID, use the following parameters:

    *
      - *
    • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
    • - *
    • take: Number of entries to retrieve when using the from parameter.
    • - *

    + *
  • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
  • + *
  • take: Number of entries to retrieve when using the from parameter.
  • + * *

    Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed.

    */ public SyncPagingIterable list(ListLogsRequestParameters request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/ManagementApi.java b/src/main/java/com/auth0/client/mgmt/ManagementApi.java index febfb2b8..7e28f9f7 100644 --- a/src/main/java/com/auth0/client/mgmt/ManagementApi.java +++ b/src/main/java/com/auth0/client/mgmt/ManagementApi.java @@ -62,6 +62,8 @@ public class ManagementApi { protected final Supplier promptsClient; + protected final Supplier rateLimitPoliciesClient; + protected final Supplier refreshTokensClient; protected final Supplier resourceServersClient; @@ -130,6 +132,7 @@ public ManagementApi(ClientOptions clientOptions) { this.networkAclsClient = Suppliers.memoize(() -> new NetworkAclsClient(clientOptions)); this.organizationsClient = Suppliers.memoize(() -> new OrganizationsClient(clientOptions)); this.promptsClient = Suppliers.memoize(() -> new PromptsClient(clientOptions)); + this.rateLimitPoliciesClient = Suppliers.memoize(() -> new RateLimitPoliciesClient(clientOptions)); this.refreshTokensClient = Suppliers.memoize(() -> new RefreshTokensClient(clientOptions)); this.resourceServersClient = Suppliers.memoize(() -> new ResourceServersClient(clientOptions)); this.rolesClient = Suppliers.memoize(() -> new RolesClient(clientOptions)); @@ -242,6 +245,10 @@ public PromptsClient prompts() { return this.promptsClient.get(); } + public RateLimitPoliciesClient rateLimitPolicies() { + return this.rateLimitPoliciesClient.get(); + } + public RefreshTokensClient refreshTokens() { return this.refreshTokensClient.get(); } diff --git a/src/main/java/com/auth0/client/mgmt/RateLimitPoliciesClient.java b/src/main/java/com/auth0/client/mgmt/RateLimitPoliciesClient.java new file mode 100644 index 00000000..3e50d36c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RateLimitPoliciesClient.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.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateRateLimitPolicyRequestContent; +import com.auth0.client.mgmt.types.CreateRateLimitPolicyResponseContent; +import com.auth0.client.mgmt.types.GetRateLimitPolicyResponseContent; +import com.auth0.client.mgmt.types.ListRateLimitPoliciesRequestParameters; +import com.auth0.client.mgmt.types.PatchRateLimitPolicyRequestContent; +import com.auth0.client.mgmt.types.RateLimitPolicy; +import com.auth0.client.mgmt.types.UpdateRateLimitPolicyResponseContent; + +public class RateLimitPoliciesClient { + protected final ClientOptions clientOptions; + + private final RawRateLimitPoliciesClient rawClient; + + public RateLimitPoliciesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawRateLimitPoliciesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawRateLimitPoliciesClient withRawResponse() { + return this.rawClient; + } + + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + public SyncPagingIterable list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).body(); + } + + public SyncPagingIterable list(ListRateLimitPoliciesRequestParameters request) { + return this.rawClient.list(request).body(); + } + + public SyncPagingIterable list( + ListRateLimitPoliciesRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + public CreateRateLimitPolicyResponseContent create(CreateRateLimitPolicyRequestContent request) { + return this.rawClient.create(request).body(); + } + + public CreateRateLimitPolicyResponseContent create( + CreateRateLimitPolicyRequestContent request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + public GetRateLimitPolicyResponseContent get(String id) { + return this.rawClient.get(id).body(); + } + + public GetRateLimitPolicyResponseContent get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + public void delete(String id) { + this.rawClient.delete(id).body(); + } + + public void delete(String id, RequestOptions requestOptions) { + this.rawClient.delete(id, requestOptions).body(); + } + + public UpdateRateLimitPolicyResponseContent update(String id, PatchRateLimitPolicyRequestContent request) { + return this.rawClient.update(id, request).body(); + } + + public UpdateRateLimitPolicyResponseContent update( + String id, PatchRateLimitPolicyRequestContent request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawConnectionsClient.java b/src/main/java/com/auth0/client/mgmt/RawConnectionsClient.java index 744b157d..2b70a36d 100644 --- a/src/main/java/com/auth0/client/mgmt/RawConnectionsClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawConnectionsClient.java @@ -50,18 +50,18 @@ public RawConnectionsClient(ClientOptions clientOptions) { /** * Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public ManagementApiHttpResponse> list() { return list(ListConnectionsQueryParameters.builder().build()); @@ -70,18 +70,18 @@ public ManagementApiHttpResponse> list() { /** * Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public ManagementApiHttpResponse> list(RequestOptions requestOptions) { return list(ListConnectionsQueryParameters.builder().build(), requestOptions); @@ -90,18 +90,18 @@ public ManagementApiHttpResponse> list(Req /** * Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public ManagementApiHttpResponse> list( ListConnectionsQueryParameters request) { @@ -111,18 +111,18 @@ public ManagementApiHttpResponse> list( /** * Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 connections.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public ManagementApiHttpResponse> list( ListConnectionsQueryParameters request, RequestOptions requestOptions) { @@ -212,7 +212,7 @@ public ManagementApiHttpResponse> list( /** * Creates a new connection according to the JSON object received in body. - *

    Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results.

    + *

    Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results.

    */ public ManagementApiHttpResponse create(CreateConnectionRequestContent request) { return create(request, null); @@ -220,7 +220,7 @@ public ManagementApiHttpResponse create(CreateC /** * Creates a new connection according to the JSON object received in body. - *

    Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results.

    + *

    Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results.

    */ public ManagementApiHttpResponse create( CreateConnectionRequestContent request, RequestOptions requestOptions) { @@ -380,7 +380,7 @@ public ManagementApiHttpResponse get( /** * Removes a specific connection from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. - *

    Note: If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent create connection requests, if they use an identical connection name.

    + *

    Note: If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent create connection requests, if they use an identical connection name.

    */ public ManagementApiHttpResponse delete(String id) { return delete(id, null); @@ -388,7 +388,7 @@ public ManagementApiHttpResponse delete(String id) { /** * Removes a specific connection from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate. - *

    Note: If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent create connection requests, if they use an identical connection name.

    + *

    Note: If your connection has a large amount of users associated with it, please be aware that this operation can be long running after the response is returned and may impact concurrent create connection requests, if they use an identical connection name.

    */ public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) @@ -444,7 +444,7 @@ public ManagementApiHttpResponse delete(String id, RequestOptions requestO /** * Update details for a specific connection, including option properties for identity provider configuration. - *

    Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    + *

    Note: If you use the options parameter, the entire options object is overridden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    */ public ManagementApiHttpResponse update(String id) { return update(id, UpdateConnectionRequestContent.builder().build()); @@ -452,7 +452,7 @@ public ManagementApiHttpResponse update(String /** * Update details for a specific connection, including option properties for identity provider configuration. - *

    Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    + *

    Note: If you use the options parameter, the entire options object is overridden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    */ public ManagementApiHttpResponse update(String id, RequestOptions requestOptions) { return update(id, UpdateConnectionRequestContent.builder().build(), requestOptions); @@ -460,7 +460,7 @@ public ManagementApiHttpResponse update(String /** * Update details for a specific connection, including option properties for identity provider configuration. - *

    Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    + *

    Note: If you use the options parameter, the entire options object is overridden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    */ public ManagementApiHttpResponse update( String id, UpdateConnectionRequestContent request) { @@ -469,7 +469,7 @@ public ManagementApiHttpResponse update( /** * Update details for a specific connection, including option properties for identity provider configuration. - *

    Note: If you use the options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    + *

    Note: If you use the options parameter, the entire options object is overridden. To avoid partial data or other issues, ensure all parameters are present when using this option.

    */ public ManagementApiHttpResponse update( String id, UpdateConnectionRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/RawCustomDomainsClient.java b/src/main/java/com/auth0/client/mgmt/RawCustomDomainsClient.java index a86f0071..ba73c878 100644 --- a/src/main/java/com/auth0/client/mgmt/RawCustomDomainsClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawCustomDomainsClient.java @@ -502,11 +502,15 @@ public ManagementApiHttpResponse delete(String id, RequestOptions requestO *
  • custom_client_ip_header
  • *
  • tls_policy
  • * - *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
    To update the custom_client_ip_header for a domain, the body to - * send should be: - *
    { "custom_client_ip_header": "cf-connecting-ip" }

    - *

    Updating TLS_POLICY for a custom domain
    To update the tls_policy for a domain, the body to send should be: - *
    { "tls_policy": "recommended" }

    + *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain

    + *

    To update the custom_client_ip_header for a domain, the body to + * send should be:

    + *
    { "custom_client_ip_header": "cf-connecting-ip" }
    +     * 
    + *

    Updating TLS_POLICY for a custom domain

    + *

    To update the tls_policy for a domain, the body to send should be:

    + *
    { "tls_policy": "recommended" }
    +     * 
    *

    TLS Policies:

    *
      *
    • recommended - for modern usage this includes TLS 1.2 only
    • @@ -528,11 +532,15 @@ public ManagementApiHttpResponse update(Strin *
    • custom_client_ip_header
    • *
    • tls_policy
    • *
    - *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
    To update the custom_client_ip_header for a domain, the body to - * send should be: - *
    { "custom_client_ip_header": "cf-connecting-ip" }

    - *

    Updating TLS_POLICY for a custom domain
    To update the tls_policy for a domain, the body to send should be: - *
    { "tls_policy": "recommended" }

    + *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain

    + *

    To update the custom_client_ip_header for a domain, the body to + * send should be:

    + *
    { "custom_client_ip_header": "cf-connecting-ip" }
    +     * 
    + *

    Updating TLS_POLICY for a custom domain

    + *

    To update the tls_policy for a domain, the body to send should be:

    + *
    { "tls_policy": "recommended" }
    +     * 
    *

    TLS Policies:

    *
      *
    • recommended - for modern usage this includes TLS 1.2 only
    • @@ -555,11 +563,15 @@ public ManagementApiHttpResponse update( *
    • custom_client_ip_header
    • *
    • tls_policy
    • *
    - *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
    To update the custom_client_ip_header for a domain, the body to - * send should be: - *
    { "custom_client_ip_header": "cf-connecting-ip" }

    - *

    Updating TLS_POLICY for a custom domain
    To update the tls_policy for a domain, the body to send should be: - *
    { "tls_policy": "recommended" }

    + *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain

    + *

    To update the custom_client_ip_header for a domain, the body to + * send should be:

    + *
    { "custom_client_ip_header": "cf-connecting-ip" }
    +     * 
    + *

    Updating TLS_POLICY for a custom domain

    + *

    To update the tls_policy for a domain, the body to send should be:

    + *
    { "tls_policy": "recommended" }
    +     * 
    *

    TLS Policies:

    *
      *
    • recommended - for modern usage this includes TLS 1.2 only
    • @@ -582,11 +594,15 @@ public ManagementApiHttpResponse update( *
    • custom_client_ip_header
    • *
    • tls_policy
    • *
    - *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
    To update the custom_client_ip_header for a domain, the body to - * send should be: - *
    { "custom_client_ip_header": "cf-connecting-ip" }

    - *

    Updating TLS_POLICY for a custom domain
    To update the tls_policy for a domain, the body to send should be: - *
    { "tls_policy": "recommended" }

    + *

    Updating CUSTOM_CLIENT_IP_HEADER for a custom domain

    + *

    To update the custom_client_ip_header for a domain, the body to + * send should be:

    + *
    { "custom_client_ip_header": "cf-connecting-ip" }
    +     * 
    + *

    Updating TLS_POLICY for a custom domain

    + *

    To update the tls_policy for a domain, the body to send should be:

    + *
    { "tls_policy": "recommended" }
    +     * 
    *

    TLS Policies:

    *
      *
    • recommended - for modern usage this includes TLS 1.2 only
    • diff --git a/src/main/java/com/auth0/client/mgmt/RawLogsClient.java b/src/main/java/com/auth0/client/mgmt/RawLogsClient.java index 5bae14d7..43bc0ee0 100644 --- a/src/main/java/com/auth0/client/mgmt/RawLogsClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawLogsClient.java @@ -40,25 +40,25 @@ public RawLogsClient(ClientOptions clientOptions) { /** * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). - *

      Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

      + *

      Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

      *

      For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes.

      - *

      To set custom search criteria, use the following parameters:

      - *

        - *
      • q: Search Criteria using Query String Syntax
      • - *
      • page: Page index of the results to return. First page is 0.
      • - *
      • per_page: Number of results per page.
      • - *
      • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
      • - *
      • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
      • - *
      • include_fields: Whether specified fields are to be included (true) or excluded (false).
      • - *
      • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
      • - *

      + *

      To set custom search criteria, use the following parameters:

      + *
        + *
      • q: Search Criteria using Query String Syntax
      • + *
      • page: Page index of the results to return. First page is 0.
      • + *
      • per_page: Number of results per page.
      • + *
      • sort: Field to use for sorting appended with :1 for ascending and :-1 for descending. e.g. date:-1
      • + *
      • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
      • + *
      • include_fields: Whether specified fields are to be included (true) or excluded (false).
      • + *
      • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
      • + *
      *

      For more information on the list of fields that can be used in fields and sort, see Searchable Fields.

      *

      Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method.

      - *

      To search from a checkpoint log ID, use the following parameters:
      + *

      To search from a checkpoint log ID, use the following parameters:

      *
        - *
      • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
      • - *
      • take: Number of entries to retrieve when using the from parameter.
      • - *

      + *
    • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
    • + *
    • take: Number of entries to retrieve when using the from parameter.
    • + *
    *

    Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed.

    */ public ManagementApiHttpResponse> list() { @@ -67,25 +67,25 @@ public ManagementApiHttpResponse> list() { /** * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). - *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    + *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    *

    For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes.

    - *

    To set custom search criteria, use the following parameters:

    - *

      - *
    • q: Search Criteria using Query String Syntax
    • - *
    • page: Page index of the results to return. First page is 0.
    • - *
    • per_page: Number of results per page.
    • - *
    • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
    • - *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • - *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • - *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • - *

    + *

    To set custom search criteria, use the following parameters:

    + *
      + *
    • q: Search Criteria using Query String Syntax
    • + *
    • page: Page index of the results to return. First page is 0.
    • + *
    • per_page: Number of results per page.
    • + *
    • sort: Field to use for sorting appended with :1 for ascending and :-1 for descending. e.g. date:-1
    • + *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • + *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • + *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • + *
    *

    For more information on the list of fields that can be used in fields and sort, see Searchable Fields.

    *

    Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method.

    - *

    To search from a checkpoint log ID, use the following parameters:
    + *

    To search from a checkpoint log ID, use the following parameters:

    *
      - *
    • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
    • - *
    • take: Number of entries to retrieve when using the from parameter.
    • - *

    + *
  • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
  • + *
  • take: Number of entries to retrieve when using the from parameter.
  • + * *

    Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed.

    */ public ManagementApiHttpResponse> list(RequestOptions requestOptions) { @@ -94,25 +94,25 @@ public ManagementApiHttpResponse> list(RequestOptions re /** * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). - *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    + *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    *

    For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes.

    - *

    To set custom search criteria, use the following parameters:

    - *

      - *
    • q: Search Criteria using Query String Syntax
    • - *
    • page: Page index of the results to return. First page is 0.
    • - *
    • per_page: Number of results per page.
    • - *
    • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
    • - *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • - *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • - *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • - *

    + *

    To set custom search criteria, use the following parameters:

    + *
      + *
    • q: Search Criteria using Query String Syntax
    • + *
    • page: Page index of the results to return. First page is 0.
    • + *
    • per_page: Number of results per page.
    • + *
    • sort: Field to use for sorting appended with :1 for ascending and :-1 for descending. e.g. date:-1
    • + *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • + *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • + *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • + *
    *

    For more information on the list of fields that can be used in fields and sort, see Searchable Fields.

    *

    Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method.

    - *

    To search from a checkpoint log ID, use the following parameters:
    + *

    To search from a checkpoint log ID, use the following parameters:

    *
      - *
    • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
    • - *
    • take: Number of entries to retrieve when using the from parameter.
    • - *

    + *
  • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
  • + *
  • take: Number of entries to retrieve when using the from parameter.
  • + * *

    Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed.

    */ public ManagementApiHttpResponse> list(ListLogsRequestParameters request) { @@ -121,25 +121,25 @@ public ManagementApiHttpResponse> list(ListLogsRequestPa /** * Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified). - *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    + *

    Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

    *

    For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes.

    - *

    To set custom search criteria, use the following parameters:

    - *

      - *
    • q: Search Criteria using Query String Syntax
    • - *
    • page: Page index of the results to return. First page is 0.
    • - *
    • per_page: Number of results per page.
    • - *
    • sort: Field to use for sorting appended with `:1` for ascending and `:-1` for descending. e.g. `date:-1`
    • - *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • - *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • - *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • - *

    + *

    To set custom search criteria, use the following parameters:

    + *
      + *
    • q: Search Criteria using Query String Syntax
    • + *
    • page: Page index of the results to return. First page is 0.
    • + *
    • per_page: Number of results per page.
    • + *
    • sort: Field to use for sorting appended with :1 for ascending and :-1 for descending. e.g. date:-1
    • + *
    • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
    • + *
    • include_fields: Whether specified fields are to be included (true) or excluded (false).
    • + *
    • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes
    • + *
    *

    For more information on the list of fields that can be used in fields and sort, see Searchable Fields.

    *

    Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method.

    - *

    To search from a checkpoint log ID, use the following parameters:
    + *

    To search from a checkpoint log ID, use the following parameters:

    *
      - *
    • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
    • - *
    • take: Number of entries to retrieve when using the from parameter.
    • - *

    + *
  • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
  • + *
  • take: Number of entries to retrieve when using the from parameter.
  • + * *

    Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed.

    */ public ManagementApiHttpResponse> list( diff --git a/src/main/java/com/auth0/client/mgmt/RawRateLimitPoliciesClient.java b/src/main/java/com/auth0/client/mgmt/RawRateLimitPoliciesClient.java new file mode 100644 index 00000000..0ba0552c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/RawRateLimitPoliciesClient.java @@ -0,0 +1,402 @@ +/** + * 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.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.CreateRateLimitPolicyRequestContent; +import com.auth0.client.mgmt.types.CreateRateLimitPolicyResponseContent; +import com.auth0.client.mgmt.types.GetRateLimitPolicyResponseContent; +import com.auth0.client.mgmt.types.ListRateLimitPoliciesPaginatedResponseContent; +import com.auth0.client.mgmt.types.ListRateLimitPoliciesRequestParameters; +import com.auth0.client.mgmt.types.PatchRateLimitPolicyRequestContent; +import com.auth0.client.mgmt.types.RateLimitPolicy; +import com.auth0.client.mgmt.types.UpdateRateLimitPolicyResponseContent; +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 RawRateLimitPoliciesClient { + protected final ClientOptions clientOptions; + + public RawRateLimitPoliciesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public ManagementApiHttpResponse> list() { + return list(ListRateLimitPoliciesRequestParameters.builder().build()); + } + + public ManagementApiHttpResponse> list(RequestOptions requestOptions) { + return list(ListRateLimitPoliciesRequestParameters.builder().build(), requestOptions); + } + + public ManagementApiHttpResponse> list( + ListRateLimitPoliciesRequestParameters request) { + return list(request, null); + } + + public ManagementApiHttpResponse> list( + ListRateLimitPoliciesRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rate-limit-policies"); + if (!request.getResource().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "resource", request.getResource().orElse(null), false); + } + if (!request.getConsumer().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "consumer", request.getConsumer().orElse(null), false); + } + if (!request.getConsumerSelector().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "consumer_selector", request.getConsumerSelector().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 (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListRateLimitPoliciesPaginatedResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListRateLimitPoliciesPaginatedResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListRateLimitPoliciesRequestParameters nextRequest = ListRateLimitPoliciesRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = + parsedResponse.getRateLimitPolicies().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 (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse create( + CreateRateLimitPolicyRequestContent request) { + return create(request, null); + } + + public ManagementApiHttpResponse create( + CreateRateLimitPolicyRequestContent request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rate-limit-policies"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, CreateRateLimitPolicyResponseContent.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse get(String id) { + return get(id, null); + } + + public ManagementApiHttpResponse get(String id, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rate-limit-policies") + .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); + } + 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, GetRateLimitPolicyResponseContent.class), + response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse delete(String id) { + return delete(id, null); + } + + public ManagementApiHttpResponse delete(String id, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rate-limit-policies") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + public ManagementApiHttpResponse update( + String id, PatchRateLimitPolicyRequestContent request) { + return update(id, request, null); + } + + public ManagementApiHttpResponse update( + String id, PatchRateLimitPolicyRequestContent request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("rate-limit-policies") + .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); + } + 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, UpdateRateLimitPolicyResponseContent.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 (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/RawRolesClient.java b/src/main/java/com/auth0/client/mgmt/RawRolesClient.java index ce2b991c..abd6e4d3 100644 --- a/src/main/java/com/auth0/client/mgmt/RawRolesClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawRolesClient.java @@ -47,7 +47,7 @@ public RawRolesClient(ClientOptions clientOptions) { /** * Retrieve detailed list of user roles created in your tenant. - *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    + *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    */ public ManagementApiHttpResponse> list() { return list(ListRolesRequestParameters.builder().build()); @@ -55,7 +55,7 @@ public ManagementApiHttpResponse> list() { /** * Retrieve detailed list of user roles created in your tenant. - *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    + *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    */ public ManagementApiHttpResponse> list(RequestOptions requestOptions) { return list(ListRolesRequestParameters.builder().build(), requestOptions); @@ -63,7 +63,7 @@ public ManagementApiHttpResponse> list(RequestOptions r /** * Retrieve detailed list of user roles created in your tenant. - *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    + *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    */ public ManagementApiHttpResponse> list(ListRolesRequestParameters request) { return list(request, null); @@ -71,7 +71,7 @@ public ManagementApiHttpResponse> list(ListRolesRequest /** * Retrieve detailed list of user roles created in your tenant. - *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    + *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    */ public ManagementApiHttpResponse> list( ListRolesRequestParameters request, RequestOptions requestOptions) { @@ -149,7 +149,7 @@ public ManagementApiHttpResponse> list( /** * Create a user role for Role-Based Access Control. - *

    Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

    + *

    Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

    */ public ManagementApiHttpResponse create(CreateRoleRequestContent request) { return create(request, null); @@ -157,7 +157,7 @@ public ManagementApiHttpResponse create(CreateRoleReq /** * Create a user role for Role-Based Access Control. - *

    Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

    + *

    Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

    */ public ManagementApiHttpResponse create( CreateRoleRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/RawUserAttributeProfilesClient.java b/src/main/java/com/auth0/client/mgmt/RawUserAttributeProfilesClient.java index 1515ed17..b1581077 100644 --- a/src/main/java/com/auth0/client/mgmt/RawUserAttributeProfilesClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawUserAttributeProfilesClient.java @@ -146,7 +146,7 @@ public ManagementApiHttpResponse> list( } /** - * Create a User Attribute Profile + * Create a User Attribute Profile. */ public ManagementApiHttpResponse create( CreateUserAttributeProfileRequestContent request) { @@ -154,7 +154,7 @@ public ManagementApiHttpResponse crea } /** - * Create a User Attribute Profile + * Create a User Attribute Profile. */ public ManagementApiHttpResponse create( CreateUserAttributeProfileRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/RawUsersClient.java b/src/main/java/com/auth0/client/mgmt/RawUsersClient.java index 2713fabe..7e986d6b 100644 --- a/src/main/java/com/auth0/client/mgmt/RawUsersClient.java +++ b/src/main/java/com/auth0/client/mgmt/RawUsersClient.java @@ -59,7 +59,6 @@ public RawUsersClient(ClientOptions clientOptions) { *
  • Select the fields to be returned
  • *
  • Specify the number of users to retrieve per page and the page index
  • * - *

    <!-- only v3 is available -->

    *

    The q query parameter can be used to get users that match the specified criteria using query string syntax.

    *

    Learn more about searching for users.

    *

    Read about best practices when working with the API endpoints for retrieving users.

    @@ -77,7 +76,6 @@ public ManagementApiHttpResponse> list() *
  • Select the fields to be returned
  • *
  • Specify the number of users to retrieve per page and the page index
  • * - *

    <!-- only v3 is available -->

    *

    The q query parameter can be used to get users that match the specified criteria using query string syntax.

    *

    Learn more about searching for users.

    *

    Read about best practices when working with the API endpoints for retrieving users.

    @@ -95,7 +93,6 @@ public ManagementApiHttpResponse> list(Re *
  • Select the fields to be returned
  • *
  • Specify the number of users to retrieve per page and the page index
  • * - *

    <!-- only v3 is available -->

    *

    The q query parameter can be used to get users that match the specified criteria using query string syntax.

    *

    Learn more about searching for users.

    *

    Read about best practices when working with the API endpoints for retrieving users.

    @@ -113,7 +110,6 @@ public ManagementApiHttpResponse> list(Li *
  • Select the fields to be returned
  • *
  • Specify the number of users to retrieve per page and the page index
  • * - *

    <!-- only v3 is available -->

    *

    The q query parameter can be used to get users that match the specified criteria using query string syntax.

    *

    Learn more about searching for users.

    *

    Read about best practices when working with the API endpoints for retrieving users.

    @@ -530,57 +526,65 @@ public ManagementApiHttpResponse delete(String id, RequestOptions requestO /** * Update a user. *

    These are the attributes that can be updated at the root level:

    - *

      - *
    • app_metadata
    • - *
    • blocked
    • - *
    • email
    • - *
    • email_verified
    • - *
    • family_name
    • - *
    • given_name
    • - *
    • name
    • - *
    • nickname
    • - *
    • password
    • - *
    • phone_number
    • - *
    • phone_verified
    • - *
    • picture
    • - *
    • username
    • - *
    • user_metadata
    • - *
    • verify_email
    • - *

    + *
      + *
    • app_metadata
    • + *
    • blocked
    • + *
    • email
    • + *
    • email_verified
    • + *
    • family_name
    • + *
    • given_name
    • + *
    • name
    • + *
    • nickname
    • + *
    • password
    • + *
    • phone_number
    • + *
    • phone_verified
    • + *
    • picture
    • + *
    • username
    • + *
    • user_metadata
    • + *
    • verify_email
    • + *
    *

    Some considerations:

    - *

      - *
    • The properties of the new object will replace the old ones.
    • - *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • - *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • - *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • - *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • - *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • - *
    • Supported attributes can be unset by supplying null as the value.
    • - *

    - *

    Updating a field (non-metadata property)
    - * To mark the email address of a user as verified, the body to send should be: - *
    { "email_verified": true }

    - *

    Updating a user metadata root property
    Let's assume that our test user has the following user_metadata: - *
    { "user_metadata" : { "profileCode": 1479 } }

    + *
      + *
    • The properties of the new object will replace the old ones.
    • + *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • + *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • + *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • + *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • + *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • + *
    • Supported attributes can be unset by supplying null as the value.
    • + *
    + *

    Updating a field (non-metadata property)

    + *

    To mark the email address of a user as verified, the body to send should be:

    + *
    { "email_verified": true }
    +     * 
    + *

    Updating a user metadata root property

    + *

    Let's assume that our test user has the following user_metadata:

    + *
    { "user_metadata" : { "profileCode": 1479 } }
    +     * 
    *

    To add the field addresses the body to send should be:

    - *

    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}

    - *

    The modified object ends up with the following user_metadata property:

    {
    -     * "user_metadata": {
    -     * "profileCode": 1479,
    -     * "addresses": { "work_address": "100 Industrial Way" }
    +     * 
    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
    +     * 
    + *

    The modified object ends up with the following user_metadata property:

    + *
    {
    +     *   "user_metadata": {
    +     *     "profileCode": 1479,
    +     *     "addresses": { "work_address": "100 Industrial Way" }
    +     *   }
          * }
    -     * }

    - *

    Updating an inner user metadata property
    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: - *
    {
    +     * 
    + *

    Updating an inner user metadata property

    + *

    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be:

    + *
    {
          *   "user_metadata": {
          *     "addresses": {
          *       "work_address": "100 Industrial Way",
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    *

    The modified object ends up with the following user_metadata property:

    - *

    {
    +     * 
    {
          *   "user_metadata": {
          *     "profileCode": 1479,
          *     "addresses": {
    @@ -588,7 +592,8 @@ public ManagementApiHttpResponse delete(String id, RequestOptions requestO
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    */ public ManagementApiHttpResponse update(String id) { return update(id, UpdateUserRequestContent.builder().build()); @@ -597,57 +602,65 @@ public ManagementApiHttpResponse update(String id) { /** * Update a user. *

    These are the attributes that can be updated at the root level:

    - *

      - *
    • app_metadata
    • - *
    • blocked
    • - *
    • email
    • - *
    • email_verified
    • - *
    • family_name
    • - *
    • given_name
    • - *
    • name
    • - *
    • nickname
    • - *
    • password
    • - *
    • phone_number
    • - *
    • phone_verified
    • - *
    • picture
    • - *
    • username
    • - *
    • user_metadata
    • - *
    • verify_email
    • - *

    + *
      + *
    • app_metadata
    • + *
    • blocked
    • + *
    • email
    • + *
    • email_verified
    • + *
    • family_name
    • + *
    • given_name
    • + *
    • name
    • + *
    • nickname
    • + *
    • password
    • + *
    • phone_number
    • + *
    • phone_verified
    • + *
    • picture
    • + *
    • username
    • + *
    • user_metadata
    • + *
    • verify_email
    • + *
    *

    Some considerations:

    - *

      - *
    • The properties of the new object will replace the old ones.
    • - *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • - *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • - *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • - *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • - *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • - *
    • Supported attributes can be unset by supplying null as the value.
    • - *

    - *

    Updating a field (non-metadata property)
    - * To mark the email address of a user as verified, the body to send should be: - *
    { "email_verified": true }

    - *

    Updating a user metadata root property
    Let's assume that our test user has the following user_metadata: - *
    { "user_metadata" : { "profileCode": 1479 } }

    + *
      + *
    • The properties of the new object will replace the old ones.
    • + *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • + *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • + *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • + *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • + *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • + *
    • Supported attributes can be unset by supplying null as the value.
    • + *
    + *

    Updating a field (non-metadata property)

    + *

    To mark the email address of a user as verified, the body to send should be:

    + *
    { "email_verified": true }
    +     * 
    + *

    Updating a user metadata root property

    + *

    Let's assume that our test user has the following user_metadata:

    + *
    { "user_metadata" : { "profileCode": 1479 } }
    +     * 
    *

    To add the field addresses the body to send should be:

    - *

    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}

    - *

    The modified object ends up with the following user_metadata property:

    {
    -     * "user_metadata": {
    -     * "profileCode": 1479,
    -     * "addresses": { "work_address": "100 Industrial Way" }
    +     * 
    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
    +     * 
    + *

    The modified object ends up with the following user_metadata property:

    + *
    {
    +     *   "user_metadata": {
    +     *     "profileCode": 1479,
    +     *     "addresses": { "work_address": "100 Industrial Way" }
    +     *   }
          * }
    -     * }

    - *

    Updating an inner user metadata property
    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: - *
    {
    +     * 
    + *

    Updating an inner user metadata property

    + *

    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be:

    + *
    {
          *   "user_metadata": {
          *     "addresses": {
          *       "work_address": "100 Industrial Way",
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    *

    The modified object ends up with the following user_metadata property:

    - *

    {
    +     * 
    {
          *   "user_metadata": {
          *     "profileCode": 1479,
          *     "addresses": {
    @@ -655,7 +668,8 @@ public ManagementApiHttpResponse update(String id) {
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    */ public ManagementApiHttpResponse update(String id, RequestOptions requestOptions) { return update(id, UpdateUserRequestContent.builder().build(), requestOptions); @@ -664,57 +678,65 @@ public ManagementApiHttpResponse update(String id, Re /** * Update a user. *

    These are the attributes that can be updated at the root level:

    - *

      - *
    • app_metadata
    • - *
    • blocked
    • - *
    • email
    • - *
    • email_verified
    • - *
    • family_name
    • - *
    • given_name
    • - *
    • name
    • - *
    • nickname
    • - *
    • password
    • - *
    • phone_number
    • - *
    • phone_verified
    • - *
    • picture
    • - *
    • username
    • - *
    • user_metadata
    • - *
    • verify_email
    • - *

    + *
      + *
    • app_metadata
    • + *
    • blocked
    • + *
    • email
    • + *
    • email_verified
    • + *
    • family_name
    • + *
    • given_name
    • + *
    • name
    • + *
    • nickname
    • + *
    • password
    • + *
    • phone_number
    • + *
    • phone_verified
    • + *
    • picture
    • + *
    • username
    • + *
    • user_metadata
    • + *
    • verify_email
    • + *
    *

    Some considerations:

    - *

      - *
    • The properties of the new object will replace the old ones.
    • - *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • - *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • - *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • - *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • - *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • - *
    • Supported attributes can be unset by supplying null as the value.
    • - *

    - *

    Updating a field (non-metadata property)
    - * To mark the email address of a user as verified, the body to send should be: - *
    { "email_verified": true }

    - *

    Updating a user metadata root property
    Let's assume that our test user has the following user_metadata: - *
    { "user_metadata" : { "profileCode": 1479 } }

    + *
      + *
    • The properties of the new object will replace the old ones.
    • + *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • + *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • + *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • + *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • + *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • + *
    • Supported attributes can be unset by supplying null as the value.
    • + *
    + *

    Updating a field (non-metadata property)

    + *

    To mark the email address of a user as verified, the body to send should be:

    + *
    { "email_verified": true }
    +     * 
    + *

    Updating a user metadata root property

    + *

    Let's assume that our test user has the following user_metadata:

    + *
    { "user_metadata" : { "profileCode": 1479 } }
    +     * 
    *

    To add the field addresses the body to send should be:

    - *

    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}

    - *

    The modified object ends up with the following user_metadata property:

    {
    -     * "user_metadata": {
    -     * "profileCode": 1479,
    -     * "addresses": { "work_address": "100 Industrial Way" }
    +     * 
    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
    +     * 
    + *

    The modified object ends up with the following user_metadata property:

    + *
    {
    +     *   "user_metadata": {
    +     *     "profileCode": 1479,
    +     *     "addresses": { "work_address": "100 Industrial Way" }
    +     *   }
          * }
    -     * }

    - *

    Updating an inner user metadata property
    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: - *
    {
    +     * 
    + *

    Updating an inner user metadata property

    + *

    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be:

    + *
    {
          *   "user_metadata": {
          *     "addresses": {
          *       "work_address": "100 Industrial Way",
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    *

    The modified object ends up with the following user_metadata property:

    - *

    {
    +     * 
    {
          *   "user_metadata": {
          *     "profileCode": 1479,
          *     "addresses": {
    @@ -722,7 +744,8 @@ public ManagementApiHttpResponse update(String id, Re
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    */ public ManagementApiHttpResponse update(String id, UpdateUserRequestContent request) { return update(id, request, null); @@ -731,57 +754,65 @@ public ManagementApiHttpResponse update(String id, Up /** * Update a user. *

    These are the attributes that can be updated at the root level:

    - *

      - *
    • app_metadata
    • - *
    • blocked
    • - *
    • email
    • - *
    • email_verified
    • - *
    • family_name
    • - *
    • given_name
    • - *
    • name
    • - *
    • nickname
    • - *
    • password
    • - *
    • phone_number
    • - *
    • phone_verified
    • - *
    • picture
    • - *
    • username
    • - *
    • user_metadata
    • - *
    • verify_email
    • - *

    + *
      + *
    • app_metadata
    • + *
    • blocked
    • + *
    • email
    • + *
    • email_verified
    • + *
    • family_name
    • + *
    • given_name
    • + *
    • name
    • + *
    • nickname
    • + *
    • password
    • + *
    • phone_number
    • + *
    • phone_verified
    • + *
    • picture
    • + *
    • username
    • + *
    • user_metadata
    • + *
    • verify_email
    • + *
    *

    Some considerations:

    - *

      - *
    • The properties of the new object will replace the old ones.
    • - *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • - *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • - *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • - *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • - *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • - *
    • Supported attributes can be unset by supplying null as the value.
    • - *

    - *

    Updating a field (non-metadata property)
    - * To mark the email address of a user as verified, the body to send should be: - *
    { "email_verified": true }

    - *

    Updating a user metadata root property
    Let's assume that our test user has the following user_metadata: - *
    { "user_metadata" : { "profileCode": 1479 } }

    + *
      + *
    • The properties of the new object will replace the old ones.
    • + *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • + *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • + *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • + *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • + *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • + *
    • Supported attributes can be unset by supplying null as the value.
    • + *
    + *

    Updating a field (non-metadata property)

    + *

    To mark the email address of a user as verified, the body to send should be:

    + *
    { "email_verified": true }
    +     * 
    + *

    Updating a user metadata root property

    + *

    Let's assume that our test user has the following user_metadata:

    + *
    { "user_metadata" : { "profileCode": 1479 } }
    +     * 
    *

    To add the field addresses the body to send should be:

    - *

    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}

    - *

    The modified object ends up with the following user_metadata property:

    {
    -     * "user_metadata": {
    -     * "profileCode": 1479,
    -     * "addresses": { "work_address": "100 Industrial Way" }
    +     * 
    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
    +     * 
    + *

    The modified object ends up with the following user_metadata property:

    + *
    {
    +     *   "user_metadata": {
    +     *     "profileCode": 1479,
    +     *     "addresses": { "work_address": "100 Industrial Way" }
    +     *   }
          * }
    -     * }

    - *

    Updating an inner user metadata property
    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: - *
    {
    +     * 
    + *

    Updating an inner user metadata property

    + *

    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be:

    + *
    {
          *   "user_metadata": {
          *     "addresses": {
          *       "work_address": "100 Industrial Way",
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    *

    The modified object ends up with the following user_metadata property:

    - *

    {
    +     * 
    {
          *   "user_metadata": {
          *     "profileCode": 1479,
          *     "addresses": {
    @@ -789,7 +820,8 @@ public ManagementApiHttpResponse update(String id, Up
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    */ public ManagementApiHttpResponse update( String id, UpdateUserRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/RolesClient.java b/src/main/java/com/auth0/client/mgmt/RolesClient.java index 5c3cb3d8..6d555e49 100644 --- a/src/main/java/com/auth0/client/mgmt/RolesClient.java +++ b/src/main/java/com/auth0/client/mgmt/RolesClient.java @@ -43,7 +43,7 @@ public RawRolesClient withRawResponse() { /** * Retrieve detailed list of user roles created in your tenant. - *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    + *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    */ public SyncPagingIterable list() { return this.rawClient.list().body(); @@ -51,7 +51,7 @@ public SyncPagingIterable list() { /** * Retrieve detailed list of user roles created in your tenant. - *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    + *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    */ public SyncPagingIterable list(RequestOptions requestOptions) { return this.rawClient.list(requestOptions).body(); @@ -59,7 +59,7 @@ public SyncPagingIterable list(RequestOptions requestOptions) { /** * Retrieve detailed list of user roles created in your tenant. - *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    + *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    */ public SyncPagingIterable list(ListRolesRequestParameters request) { return this.rawClient.list(request).body(); @@ -67,7 +67,7 @@ public SyncPagingIterable list(ListRolesRequestParameters request) { /** * Retrieve detailed list of user roles created in your tenant. - *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    + *

    Note: The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

    */ public SyncPagingIterable list(ListRolesRequestParameters request, RequestOptions requestOptions) { return this.rawClient.list(request, requestOptions).body(); @@ -75,7 +75,7 @@ public SyncPagingIterable list(ListRolesRequestParameters request, Request /** * Create a user role for Role-Based Access Control. - *

    Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

    + *

    Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

    */ public CreateRoleResponseContent create(CreateRoleRequestContent request) { return this.rawClient.create(request).body(); @@ -83,7 +83,7 @@ public CreateRoleResponseContent create(CreateRoleRequestContent request) { /** * Create a user role for Role-Based Access Control. - *

    Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

    + *

    Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

    */ public CreateRoleResponseContent create(CreateRoleRequestContent request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).body(); diff --git a/src/main/java/com/auth0/client/mgmt/UserAttributeProfilesClient.java b/src/main/java/com/auth0/client/mgmt/UserAttributeProfilesClient.java index 7db326ab..7ba9b9ca 100644 --- a/src/main/java/com/auth0/client/mgmt/UserAttributeProfilesClient.java +++ b/src/main/java/com/auth0/client/mgmt/UserAttributeProfilesClient.java @@ -63,14 +63,14 @@ public SyncPagingIterable list( } /** - * Create a User Attribute Profile + * Create a User Attribute Profile. */ public CreateUserAttributeProfileResponseContent create(CreateUserAttributeProfileRequestContent request) { return this.rawClient.create(request).body(); } /** - * Create a User Attribute Profile + * Create a User Attribute Profile. */ public CreateUserAttributeProfileResponseContent create( CreateUserAttributeProfileRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/UsersClient.java b/src/main/java/com/auth0/client/mgmt/UsersClient.java index 39c83c13..f41341bf 100644 --- a/src/main/java/com/auth0/client/mgmt/UsersClient.java +++ b/src/main/java/com/auth0/client/mgmt/UsersClient.java @@ -107,7 +107,6 @@ public RawUsersClient withRawResponse() { *
  • Select the fields to be returned
  • *
  • Specify the number of users to retrieve per page and the page index
  • * - *

    <!-- only v3 is available -->

    *

    The q query parameter can be used to get users that match the specified criteria using query string syntax.

    *

    Learn more about searching for users.

    *

    Read about best practices when working with the API endpoints for retrieving users.

    @@ -125,7 +124,6 @@ public SyncPagingIterable list() { *
  • Select the fields to be returned
  • *
  • Specify the number of users to retrieve per page and the page index
  • * - *

    <!-- only v3 is available -->

    *

    The q query parameter can be used to get users that match the specified criteria using query string syntax.

    *

    Learn more about searching for users.

    *

    Read about best practices when working with the API endpoints for retrieving users.

    @@ -143,7 +141,6 @@ public SyncPagingIterable list(RequestOptions requestOptions *
  • Select the fields to be returned
  • *
  • Specify the number of users to retrieve per page and the page index
  • * - *

    <!-- only v3 is available -->

    *

    The q query parameter can be used to get users that match the specified criteria using query string syntax.

    *

    Learn more about searching for users.

    *

    Read about best practices when working with the API endpoints for retrieving users.

    @@ -161,7 +158,6 @@ public SyncPagingIterable list(ListUsersRequestParameters re *
  • Select the fields to be returned
  • *
  • Specify the number of users to retrieve per page and the page index
  • * - *

    <!-- only v3 is available -->

    *

    The q query parameter can be used to get users that match the specified criteria using query string syntax.

    *

    Learn more about searching for users.

    *

    Read about best practices when working with the API endpoints for retrieving users.

    @@ -252,57 +248,65 @@ public void delete(String id, RequestOptions requestOptions) { /** * Update a user. *

    These are the attributes that can be updated at the root level:

    - *

      - *
    • app_metadata
    • - *
    • blocked
    • - *
    • email
    • - *
    • email_verified
    • - *
    • family_name
    • - *
    • given_name
    • - *
    • name
    • - *
    • nickname
    • - *
    • password
    • - *
    • phone_number
    • - *
    • phone_verified
    • - *
    • picture
    • - *
    • username
    • - *
    • user_metadata
    • - *
    • verify_email
    • - *

    + *
      + *
    • app_metadata
    • + *
    • blocked
    • + *
    • email
    • + *
    • email_verified
    • + *
    • family_name
    • + *
    • given_name
    • + *
    • name
    • + *
    • nickname
    • + *
    • password
    • + *
    • phone_number
    • + *
    • phone_verified
    • + *
    • picture
    • + *
    • username
    • + *
    • user_metadata
    • + *
    • verify_email
    • + *
    *

    Some considerations:

    - *

      - *
    • The properties of the new object will replace the old ones.
    • - *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • - *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • - *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • - *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • - *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • - *
    • Supported attributes can be unset by supplying null as the value.
    • - *

    - *

    Updating a field (non-metadata property)
    - * To mark the email address of a user as verified, the body to send should be: - *
    { "email_verified": true }

    - *

    Updating a user metadata root property
    Let's assume that our test user has the following user_metadata: - *
    { "user_metadata" : { "profileCode": 1479 } }

    + *
      + *
    • The properties of the new object will replace the old ones.
    • + *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • + *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • + *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • + *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • + *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • + *
    • Supported attributes can be unset by supplying null as the value.
    • + *
    + *

    Updating a field (non-metadata property)

    + *

    To mark the email address of a user as verified, the body to send should be:

    + *
    { "email_verified": true }
    +     * 
    + *

    Updating a user metadata root property

    + *

    Let's assume that our test user has the following user_metadata:

    + *
    { "user_metadata" : { "profileCode": 1479 } }
    +     * 
    *

    To add the field addresses the body to send should be:

    - *

    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}

    - *

    The modified object ends up with the following user_metadata property:

    {
    -     * "user_metadata": {
    -     * "profileCode": 1479,
    -     * "addresses": { "work_address": "100 Industrial Way" }
    +     * 
    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
    +     * 
    + *

    The modified object ends up with the following user_metadata property:

    + *
    {
    +     *   "user_metadata": {
    +     *     "profileCode": 1479,
    +     *     "addresses": { "work_address": "100 Industrial Way" }
    +     *   }
          * }
    -     * }

    - *

    Updating an inner user metadata property
    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: - *
    {
    +     * 
    + *

    Updating an inner user metadata property

    + *

    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be:

    + *
    {
          *   "user_metadata": {
          *     "addresses": {
          *       "work_address": "100 Industrial Way",
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    *

    The modified object ends up with the following user_metadata property:

    - *

    {
    +     * 
    {
          *   "user_metadata": {
          *     "profileCode": 1479,
          *     "addresses": {
    @@ -310,7 +314,8 @@ public void delete(String id, RequestOptions requestOptions) {
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    */ public UpdateUserResponseContent update(String id) { return this.rawClient.update(id).body(); @@ -319,57 +324,65 @@ public UpdateUserResponseContent update(String id) { /** * Update a user. *

    These are the attributes that can be updated at the root level:

    - *

      - *
    • app_metadata
    • - *
    • blocked
    • - *
    • email
    • - *
    • email_verified
    • - *
    • family_name
    • - *
    • given_name
    • - *
    • name
    • - *
    • nickname
    • - *
    • password
    • - *
    • phone_number
    • - *
    • phone_verified
    • - *
    • picture
    • - *
    • username
    • - *
    • user_metadata
    • - *
    • verify_email
    • - *

    + *
      + *
    • app_metadata
    • + *
    • blocked
    • + *
    • email
    • + *
    • email_verified
    • + *
    • family_name
    • + *
    • given_name
    • + *
    • name
    • + *
    • nickname
    • + *
    • password
    • + *
    • phone_number
    • + *
    • phone_verified
    • + *
    • picture
    • + *
    • username
    • + *
    • user_metadata
    • + *
    • verify_email
    • + *
    *

    Some considerations:

    - *

      - *
    • The properties of the new object will replace the old ones.
    • - *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • - *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • - *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • - *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • - *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • - *
    • Supported attributes can be unset by supplying null as the value.
    • - *

    - *

    Updating a field (non-metadata property)
    - * To mark the email address of a user as verified, the body to send should be: - *
    { "email_verified": true }

    - *

    Updating a user metadata root property
    Let's assume that our test user has the following user_metadata: - *
    { "user_metadata" : { "profileCode": 1479 } }

    + *
      + *
    • The properties of the new object will replace the old ones.
    • + *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • + *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • + *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • + *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • + *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • + *
    • Supported attributes can be unset by supplying null as the value.
    • + *
    + *

    Updating a field (non-metadata property)

    + *

    To mark the email address of a user as verified, the body to send should be:

    + *
    { "email_verified": true }
    +     * 
    + *

    Updating a user metadata root property

    + *

    Let's assume that our test user has the following user_metadata:

    + *
    { "user_metadata" : { "profileCode": 1479 } }
    +     * 
    *

    To add the field addresses the body to send should be:

    - *

    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}

    - *

    The modified object ends up with the following user_metadata property:

    {
    -     * "user_metadata": {
    -     * "profileCode": 1479,
    -     * "addresses": { "work_address": "100 Industrial Way" }
    +     * 
    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
    +     * 
    + *

    The modified object ends up with the following user_metadata property:

    + *
    {
    +     *   "user_metadata": {
    +     *     "profileCode": 1479,
    +     *     "addresses": { "work_address": "100 Industrial Way" }
    +     *   }
          * }
    -     * }

    - *

    Updating an inner user metadata property
    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: - *
    {
    +     * 
    + *

    Updating an inner user metadata property

    + *

    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be:

    + *
    {
          *   "user_metadata": {
          *     "addresses": {
          *       "work_address": "100 Industrial Way",
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    *

    The modified object ends up with the following user_metadata property:

    - *

    {
    +     * 
    {
          *   "user_metadata": {
          *     "profileCode": 1479,
          *     "addresses": {
    @@ -377,7 +390,8 @@ public UpdateUserResponseContent update(String id) {
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    */ public UpdateUserResponseContent update(String id, RequestOptions requestOptions) { return this.rawClient.update(id, requestOptions).body(); @@ -386,57 +400,65 @@ public UpdateUserResponseContent update(String id, RequestOptions requestOptions /** * Update a user. *

    These are the attributes that can be updated at the root level:

    - *

      - *
    • app_metadata
    • - *
    • blocked
    • - *
    • email
    • - *
    • email_verified
    • - *
    • family_name
    • - *
    • given_name
    • - *
    • name
    • - *
    • nickname
    • - *
    • password
    • - *
    • phone_number
    • - *
    • phone_verified
    • - *
    • picture
    • - *
    • username
    • - *
    • user_metadata
    • - *
    • verify_email
    • - *

    + *
      + *
    • app_metadata
    • + *
    • blocked
    • + *
    • email
    • + *
    • email_verified
    • + *
    • family_name
    • + *
    • given_name
    • + *
    • name
    • + *
    • nickname
    • + *
    • password
    • + *
    • phone_number
    • + *
    • phone_verified
    • + *
    • picture
    • + *
    • username
    • + *
    • user_metadata
    • + *
    • verify_email
    • + *
    *

    Some considerations:

    - *

      - *
    • The properties of the new object will replace the old ones.
    • - *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • - *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • - *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • - *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • - *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • - *
    • Supported attributes can be unset by supplying null as the value.
    • - *

    - *

    Updating a field (non-metadata property)
    - * To mark the email address of a user as verified, the body to send should be: - *
    { "email_verified": true }

    - *

    Updating a user metadata root property
    Let's assume that our test user has the following user_metadata: - *
    { "user_metadata" : { "profileCode": 1479 } }

    + *
      + *
    • The properties of the new object will replace the old ones.
    • + *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • + *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • + *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • + *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • + *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • + *
    • Supported attributes can be unset by supplying null as the value.
    • + *
    + *

    Updating a field (non-metadata property)

    + *

    To mark the email address of a user as verified, the body to send should be:

    + *
    { "email_verified": true }
    +     * 
    + *

    Updating a user metadata root property

    + *

    Let's assume that our test user has the following user_metadata:

    + *
    { "user_metadata" : { "profileCode": 1479 } }
    +     * 
    *

    To add the field addresses the body to send should be:

    - *

    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}

    - *

    The modified object ends up with the following user_metadata property:

    {
    -     * "user_metadata": {
    -     * "profileCode": 1479,
    -     * "addresses": { "work_address": "100 Industrial Way" }
    +     * 
    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
    +     * 
    + *

    The modified object ends up with the following user_metadata property:

    + *
    {
    +     *   "user_metadata": {
    +     *     "profileCode": 1479,
    +     *     "addresses": { "work_address": "100 Industrial Way" }
    +     *   }
          * }
    -     * }

    - *

    Updating an inner user metadata property
    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: - *
    {
    +     * 
    + *

    Updating an inner user metadata property

    + *

    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be:

    + *
    {
          *   "user_metadata": {
          *     "addresses": {
          *       "work_address": "100 Industrial Way",
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    *

    The modified object ends up with the following user_metadata property:

    - *

    {
    +     * 
    {
          *   "user_metadata": {
          *     "profileCode": 1479,
          *     "addresses": {
    @@ -444,7 +466,8 @@ public UpdateUserResponseContent update(String id, RequestOptions requestOptions
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    */ public UpdateUserResponseContent update(String id, UpdateUserRequestContent request) { return this.rawClient.update(id, request).body(); @@ -453,57 +476,65 @@ public UpdateUserResponseContent update(String id, UpdateUserRequestContent requ /** * Update a user. *

    These are the attributes that can be updated at the root level:

    - *

      - *
    • app_metadata
    • - *
    • blocked
    • - *
    • email
    • - *
    • email_verified
    • - *
    • family_name
    • - *
    • given_name
    • - *
    • name
    • - *
    • nickname
    • - *
    • password
    • - *
    • phone_number
    • - *
    • phone_verified
    • - *
    • picture
    • - *
    • username
    • - *
    • user_metadata
    • - *
    • verify_email
    • - *

    + *
      + *
    • app_metadata
    • + *
    • blocked
    • + *
    • email
    • + *
    • email_verified
    • + *
    • family_name
    • + *
    • given_name
    • + *
    • name
    • + *
    • nickname
    • + *
    • password
    • + *
    • phone_number
    • + *
    • phone_verified
    • + *
    • picture
    • + *
    • username
    • + *
    • user_metadata
    • + *
    • verify_email
    • + *
    *

    Some considerations:

    - *

      - *
    • The properties of the new object will replace the old ones.
    • - *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • - *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • - *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • - *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • - *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • - *
    • Supported attributes can be unset by supplying null as the value.
    • - *

    - *

    Updating a field (non-metadata property)
    - * To mark the email address of a user as verified, the body to send should be: - *
    { "email_verified": true }

    - *

    Updating a user metadata root property
    Let's assume that our test user has the following user_metadata: - *
    { "user_metadata" : { "profileCode": 1479 } }

    + *
      + *
    • The properties of the new object will replace the old ones.
    • + *
    • The metadata fields are an exception to this rule (user_metadata and app_metadata). These properties are merged instead of being replaced but be careful, the merge only occurs on the first level.
    • + *
    • If you are updating email, email_verified, phone_number, phone_verified, username or password of a secondary identity, you need to specify the connection property too.
    • + *
    • If you are updating email or phone_number you can specify, optionally, the client_id property.
    • + *
    • Updating email_verified is not supported for enterprise and passwordless sms connections.
    • + *
    • Updating the blocked to false does not affect the user's blocked state from an excessive amount of incorrectly provided credentials. Use the "Unblock a user" endpoint from the "User Blocks" API to change the user's state.
    • + *
    • Supported attributes can be unset by supplying null as the value.
    • + *
    + *

    Updating a field (non-metadata property)

    + *

    To mark the email address of a user as verified, the body to send should be:

    + *
    { "email_verified": true }
    +     * 
    + *

    Updating a user metadata root property

    + *

    Let's assume that our test user has the following user_metadata:

    + *
    { "user_metadata" : { "profileCode": 1479 } }
    +     * 
    *

    To add the field addresses the body to send should be:

    - *

    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}

    - *

    The modified object ends up with the following user_metadata property:

    {
    -     * "user_metadata": {
    -     * "profileCode": 1479,
    -     * "addresses": { "work_address": "100 Industrial Way" }
    +     * 
    { "user_metadata" : { "addresses": {"work_address": "100 Industrial Way"} }}
    +     * 
    + *

    The modified object ends up with the following user_metadata property:

    + *
    {
    +     *   "user_metadata": {
    +     *     "profileCode": 1479,
    +     *     "addresses": { "work_address": "100 Industrial Way" }
    +     *   }
          * }
    -     * }

    - *

    Updating an inner user metadata property
    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be: - *
    {
    +     * 
    + *

    Updating an inner user metadata property

    + *

    If there's existing user metadata to which we want to add "home_address": "742 Evergreen Terrace" (using the addresses property) we should send the whole addresses object. Since this is a first-level object, the object will be merged in, but its own properties will not be. The body to send should be:

    + *
    {
          *   "user_metadata": {
          *     "addresses": {
          *       "work_address": "100 Industrial Way",
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    *

    The modified object ends up with the following user_metadata property:

    - *

    {
    +     * 
    {
          *   "user_metadata": {
          *     "profileCode": 1479,
          *     "addresses": {
    @@ -511,7 +542,8 @@ public UpdateUserResponseContent update(String id, UpdateUserRequestContent requ
          *       "home_address": "742 Evergreen Terrace"
          *     }
          *   }
    -     * }

    + * } + *
    */ public UpdateUserResponseContent update( String id, UpdateUserRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/branding/AsyncRawTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/branding/AsyncRawTemplatesClient.java index df2bb17b..5135447c 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/AsyncRawTemplatesClient.java +++ b/src/main/java/com/auth0/client/mgmt/branding/AsyncRawTemplatesClient.java @@ -128,27 +128,23 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Update the Universal Login branding template. - *

    When content-type header is set to application/json:

    - *
    -     * {
    -     *   "template": "&lt;!DOCTYPE html&gt;{% assign resolved_dir = dir | default: "auto" %}&lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body class="_widget-auto-layout"&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;"
    +     * 

    When content-type header is set to application/json:

    + *
    {
    +     *   "template": "<!DOCTYPE html>{% assign resolved_dir = dir | default: \"auto\" %}<html lang=\"{{locale}}\" dir=\"{{resolved_dir}}\"><head>{%- auth0:head -%}</head><body class=\"_widget-auto-layout\">{%- auth0:widget -%}</body></html>"
          * }
    -     * 

    - *

    - * When content-type header is set to text/html: - *

    - *
    -     * &lt!DOCTYPE html&gt;
    +     * 
    + *

    When content-type header is set to text/html:

    + *
    <!DOCTYPE html>
          * {% assign resolved_dir = dir | default: "auto" %}
    -     * &lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;
    -     *   &lt;head&gt;
    +     * <html lang="{{locale}}" dir="{{resolved_dir}}">
    +     *   <head>
          *     {%- auth0:head -%}
    -     *   &lt;/head&gt;
    -     *   &lt;body class="_widget-auto-layout"&gt;
    +     *   </head>
    +     *   <body class="_widget-auto-layout">
          *     {%- auth0:widget -%}
    -     *   &lt;/body&gt;
    -     * &lt;/html&gt;
    -     * 

    + * </body> + * </html> + *
    */ public CompletableFuture> updateUniversalLogin( UpdateUniversalLoginTemplateRequestContent request) { @@ -157,27 +153,23 @@ public CompletableFuture> updateUniversalLogin( /** * Update the Universal Login branding template. - *

    When content-type header is set to application/json:

    - *
    -     * {
    -     *   "template": "&lt;!DOCTYPE html&gt;{% assign resolved_dir = dir | default: "auto" %}&lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body class="_widget-auto-layout"&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;"
    +     * 

    When content-type header is set to application/json:

    + *
    {
    +     *   "template": "<!DOCTYPE html>{% assign resolved_dir = dir | default: \"auto\" %}<html lang=\"{{locale}}\" dir=\"{{resolved_dir}}\"><head>{%- auth0:head -%}</head><body class=\"_widget-auto-layout\">{%- auth0:widget -%}</body></html>"
          * }
    -     * 

    - *

    - * When content-type header is set to text/html: - *

    - *
    -     * &lt!DOCTYPE html&gt;
    +     * 
    + *

    When content-type header is set to text/html:

    + *
    <!DOCTYPE html>
          * {% assign resolved_dir = dir | default: "auto" %}
    -     * &lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;
    -     *   &lt;head&gt;
    +     * <html lang="{{locale}}" dir="{{resolved_dir}}">
    +     *   <head>
          *     {%- auth0:head -%}
    -     *   &lt;/head&gt;
    -     *   &lt;body class="_widget-auto-layout"&gt;
    +     *   </head>
    +     *   <body class="_widget-auto-layout">
          *     {%- auth0:widget -%}
    -     *   &lt;/body&gt;
    -     * &lt;/html&gt;
    -     * 

    + * </body> + * </html> + *
    */ public CompletableFuture> updateUniversalLogin( UpdateUniversalLoginTemplateRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/branding/AsyncTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/branding/AsyncTemplatesClient.java index 2b37c91d..06de781d 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/AsyncTemplatesClient.java +++ b/src/main/java/com/auth0/client/mgmt/branding/AsyncTemplatesClient.java @@ -37,27 +37,23 @@ public CompletableFuture getUniversalL /** * Update the Universal Login branding template. - *

    When content-type header is set to application/json:

    - *
    -     * {
    -     *   "template": "&lt;!DOCTYPE html&gt;{% assign resolved_dir = dir | default: "auto" %}&lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body class="_widget-auto-layout"&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;"
    +     * 

    When content-type header is set to application/json:

    + *
    {
    +     *   "template": "<!DOCTYPE html>{% assign resolved_dir = dir | default: \"auto\" %}<html lang=\"{{locale}}\" dir=\"{{resolved_dir}}\"><head>{%- auth0:head -%}</head><body class=\"_widget-auto-layout\">{%- auth0:widget -%}</body></html>"
          * }
    -     * 

    - *

    - * When content-type header is set to text/html: - *

    - *
    -     * &lt!DOCTYPE html&gt;
    +     * 
    + *

    When content-type header is set to text/html:

    + *
    <!DOCTYPE html>
          * {% assign resolved_dir = dir | default: "auto" %}
    -     * &lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;
    -     *   &lt;head&gt;
    +     * <html lang="{{locale}}" dir="{{resolved_dir}}">
    +     *   <head>
          *     {%- auth0:head -%}
    -     *   &lt;/head&gt;
    -     *   &lt;body class="_widget-auto-layout"&gt;
    +     *   </head>
    +     *   <body class="_widget-auto-layout">
          *     {%- auth0:widget -%}
    -     *   &lt;/body&gt;
    -     * &lt;/html&gt;
    -     * 

    + * </body> + * </html> + *
    */ public CompletableFuture updateUniversalLogin(UpdateUniversalLoginTemplateRequestContent request) { return this.rawClient.updateUniversalLogin(request).thenApply(response -> response.body()); @@ -65,27 +61,23 @@ public CompletableFuture updateUniversalLogin(UpdateUniversalLoginTemplate /** * Update the Universal Login branding template. - *

    When content-type header is set to application/json:

    - *
    -     * {
    -     *   "template": "&lt;!DOCTYPE html&gt;{% assign resolved_dir = dir | default: "auto" %}&lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body class="_widget-auto-layout"&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;"
    +     * 

    When content-type header is set to application/json:

    + *
    {
    +     *   "template": "<!DOCTYPE html>{% assign resolved_dir = dir | default: \"auto\" %}<html lang=\"{{locale}}\" dir=\"{{resolved_dir}}\"><head>{%- auth0:head -%}</head><body class=\"_widget-auto-layout\">{%- auth0:widget -%}</body></html>"
          * }
    -     * 

    - *

    - * When content-type header is set to text/html: - *

    - *
    -     * &lt!DOCTYPE html&gt;
    +     * 
    + *

    When content-type header is set to text/html:

    + *
    <!DOCTYPE html>
          * {% assign resolved_dir = dir | default: "auto" %}
    -     * &lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;
    -     *   &lt;head&gt;
    +     * <html lang="{{locale}}" dir="{{resolved_dir}}">
    +     *   <head>
          *     {%- auth0:head -%}
    -     *   &lt;/head&gt;
    -     *   &lt;body class="_widget-auto-layout"&gt;
    +     *   </head>
    +     *   <body class="_widget-auto-layout">
          *     {%- auth0:widget -%}
    -     *   &lt;/body&gt;
    -     * &lt;/html&gt;
    -     * 

    + * </body> + * </html> + *
    */ public CompletableFuture updateUniversalLogin( UpdateUniversalLoginTemplateRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/branding/RawTemplatesClient.java b/src/main/java/com/auth0/client/mgmt/branding/RawTemplatesClient.java index 03751a95..7e1502ef 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/RawTemplatesClient.java +++ b/src/main/java/com/auth0/client/mgmt/branding/RawTemplatesClient.java @@ -100,27 +100,23 @@ public ManagementApiHttpResponse getUn /** * Update the Universal Login branding template. - *

    When content-type header is set to application/json:

    - *
    -     * {
    -     *   "template": "&lt;!DOCTYPE html&gt;{% assign resolved_dir = dir | default: "auto" %}&lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body class="_widget-auto-layout"&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;"
    +     * 

    When content-type header is set to application/json:

    + *
    {
    +     *   "template": "<!DOCTYPE html>{% assign resolved_dir = dir | default: \"auto\" %}<html lang=\"{{locale}}\" dir=\"{{resolved_dir}}\"><head>{%- auth0:head -%}</head><body class=\"_widget-auto-layout\">{%- auth0:widget -%}</body></html>"
          * }
    -     * 

    - *

    - * When content-type header is set to text/html: - *

    - *
    -     * &lt!DOCTYPE html&gt;
    +     * 
    + *

    When content-type header is set to text/html:

    + *
    <!DOCTYPE html>
          * {% assign resolved_dir = dir | default: "auto" %}
    -     * &lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;
    -     *   &lt;head&gt;
    +     * <html lang="{{locale}}" dir="{{resolved_dir}}">
    +     *   <head>
          *     {%- auth0:head -%}
    -     *   &lt;/head&gt;
    -     *   &lt;body class="_widget-auto-layout"&gt;
    +     *   </head>
    +     *   <body class="_widget-auto-layout">
          *     {%- auth0:widget -%}
    -     *   &lt;/body&gt;
    -     * &lt;/html&gt;
    -     * 

    + * </body> + * </html> + *
    */ public ManagementApiHttpResponse updateUniversalLogin(UpdateUniversalLoginTemplateRequestContent request) { return updateUniversalLogin(request, null); @@ -128,27 +124,23 @@ public ManagementApiHttpResponse updateUniversalLogin(UpdateUniversalLogin /** * Update the Universal Login branding template. - *

    When content-type header is set to application/json:

    - *
    -     * {
    -     *   "template": "&lt;!DOCTYPE html&gt;{% assign resolved_dir = dir | default: "auto" %}&lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body class="_widget-auto-layout"&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;"
    +     * 

    When content-type header is set to application/json:

    + *
    {
    +     *   "template": "<!DOCTYPE html>{% assign resolved_dir = dir | default: \"auto\" %}<html lang=\"{{locale}}\" dir=\"{{resolved_dir}}\"><head>{%- auth0:head -%}</head><body class=\"_widget-auto-layout\">{%- auth0:widget -%}</body></html>"
          * }
    -     * 

    - *

    - * When content-type header is set to text/html: - *

    - *
    -     * &lt!DOCTYPE html&gt;
    +     * 
    + *

    When content-type header is set to text/html:

    + *
    <!DOCTYPE html>
          * {% assign resolved_dir = dir | default: "auto" %}
    -     * &lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;
    -     *   &lt;head&gt;
    +     * <html lang="{{locale}}" dir="{{resolved_dir}}">
    +     *   <head>
          *     {%- auth0:head -%}
    -     *   &lt;/head&gt;
    -     *   &lt;body class="_widget-auto-layout"&gt;
    +     *   </head>
    +     *   <body class="_widget-auto-layout">
          *     {%- auth0:widget -%}
    -     *   &lt;/body&gt;
    -     * &lt;/html&gt;
    -     * 

    + * </body> + * </html> + *
    */ public ManagementApiHttpResponse updateUniversalLogin( UpdateUniversalLoginTemplateRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/branding/TemplatesClient.java b/src/main/java/com/auth0/client/mgmt/branding/TemplatesClient.java index 2e27e21d..c6cdeca2 100644 --- a/src/main/java/com/auth0/client/mgmt/branding/TemplatesClient.java +++ b/src/main/java/com/auth0/client/mgmt/branding/TemplatesClient.java @@ -35,27 +35,23 @@ public GetUniversalLoginTemplateResponseContent getUniversalLogin(RequestOptions /** * Update the Universal Login branding template. - *

    When content-type header is set to application/json:

    - *
    -     * {
    -     *   "template": "&lt;!DOCTYPE html&gt;{% assign resolved_dir = dir | default: "auto" %}&lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body class="_widget-auto-layout"&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;"
    +     * 

    When content-type header is set to application/json:

    + *
    {
    +     *   "template": "<!DOCTYPE html>{% assign resolved_dir = dir | default: \"auto\" %}<html lang=\"{{locale}}\" dir=\"{{resolved_dir}}\"><head>{%- auth0:head -%}</head><body class=\"_widget-auto-layout\">{%- auth0:widget -%}</body></html>"
          * }
    -     * 

    - *

    - * When content-type header is set to text/html: - *

    - *
    -     * &lt!DOCTYPE html&gt;
    +     * 
    + *

    When content-type header is set to text/html:

    + *
    <!DOCTYPE html>
          * {% assign resolved_dir = dir | default: "auto" %}
    -     * &lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;
    -     *   &lt;head&gt;
    +     * <html lang="{{locale}}" dir="{{resolved_dir}}">
    +     *   <head>
          *     {%- auth0:head -%}
    -     *   &lt;/head&gt;
    -     *   &lt;body class="_widget-auto-layout"&gt;
    +     *   </head>
    +     *   <body class="_widget-auto-layout">
          *     {%- auth0:widget -%}
    -     *   &lt;/body&gt;
    -     * &lt;/html&gt;
    -     * 

    + * </body> + * </html> + *
    */ public void updateUniversalLogin(UpdateUniversalLoginTemplateRequestContent request) { this.rawClient.updateUniversalLogin(request).body(); @@ -63,27 +59,23 @@ public void updateUniversalLogin(UpdateUniversalLoginTemplateRequestContent requ /** * Update the Universal Login branding template. - *

    When content-type header is set to application/json:

    - *
    -     * {
    -     *   "template": "&lt;!DOCTYPE html&gt;{% assign resolved_dir = dir | default: "auto" %}&lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;&lt;head&gt;{%- auth0:head -%}&lt;/head&gt;&lt;body class="_widget-auto-layout"&gt;{%- auth0:widget -%}&lt;/body&gt;&lt;/html&gt;"
    +     * 

    When content-type header is set to application/json:

    + *
    {
    +     *   "template": "<!DOCTYPE html>{% assign resolved_dir = dir | default: \"auto\" %}<html lang=\"{{locale}}\" dir=\"{{resolved_dir}}\"><head>{%- auth0:head -%}</head><body class=\"_widget-auto-layout\">{%- auth0:widget -%}</body></html>"
          * }
    -     * 

    - *

    - * When content-type header is set to text/html: - *

    - *
    -     * &lt!DOCTYPE html&gt;
    +     * 
    + *

    When content-type header is set to text/html:

    + *
    <!DOCTYPE html>
          * {% assign resolved_dir = dir | default: "auto" %}
    -     * &lt;html lang="{{locale}}" dir="{{resolved_dir}}"&gt;
    -     *   &lt;head&gt;
    +     * <html lang="{{locale}}" dir="{{resolved_dir}}">
    +     *   <head>
          *     {%- auth0:head -%}
    -     *   &lt;/head&gt;
    -     *   &lt;body class="_widget-auto-layout"&gt;
    +     *   </head>
    +     *   <body class="_widget-auto-layout">
          *     {%- auth0:widget -%}
    -     *   &lt;/body&gt;
    -     * &lt;/html&gt;
    -     * 

    + * </body> + * </html> + *
    */ public void updateUniversalLogin( UpdateUniversalLoginTemplateRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/connections/AsyncClientsClient.java b/src/main/java/com/auth0/client/mgmt/connections/AsyncClientsClient.java index 10817ae7..7e462e92 100644 --- a/src/main/java/com/auth0/client/mgmt/connections/AsyncClientsClient.java +++ b/src/main/java/com/auth0/client/mgmt/connections/AsyncClientsClient.java @@ -31,7 +31,7 @@ public AsyncRawClientsClient withRawResponse() { /** * Retrieve all clients that have the specified connection enabled. - *

    Note: The first time you call this endpoint, 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 further results are remaining.

    + *

    Note: The first time you call this endpoint, 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 further results are remaining.

    */ public CompletableFuture> get(String id) { return this.rawClient.get(id).thenApply(response -> response.body()); @@ -39,7 +39,7 @@ public CompletableFuture> get(String /** * Retrieve all clients that have the specified connection enabled. - *

    Note: The first time you call this endpoint, 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 further results are remaining.

    + *

    Note: The first time you call this endpoint, 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 further results are remaining.

    */ public CompletableFuture> get( String id, RequestOptions requestOptions) { @@ -48,7 +48,7 @@ public CompletableFuture> get( /** * Retrieve all clients that have the specified connection enabled. - *

    Note: The first time you call this endpoint, 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 further results are remaining.

    + *

    Note: The first time you call this endpoint, 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 further results are remaining.

    */ public CompletableFuture> get( String id, GetConnectionEnabledClientsRequestParameters request) { @@ -57,7 +57,7 @@ public CompletableFuture> get( /** * Retrieve all clients that have the specified connection enabled. - *

    Note: The first time you call this endpoint, 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 further results are remaining.

    + *

    Note: The first time you call this endpoint, 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 further results are remaining.

    */ public CompletableFuture> get( String id, GetConnectionEnabledClientsRequestParameters request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/connections/AsyncRawClientsClient.java b/src/main/java/com/auth0/client/mgmt/connections/AsyncRawClientsClient.java index f9dd8ae7..b703a6e3 100644 --- a/src/main/java/com/auth0/client/mgmt/connections/AsyncRawClientsClient.java +++ b/src/main/java/com/auth0/client/mgmt/connections/AsyncRawClientsClient.java @@ -47,7 +47,7 @@ public AsyncRawClientsClient(ClientOptions clientOptions) { /** * Retrieve all clients that have the specified connection enabled. - *

    Note: The first time you call this endpoint, 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 further results are remaining.

    + *

    Note: The first time you call this endpoint, 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 further results are remaining.

    */ public CompletableFuture>> get(String id) { return get(id, GetConnectionEnabledClientsRequestParameters.builder().build()); @@ -55,7 +55,7 @@ public CompletableFutureconnection enabled. - *

    Note: The first time you call this endpoint, 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 further results are remaining.

    + *

    Note: The first time you call this endpoint, 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 further results are remaining.

    */ public CompletableFuture>> get( String id, RequestOptions requestOptions) { @@ -64,7 +64,7 @@ public CompletableFutureconnection enabled. - *

    Note: The first time you call this endpoint, 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 further results are remaining.

    + *

    Note: The first time you call this endpoint, 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 further results are remaining.

    */ public CompletableFuture>> get( String id, GetConnectionEnabledClientsRequestParameters request) { @@ -73,7 +73,7 @@ public CompletableFutureconnection enabled. - *

    Note: The first time you call this endpoint, 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 further results are remaining.

    + *

    Note: The first time you call this endpoint, 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 further results are remaining.

    */ public CompletableFuture>> get( String id, GetConnectionEnabledClientsRequestParameters request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/connections/ClientsClient.java b/src/main/java/com/auth0/client/mgmt/connections/ClientsClient.java index 5220513b..f92c1521 100644 --- a/src/main/java/com/auth0/client/mgmt/connections/ClientsClient.java +++ b/src/main/java/com/auth0/client/mgmt/connections/ClientsClient.java @@ -30,7 +30,7 @@ public RawClientsClient withRawResponse() { /** * Retrieve all clients that have the specified connection enabled. - *

    Note: The first time you call this endpoint, 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 further results are remaining.

    + *

    Note: The first time you call this endpoint, 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 further results are remaining.

    */ public SyncPagingIterable get(String id) { return this.rawClient.get(id).body(); @@ -38,7 +38,7 @@ public SyncPagingIterable get(String id) { /** * Retrieve all clients that have the specified connection enabled. - *

    Note: The first time you call this endpoint, 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 further results are remaining.

    + *

    Note: The first time you call this endpoint, 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 further results are remaining.

    */ public SyncPagingIterable get(String id, RequestOptions requestOptions) { return this.rawClient.get(id, requestOptions).body(); @@ -46,7 +46,7 @@ public SyncPagingIterable get(String id, RequestOptions /** * Retrieve all clients that have the specified connection enabled. - *

    Note: The first time you call this endpoint, 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 further results are remaining.

    + *

    Note: The first time you call this endpoint, 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 further results are remaining.

    */ public SyncPagingIterable get( String id, GetConnectionEnabledClientsRequestParameters request) { @@ -55,7 +55,7 @@ public SyncPagingIterable get( /** * Retrieve all clients that have the specified connection enabled. - *

    Note: The first time you call this endpoint, 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 further results are remaining.

    + *

    Note: The first time you call this endpoint, 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 further results are remaining.

    */ public SyncPagingIterable get( String id, GetConnectionEnabledClientsRequestParameters request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/connections/RawClientsClient.java b/src/main/java/com/auth0/client/mgmt/connections/RawClientsClient.java index 8108c49f..20433e63 100644 --- a/src/main/java/com/auth0/client/mgmt/connections/RawClientsClient.java +++ b/src/main/java/com/auth0/client/mgmt/connections/RawClientsClient.java @@ -42,7 +42,7 @@ public RawClientsClient(ClientOptions clientOptions) { /** * Retrieve all clients that have the specified connection enabled. - *

    Note: The first time you call this endpoint, 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 further results are remaining.

    + *

    Note: The first time you call this endpoint, 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 further results are remaining.

    */ public ManagementApiHttpResponse> get(String id) { return get(id, GetConnectionEnabledClientsRequestParameters.builder().build()); @@ -50,7 +50,7 @@ public ManagementApiHttpResponse> ge /** * Retrieve all clients that have the specified connection enabled. - *

    Note: The first time you call this endpoint, 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 further results are remaining.

    + *

    Note: The first time you call this endpoint, 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 further results are remaining.

    */ public ManagementApiHttpResponse> get( String id, RequestOptions requestOptions) { @@ -59,7 +59,7 @@ public ManagementApiHttpResponse> ge /** * Retrieve all clients that have the specified connection enabled. - *

    Note: The first time you call this endpoint, 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 further results are remaining.

    + *

    Note: The first time you call this endpoint, 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 further results are remaining.

    */ public ManagementApiHttpResponse> get( String id, GetConnectionEnabledClientsRequestParameters request) { @@ -68,7 +68,7 @@ public ManagementApiHttpResponse> ge /** * Retrieve all clients that have the specified connection enabled. - *

    Note: The first time you call this endpoint, 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 further results are remaining.

    + *

    Note: The first time you call this endpoint, 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 further results are remaining.

    */ public ManagementApiHttpResponse> get( String id, GetConnectionEnabledClientsRequestParameters request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/groups/AsyncRawRolesClient.java b/src/main/java/com/auth0/client/mgmt/groups/AsyncRawRolesClient.java new file mode 100644 index 00000000..419e2e32 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/groups/AsyncRawRolesClient.java @@ -0,0 +1,365 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.groups; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.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.groups.types.CreateGroupRolesRequestParameters; +import com.auth0.client.mgmt.groups.types.DeleteGroupRolesRequestContent; +import com.auth0.client.mgmt.groups.types.ListGroupRolesRequestParameters; +import com.auth0.client.mgmt.types.ListGroupRolesResponseContent; +import com.auth0.client.mgmt.types.Role; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +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 AsyncRawRolesClient { + protected final ClientOptions clientOptions; + + public AsyncRawRolesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Lists the roles assigned to a group. + */ + public CompletableFuture>> list(String id) { + return list(id, ListGroupRolesRequestParameters.builder().build()); + } + + /** + * Lists the roles assigned to a group. + */ + public CompletableFuture>> list( + String id, RequestOptions requestOptions) { + return list(id, ListGroupRolesRequestParameters.builder().build(), requestOptions); + } + + /** + * Lists the roles assigned to a group. + */ + public CompletableFuture>> list( + String id, ListGroupRolesRequestParameters request) { + return list(id, request, null); + } + + /** + * Lists the roles assigned to a group. + */ + public CompletableFuture>> list( + String id, ListGroupRolesRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("groups") + .addPathSegment(id) + .addPathSegments("roles"); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListGroupRolesResponseContent parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ListGroupRolesResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListGroupRolesRequestParameters nextRequest = ListGroupRolesRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = parsedResponse.getRoles(); + future.complete(new ManagementApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(id, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Assign one or more roles to a specified group. + */ + public CompletableFuture> create( + String id, CreateGroupRolesRequestParameters request) { + return create(id, request, null); + } + + /** + * Assign one or more roles to a specified group. + */ + public CompletableFuture> create( + String id, CreateGroupRolesRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("groups") + .addPathSegment(id) + .addPathSegments("roles"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + 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 (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; + } + + /** + * Unassign one or more roles from a specified group. + */ + public CompletableFuture> delete( + String id, DeleteGroupRolesRequestContent request) { + return delete(id, request, null); + } + + /** + * Unassign one or more roles from a specified group. + */ + public CompletableFuture> delete( + String id, DeleteGroupRolesRequestContent request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("groups") + .addPathSegment(id) + .addPathSegments("roles"); + 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("DELETE", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new ManagementApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new ManagementException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/auth0/client/mgmt/groups/AsyncRolesClient.java b/src/main/java/com/auth0/client/mgmt/groups/AsyncRolesClient.java new file mode 100644 index 00000000..96ebd0da --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/groups/AsyncRolesClient.java @@ -0,0 +1,90 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.groups; + +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.groups.types.CreateGroupRolesRequestParameters; +import com.auth0.client.mgmt.groups.types.DeleteGroupRolesRequestContent; +import com.auth0.client.mgmt.groups.types.ListGroupRolesRequestParameters; +import com.auth0.client.mgmt.types.Role; +import java.util.concurrent.CompletableFuture; + +public class AsyncRolesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawRolesClient rawClient; + + public AsyncRolesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawRolesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawRolesClient withRawResponse() { + return this.rawClient; + } + + /** + * Lists the roles assigned to a group. + */ + public CompletableFuture> list(String id) { + return this.rawClient.list(id).thenApply(response -> response.body()); + } + + /** + * Lists the roles assigned to a group. + */ + public CompletableFuture> list(String id, RequestOptions requestOptions) { + return this.rawClient.list(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Lists the roles assigned to a group. + */ + public CompletableFuture> list(String id, ListGroupRolesRequestParameters request) { + return this.rawClient.list(id, request).thenApply(response -> response.body()); + } + + /** + * Lists the roles assigned to a group. + */ + public CompletableFuture> list( + String id, ListGroupRolesRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Assign one or more roles to a specified group. + */ + public CompletableFuture create(String id, CreateGroupRolesRequestParameters request) { + return this.rawClient.create(id, request).thenApply(response -> response.body()); + } + + /** + * Assign one or more roles to a specified group. + */ + public CompletableFuture create( + String id, CreateGroupRolesRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.create(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Unassign one or more roles from a specified group. + */ + public CompletableFuture delete(String id, DeleteGroupRolesRequestContent request) { + return this.rawClient.delete(id, request).thenApply(response -> response.body()); + } + + /** + * Unassign one or more roles from a specified group. + */ + public CompletableFuture delete( + String id, DeleteGroupRolesRequestContent request, RequestOptions requestOptions) { + return this.rawClient.delete(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/groups/RawRolesClient.java b/src/main/java/com/auth0/client/mgmt/groups/RawRolesClient.java new file mode 100644 index 00000000..382e968a --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/groups/RawRolesClient.java @@ -0,0 +1,286 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.groups; + +import com.auth0.client.mgmt.core.ClientOptions; +import com.auth0.client.mgmt.core.ManagementApiException; +import com.auth0.client.mgmt.core.ManagementApiHttpResponse; +import com.auth0.client.mgmt.core.ManagementException; +import com.auth0.client.mgmt.core.MediaTypes; +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.QueryStringMapper; +import com.auth0.client.mgmt.core.RequestOptions; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.errors.BadRequestError; +import com.auth0.client.mgmt.errors.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.groups.types.CreateGroupRolesRequestParameters; +import com.auth0.client.mgmt.groups.types.DeleteGroupRolesRequestContent; +import com.auth0.client.mgmt.groups.types.ListGroupRolesRequestParameters; +import com.auth0.client.mgmt.types.ListGroupRolesResponseContent; +import com.auth0.client.mgmt.types.Role; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +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 RawRolesClient { + protected final ClientOptions clientOptions; + + public RawRolesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Lists the roles assigned to a group. + */ + public ManagementApiHttpResponse> list(String id) { + return list(id, ListGroupRolesRequestParameters.builder().build()); + } + + /** + * Lists the roles assigned to a group. + */ + public ManagementApiHttpResponse> list(String id, RequestOptions requestOptions) { + return list(id, ListGroupRolesRequestParameters.builder().build(), requestOptions); + } + + /** + * Lists the roles assigned to a group. + */ + public ManagementApiHttpResponse> list( + String id, ListGroupRolesRequestParameters request) { + return list(id, request, null); + } + + /** + * Lists the roles assigned to a group. + */ + public ManagementApiHttpResponse> list( + String id, ListGroupRolesRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("groups") + .addPathSegment(id) + .addPathSegments("roles"); + if (!request.getFrom().isAbsent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from", request.getFrom().orElse(null), false); + } + QueryStringMapper.addQueryParameter(httpUrl, "take", request.getTake().orElse(50), false); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + ListGroupRolesResponseContent parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ListGroupRolesResponseContent.class); + Optional startingAfter = parsedResponse.getNext(); + ListGroupRolesRequestParameters nextRequest = ListGroupRolesRequestParameters.builder() + .from(request) + .from(startingAfter) + .build(); + List result = parsedResponse.getRoles(); + return new ManagementApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + id, nextRequest, requestOptions) + .body()), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Assign one or more roles to a specified group. + */ + public ManagementApiHttpResponse create(String id, CreateGroupRolesRequestParameters request) { + return create(id, request, null); + } + + /** + * Assign one or more roles to a specified group. + */ + public ManagementApiHttpResponse create( + String id, CreateGroupRolesRequestParameters request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("groups") + .addPathSegment(id) + .addPathSegments("roles"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new ManagementException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + 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 (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } + + /** + * Unassign one or more roles from a specified group. + */ + public ManagementApiHttpResponse delete(String id, DeleteGroupRolesRequestContent request) { + return delete(id, request, null); + } + + /** + * Unassign one or more roles from a specified group. + */ + public ManagementApiHttpResponse delete( + String id, DeleteGroupRolesRequestContent request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("groups") + .addPathSegment(id) + .addPathSegments("roles"); + 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("DELETE", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new ManagementApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ManagementApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new ManagementException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/groups/RolesClient.java b/src/main/java/com/auth0/client/mgmt/groups/RolesClient.java new file mode 100644 index 00000000..b2280821 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/groups/RolesClient.java @@ -0,0 +1,87 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.groups; + +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.groups.types.CreateGroupRolesRequestParameters; +import com.auth0.client.mgmt.groups.types.DeleteGroupRolesRequestContent; +import com.auth0.client.mgmt.groups.types.ListGroupRolesRequestParameters; +import com.auth0.client.mgmt.types.Role; + +public class RolesClient { + protected final ClientOptions clientOptions; + + private final RawRolesClient rawClient; + + public RolesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawRolesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawRolesClient withRawResponse() { + return this.rawClient; + } + + /** + * Lists the roles assigned to a group. + */ + public SyncPagingIterable list(String id) { + return this.rawClient.list(id).body(); + } + + /** + * Lists the roles assigned to a group. + */ + public SyncPagingIterable list(String id, RequestOptions requestOptions) { + return this.rawClient.list(id, requestOptions).body(); + } + + /** + * Lists the roles assigned to a group. + */ + public SyncPagingIterable list(String id, ListGroupRolesRequestParameters request) { + return this.rawClient.list(id, request).body(); + } + + /** + * Lists the roles assigned to a group. + */ + public SyncPagingIterable list( + String id, ListGroupRolesRequestParameters request, RequestOptions requestOptions) { + return this.rawClient.list(id, request, requestOptions).body(); + } + + /** + * Assign one or more roles to a specified group. + */ + public void create(String id, CreateGroupRolesRequestParameters request) { + this.rawClient.create(id, request).body(); + } + + /** + * Assign one or more roles to a specified group. + */ + public void create(String id, CreateGroupRolesRequestParameters request, RequestOptions requestOptions) { + this.rawClient.create(id, request, requestOptions).body(); + } + + /** + * Unassign one or more roles from a specified group. + */ + public void delete(String id, DeleteGroupRolesRequestContent request) { + this.rawClient.delete(id, request).body(); + } + + /** + * Unassign one or more roles from a specified group. + */ + public void delete(String id, DeleteGroupRolesRequestContent request, RequestOptions requestOptions) { + this.rawClient.delete(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/groups/types/CreateGroupRolesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/groups/types/CreateGroupRolesRequestParameters.java new file mode 100644 index 00000000..9dfa3a20 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/groups/types/CreateGroupRolesRequestParameters.java @@ -0,0 +1,122 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.groups.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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateGroupRolesRequestParameters.Builder.class) +public final class CreateGroupRolesRequestParameters { + private final List roles; + + private final Map additionalProperties; + + private CreateGroupRolesRequestParameters(List roles, Map additionalProperties) { + this.roles = roles; + this.additionalProperties = additionalProperties; + } + + /** + * @return Array of role IDs to assign to the group. + */ + @JsonProperty("roles") + public List getRoles() { + return roles; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateGroupRolesRequestParameters && equalTo((CreateGroupRolesRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateGroupRolesRequestParameters other) { + return roles.equals(other.roles); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.roles); + } + + @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 List roles = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateGroupRolesRequestParameters other) { + roles(other.getRoles()); + return this; + } + + /** + *

    Array of role IDs to assign to the group.

    + */ + @JsonSetter(value = "roles", nulls = Nulls.SKIP) + public Builder roles(List roles) { + this.roles.clear(); + if (roles != null) { + this.roles.addAll(roles); + } + return this; + } + + public Builder addRoles(String roles) { + this.roles.add(roles); + return this; + } + + public Builder addAllRoles(List roles) { + if (roles != null) { + this.roles.addAll(roles); + } + return this; + } + + public CreateGroupRolesRequestParameters build() { + return new CreateGroupRolesRequestParameters(roles, 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/groups/types/DeleteGroupRolesRequestContent.java b/src/main/java/com/auth0/client/mgmt/groups/types/DeleteGroupRolesRequestContent.java new file mode 100644 index 00000000..f245ba99 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/groups/types/DeleteGroupRolesRequestContent.java @@ -0,0 +1,122 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.groups.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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeleteGroupRolesRequestContent.Builder.class) +public final class DeleteGroupRolesRequestContent { + private final List roles; + + private final Map additionalProperties; + + private DeleteGroupRolesRequestContent(List roles, Map additionalProperties) { + this.roles = roles; + this.additionalProperties = additionalProperties; + } + + /** + * @return Array of role IDs to remove from the group. + */ + @JsonProperty("roles") + public List getRoles() { + return roles; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeleteGroupRolesRequestContent && equalTo((DeleteGroupRolesRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeleteGroupRolesRequestContent other) { + return roles.equals(other.roles); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.roles); + } + + @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 List roles = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DeleteGroupRolesRequestContent other) { + roles(other.getRoles()); + return this; + } + + /** + *

    Array of role IDs to remove from the group.

    + */ + @JsonSetter(value = "roles", nulls = Nulls.SKIP) + public Builder roles(List roles) { + this.roles.clear(); + if (roles != null) { + this.roles.addAll(roles); + } + return this; + } + + public Builder addRoles(String roles) { + this.roles.add(roles); + return this; + } + + public Builder addAllRoles(List roles) { + if (roles != null) { + this.roles.addAll(roles); + } + return this; + } + + public DeleteGroupRolesRequestContent build() { + return new DeleteGroupRolesRequestContent(roles, 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/groups/types/ListGroupRolesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/groups/types/ListGroupRolesRequestParameters.java new file mode 100644 index 00000000..417c9c74 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/groups/types/ListGroupRolesRequestParameters.java @@ -0,0 +1,188 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.groups.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +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 = ListGroupRolesRequestParameters.Builder.class) +public final class ListGroupRolesRequestParameters { + private final OptionalNullable from; + + private final OptionalNullable take; + + private final Map additionalProperties; + + private ListGroupRolesRequestParameters( + OptionalNullable from, OptionalNullable take, Map additionalProperties) { + this.from = from; + this.take = take; + this.additionalProperties = additionalProperties; + } + + /** + * @return Optional Id from which to start selection. + */ + @JsonIgnore + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonIgnore + public OptionalNullable getTake() { + if (take == null) { + return OptionalNullable.absent(); + } + return take; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListGroupRolesRequestParameters && equalTo((ListGroupRolesRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListGroupRolesRequestParameters 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(ListGroupRolesRequestParameters 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 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; + } + + public ListGroupRolesRequestParameters build() { + return new ListGroupRolesRequestParameters(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/guardian/AsyncEnrollmentsClient.java b/src/main/java/com/auth0/client/mgmt/guardian/AsyncEnrollmentsClient.java index 0e7065c8..dbf5d042 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/AsyncEnrollmentsClient.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/AsyncEnrollmentsClient.java @@ -28,9 +28,7 @@ public AsyncRawEnrollmentsClient withRawResponse() { } /** - * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket, to a given user. - * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.
    - *

    Note: Users cannot enroll in Email as a factor through custom enrollment tickets.

    + * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors. */ public CompletableFuture createTicket( CreateGuardianEnrollmentTicketRequestContent request) { @@ -38,9 +36,7 @@ public CompletableFuture createTi } /** - * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket, to a given user. - * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.
    - *

    Note: Users cannot enroll in Email as a factor through custom enrollment tickets.

    + * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors. */ public CompletableFuture createTicket( CreateGuardianEnrollmentTicketRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/guardian/AsyncPoliciesClient.java b/src/main/java/com/auth0/client/mgmt/guardian/AsyncPoliciesClient.java index dc433cc3..22b2a747 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/AsyncPoliciesClient.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/AsyncPoliciesClient.java @@ -29,11 +29,11 @@ public AsyncRawPoliciesClient withRawResponse() { /** * Retrieve the multi-factor authentication (MFA) policies configured for your tenant. *

    The following policies are supported:

    - *

      + *
        *
      • all-applications policy prompts with MFA for all logins.
      • *
      • confidence-score policy prompts with MFA only for low confidence logins.
      • - *

      - *

      Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

      + *
    + *

    Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

    */ public CompletableFuture> list() { return this.rawClient.list().thenApply(response -> response.body()); @@ -42,11 +42,11 @@ public CompletableFuture> list() { /** * Retrieve the multi-factor authentication (MFA) policies configured for your tenant. *

    The following policies are supported:

    - *

      + *
        *
      • all-applications policy prompts with MFA for all logins.
      • *
      • confidence-score policy prompts with MFA only for low confidence logins.
      • - *

      - *

      Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

      + *
    + *

    Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

    */ public CompletableFuture> list(RequestOptions requestOptions) { return this.rawClient.list(requestOptions).thenApply(response -> response.body()); @@ -55,11 +55,11 @@ public CompletableFuture> list(RequestOptions requestOptions /** * Set multi-factor authentication (MFA) policies for your tenant. *

    The following policies are supported:

    - *

      + *
        *
      • all-applications policy prompts with MFA for all logins.
      • *
      • confidence-score policy prompts with MFA only for low confidence logins.
      • - *

      - *

      Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

      + *
    + *

    Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

    */ public CompletableFuture> set(List request) { return this.rawClient.set(request).thenApply(response -> response.body()); @@ -68,11 +68,11 @@ public CompletableFuture> set(List request) { /** * Set multi-factor authentication (MFA) policies for your tenant. *

    The following policies are supported:

    - *

      + *
        *
      • all-applications policy prompts with MFA for all logins.
      • *
      • confidence-score policy prompts with MFA only for low confidence logins.
      • - *

      - *

      Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

      + *
    + *

    Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

    */ public CompletableFuture> set(List request, RequestOptions requestOptions) { return this.rawClient.set(request, requestOptions).thenApply(response -> response.body()); diff --git a/src/main/java/com/auth0/client/mgmt/guardian/AsyncRawEnrollmentsClient.java b/src/main/java/com/auth0/client/mgmt/guardian/AsyncRawEnrollmentsClient.java index 9e2ac9f4..35a13ab8 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/AsyncRawEnrollmentsClient.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/AsyncRawEnrollmentsClient.java @@ -39,9 +39,7 @@ public AsyncRawEnrollmentsClient(ClientOptions clientOptions) { } /** - * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket, to a given user. - * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.
    - *

    Note: Users cannot enroll in Email as a factor through custom enrollment tickets.

    + * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors. */ public CompletableFuture> createTicket( CreateGuardianEnrollmentTicketRequestContent request) { @@ -49,9 +47,7 @@ public CompletableFuturemulti-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket, to a given user. - * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.
    - *

    Note: Users cannot enroll in Email as a factor through custom enrollment tickets.

    + * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors. */ public CompletableFuture> createTicket( CreateGuardianEnrollmentTicketRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/guardian/AsyncRawPoliciesClient.java b/src/main/java/com/auth0/client/mgmt/guardian/AsyncRawPoliciesClient.java index a81a3872..c72388dd 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/AsyncRawPoliciesClient.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/AsyncRawPoliciesClient.java @@ -40,11 +40,11 @@ public AsyncRawPoliciesClient(ClientOptions clientOptions) { /** * Retrieve the multi-factor authentication (MFA) policies configured for your tenant. *

    The following policies are supported:

    - *

      + *
        *
      • all-applications policy prompts with MFA for all logins.
      • *
      • confidence-score policy prompts with MFA only for low confidence logins.
      • - *

      - *

      Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

      + *
    + *

    Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

    */ public CompletableFuture>> list() { return list(null); @@ -53,11 +53,11 @@ public CompletableFuture>> list() /** * Retrieve the multi-factor authentication (MFA) policies configured for your tenant. *

    The following policies are supported:

    - *

      + *
        *
      • all-applications policy prompts with MFA for all logins.
      • *
      • confidence-score policy prompts with MFA only for low confidence logins.
      • - *

      - *

      Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

      + *
    + *

    Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

    */ public CompletableFuture>> list(RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) @@ -132,11 +132,11 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Set multi-factor authentication (MFA) policies for your tenant. *

    The following policies are supported:

    - *

      + *
        *
      • all-applications policy prompts with MFA for all logins.
      • *
      • confidence-score policy prompts with MFA only for low confidence logins.
      • - *

      - *

      Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

      + *
    + *

    Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

    */ public CompletableFuture>> set(List request) { return set(request, null); @@ -145,11 +145,11 @@ public CompletableFuture>> set(Lis /** * Set multi-factor authentication (MFA) policies for your tenant. *

    The following policies are supported:

    - *

      + *
        *
      • all-applications policy prompts with MFA for all logins.
      • *
      • confidence-score policy prompts with MFA only for low confidence logins.
      • - *

      - *

      Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

      + *
    + *

    Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

    */ public CompletableFuture>> set( List request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/guardian/EnrollmentsClient.java b/src/main/java/com/auth0/client/mgmt/guardian/EnrollmentsClient.java index 41475707..dc4fc115 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/EnrollmentsClient.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/EnrollmentsClient.java @@ -27,9 +27,7 @@ public RawEnrollmentsClient withRawResponse() { } /** - * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket, to a given user. - * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.
    - *

    Note: Users cannot enroll in Email as a factor through custom enrollment tickets.

    + * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors. */ public CreateGuardianEnrollmentTicketResponseContent createTicket( CreateGuardianEnrollmentTicketRequestContent request) { @@ -37,9 +35,7 @@ public CreateGuardianEnrollmentTicketResponseContent createTicket( } /** - * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket, to a given user. - * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.
    - *

    Note: Users cannot enroll in Email as a factor through custom enrollment tickets.

    + * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors. */ public CreateGuardianEnrollmentTicketResponseContent createTicket( CreateGuardianEnrollmentTicketRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/guardian/PoliciesClient.java b/src/main/java/com/auth0/client/mgmt/guardian/PoliciesClient.java index e97f7cdb..8caa0479 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/PoliciesClient.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/PoliciesClient.java @@ -28,11 +28,11 @@ public RawPoliciesClient withRawResponse() { /** * Retrieve the multi-factor authentication (MFA) policies configured for your tenant. *

    The following policies are supported:

    - *

      + *
        *
      • all-applications policy prompts with MFA for all logins.
      • *
      • confidence-score policy prompts with MFA only for low confidence logins.
      • - *

      - *

      Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

      + *
    + *

    Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

    */ public List list() { return this.rawClient.list().body(); @@ -41,11 +41,11 @@ public List list() { /** * Retrieve the multi-factor authentication (MFA) policies configured for your tenant. *

    The following policies are supported:

    - *

      + *
        *
      • all-applications policy prompts with MFA for all logins.
      • *
      • confidence-score policy prompts with MFA only for low confidence logins.
      • - *

      - *

      Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

      + *
    + *

    Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

    */ public List list(RequestOptions requestOptions) { return this.rawClient.list(requestOptions).body(); @@ -54,11 +54,11 @@ public List list(RequestOptions requestOptions) { /** * Set multi-factor authentication (MFA) policies for your tenant. *

    The following policies are supported:

    - *

      + *
        *
      • all-applications policy prompts with MFA for all logins.
      • *
      • confidence-score policy prompts with MFA only for low confidence logins.
      • - *

      - *

      Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

      + *
    + *

    Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

    */ public List set(List request) { return this.rawClient.set(request).body(); @@ -67,11 +67,11 @@ public List set(List request) { /** * Set multi-factor authentication (MFA) policies for your tenant. *

    The following policies are supported:

    - *

      + *
        *
      • all-applications policy prompts with MFA for all logins.
      • *
      • confidence-score policy prompts with MFA only for low confidence logins.
      • - *

      - *

      Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

      + *
    + *

    Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

    */ public List set(List request, RequestOptions requestOptions) { return this.rawClient.set(request, requestOptions).body(); diff --git a/src/main/java/com/auth0/client/mgmt/guardian/RawEnrollmentsClient.java b/src/main/java/com/auth0/client/mgmt/guardian/RawEnrollmentsClient.java index 38535556..1af3e0d5 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/RawEnrollmentsClient.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/RawEnrollmentsClient.java @@ -35,9 +35,7 @@ public RawEnrollmentsClient(ClientOptions clientOptions) { } /** - * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket, to a given user. - * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.
    - *

    Note: Users cannot enroll in Email as a factor through custom enrollment tickets.

    + * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors. */ public ManagementApiHttpResponse createTicket( CreateGuardianEnrollmentTicketRequestContent request) { @@ -45,9 +43,7 @@ public ManagementApiHttpResponse } /** - * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket, to a given user. - * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors.
    - *

    Note: Users cannot enroll in Email as a factor through custom enrollment tickets.

    + * Create a multi-factor authentication (MFA) enrollment ticket, and optionally send an email with the created ticket to a given user. Enrollment tickets can specify which factor users must enroll with or allow existing MFA users to enroll in additional factors. */ public ManagementApiHttpResponse createTicket( CreateGuardianEnrollmentTicketRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/guardian/RawPoliciesClient.java b/src/main/java/com/auth0/client/mgmt/guardian/RawPoliciesClient.java index 2305d3dd..3fbc2bce 100644 --- a/src/main/java/com/auth0/client/mgmt/guardian/RawPoliciesClient.java +++ b/src/main/java/com/auth0/client/mgmt/guardian/RawPoliciesClient.java @@ -36,11 +36,11 @@ public RawPoliciesClient(ClientOptions clientOptions) { /** * Retrieve the multi-factor authentication (MFA) policies configured for your tenant. *

    The following policies are supported:

    - *

      + *
        *
      • all-applications policy prompts with MFA for all logins.
      • *
      • confidence-score policy prompts with MFA only for low confidence logins.
      • - *

      - *

      Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

      + *
    + *

    Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

    */ public ManagementApiHttpResponse> list() { return list(null); @@ -49,11 +49,11 @@ public ManagementApiHttpResponse> list() { /** * Retrieve the multi-factor authentication (MFA) policies configured for your tenant. *

    The following policies are supported:

    - *

      + *
        *
      • all-applications policy prompts with MFA for all logins.
      • *
      • confidence-score policy prompts with MFA only for low confidence logins.
      • - *

      - *

      Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

      + *
    + *

    Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

    */ public ManagementApiHttpResponse> list(RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) @@ -109,11 +109,11 @@ public ManagementApiHttpResponse> list(RequestOptions reques /** * Set multi-factor authentication (MFA) policies for your tenant. *

    The following policies are supported:

    - *

      + *
        *
      • all-applications policy prompts with MFA for all logins.
      • *
      • confidence-score policy prompts with MFA only for low confidence logins.
      • - *

      - *

      Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

      + *
    + *

    Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

    */ public ManagementApiHttpResponse> set(List request) { return set(request, null); @@ -122,11 +122,11 @@ public ManagementApiHttpResponse> set(List re /** * Set multi-factor authentication (MFA) policies for your tenant. *

    The following policies are supported:

    - *

      + *
        *
      • all-applications policy prompts with MFA for all logins.
      • *
      • confidence-score policy prompts with MFA only for low confidence logins.
      • - *

      - *

      Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

      + *
    + *

    Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.

    */ public ManagementApiHttpResponse> set( List request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/prompts/AsyncRawRenderingClient.java b/src/main/java/com/auth0/client/mgmt/prompts/AsyncRawRenderingClient.java index b0727307..290858a2 100644 --- a/src/main/java/com/auth0/client/mgmt/prompts/AsyncRawRenderingClient.java +++ b/src/main/java/com/auth0/client/mgmt/prompts/AsyncRawRenderingClient.java @@ -205,7 +205,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * Learn more about configuring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public CompletableFuture> bulkUpdate( BulkUpdateAculRequestContent request) { @@ -213,7 +213,7 @@ public CompletableFutureconfiguring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public CompletableFuture> bulkUpdate( BulkUpdateAculRequestContent request, RequestOptions requestOptions) { @@ -405,7 +405,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * Learn more about configuring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public CompletableFuture> update( PromptGroupNameEnum prompt, ScreenGroupNameEnum screen) { @@ -413,7 +413,7 @@ public CompletableFuture> u } /** - * Learn more about configuring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public CompletableFuture> update( PromptGroupNameEnum prompt, ScreenGroupNameEnum screen, RequestOptions requestOptions) { @@ -421,7 +421,7 @@ public CompletableFuture> u } /** - * Learn more about configuring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public CompletableFuture> update( PromptGroupNameEnum prompt, ScreenGroupNameEnum screen, UpdateAculRequestContent request) { @@ -429,7 +429,7 @@ public CompletableFuture> u } /** - * Learn more about configuring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public CompletableFuture> update( PromptGroupNameEnum prompt, diff --git a/src/main/java/com/auth0/client/mgmt/prompts/AsyncRenderingClient.java b/src/main/java/com/auth0/client/mgmt/prompts/AsyncRenderingClient.java index 0fdf5cf0..d00bc997 100644 --- a/src/main/java/com/auth0/client/mgmt/prompts/AsyncRenderingClient.java +++ b/src/main/java/com/auth0/client/mgmt/prompts/AsyncRenderingClient.java @@ -65,14 +65,14 @@ public CompletableFuture> list( } /** - * Learn more about configuring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public CompletableFuture bulkUpdate(BulkUpdateAculRequestContent request) { return this.rawClient.bulkUpdate(request).thenApply(response -> response.body()); } /** - * Learn more about configuring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public CompletableFuture bulkUpdate( BulkUpdateAculRequestContent request, RequestOptions requestOptions) { @@ -95,14 +95,14 @@ public CompletableFuture get( } /** - * Learn more about configuring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public CompletableFuture update(PromptGroupNameEnum prompt, ScreenGroupNameEnum screen) { return this.rawClient.update(prompt, screen).thenApply(response -> response.body()); } /** - * Learn more about configuring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public CompletableFuture update( PromptGroupNameEnum prompt, ScreenGroupNameEnum screen, RequestOptions requestOptions) { @@ -110,7 +110,7 @@ public CompletableFuture update( } /** - * Learn more about configuring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public CompletableFuture update( PromptGroupNameEnum prompt, ScreenGroupNameEnum screen, UpdateAculRequestContent request) { @@ -118,7 +118,7 @@ public CompletableFuture update( } /** - * Learn more about configuring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public CompletableFuture update( PromptGroupNameEnum prompt, diff --git a/src/main/java/com/auth0/client/mgmt/prompts/RawRenderingClient.java b/src/main/java/com/auth0/client/mgmt/prompts/RawRenderingClient.java index f4b7cb4b..e1efb1c0 100644 --- a/src/main/java/com/auth0/client/mgmt/prompts/RawRenderingClient.java +++ b/src/main/java/com/auth0/client/mgmt/prompts/RawRenderingClient.java @@ -168,14 +168,14 @@ public ManagementApiHttpResponseconfiguring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public ManagementApiHttpResponse bulkUpdate(BulkUpdateAculRequestContent request) { return bulkUpdate(request, null); } /** - * Learn more about configuring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public ManagementApiHttpResponse bulkUpdate( BulkUpdateAculRequestContent request, RequestOptions requestOptions) { @@ -318,7 +318,7 @@ public ManagementApiHttpResponse get( } /** - * Learn more about configuring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public ManagementApiHttpResponse update( PromptGroupNameEnum prompt, ScreenGroupNameEnum screen) { @@ -326,7 +326,7 @@ public ManagementApiHttpResponse update( } /** - * Learn more about configuring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public ManagementApiHttpResponse update( PromptGroupNameEnum prompt, ScreenGroupNameEnum screen, RequestOptions requestOptions) { @@ -334,7 +334,7 @@ public ManagementApiHttpResponse update( } /** - * Learn more about configuring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public ManagementApiHttpResponse update( PromptGroupNameEnum prompt, ScreenGroupNameEnum screen, UpdateAculRequestContent request) { @@ -342,7 +342,7 @@ public ManagementApiHttpResponse update( } /** - * Learn more about configuring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public ManagementApiHttpResponse update( PromptGroupNameEnum prompt, diff --git a/src/main/java/com/auth0/client/mgmt/prompts/RenderingClient.java b/src/main/java/com/auth0/client/mgmt/prompts/RenderingClient.java index a819e40f..81f550ac 100644 --- a/src/main/java/com/auth0/client/mgmt/prompts/RenderingClient.java +++ b/src/main/java/com/auth0/client/mgmt/prompts/RenderingClient.java @@ -63,14 +63,14 @@ public SyncPagingIterable list( } /** - * Learn more about configuring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public BulkUpdateAculResponseContent bulkUpdate(BulkUpdateAculRequestContent request) { return this.rawClient.bulkUpdate(request).body(); } /** - * Learn more about configuring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public BulkUpdateAculResponseContent bulkUpdate( BulkUpdateAculRequestContent request, RequestOptions requestOptions) { @@ -93,14 +93,14 @@ public GetAculResponseContent get( } /** - * Learn more about configuring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public UpdateAculResponseContent update(PromptGroupNameEnum prompt, ScreenGroupNameEnum screen) { return this.rawClient.update(prompt, screen).body(); } /** - * Learn more about configuring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public UpdateAculResponseContent update( PromptGroupNameEnum prompt, ScreenGroupNameEnum screen, RequestOptions requestOptions) { @@ -108,7 +108,7 @@ public UpdateAculResponseContent update( } /** - * Learn more about configuring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public UpdateAculResponseContent update( PromptGroupNameEnum prompt, ScreenGroupNameEnum screen, UpdateAculRequestContent request) { @@ -116,7 +116,7 @@ public UpdateAculResponseContent update( } /** - * Learn more about configuring render settings for advanced customization. + * Learn more about configuring render settings for advanced customization. */ public UpdateAculResponseContent update( PromptGroupNameEnum prompt, diff --git a/src/main/java/com/auth0/client/mgmt/roles/AsyncRawUsersClient.java b/src/main/java/com/auth0/client/mgmt/roles/AsyncRawUsersClient.java index a6d626ef..35afcf25 100644 --- a/src/main/java/com/auth0/client/mgmt/roles/AsyncRawUsersClient.java +++ b/src/main/java/com/auth0/client/mgmt/roles/AsyncRawUsersClient.java @@ -49,18 +49,18 @@ public AsyncRawUsersClient(ClientOptions clientOptions) { /** * Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public CompletableFuture>> list(String id) { return list(id, ListRoleUsersRequestParameters.builder().build()); @@ -69,18 +69,18 @@ public CompletableFuture> /** * Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public CompletableFuture>> list( String id, RequestOptions requestOptions) { @@ -90,18 +90,18 @@ public CompletableFuture> /** * Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public CompletableFuture>> list( String id, ListRoleUsersRequestParameters request) { @@ -111,18 +111,18 @@ public CompletableFuture> /** * Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public CompletableFuture>> list( String id, ListRoleUsersRequestParameters request, RequestOptions requestOptions) { @@ -230,7 +230,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Assign one or more users to an existing user role. To learn more, review Role-Based Access Control. - *

    Note: New roles cannot be created through this action.

    + *

    Note: New roles cannot be created through this action.

    */ public CompletableFuture> assign(String id, AssignRoleUsersRequestContent request) { return assign(id, request, null); @@ -238,7 +238,7 @@ public CompletableFuture> assign(String id, Assi /** * Assign one or more users to an existing user role. To learn more, review Role-Based Access Control. - *

    Note: New roles cannot be created through this action.

    + *

    Note: New roles cannot be created through this action.

    */ public CompletableFuture> assign( String id, AssignRoleUsersRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/roles/AsyncUsersClient.java b/src/main/java/com/auth0/client/mgmt/roles/AsyncUsersClient.java index fd83ef32..39bda944 100644 --- a/src/main/java/com/auth0/client/mgmt/roles/AsyncUsersClient.java +++ b/src/main/java/com/auth0/client/mgmt/roles/AsyncUsersClient.java @@ -31,18 +31,18 @@ public AsyncRawUsersClient withRawResponse() { /** * Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public CompletableFuture> list(String id) { return this.rawClient.list(id).thenApply(response -> response.body()); @@ -51,18 +51,18 @@ public CompletableFuture> list(String id) { /** * Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public CompletableFuture> list(String id, RequestOptions requestOptions) { return this.rawClient.list(id, requestOptions).thenApply(response -> response.body()); @@ -71,18 +71,18 @@ public CompletableFuture> list(String id, RequestOp /** * Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public CompletableFuture> list(String id, ListRoleUsersRequestParameters request) { return this.rawClient.list(id, request).thenApply(response -> response.body()); @@ -91,18 +91,18 @@ public CompletableFuture> list(String id, ListRoleU /** * Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public CompletableFuture> list( String id, ListRoleUsersRequestParameters request, RequestOptions requestOptions) { @@ -111,7 +111,7 @@ public CompletableFuture> list( /** * Assign one or more users to an existing user role. To learn more, review Role-Based Access Control. - *

    Note: New roles cannot be created through this action.

    + *

    Note: New roles cannot be created through this action.

    */ public CompletableFuture assign(String id, AssignRoleUsersRequestContent request) { return this.rawClient.assign(id, request).thenApply(response -> response.body()); @@ -119,7 +119,7 @@ public CompletableFuture assign(String id, AssignRoleUsersRequestContent r /** * Assign one or more users to an existing user role. To learn more, review Role-Based Access Control. - *

    Note: New roles cannot be created through this action.

    + *

    Note: New roles cannot be created through this action.

    */ public CompletableFuture assign( String id, AssignRoleUsersRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/roles/RawUsersClient.java b/src/main/java/com/auth0/client/mgmt/roles/RawUsersClient.java index 7e830143..035e1f30 100644 --- a/src/main/java/com/auth0/client/mgmt/roles/RawUsersClient.java +++ b/src/main/java/com/auth0/client/mgmt/roles/RawUsersClient.java @@ -44,18 +44,18 @@ public RawUsersClient(ClientOptions clientOptions) { /** * Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public ManagementApiHttpResponse> list(String id) { return list(id, ListRoleUsersRequestParameters.builder().build()); @@ -64,18 +64,18 @@ public ManagementApiHttpResponse> list(String id) { /** * Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public ManagementApiHttpResponse> list(String id, RequestOptions requestOptions) { return list(id, ListRoleUsersRequestParameters.builder().build(), requestOptions); @@ -84,18 +84,18 @@ public ManagementApiHttpResponse> list(String id, R /** * Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public ManagementApiHttpResponse> list( String id, ListRoleUsersRequestParameters request) { @@ -105,18 +105,18 @@ public ManagementApiHttpResponse> list( /** * Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public ManagementApiHttpResponse> list( String id, ListRoleUsersRequestParameters request, RequestOptions requestOptions) { @@ -194,7 +194,7 @@ public ManagementApiHttpResponse> list( /** * Assign one or more users to an existing user role. To learn more, review Role-Based Access Control. - *

    Note: New roles cannot be created through this action.

    + *

    Note: New roles cannot be created through this action.

    */ public ManagementApiHttpResponse assign(String id, AssignRoleUsersRequestContent request) { return assign(id, request, null); @@ -202,7 +202,7 @@ public ManagementApiHttpResponse assign(String id, AssignRoleUsersRequestC /** * Assign one or more users to an existing user role. To learn more, review Role-Based Access Control. - *

    Note: New roles cannot be created through this action.

    + *

    Note: New roles cannot be created through this action.

    */ public ManagementApiHttpResponse assign( String id, AssignRoleUsersRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/roles/UsersClient.java b/src/main/java/com/auth0/client/mgmt/roles/UsersClient.java index f7a2823b..a9247945 100644 --- a/src/main/java/com/auth0/client/mgmt/roles/UsersClient.java +++ b/src/main/java/com/auth0/client/mgmt/roles/UsersClient.java @@ -30,18 +30,18 @@ public RawUsersClient withRawResponse() { /** * Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public SyncPagingIterable list(String id) { return this.rawClient.list(id).body(); @@ -50,18 +50,18 @@ public SyncPagingIterable list(String id) { /** * Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public SyncPagingIterable list(String id, RequestOptions requestOptions) { return this.rawClient.list(id, requestOptions).body(); @@ -70,18 +70,18 @@ public SyncPagingIterable list(String id, RequestOptions requestOption /** * Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public SyncPagingIterable list(String id, ListRoleUsersRequestParameters request) { return this.rawClient.list(id, request).body(); @@ -90,18 +90,18 @@ public SyncPagingIterable list(String id, ListRoleUsersRequestParamete /** * Retrieve list of users associated with a specific role. For Dashboard instructions, review View Users Assigned to Roles. *

    This endpoint supports two types of pagination:

    - *

      + *
        *
      • Offset pagination
      • *
      • Checkpoint pagination
      • - *

      + *
    *

    Checkpoint pagination must be used if you need to retrieve more than 1000 organization members.

    - *

    Checkpoint Pagination

    + *

    Checkpoint Pagination

    *

    To search by checkpoint, use the following parameters:

    - *

      + *
        *
      • from: Optional id from which to start selection.
      • *
      • take: The total amount 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.

      + *
    + *

    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.

    */ public SyncPagingIterable list( String id, ListRoleUsersRequestParameters request, RequestOptions requestOptions) { @@ -110,7 +110,7 @@ public SyncPagingIterable list( /** * Assign one or more users to an existing user role. To learn more, review Role-Based Access Control. - *

    Note: New roles cannot be created through this action.

    + *

    Note: New roles cannot be created through this action.

    */ public void assign(String id, AssignRoleUsersRequestContent request) { this.rawClient.assign(id, request).body(); @@ -118,7 +118,7 @@ public void assign(String id, AssignRoleUsersRequestContent request) { /** * Assign one or more users to an existing user role. To learn more, review Role-Based Access Control. - *

    Note: New roles cannot be created through this action.

    + *

    Note: New roles cannot be created through this action.

    */ public void assign(String id, AssignRoleUsersRequestContent request, RequestOptions requestOptions) { this.rawClient.assign(id, request, requestOptions).body(); diff --git a/src/main/java/com/auth0/client/mgmt/types/ClientExternalMetadataTypeEnum.java b/src/main/java/com/auth0/client/mgmt/types/ClientExternalMetadataTypeEnum.java index 927729b9..55745d41 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ClientExternalMetadataTypeEnum.java +++ b/src/main/java/com/auth0/client/mgmt/types/ClientExternalMetadataTypeEnum.java @@ -7,6 +7,8 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class ClientExternalMetadataTypeEnum { + public static final ClientExternalMetadataTypeEnum DCR = new ClientExternalMetadataTypeEnum(Value.DCR, "dcr"); + public static final ClientExternalMetadataTypeEnum CIMD = new ClientExternalMetadataTypeEnum(Value.CIMD, "cimd"); private final Value value; @@ -42,6 +44,8 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { + case DCR: + return visitor.visitDcr(); case CIMD: return visitor.visitCimd(); case UNKNOWN: @@ -53,6 +57,8 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static ClientExternalMetadataTypeEnum valueOf(String value) { switch (value) { + case "dcr": + return DCR; case "cimd": return CIMD; default: @@ -63,12 +69,16 @@ public static ClientExternalMetadataTypeEnum valueOf(String value) { public enum Value { CIMD, + DCR, + UNKNOWN } public interface Visitor { T visitCimd(); + T visitDcr(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/auth0/client/mgmt/types/ConnectionPropertiesOptions.java b/src/main/java/com/auth0/client/mgmt/types/ConnectionPropertiesOptions.java index 53f76bf1..ddb21697 100644 --- a/src/main/java/com/auth0/client/mgmt/types/ConnectionPropertiesOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/ConnectionPropertiesOptions.java @@ -91,6 +91,8 @@ public final class ConnectionPropertiesOptions { private final OptionalNullable> idTokenSignedResponseAlgs; + private final Optional dpopSigningAlg; + private final OptionalNullable tokenEndpointAuthMethod; private final OptionalNullable tokenEndpointAuthSigningAlg; @@ -133,6 +135,7 @@ private ConnectionPropertiesOptions( Optional passwordOptions, Optional assertionDecryptionSettings, OptionalNullable> idTokenSignedResponseAlgs, + Optional dpopSigningAlg, OptionalNullable tokenEndpointAuthMethod, OptionalNullable tokenEndpointAuthSigningAlg, Optional tokenEndpointJwtcaAudFormat, @@ -170,6 +173,7 @@ private ConnectionPropertiesOptions( this.passwordOptions = passwordOptions; this.assertionDecryptionSettings = assertionDecryptionSettings; this.idTokenSignedResponseAlgs = idTokenSignedResponseAlgs; + this.dpopSigningAlg = dpopSigningAlg; this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; this.tokenEndpointAuthSigningAlg = tokenEndpointAuthSigningAlg; this.tokenEndpointJwtcaAudFormat = tokenEndpointJwtcaAudFormat; @@ -415,6 +419,11 @@ public OptionalNullable> getIdToken return idTokenSignedResponseAlgs; } + @JsonProperty("dpop_signing_alg") + public Optional getDpopSigningAlg() { + return dpopSigningAlg; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("token_endpoint_auth_method") public OptionalNullable getTokenEndpointAuthMethod() { @@ -580,6 +589,7 @@ private boolean equalTo(ConnectionPropertiesOptions other) { && passwordOptions.equals(other.passwordOptions) && assertionDecryptionSettings.equals(other.assertionDecryptionSettings) && idTokenSignedResponseAlgs.equals(other.idTokenSignedResponseAlgs) + && dpopSigningAlg.equals(other.dpopSigningAlg) && tokenEndpointAuthMethod.equals(other.tokenEndpointAuthMethod) && tokenEndpointAuthSigningAlg.equals(other.tokenEndpointAuthSigningAlg) && tokenEndpointJwtcaAudFormat.equals(other.tokenEndpointJwtcaAudFormat); @@ -621,6 +631,7 @@ public int hashCode() { this.passwordOptions, this.assertionDecryptionSettings, this.idTokenSignedResponseAlgs, + this.dpopSigningAlg, this.tokenEndpointAuthMethod, this.tokenEndpointAuthSigningAlg, this.tokenEndpointJwtcaAudFormat); @@ -708,6 +719,8 @@ public static final class Builder { private OptionalNullable> idTokenSignedResponseAlgs = OptionalNullable.absent(); + private Optional dpopSigningAlg = Optional.empty(); + private OptionalNullable tokenEndpointAuthMethod = OptionalNullable.absent(); @@ -755,6 +768,7 @@ public Builder from(ConnectionPropertiesOptions other) { passwordOptions(other.getPasswordOptions()); assertionDecryptionSettings(other.getAssertionDecryptionSettings()); idTokenSignedResponseAlgs(other.getIdTokenSignedResponseAlgs()); + dpopSigningAlg(other.getDpopSigningAlg()); tokenEndpointAuthMethod(other.getTokenEndpointAuthMethod()); tokenEndpointAuthSigningAlg(other.getTokenEndpointAuthSigningAlg()); tokenEndpointJwtcaAudFormat(other.getTokenEndpointJwtcaAudFormat()); @@ -1457,6 +1471,17 @@ public Builder idTokenSignedResponseAlgs( return this; } + @JsonSetter(value = "dpop_signing_alg", nulls = Nulls.SKIP) + public Builder dpopSigningAlg(Optional dpopSigningAlg) { + this.dpopSigningAlg = dpopSigningAlg; + return this; + } + + public Builder dpopSigningAlg(ConnectionDpopSigningAlgEnum dpopSigningAlg) { + this.dpopSigningAlg = Optional.ofNullable(dpopSigningAlg); + return this; + } + @JsonSetter(value = "token_endpoint_auth_method", nulls = Nulls.SKIP) public Builder tokenEndpointAuthMethod( @Nullable OptionalNullable tokenEndpointAuthMethod) { @@ -1575,6 +1600,7 @@ public ConnectionPropertiesOptions build() { passwordOptions, assertionDecryptionSettings, idTokenSignedResponseAlgs, + dpopSigningAlg, tokenEndpointAuthMethod, tokenEndpointAuthSigningAlg, tokenEndpointJwtcaAudFormat, diff --git a/src/main/java/com/auth0/client/mgmt/types/CreateRateLimitPolicyRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateRateLimitPolicyRequestContent.java new file mode 100644 index 00000000..57aa519d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateRateLimitPolicyRequestContent.java @@ -0,0 +1,206 @@ +/** + * 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 = CreateRateLimitPolicyRequestContent.Builder.class) +public final class CreateRateLimitPolicyRequestContent { + private final RateLimitPolicyResourceEnum resource; + + private final RateLimitPolicyConsumerEnum consumer; + + private final String consumerSelector; + + private final RateLimitPolicyConfiguration configuration; + + private final Map additionalProperties; + + private CreateRateLimitPolicyRequestContent( + RateLimitPolicyResourceEnum resource, + RateLimitPolicyConsumerEnum consumer, + String consumerSelector, + RateLimitPolicyConfiguration configuration, + Map additionalProperties) { + this.resource = resource; + this.consumer = consumer; + this.consumerSelector = consumerSelector; + this.configuration = configuration; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("resource") + public RateLimitPolicyResourceEnum getResource() { + return resource; + } + + @JsonProperty("consumer") + public RateLimitPolicyConsumerEnum getConsumer() { + return consumer; + } + + /** + * @return Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted. + */ + @JsonProperty("consumer_selector") + public String getConsumerSelector() { + return consumerSelector; + } + + @JsonProperty("configuration") + public RateLimitPolicyConfiguration getConfiguration() { + return configuration; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateRateLimitPolicyRequestContent + && equalTo((CreateRateLimitPolicyRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateRateLimitPolicyRequestContent other) { + return resource.equals(other.resource) + && consumer.equals(other.consumer) + && consumerSelector.equals(other.consumerSelector) + && configuration.equals(other.configuration); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.resource, this.consumer, this.consumerSelector, this.configuration); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ResourceStage builder() { + return new Builder(); + } + + public interface ResourceStage { + ConsumerStage resource(@NotNull RateLimitPolicyResourceEnum resource); + + Builder from(CreateRateLimitPolicyRequestContent other); + } + + public interface ConsumerStage { + ConsumerSelectorStage consumer(@NotNull RateLimitPolicyConsumerEnum consumer); + } + + public interface ConsumerSelectorStage { + /** + *

    Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted.

    + */ + ConfigurationStage consumerSelector(@NotNull String consumerSelector); + } + + public interface ConfigurationStage { + _FinalStage configuration(@NotNull RateLimitPolicyConfiguration configuration); + } + + public interface _FinalStage { + CreateRateLimitPolicyRequestContent build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ResourceStage, ConsumerStage, ConsumerSelectorStage, ConfigurationStage, _FinalStage { + private RateLimitPolicyResourceEnum resource; + + private RateLimitPolicyConsumerEnum consumer; + + private String consumerSelector; + + private RateLimitPolicyConfiguration configuration; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateRateLimitPolicyRequestContent other) { + resource(other.getResource()); + consumer(other.getConsumer()); + consumerSelector(other.getConsumerSelector()); + configuration(other.getConfiguration()); + return this; + } + + @java.lang.Override + @JsonSetter("resource") + public ConsumerStage resource(@NotNull RateLimitPolicyResourceEnum resource) { + this.resource = Objects.requireNonNull(resource, "resource must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("consumer") + public ConsumerSelectorStage consumer(@NotNull RateLimitPolicyConsumerEnum consumer) { + this.consumer = Objects.requireNonNull(consumer, "consumer must not be null"); + return this; + } + + /** + *

    Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted.

    + *

    Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("consumer_selector") + public ConfigurationStage consumerSelector(@NotNull String consumerSelector) { + this.consumerSelector = Objects.requireNonNull(consumerSelector, "consumerSelector must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("configuration") + public _FinalStage configuration(@NotNull RateLimitPolicyConfiguration configuration) { + this.configuration = Objects.requireNonNull(configuration, "configuration must not be null"); + return this; + } + + @java.lang.Override + public CreateRateLimitPolicyRequestContent build() { + return new CreateRateLimitPolicyRequestContent( + resource, consumer, consumerSelector, configuration, 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/CreateRateLimitPolicyResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateRateLimitPolicyResponseContent.java new file mode 100644 index 00000000..ddd2b739 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/CreateRateLimitPolicyResponseContent.java @@ -0,0 +1,344 @@ +/** + * 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.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateRateLimitPolicyResponseContent.Builder.class) +public final class CreateRateLimitPolicyResponseContent { + private final String id; + + private final RateLimitPolicyResourceEnum resource; + + private final RateLimitPolicyConsumerEnum consumer; + + private final String consumerSelector; + + private final RateLimitPolicyConfiguration configuration; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private CreateRateLimitPolicyResponseContent( + String id, + RateLimitPolicyResourceEnum resource, + RateLimitPolicyConsumerEnum consumer, + String consumerSelector, + RateLimitPolicyConfiguration configuration, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.resource = resource; + this.consumer = consumer; + this.consumerSelector = consumerSelector; + this.configuration = configuration; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return Unique identifier for the Rate Limit Policy. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("resource") + public RateLimitPolicyResourceEnum getResource() { + return resource; + } + + @JsonProperty("consumer") + public RateLimitPolicyConsumerEnum getConsumer() { + return consumer; + } + + /** + * @return Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted. + */ + @JsonProperty("consumer_selector") + public String getConsumerSelector() { + return consumerSelector; + } + + @JsonProperty("configuration") + public RateLimitPolicyConfiguration getConfiguration() { + return configuration; + } + + /** + * @return The date and time when the rate limit policy was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The date and time when the rate limit policy was last updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateRateLimitPolicyResponseContent + && equalTo((CreateRateLimitPolicyResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateRateLimitPolicyResponseContent other) { + return id.equals(other.id) + && resource.equals(other.resource) + && consumer.equals(other.consumer) + && consumerSelector.equals(other.consumerSelector) + && configuration.equals(other.configuration) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.resource, + this.consumer, + this.consumerSelector, + this.configuration, + this.createdAt, + this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

    Unique identifier for the Rate Limit Policy.

    + */ + ResourceStage id(@NotNull String id); + + Builder from(CreateRateLimitPolicyResponseContent other); + } + + public interface ResourceStage { + ConsumerStage resource(@NotNull RateLimitPolicyResourceEnum resource); + } + + public interface ConsumerStage { + ConsumerSelectorStage consumer(@NotNull RateLimitPolicyConsumerEnum consumer); + } + + public interface ConsumerSelectorStage { + /** + *

    Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted.

    + */ + ConfigurationStage consumerSelector(@NotNull String consumerSelector); + } + + public interface ConfigurationStage { + _FinalStage configuration(@NotNull RateLimitPolicyConfiguration configuration); + } + + public interface _FinalStage { + CreateRateLimitPolicyResponseContent build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

    The date and time when the rate limit policy was created.

    + */ + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + + /** + *

    The date and time when the rate limit policy was last updated.

    + */ + _FinalStage updatedAt(Optional updatedAt); + + _FinalStage updatedAt(OffsetDateTime updatedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, ResourceStage, ConsumerStage, ConsumerSelectorStage, ConfigurationStage, _FinalStage { + private String id; + + private RateLimitPolicyResourceEnum resource; + + private RateLimitPolicyConsumerEnum consumer; + + private String consumerSelector; + + private RateLimitPolicyConfiguration configuration; + + private Optional updatedAt = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateRateLimitPolicyResponseContent other) { + id(other.getId()); + resource(other.getResource()); + consumer(other.getConsumer()); + consumerSelector(other.getConsumerSelector()); + configuration(other.getConfiguration()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + /** + *

    Unique identifier for the Rate Limit Policy.

    + *

    Unique identifier for the Rate Limit Policy.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public ResourceStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("resource") + public ConsumerStage resource(@NotNull RateLimitPolicyResourceEnum resource) { + this.resource = Objects.requireNonNull(resource, "resource must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("consumer") + public ConsumerSelectorStage consumer(@NotNull RateLimitPolicyConsumerEnum consumer) { + this.consumer = Objects.requireNonNull(consumer, "consumer must not be null"); + return this; + } + + /** + *

    Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted.

    + *

    Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted.

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

    The date and time when the rate limit policy was last updated.

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

    The date and time when the rate limit policy was last updated.

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

    The date and time when the rate limit policy was created.

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

    The date and time when the rate limit policy was created.

    + */ + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + public CreateRateLimitPolicyResponseContent build() { + return new CreateRateLimitPolicyResponseContent( + id, + resource, + consumer, + consumerSelector, + configuration, + createdAt, + updatedAt, + 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/CreateUserResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/CreateUserResponseContent.java index 658d3416..8208679d 100644 --- a/src/main/java/com/auth0/client/mgmt/types/CreateUserResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/CreateUserResponseContent.java @@ -51,10 +51,14 @@ public final class CreateUserResponseContent { private final Optional> multifactor; + private final Optional multifactorLastModified; + private final Optional lastIp; private final Optional lastLogin; + private final Optional lastPasswordReset; + private final Optional loginsCount; private final Optional blocked; @@ -81,8 +85,10 @@ private CreateUserResponseContent( Optional name, Optional nickname, Optional> multifactor, + Optional multifactorLastModified, Optional lastIp, Optional lastLogin, + Optional lastPasswordReset, Optional loginsCount, Optional blocked, Optional givenName, @@ -103,8 +109,10 @@ private CreateUserResponseContent( this.name = name; this.nickname = nickname; this.multifactor = multifactor; + this.multifactorLastModified = multifactorLastModified; this.lastIp = lastIp; this.lastLogin = lastLogin; + this.lastPasswordReset = lastPasswordReset; this.loginsCount = loginsCount; this.blocked = blocked; this.givenName = givenName; @@ -220,6 +228,11 @@ public Optional> getMultifactor() { return multifactor; } + @JsonProperty("multifactor_last_modified") + public Optional getMultifactorLastModified() { + return multifactorLastModified; + } + /** * @return Last IP address from which this user logged in. */ @@ -233,6 +246,11 @@ public Optional getLastLogin() { return lastLogin; } + @JsonProperty("last_password_reset") + public Optional getLastPasswordReset() { + return lastPasswordReset; + } + /** * @return Total number of logins this user has performed. */ @@ -292,8 +310,10 @@ private boolean equalTo(CreateUserResponseContent other) { && name.equals(other.name) && nickname.equals(other.nickname) && multifactor.equals(other.multifactor) + && multifactorLastModified.equals(other.multifactorLastModified) && lastIp.equals(other.lastIp) && lastLogin.equals(other.lastLogin) + && lastPasswordReset.equals(other.lastPasswordReset) && loginsCount.equals(other.loginsCount) && blocked.equals(other.blocked) && givenName.equals(other.givenName) @@ -318,8 +338,10 @@ public int hashCode() { this.name, this.nickname, this.multifactor, + this.multifactorLastModified, this.lastIp, this.lastLogin, + this.lastPasswordReset, this.loginsCount, this.blocked, this.givenName, @@ -367,10 +389,14 @@ public static final class Builder { private Optional> multifactor = Optional.empty(); + private Optional multifactorLastModified = Optional.empty(); + private Optional lastIp = Optional.empty(); private Optional lastLogin = Optional.empty(); + private Optional lastPasswordReset = Optional.empty(); + private Optional loginsCount = Optional.empty(); private Optional blocked = Optional.empty(); @@ -400,8 +426,10 @@ public Builder from(CreateUserResponseContent other) { name(other.getName()); nickname(other.getNickname()); multifactor(other.getMultifactor()); + multifactorLastModified(other.getMultifactorLastModified()); lastIp(other.getLastIp()); lastLogin(other.getLastLogin()); + lastPasswordReset(other.getLastPasswordReset()); loginsCount(other.getLoginsCount()); blocked(other.getBlocked()); givenName(other.getGivenName()); @@ -607,6 +635,17 @@ public Builder multifactor(List multifactor) { return this; } + @JsonSetter(value = "multifactor_last_modified", nulls = Nulls.SKIP) + public Builder multifactorLastModified(Optional multifactorLastModified) { + this.multifactorLastModified = multifactorLastModified; + return this; + } + + public Builder multifactorLastModified(UserDateSchema multifactorLastModified) { + this.multifactorLastModified = Optional.ofNullable(multifactorLastModified); + return this; + } + /** *

    Last IP address from which this user logged in.

    */ @@ -632,6 +671,17 @@ public Builder lastLogin(UserDateSchema lastLogin) { return this; } + @JsonSetter(value = "last_password_reset", nulls = Nulls.SKIP) + public Builder lastPasswordReset(Optional lastPasswordReset) { + this.lastPasswordReset = lastPasswordReset; + return this; + } + + public Builder lastPasswordReset(UserDateSchema lastPasswordReset) { + this.lastPasswordReset = Optional.ofNullable(lastPasswordReset); + return this; + } + /** *

    Total number of logins this user has performed.

    */ @@ -705,8 +755,10 @@ public CreateUserResponseContent build() { name, nickname, multifactor, + multifactorLastModified, lastIp, lastLogin, + lastPasswordReset, loginsCount, blocked, givenName, diff --git a/src/main/java/com/auth0/client/mgmt/types/GetRateLimitPolicyResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetRateLimitPolicyResponseContent.java new file mode 100644 index 00000000..fc4fa4f3 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/GetRateLimitPolicyResponseContent.java @@ -0,0 +1,343 @@ +/** + * 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.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetRateLimitPolicyResponseContent.Builder.class) +public final class GetRateLimitPolicyResponseContent { + private final String id; + + private final RateLimitPolicyResourceEnum resource; + + private final RateLimitPolicyConsumerEnum consumer; + + private final String consumerSelector; + + private final RateLimitPolicyConfiguration configuration; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private GetRateLimitPolicyResponseContent( + String id, + RateLimitPolicyResourceEnum resource, + RateLimitPolicyConsumerEnum consumer, + String consumerSelector, + RateLimitPolicyConfiguration configuration, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.resource = resource; + this.consumer = consumer; + this.consumerSelector = consumerSelector; + this.configuration = configuration; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return Unique identifier for the Rate Limit Policy. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("resource") + public RateLimitPolicyResourceEnum getResource() { + return resource; + } + + @JsonProperty("consumer") + public RateLimitPolicyConsumerEnum getConsumer() { + return consumer; + } + + /** + * @return Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted. + */ + @JsonProperty("consumer_selector") + public String getConsumerSelector() { + return consumerSelector; + } + + @JsonProperty("configuration") + public RateLimitPolicyConfiguration getConfiguration() { + return configuration; + } + + /** + * @return The date and time when the rate limit policy was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The date and time when the rate limit policy was last updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetRateLimitPolicyResponseContent && equalTo((GetRateLimitPolicyResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetRateLimitPolicyResponseContent other) { + return id.equals(other.id) + && resource.equals(other.resource) + && consumer.equals(other.consumer) + && consumerSelector.equals(other.consumerSelector) + && configuration.equals(other.configuration) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.resource, + this.consumer, + this.consumerSelector, + this.configuration, + this.createdAt, + this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

    Unique identifier for the Rate Limit Policy.

    + */ + ResourceStage id(@NotNull String id); + + Builder from(GetRateLimitPolicyResponseContent other); + } + + public interface ResourceStage { + ConsumerStage resource(@NotNull RateLimitPolicyResourceEnum resource); + } + + public interface ConsumerStage { + ConsumerSelectorStage consumer(@NotNull RateLimitPolicyConsumerEnum consumer); + } + + public interface ConsumerSelectorStage { + /** + *

    Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted.

    + */ + ConfigurationStage consumerSelector(@NotNull String consumerSelector); + } + + public interface ConfigurationStage { + _FinalStage configuration(@NotNull RateLimitPolicyConfiguration configuration); + } + + public interface _FinalStage { + GetRateLimitPolicyResponseContent build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

    The date and time when the rate limit policy was created.

    + */ + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + + /** + *

    The date and time when the rate limit policy was last updated.

    + */ + _FinalStage updatedAt(Optional updatedAt); + + _FinalStage updatedAt(OffsetDateTime updatedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, ResourceStage, ConsumerStage, ConsumerSelectorStage, ConfigurationStage, _FinalStage { + private String id; + + private RateLimitPolicyResourceEnum resource; + + private RateLimitPolicyConsumerEnum consumer; + + private String consumerSelector; + + private RateLimitPolicyConfiguration configuration; + + private Optional updatedAt = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetRateLimitPolicyResponseContent other) { + id(other.getId()); + resource(other.getResource()); + consumer(other.getConsumer()); + consumerSelector(other.getConsumerSelector()); + configuration(other.getConfiguration()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + /** + *

    Unique identifier for the Rate Limit Policy.

    + *

    Unique identifier for the Rate Limit Policy.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public ResourceStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("resource") + public ConsumerStage resource(@NotNull RateLimitPolicyResourceEnum resource) { + this.resource = Objects.requireNonNull(resource, "resource must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("consumer") + public ConsumerSelectorStage consumer(@NotNull RateLimitPolicyConsumerEnum consumer) { + this.consumer = Objects.requireNonNull(consumer, "consumer must not be null"); + return this; + } + + /** + *

    Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted.

    + *

    Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted.

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

    The date and time when the rate limit policy was last updated.

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

    The date and time when the rate limit policy was last updated.

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

    The date and time when the rate limit policy was created.

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

    The date and time when the rate limit policy was created.

    + */ + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + public GetRateLimitPolicyResponseContent build() { + return new GetRateLimitPolicyResponseContent( + id, + resource, + consumer, + consumerSelector, + configuration, + createdAt, + updatedAt, + 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/GetUserResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/GetUserResponseContent.java index a9176af1..c5b56d9a 100644 --- a/src/main/java/com/auth0/client/mgmt/types/GetUserResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/GetUserResponseContent.java @@ -51,10 +51,14 @@ public final class GetUserResponseContent { private final Optional> multifactor; + private final Optional multifactorLastModified; + private final Optional lastIp; private final Optional lastLogin; + private final Optional lastPasswordReset; + private final Optional loginsCount; private final Optional blocked; @@ -81,8 +85,10 @@ private GetUserResponseContent( Optional name, Optional nickname, Optional> multifactor, + Optional multifactorLastModified, Optional lastIp, Optional lastLogin, + Optional lastPasswordReset, Optional loginsCount, Optional blocked, Optional givenName, @@ -103,8 +109,10 @@ private GetUserResponseContent( this.name = name; this.nickname = nickname; this.multifactor = multifactor; + this.multifactorLastModified = multifactorLastModified; this.lastIp = lastIp; this.lastLogin = lastLogin; + this.lastPasswordReset = lastPasswordReset; this.loginsCount = loginsCount; this.blocked = blocked; this.givenName = givenName; @@ -220,6 +228,11 @@ public Optional> getMultifactor() { return multifactor; } + @JsonProperty("multifactor_last_modified") + public Optional getMultifactorLastModified() { + return multifactorLastModified; + } + /** * @return Last IP address from which this user logged in. */ @@ -233,6 +246,11 @@ public Optional getLastLogin() { return lastLogin; } + @JsonProperty("last_password_reset") + public Optional getLastPasswordReset() { + return lastPasswordReset; + } + /** * @return Total number of logins this user has performed. */ @@ -292,8 +310,10 @@ private boolean equalTo(GetUserResponseContent other) { && name.equals(other.name) && nickname.equals(other.nickname) && multifactor.equals(other.multifactor) + && multifactorLastModified.equals(other.multifactorLastModified) && lastIp.equals(other.lastIp) && lastLogin.equals(other.lastLogin) + && lastPasswordReset.equals(other.lastPasswordReset) && loginsCount.equals(other.loginsCount) && blocked.equals(other.blocked) && givenName.equals(other.givenName) @@ -318,8 +338,10 @@ public int hashCode() { this.name, this.nickname, this.multifactor, + this.multifactorLastModified, this.lastIp, this.lastLogin, + this.lastPasswordReset, this.loginsCount, this.blocked, this.givenName, @@ -367,10 +389,14 @@ public static final class Builder { private Optional> multifactor = Optional.empty(); + private Optional multifactorLastModified = Optional.empty(); + private Optional lastIp = Optional.empty(); private Optional lastLogin = Optional.empty(); + private Optional lastPasswordReset = Optional.empty(); + private Optional loginsCount = Optional.empty(); private Optional blocked = Optional.empty(); @@ -400,8 +426,10 @@ public Builder from(GetUserResponseContent other) { name(other.getName()); nickname(other.getNickname()); multifactor(other.getMultifactor()); + multifactorLastModified(other.getMultifactorLastModified()); lastIp(other.getLastIp()); lastLogin(other.getLastLogin()); + lastPasswordReset(other.getLastPasswordReset()); loginsCount(other.getLoginsCount()); blocked(other.getBlocked()); givenName(other.getGivenName()); @@ -607,6 +635,17 @@ public Builder multifactor(List multifactor) { return this; } + @JsonSetter(value = "multifactor_last_modified", nulls = Nulls.SKIP) + public Builder multifactorLastModified(Optional multifactorLastModified) { + this.multifactorLastModified = multifactorLastModified; + return this; + } + + public Builder multifactorLastModified(UserDateSchema multifactorLastModified) { + this.multifactorLastModified = Optional.ofNullable(multifactorLastModified); + return this; + } + /** *

    Last IP address from which this user logged in.

    */ @@ -632,6 +671,17 @@ public Builder lastLogin(UserDateSchema lastLogin) { return this; } + @JsonSetter(value = "last_password_reset", nulls = Nulls.SKIP) + public Builder lastPasswordReset(Optional lastPasswordReset) { + this.lastPasswordReset = lastPasswordReset; + return this; + } + + public Builder lastPasswordReset(UserDateSchema lastPasswordReset) { + this.lastPasswordReset = Optional.ofNullable(lastPasswordReset); + return this; + } + /** *

    Total number of logins this user has performed.

    */ @@ -705,8 +755,10 @@ public GetUserResponseContent build() { name, nickname, multifactor, + multifactorLastModified, lastIp, lastLogin, + lastPasswordReset, loginsCount, blocked, givenName, diff --git a/src/main/java/com/auth0/client/mgmt/types/ListGroupRolesResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListGroupRolesResponseContent.java new file mode 100644 index 00000000..ac06ad81 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListGroupRolesResponseContent.java @@ -0,0 +1,146 @@ +/** + * 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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListGroupRolesResponseContent.Builder.class) +public final class ListGroupRolesResponseContent { + private final List roles; + + private final Optional next; + + private final Map additionalProperties; + + private ListGroupRolesResponseContent( + List roles, Optional next, Map additionalProperties) { + this.roles = roles; + this.next = next; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("roles") + public List getRoles() { + return roles; + } + + /** + * @return A cursor to be used as the "from" query parameter for the next page of results. + */ + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListGroupRolesResponseContent && equalTo((ListGroupRolesResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListGroupRolesResponseContent other) { + return roles.equals(other.roles) && next.equals(other.next); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.roles, this.next); + } + + @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 List roles = new ArrayList<>(); + + private Optional next = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListGroupRolesResponseContent other) { + roles(other.getRoles()); + next(other.getNext()); + return this; + } + + @JsonSetter(value = "roles", nulls = Nulls.SKIP) + public Builder roles(List roles) { + this.roles.clear(); + if (roles != null) { + this.roles.addAll(roles); + } + return this; + } + + public Builder addRoles(Role roles) { + this.roles.add(roles); + return this; + } + + public Builder addAllRoles(List roles) { + if (roles != null) { + this.roles.addAll(roles); + } + 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; + } + + public ListGroupRolesResponseContent build() { + return new ListGroupRolesResponseContent(roles, next, 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/ListRateLimitPoliciesPaginatedResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/ListRateLimitPoliciesPaginatedResponseContent.java new file mode 100644 index 00000000..d2c7151f --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListRateLimitPoliciesPaginatedResponseContent.java @@ -0,0 +1,138 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.auth0.client.mgmt.types; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListRateLimitPoliciesPaginatedResponseContent.Builder.class) +public final class ListRateLimitPoliciesPaginatedResponseContent { + private final Optional> rateLimitPolicies; + + private final Optional next; + + private final Map additionalProperties; + + private ListRateLimitPoliciesPaginatedResponseContent( + Optional> rateLimitPolicies, + Optional next, + Map additionalProperties) { + this.rateLimitPolicies = rateLimitPolicies; + this.next = next; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("rate_limit_policies") + public Optional> getRateLimitPolicies() { + return rateLimitPolicies; + } + + /** + * @return A cursor to be used as the "from" query parameter for the next page of results. + */ + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListRateLimitPoliciesPaginatedResponseContent + && equalTo((ListRateLimitPoliciesPaginatedResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListRateLimitPoliciesPaginatedResponseContent other) { + return rateLimitPolicies.equals(other.rateLimitPolicies) && next.equals(other.next); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.rateLimitPolicies, this.next); + } + + @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> rateLimitPolicies = Optional.empty(); + + private Optional next = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListRateLimitPoliciesPaginatedResponseContent other) { + rateLimitPolicies(other.getRateLimitPolicies()); + next(other.getNext()); + return this; + } + + @JsonSetter(value = "rate_limit_policies", nulls = Nulls.SKIP) + public Builder rateLimitPolicies(Optional> rateLimitPolicies) { + this.rateLimitPolicies = rateLimitPolicies; + return this; + } + + public Builder rateLimitPolicies(List rateLimitPolicies) { + this.rateLimitPolicies = Optional.ofNullable(rateLimitPolicies); + 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; + } + + public ListRateLimitPoliciesPaginatedResponseContent build() { + return new ListRateLimitPoliciesPaginatedResponseContent(rateLimitPolicies, next, 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/ListRateLimitPoliciesRequestParameters.java b/src/main/java/com/auth0/client/mgmt/types/ListRateLimitPoliciesRequestParameters.java new file mode 100644 index 00000000..4cbdca96 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/ListRateLimitPoliciesRequestParameters.java @@ -0,0 +1,352 @@ +/** + * 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +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 = ListRateLimitPoliciesRequestParameters.Builder.class) +public final class ListRateLimitPoliciesRequestParameters { + private final OptionalNullable resource; + + private final OptionalNullable consumer; + + private final OptionalNullable consumerSelector; + + private final OptionalNullable take; + + private final OptionalNullable from; + + private final Map additionalProperties; + + private ListRateLimitPoliciesRequestParameters( + OptionalNullable resource, + OptionalNullable consumer, + OptionalNullable consumerSelector, + OptionalNullable take, + OptionalNullable from, + Map additionalProperties) { + this.resource = resource; + this.consumer = consumer; + this.consumerSelector = consumerSelector; + this.take = take; + this.from = from; + this.additionalProperties = additionalProperties; + } + + /** + * @return The API protected by the Rate Limit Policy. + */ + @JsonIgnore + public OptionalNullable getResource() { + if (resource == null) { + return OptionalNullable.absent(); + } + return resource; + } + + /** + * @return The consumer to which the rate limit policy applies. + */ + @JsonIgnore + public OptionalNullable getConsumer() { + if (consumer == null) { + return OptionalNullable.absent(); + } + return consumer; + } + + /** + * @return Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted. + */ + @JsonIgnore + public OptionalNullable getConsumerSelector() { + if (consumerSelector == null) { + return OptionalNullable.absent(); + } + return consumerSelector; + } + + /** + * @return Number of results per page. Defaults to 50. + */ + @JsonIgnore + public OptionalNullable getTake() { + if (take == null) { + return OptionalNullable.absent(); + } + return take; + } + + /** + * @return Cursor for pagination. + */ + @JsonIgnore + public OptionalNullable getFrom() { + if (from == null) { + return OptionalNullable.absent(); + } + return from; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListRateLimitPoliciesRequestParameters + && equalTo((ListRateLimitPoliciesRequestParameters) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListRateLimitPoliciesRequestParameters other) { + return resource.equals(other.resource) + && consumer.equals(other.consumer) + && consumerSelector.equals(other.consumerSelector) + && take.equals(other.take) + && from.equals(other.from); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.resource, this.consumer, this.consumerSelector, this.take, this.from); + } + + @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 resource = OptionalNullable.absent(); + + private OptionalNullable consumer = OptionalNullable.absent(); + + private OptionalNullable consumerSelector = OptionalNullable.absent(); + + private OptionalNullable take = OptionalNullable.absent(); + + private OptionalNullable from = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListRateLimitPoliciesRequestParameters other) { + resource(other.getResource()); + consumer(other.getConsumer()); + consumerSelector(other.getConsumerSelector()); + take(other.getTake()); + from(other.getFrom()); + return this; + } + + /** + *

    The API protected by the Rate Limit Policy.

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

    The consumer to which the rate limit policy applies.

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

    Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted.

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

    Number of results per page. 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 pagination.

    + */ + @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; + } + + public ListRateLimitPoliciesRequestParameters build() { + return new ListRateLimitPoliciesRequestParameters( + resource, consumer, consumerSelector, take, from, 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 e265ac47..17e5c357 100644 --- a/src/main/java/com/auth0/client/mgmt/types/OauthScope.java +++ b/src/main/java/com/auth0/client/mgmt/types/OauthScope.java @@ -95,9 +95,14 @@ public final class OauthScope { public static final OauthScope DELETE_CLIENTS = new OauthScope(Value.DELETE_CLIENTS, "delete:clients"); + public static final OauthScope DELETE_GROUP_ROLES = new OauthScope(Value.DELETE_GROUP_ROLES, "delete:group_roles"); + public static final OauthScope READ_FLOWS_EXECUTIONS = new OauthScope(Value.READ_FLOWS_EXECUTIONS, "read:flows_executions"); + public static final OauthScope CREATE_RATE_LIMIT_POLICIES = + new OauthScope(Value.CREATE_RATE_LIMIT_POLICIES, "create:rate_limit_policies"); + public static final OauthScope DELETE_AUTHENTICATION_METHODS = new OauthScope(Value.DELETE_AUTHENTICATION_METHODS, "delete:authentication_methods"); @@ -124,6 +129,9 @@ public final class OauthScope { public static final OauthScope CREATE_FLOWS = new OauthScope(Value.CREATE_FLOWS, "create:flows"); + public static final OauthScope UPDATE_RATE_LIMIT_POLICIES = + new OauthScope(Value.UPDATE_RATE_LIMIT_POLICIES, "update:rate_limit_policies"); + public static final OauthScope READ_CUSTOM_SIGNING_KEYS = new OauthScope(Value.READ_CUSTOM_SIGNING_KEYS, "read:custom_signing_keys"); @@ -268,6 +276,8 @@ public final class OauthScope { public static final OauthScope UPDATE_USERS = new OauthScope(Value.UPDATE_USERS, "update:users"); + public static final OauthScope READ_GROUP_ROLES = new OauthScope(Value.READ_GROUP_ROLES, "read:group_roles"); + public static final OauthScope READ_GRANTS = new OauthScope(Value.READ_GRANTS, "read:grants"); public static final OauthScope UPDATE_SIGNING_KEYS = @@ -285,6 +295,9 @@ public final class OauthScope { public static final OauthScope READ_CLIENTS = new OauthScope(Value.READ_CLIENTS, "read:clients"); + public static final OauthScope READ_RATE_LIMIT_POLICIES = + new OauthScope(Value.READ_RATE_LIMIT_POLICIES, "read:rate_limit_policies"); + public static final OauthScope DELETE_GRANTS = new OauthScope(Value.DELETE_GRANTS, "delete:grants"); public static final OauthScope UPDATE_REFRESH_TOKENS = @@ -546,6 +559,8 @@ public final class OauthScope { public static final OauthScope UPDATE_PHONE_TEMPLATES = new OauthScope(Value.UPDATE_PHONE_TEMPLATES, "update:phone_templates"); + public static final OauthScope CREATE_GROUP_ROLES = new OauthScope(Value.CREATE_GROUP_ROLES, "create:group_roles"); + public static final OauthScope READ_GUARDIAN_ENROLLMENTS = new OauthScope(Value.READ_GUARDIAN_ENROLLMENTS, "read:guardian_enrollments"); @@ -575,6 +590,9 @@ public final class OauthScope { public static final OauthScope DELETE_RESOURCE_SERVERS = new OauthScope(Value.DELETE_RESOURCE_SERVERS, "delete:resource_servers"); + public static final OauthScope DELETE_RATE_LIMIT_POLICIES = + new OauthScope(Value.DELETE_RATE_LIMIT_POLICIES, "delete:rate_limit_policies"); + public static final OauthScope READ_RESOURCE_SERVERS = new OauthScope(Value.READ_RESOURCE_SERVERS, "read:resource_servers"); @@ -694,8 +712,12 @@ public T visit(Visitor visitor) { return visitor.visitUpdateScimConfig(); case DELETE_CLIENTS: return visitor.visitDeleteClients(); + case DELETE_GROUP_ROLES: + return visitor.visitDeleteGroupRoles(); case READ_FLOWS_EXECUTIONS: return visitor.visitReadFlowsExecutions(); + case CREATE_RATE_LIMIT_POLICIES: + return visitor.visitCreateRateLimitPolicies(); case DELETE_AUTHENTICATION_METHODS: return visitor.visitDeleteAuthenticationMethods(); case CREATE_CONNECTIONS_KEYS: @@ -716,6 +738,8 @@ public T visit(Visitor visitor) { return visitor.visitUpdateActions(); case CREATE_FLOWS: return visitor.visitCreateFlows(); + case UPDATE_RATE_LIMIT_POLICIES: + return visitor.visitUpdateRateLimitPolicies(); case READ_CUSTOM_SIGNING_KEYS: return visitor.visitReadCustomSigningKeys(); case DELETE_CLIENT_CREDENTIALS: @@ -822,6 +846,8 @@ public T visit(Visitor visitor) { return visitor.visitCreateUserAttributeProfiles(); case UPDATE_USERS: return visitor.visitUpdateUsers(); + case READ_GROUP_ROLES: + return visitor.visitReadGroupRoles(); case READ_GRANTS: return visitor.visitReadGrants(); case UPDATE_SIGNING_KEYS: @@ -836,6 +862,8 @@ public T visit(Visitor visitor) { return visitor.visitUpdateCustomSigningKeys(); case READ_CLIENTS: return visitor.visitReadClients(); + case READ_RATE_LIMIT_POLICIES: + return visitor.visitReadRateLimitPolicies(); case DELETE_GRANTS: return visitor.visitDeleteGrants(); case UPDATE_REFRESH_TOKENS: @@ -1032,6 +1060,8 @@ public T visit(Visitor visitor) { return visitor.visitDeleteEventStreams(); case UPDATE_PHONE_TEMPLATES: return visitor.visitUpdatePhoneTemplates(); + case CREATE_GROUP_ROLES: + return visitor.visitCreateGroupRoles(); case READ_GUARDIAN_ENROLLMENTS: return visitor.visitReadGuardianEnrollments(); case DELETE_FLOWS: @@ -1054,6 +1084,8 @@ public T visit(Visitor visitor) { return visitor.visitUpdateConnectionsKeys(); case DELETE_RESOURCE_SERVERS: return visitor.visitDeleteResourceServers(); + case DELETE_RATE_LIMIT_POLICIES: + return visitor.visitDeleteRateLimitPolicies(); case READ_RESOURCE_SERVERS: return visitor.visitReadResourceServers(); case UPDATE_EVENT_DELIVERIES: @@ -1145,8 +1177,12 @@ public static OauthScope valueOf(String value) { return UPDATE_SCIM_CONFIG; case "delete:clients": return DELETE_CLIENTS; + case "delete:group_roles": + return DELETE_GROUP_ROLES; case "read:flows_executions": return READ_FLOWS_EXECUTIONS; + case "create:rate_limit_policies": + return CREATE_RATE_LIMIT_POLICIES; case "delete:authentication_methods": return DELETE_AUTHENTICATION_METHODS; case "create:connections_keys": @@ -1167,6 +1203,8 @@ public static OauthScope valueOf(String value) { return UPDATE_ACTIONS; case "create:flows": return CREATE_FLOWS; + case "update:rate_limit_policies": + return UPDATE_RATE_LIMIT_POLICIES; case "read:custom_signing_keys": return READ_CUSTOM_SIGNING_KEYS; case "delete:client_credentials": @@ -1273,6 +1311,8 @@ public static OauthScope valueOf(String value) { return CREATE_USER_ATTRIBUTE_PROFILES; case "update:users": return UPDATE_USERS; + case "read:group_roles": + return READ_GROUP_ROLES; case "read:grants": return READ_GRANTS; case "update:signing_keys": @@ -1287,6 +1327,8 @@ public static OauthScope valueOf(String value) { return UPDATE_CUSTOM_SIGNING_KEYS; case "read:clients": return READ_CLIENTS; + case "read:rate_limit_policies": + return READ_RATE_LIMIT_POLICIES; case "delete:grants": return DELETE_GRANTS; case "update:refresh_tokens": @@ -1483,6 +1525,8 @@ public static OauthScope valueOf(String value) { return DELETE_EVENT_STREAMS; case "update:phone_templates": return UPDATE_PHONE_TEMPLATES; + case "create:group_roles": + return CREATE_GROUP_ROLES; case "read:guardian_enrollments": return READ_GUARDIAN_ENROLLMENTS; case "delete:flows": @@ -1505,6 +1549,8 @@ public static OauthScope valueOf(String value) { return UPDATE_CONNECTIONS_KEYS; case "delete:resource_servers": return DELETE_RESOURCE_SERVERS; + case "delete:rate_limit_policies": + return DELETE_RATE_LIMIT_POLICIES; case "read:resource_servers": return READ_RESOURCE_SERVERS; case "update:event_deliveries": @@ -1723,6 +1769,12 @@ public enum Value { READ_GROUP_MEMBERS, + CREATE_GROUP_ROLES, + + READ_GROUP_ROLES, + + DELETE_GROUP_ROLES, + READ_GROUPS, DELETE_GROUPS, @@ -1839,6 +1891,14 @@ public enum Value { UPDATE_PROMPTS, + CREATE_RATE_LIMIT_POLICIES, + + READ_RATE_LIMIT_POLICIES, + + UPDATE_RATE_LIMIT_POLICIES, + + DELETE_RATE_LIMIT_POLICIES, + READ_REFRESH_TOKENS, UPDATE_REFRESH_TOKENS, @@ -2169,6 +2229,12 @@ public interface Visitor { T visitReadGroupMembers(); + T visitCreateGroupRoles(); + + T visitReadGroupRoles(); + + T visitDeleteGroupRoles(); + T visitReadGroups(); T visitDeleteGroups(); @@ -2285,6 +2351,14 @@ public interface Visitor { T visitUpdatePrompts(); + T visitCreateRateLimitPolicies(); + + T visitReadRateLimitPolicies(); + + T visitUpdateRateLimitPolicies(); + + T visitDeleteRateLimitPolicies(); + T visitReadRefreshTokens(); T visitUpdateRefreshTokens(); diff --git a/src/main/java/com/auth0/client/mgmt/types/PatchRateLimitPolicyConfigurationRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/PatchRateLimitPolicyConfigurationRequestContent.java new file mode 100644 index 00000000..dd358df1 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PatchRateLimitPolicyConfigurationRequestContent.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.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Map; +import java.util.Objects; + +@JsonDeserialize(using = PatchRateLimitPolicyConfigurationRequestContent.Deserializer.class) +public final class PatchRateLimitPolicyConfigurationRequestContent { + private final Object value; + + private final int type; + + private PatchRateLimitPolicyConfigurationRequestContent(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((PatchRateLimitPolicyConfigurationRequestContentZero) this.value); + } else if (this.type == 1) { + return visitor.visit((PatchRateLimitPolicyConfigurationRequestContentOne) this.value); + } else if (this.type == 2) { + return visitor.visit((PatchRateLimitPolicyConfigurationRequestContentAction) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchRateLimitPolicyConfigurationRequestContent + && equalTo((PatchRateLimitPolicyConfigurationRequestContent) other); + } + + private boolean equalTo(PatchRateLimitPolicyConfigurationRequestContent other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static PatchRateLimitPolicyConfigurationRequestContent of( + PatchRateLimitPolicyConfigurationRequestContentZero value) { + return new PatchRateLimitPolicyConfigurationRequestContent(value, 0); + } + + public static PatchRateLimitPolicyConfigurationRequestContent of( + PatchRateLimitPolicyConfigurationRequestContentOne value) { + return new PatchRateLimitPolicyConfigurationRequestContent(value, 1); + } + + public static PatchRateLimitPolicyConfigurationRequestContent of( + PatchRateLimitPolicyConfigurationRequestContentAction value) { + return new PatchRateLimitPolicyConfigurationRequestContent(value, 2); + } + + public interface Visitor { + T visit(PatchRateLimitPolicyConfigurationRequestContentZero value); + + T visit(PatchRateLimitPolicyConfigurationRequestContentOne value); + + T visit(PatchRateLimitPolicyConfigurationRequestContentAction value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PatchRateLimitPolicyConfigurationRequestContent.class); + } + + @java.lang.Override + public PatchRateLimitPolicyConfigurationRequestContent deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + if (value instanceof Map && ((Map) value).containsKey("action")) { + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, PatchRateLimitPolicyConfigurationRequestContentZero.class)); + } catch (RuntimeException e) { + } + } + if (value instanceof Map + && ((Map) value).containsKey("action") + && ((Map) value).containsKey("limit")) { + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, PatchRateLimitPolicyConfigurationRequestContentOne.class)); + } catch (RuntimeException e) { + } + } + if (value instanceof Map + && ((Map) value).containsKey("action") + && ((Map) value).containsKey("limit") + && ((Map) value).containsKey("redirect_uri")) { + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, PatchRateLimitPolicyConfigurationRequestContentAction.class)); + } catch (RuntimeException e) { + } + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PatchRateLimitPolicyConfigurationRequestContentAction.java b/src/main/java/com/auth0/client/mgmt/types/PatchRateLimitPolicyConfigurationRequestContentAction.java new file mode 100644 index 00000000..3dc98978 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PatchRateLimitPolicyConfigurationRequestContentAction.java @@ -0,0 +1,201 @@ +/** + * 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 = PatchRateLimitPolicyConfigurationRequestContentAction.Builder.class) +public final class PatchRateLimitPolicyConfigurationRequestContentAction { + private final PatchRateLimitPolicyConfigurationRequestContentActionAction action; + + private final int limit; + + private final String redirectUri; + + private final Map additionalProperties; + + private PatchRateLimitPolicyConfigurationRequestContentAction( + PatchRateLimitPolicyConfigurationRequestContentActionAction action, + int limit, + String redirectUri, + Map additionalProperties) { + this.action = action; + this.limit = limit; + this.redirectUri = redirectUri; + this.additionalProperties = additionalProperties; + } + + /** + * @return Determines the action to take when the rate limit is exceeded. + */ + @JsonProperty("action") + public PatchRateLimitPolicyConfigurationRequestContentActionAction getAction() { + return action; + } + + /** + * @return The maximum number of requests allowed in a single refresh window. + */ + @JsonProperty("limit") + public int getLimit() { + return limit; + } + + /** + * @return The HTTPS URI to redirect to when the rate limit is exceeded. + */ + @JsonProperty("redirect_uri") + public String getRedirectUri() { + return redirectUri; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchRateLimitPolicyConfigurationRequestContentAction + && equalTo((PatchRateLimitPolicyConfigurationRequestContentAction) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchRateLimitPolicyConfigurationRequestContentAction other) { + return action.equals(other.action) && limit == other.limit && redirectUri.equals(other.redirectUri); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.action, this.limit, this.redirectUri); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionStage builder() { + return new Builder(); + } + + public interface ActionStage { + /** + *

    Determines the action to take when the rate limit is exceeded.

    + */ + LimitStage action(@NotNull PatchRateLimitPolicyConfigurationRequestContentActionAction action); + + Builder from(PatchRateLimitPolicyConfigurationRequestContentAction other); + } + + public interface LimitStage { + /** + *

    The maximum number of requests allowed in a single refresh window.

    + */ + RedirectUriStage limit(int limit); + } + + public interface RedirectUriStage { + /** + *

    The HTTPS URI to redirect to when the rate limit is exceeded.

    + */ + _FinalStage redirectUri(@NotNull String redirectUri); + } + + public interface _FinalStage { + PatchRateLimitPolicyConfigurationRequestContentAction build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionStage, LimitStage, RedirectUriStage, _FinalStage { + private PatchRateLimitPolicyConfigurationRequestContentActionAction action; + + private int limit; + + private String redirectUri; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PatchRateLimitPolicyConfigurationRequestContentAction other) { + action(other.getAction()); + limit(other.getLimit()); + redirectUri(other.getRedirectUri()); + return this; + } + + /** + *

    Determines the action to take when the rate limit is exceeded.

    + *

    Determines the action to take when the rate limit is exceeded.

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

    The maximum number of requests allowed in a single refresh window.

    + *

    The maximum number of requests allowed in a single refresh window.

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

    The HTTPS URI to redirect to when the rate limit is exceeded.

    + *

    The HTTPS URI to redirect to when the rate limit is exceeded.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("redirect_uri") + public _FinalStage redirectUri(@NotNull String redirectUri) { + this.redirectUri = Objects.requireNonNull(redirectUri, "redirectUri must not be null"); + return this; + } + + @java.lang.Override + public PatchRateLimitPolicyConfigurationRequestContentAction build() { + return new PatchRateLimitPolicyConfigurationRequestContentAction( + action, limit, redirectUri, 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/PatchRateLimitPolicyConfigurationRequestContentActionAction.java b/src/main/java/com/auth0/client/mgmt/types/PatchRateLimitPolicyConfigurationRequestContentActionAction.java new file mode 100644 index 00000000..37ec13f6 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PatchRateLimitPolicyConfigurationRequestContentActionAction.java @@ -0,0 +1,76 @@ +/** + * 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 PatchRateLimitPolicyConfigurationRequestContentActionAction { + public static final PatchRateLimitPolicyConfigurationRequestContentActionAction REDIRECT = + new PatchRateLimitPolicyConfigurationRequestContentActionAction(Value.REDIRECT, "redirect"); + + private final Value value; + + private final String string; + + PatchRateLimitPolicyConfigurationRequestContentActionAction(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 PatchRateLimitPolicyConfigurationRequestContentActionAction + && this.string.equals( + ((PatchRateLimitPolicyConfigurationRequestContentActionAction) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case REDIRECT: + return visitor.visitRedirect(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static PatchRateLimitPolicyConfigurationRequestContentActionAction valueOf(String value) { + switch (value) { + case "redirect": + return REDIRECT; + default: + return new PatchRateLimitPolicyConfigurationRequestContentActionAction(Value.UNKNOWN, value); + } + } + + public enum Value { + REDIRECT, + + UNKNOWN + } + + public interface Visitor { + T visitRedirect(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PatchRateLimitPolicyConfigurationRequestContentOne.java b/src/main/java/com/auth0/client/mgmt/types/PatchRateLimitPolicyConfigurationRequestContentOne.java new file mode 100644 index 00000000..820af226 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PatchRateLimitPolicyConfigurationRequestContentOne.java @@ -0,0 +1,166 @@ +/** + * 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 = PatchRateLimitPolicyConfigurationRequestContentOne.Builder.class) +public final class PatchRateLimitPolicyConfigurationRequestContentOne { + private final PatchRateLimitPolicyConfigurationRequestContentOneAction action; + + private final int limit; + + private final Map additionalProperties; + + private PatchRateLimitPolicyConfigurationRequestContentOne( + PatchRateLimitPolicyConfigurationRequestContentOneAction action, + int limit, + Map additionalProperties) { + this.action = action; + this.limit = limit; + this.additionalProperties = additionalProperties; + } + + /** + * @return Determines the action to take when the rate limit is exceeded. + */ + @JsonProperty("action") + public PatchRateLimitPolicyConfigurationRequestContentOneAction getAction() { + return action; + } + + /** + * @return The maximum number of requests allowed in a single refresh window. + */ + @JsonProperty("limit") + public int getLimit() { + return limit; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchRateLimitPolicyConfigurationRequestContentOne + && equalTo((PatchRateLimitPolicyConfigurationRequestContentOne) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchRateLimitPolicyConfigurationRequestContentOne other) { + return action.equals(other.action) && limit == other.limit; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.action, this.limit); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionStage builder() { + return new Builder(); + } + + public interface ActionStage { + /** + *

    Determines the action to take when the rate limit is exceeded.

    + */ + LimitStage action(@NotNull PatchRateLimitPolicyConfigurationRequestContentOneAction action); + + Builder from(PatchRateLimitPolicyConfigurationRequestContentOne other); + } + + public interface LimitStage { + /** + *

    The maximum number of requests allowed in a single refresh window.

    + */ + _FinalStage limit(int limit); + } + + public interface _FinalStage { + PatchRateLimitPolicyConfigurationRequestContentOne build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionStage, LimitStage, _FinalStage { + private PatchRateLimitPolicyConfigurationRequestContentOneAction action; + + private int limit; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PatchRateLimitPolicyConfigurationRequestContentOne other) { + action(other.getAction()); + limit(other.getLimit()); + return this; + } + + /** + *

    Determines the action to take when the rate limit is exceeded.

    + *

    Determines the action to take when the rate limit is exceeded.

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

    The maximum number of requests allowed in a single refresh window.

    + *

    The maximum number of requests allowed in a single refresh window.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("limit") + public _FinalStage limit(int limit) { + this.limit = limit; + return this; + } + + @java.lang.Override + public PatchRateLimitPolicyConfigurationRequestContentOne build() { + return new PatchRateLimitPolicyConfigurationRequestContentOne(action, limit, 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/PatchRateLimitPolicyConfigurationRequestContentOneAction.java b/src/main/java/com/auth0/client/mgmt/types/PatchRateLimitPolicyConfigurationRequestContentOneAction.java new file mode 100644 index 00000000..fbf9c65c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PatchRateLimitPolicyConfigurationRequestContentOneAction.java @@ -0,0 +1,87 @@ +/** + * 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 PatchRateLimitPolicyConfigurationRequestContentOneAction { + public static final PatchRateLimitPolicyConfigurationRequestContentOneAction BLOCK = + new PatchRateLimitPolicyConfigurationRequestContentOneAction(Value.BLOCK, "block"); + + public static final PatchRateLimitPolicyConfigurationRequestContentOneAction LOG = + new PatchRateLimitPolicyConfigurationRequestContentOneAction(Value.LOG, "log"); + + private final Value value; + + private final String string; + + PatchRateLimitPolicyConfigurationRequestContentOneAction(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 PatchRateLimitPolicyConfigurationRequestContentOneAction + && this.string.equals( + ((PatchRateLimitPolicyConfigurationRequestContentOneAction) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case BLOCK: + return visitor.visitBlock(); + case LOG: + return visitor.visitLog(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static PatchRateLimitPolicyConfigurationRequestContentOneAction valueOf(String value) { + switch (value) { + case "block": + return BLOCK; + case "log": + return LOG; + default: + return new PatchRateLimitPolicyConfigurationRequestContentOneAction(Value.UNKNOWN, value); + } + } + + public enum Value { + BLOCK, + + LOG, + + UNKNOWN + } + + public interface Visitor { + T visitBlock(); + + T visitLog(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PatchRateLimitPolicyConfigurationRequestContentZero.java b/src/main/java/com/auth0/client/mgmt/types/PatchRateLimitPolicyConfigurationRequestContentZero.java new file mode 100644 index 00000000..b018d3ed --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PatchRateLimitPolicyConfigurationRequestContentZero.java @@ -0,0 +1,132 @@ +/** + * 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 = PatchRateLimitPolicyConfigurationRequestContentZero.Builder.class) +public final class PatchRateLimitPolicyConfigurationRequestContentZero { + private final PatchRateLimitPolicyConfigurationRequestContentZeroAction action; + + private final Map additionalProperties; + + private PatchRateLimitPolicyConfigurationRequestContentZero( + PatchRateLimitPolicyConfigurationRequestContentZeroAction action, + Map additionalProperties) { + this.action = action; + this.additionalProperties = additionalProperties; + } + + /** + * @return Determines the action to take when the rate limit is exceeded. + */ + @JsonProperty("action") + public PatchRateLimitPolicyConfigurationRequestContentZeroAction getAction() { + return action; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchRateLimitPolicyConfigurationRequestContentZero + && equalTo((PatchRateLimitPolicyConfigurationRequestContentZero) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchRateLimitPolicyConfigurationRequestContentZero other) { + return action.equals(other.action); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.action); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionStage builder() { + return new Builder(); + } + + public interface ActionStage { + /** + *

    Determines the action to take when the rate limit is exceeded.

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

    Determines the action to take when the rate limit is exceeded.

    + *

    Determines the action to take when the rate limit is exceeded.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action") + public _FinalStage action(@NotNull PatchRateLimitPolicyConfigurationRequestContentZeroAction action) { + this.action = Objects.requireNonNull(action, "action must not be null"); + return this; + } + + @java.lang.Override + public PatchRateLimitPolicyConfigurationRequestContentZero build() { + return new PatchRateLimitPolicyConfigurationRequestContentZero(action, 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/PatchRateLimitPolicyConfigurationRequestContentZeroAction.java b/src/main/java/com/auth0/client/mgmt/types/PatchRateLimitPolicyConfigurationRequestContentZeroAction.java new file mode 100644 index 00000000..a1da1de8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PatchRateLimitPolicyConfigurationRequestContentZeroAction.java @@ -0,0 +1,76 @@ +/** + * 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 PatchRateLimitPolicyConfigurationRequestContentZeroAction { + public static final PatchRateLimitPolicyConfigurationRequestContentZeroAction ALLOW = + new PatchRateLimitPolicyConfigurationRequestContentZeroAction(Value.ALLOW, "allow"); + + private final Value value; + + private final String string; + + PatchRateLimitPolicyConfigurationRequestContentZeroAction(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 PatchRateLimitPolicyConfigurationRequestContentZeroAction + && this.string.equals( + ((PatchRateLimitPolicyConfigurationRequestContentZeroAction) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ALLOW: + return visitor.visitAllow(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static PatchRateLimitPolicyConfigurationRequestContentZeroAction valueOf(String value) { + switch (value) { + case "allow": + return ALLOW; + default: + return new PatchRateLimitPolicyConfigurationRequestContentZeroAction(Value.UNKNOWN, value); + } + } + + public enum Value { + ALLOW, + + UNKNOWN + } + + public interface Visitor { + T visitAllow(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/PatchRateLimitPolicyRequestContent.java b/src/main/java/com/auth0/client/mgmt/types/PatchRateLimitPolicyRequestContent.java new file mode 100644 index 00000000..fa661fb2 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/PatchRateLimitPolicyRequestContent.java @@ -0,0 +1,120 @@ +/** + * 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 = PatchRateLimitPolicyRequestContent.Builder.class) +public final class PatchRateLimitPolicyRequestContent { + private final PatchRateLimitPolicyConfigurationRequestContent configuration; + + private final Map additionalProperties; + + private PatchRateLimitPolicyRequestContent( + PatchRateLimitPolicyConfigurationRequestContent configuration, Map additionalProperties) { + this.configuration = configuration; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("configuration") + public PatchRateLimitPolicyConfigurationRequestContent getConfiguration() { + return configuration; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchRateLimitPolicyRequestContent + && equalTo((PatchRateLimitPolicyRequestContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchRateLimitPolicyRequestContent other) { + return configuration.equals(other.configuration); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.configuration); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConfigurationStage builder() { + return new Builder(); + } + + public interface ConfigurationStage { + _FinalStage configuration(@NotNull PatchRateLimitPolicyConfigurationRequestContent configuration); + + Builder from(PatchRateLimitPolicyRequestContent other); + } + + public interface _FinalStage { + PatchRateLimitPolicyRequestContent build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConfigurationStage, _FinalStage { + private PatchRateLimitPolicyConfigurationRequestContent configuration; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PatchRateLimitPolicyRequestContent other) { + configuration(other.getConfiguration()); + return this; + } + + @java.lang.Override + @JsonSetter("configuration") + public _FinalStage configuration(@NotNull PatchRateLimitPolicyConfigurationRequestContent configuration) { + this.configuration = Objects.requireNonNull(configuration, "configuration must not be null"); + return this; + } + + @java.lang.Override + public PatchRateLimitPolicyRequestContent build() { + return new PatchRateLimitPolicyRequestContent(configuration, 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/RateLimitPolicy.java b/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicy.java new file mode 100644 index 00000000..0e0eb85d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicy.java @@ -0,0 +1,343 @@ +/** + * 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.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RateLimitPolicy.Builder.class) +public final class RateLimitPolicy { + private final String id; + + private final RateLimitPolicyResourceEnum resource; + + private final RateLimitPolicyConsumerEnum consumer; + + private final String consumerSelector; + + private final RateLimitPolicyConfiguration configuration; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private RateLimitPolicy( + String id, + RateLimitPolicyResourceEnum resource, + RateLimitPolicyConsumerEnum consumer, + String consumerSelector, + RateLimitPolicyConfiguration configuration, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.resource = resource; + this.consumer = consumer; + this.consumerSelector = consumerSelector; + this.configuration = configuration; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return Unique identifier for the Rate Limit Policy. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("resource") + public RateLimitPolicyResourceEnum getResource() { + return resource; + } + + @JsonProperty("consumer") + public RateLimitPolicyConsumerEnum getConsumer() { + return consumer; + } + + /** + * @return Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted. + */ + @JsonProperty("consumer_selector") + public String getConsumerSelector() { + return consumerSelector; + } + + @JsonProperty("configuration") + public RateLimitPolicyConfiguration getConfiguration() { + return configuration; + } + + /** + * @return The date and time when the rate limit policy was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The date and time when the rate limit policy was last updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RateLimitPolicy && equalTo((RateLimitPolicy) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RateLimitPolicy other) { + return id.equals(other.id) + && resource.equals(other.resource) + && consumer.equals(other.consumer) + && consumerSelector.equals(other.consumerSelector) + && configuration.equals(other.configuration) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.resource, + this.consumer, + this.consumerSelector, + this.configuration, + this.createdAt, + this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

    Unique identifier for the Rate Limit Policy.

    + */ + ResourceStage id(@NotNull String id); + + Builder from(RateLimitPolicy other); + } + + public interface ResourceStage { + ConsumerStage resource(@NotNull RateLimitPolicyResourceEnum resource); + } + + public interface ConsumerStage { + ConsumerSelectorStage consumer(@NotNull RateLimitPolicyConsumerEnum consumer); + } + + public interface ConsumerSelectorStage { + /** + *

    Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted.

    + */ + ConfigurationStage consumerSelector(@NotNull String consumerSelector); + } + + public interface ConfigurationStage { + _FinalStage configuration(@NotNull RateLimitPolicyConfiguration configuration); + } + + public interface _FinalStage { + RateLimitPolicy build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

    The date and time when the rate limit policy was created.

    + */ + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + + /** + *

    The date and time when the rate limit policy was last updated.

    + */ + _FinalStage updatedAt(Optional updatedAt); + + _FinalStage updatedAt(OffsetDateTime updatedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, ResourceStage, ConsumerStage, ConsumerSelectorStage, ConfigurationStage, _FinalStage { + private String id; + + private RateLimitPolicyResourceEnum resource; + + private RateLimitPolicyConsumerEnum consumer; + + private String consumerSelector; + + private RateLimitPolicyConfiguration configuration; + + private Optional updatedAt = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RateLimitPolicy other) { + id(other.getId()); + resource(other.getResource()); + consumer(other.getConsumer()); + consumerSelector(other.getConsumerSelector()); + configuration(other.getConfiguration()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + /** + *

    Unique identifier for the Rate Limit Policy.

    + *

    Unique identifier for the Rate Limit Policy.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public ResourceStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("resource") + public ConsumerStage resource(@NotNull RateLimitPolicyResourceEnum resource) { + this.resource = Objects.requireNonNull(resource, "resource must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("consumer") + public ConsumerSelectorStage consumer(@NotNull RateLimitPolicyConsumerEnum consumer) { + this.consumer = Objects.requireNonNull(consumer, "consumer must not be null"); + return this; + } + + /** + *

    Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted.

    + *

    Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted.

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

    The date and time when the rate limit policy was last updated.

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

    The date and time when the rate limit policy was last updated.

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

    The date and time when the rate limit policy was created.

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

    The date and time when the rate limit policy was created.

    + */ + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + public RateLimitPolicy build() { + return new RateLimitPolicy( + id, + resource, + consumer, + consumerSelector, + configuration, + createdAt, + updatedAt, + 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/RateLimitPolicyConfiguration.java b/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyConfiguration.java new file mode 100644 index 00000000..e7277d5e --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyConfiguration.java @@ -0,0 +1,120 @@ +/** + * 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.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Map; +import java.util.Objects; + +@JsonDeserialize(using = RateLimitPolicyConfiguration.Deserializer.class) +public final class RateLimitPolicyConfiguration { + private final Object value; + + private final int type; + + private RateLimitPolicyConfiguration(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((RateLimitPolicyConfigurationZero) this.value); + } else if (this.type == 1) { + return visitor.visit((RateLimitPolicyConfigurationOne) this.value); + } else if (this.type == 2) { + return visitor.visit((RateLimitPolicyConfigurationAction) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RateLimitPolicyConfiguration && equalTo((RateLimitPolicyConfiguration) other); + } + + private boolean equalTo(RateLimitPolicyConfiguration other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static RateLimitPolicyConfiguration of(RateLimitPolicyConfigurationZero value) { + return new RateLimitPolicyConfiguration(value, 0); + } + + public static RateLimitPolicyConfiguration of(RateLimitPolicyConfigurationOne value) { + return new RateLimitPolicyConfiguration(value, 1); + } + + public static RateLimitPolicyConfiguration of(RateLimitPolicyConfigurationAction value) { + return new RateLimitPolicyConfiguration(value, 2); + } + + public interface Visitor { + T visit(RateLimitPolicyConfigurationZero value); + + T visit(RateLimitPolicyConfigurationOne value); + + T visit(RateLimitPolicyConfigurationAction value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(RateLimitPolicyConfiguration.class); + } + + @java.lang.Override + public RateLimitPolicyConfiguration deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + if (value instanceof Map && ((Map) value).containsKey("action")) { + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, RateLimitPolicyConfigurationZero.class)); + } catch (RuntimeException e) { + } + } + if (value instanceof Map + && ((Map) value).containsKey("action") + && ((Map) value).containsKey("limit")) { + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, RateLimitPolicyConfigurationOne.class)); + } catch (RuntimeException e) { + } + } + if (value instanceof Map + && ((Map) value).containsKey("action") + && ((Map) value).containsKey("limit") + && ((Map) value).containsKey("redirect_uri")) { + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, RateLimitPolicyConfigurationAction.class)); + } catch (RuntimeException e) { + } + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyConfigurationAction.java b/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyConfigurationAction.java new file mode 100644 index 00000000..1b06ebc0 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyConfigurationAction.java @@ -0,0 +1,200 @@ +/** + * 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 = RateLimitPolicyConfigurationAction.Builder.class) +public final class RateLimitPolicyConfigurationAction { + private final RateLimitPolicyConfigurationActionAction action; + + private final int limit; + + private final String redirectUri; + + private final Map additionalProperties; + + private RateLimitPolicyConfigurationAction( + RateLimitPolicyConfigurationActionAction action, + int limit, + String redirectUri, + Map additionalProperties) { + this.action = action; + this.limit = limit; + this.redirectUri = redirectUri; + this.additionalProperties = additionalProperties; + } + + /** + * @return Determines the action to take when the rate limit is exceeded. + */ + @JsonProperty("action") + public RateLimitPolicyConfigurationActionAction getAction() { + return action; + } + + /** + * @return The maximum number of requests allowed in a single refresh window. + */ + @JsonProperty("limit") + public int getLimit() { + return limit; + } + + /** + * @return The HTTPS URI to redirect to when the rate limit is exceeded. + */ + @JsonProperty("redirect_uri") + public String getRedirectUri() { + return redirectUri; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RateLimitPolicyConfigurationAction + && equalTo((RateLimitPolicyConfigurationAction) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RateLimitPolicyConfigurationAction other) { + return action.equals(other.action) && limit == other.limit && redirectUri.equals(other.redirectUri); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.action, this.limit, this.redirectUri); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionStage builder() { + return new Builder(); + } + + public interface ActionStage { + /** + *

    Determines the action to take when the rate limit is exceeded.

    + */ + LimitStage action(@NotNull RateLimitPolicyConfigurationActionAction action); + + Builder from(RateLimitPolicyConfigurationAction other); + } + + public interface LimitStage { + /** + *

    The maximum number of requests allowed in a single refresh window.

    + */ + RedirectUriStage limit(int limit); + } + + public interface RedirectUriStage { + /** + *

    The HTTPS URI to redirect to when the rate limit is exceeded.

    + */ + _FinalStage redirectUri(@NotNull String redirectUri); + } + + public interface _FinalStage { + RateLimitPolicyConfigurationAction build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionStage, LimitStage, RedirectUriStage, _FinalStage { + private RateLimitPolicyConfigurationActionAction action; + + private int limit; + + private String redirectUri; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RateLimitPolicyConfigurationAction other) { + action(other.getAction()); + limit(other.getLimit()); + redirectUri(other.getRedirectUri()); + return this; + } + + /** + *

    Determines the action to take when the rate limit is exceeded.

    + *

    Determines the action to take when the rate limit is exceeded.

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

    The maximum number of requests allowed in a single refresh window.

    + *

    The maximum number of requests allowed in a single refresh window.

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

    The HTTPS URI to redirect to when the rate limit is exceeded.

    + *

    The HTTPS URI to redirect to when the rate limit is exceeded.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("redirect_uri") + public _FinalStage redirectUri(@NotNull String redirectUri) { + this.redirectUri = Objects.requireNonNull(redirectUri, "redirectUri must not be null"); + return this; + } + + @java.lang.Override + public RateLimitPolicyConfigurationAction build() { + return new RateLimitPolicyConfigurationAction(action, limit, redirectUri, 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/RateLimitPolicyConfigurationActionAction.java b/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyConfigurationActionAction.java new file mode 100644 index 00000000..0ad8fc82 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyConfigurationActionAction.java @@ -0,0 +1,75 @@ +/** + * 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 RateLimitPolicyConfigurationActionAction { + public static final RateLimitPolicyConfigurationActionAction REDIRECT = + new RateLimitPolicyConfigurationActionAction(Value.REDIRECT, "redirect"); + + private final Value value; + + private final String string; + + RateLimitPolicyConfigurationActionAction(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 RateLimitPolicyConfigurationActionAction + && this.string.equals(((RateLimitPolicyConfigurationActionAction) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case REDIRECT: + return visitor.visitRedirect(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static RateLimitPolicyConfigurationActionAction valueOf(String value) { + switch (value) { + case "redirect": + return REDIRECT; + default: + return new RateLimitPolicyConfigurationActionAction(Value.UNKNOWN, value); + } + } + + public enum Value { + REDIRECT, + + UNKNOWN + } + + public interface Visitor { + T visitRedirect(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyConfigurationOne.java b/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyConfigurationOne.java new file mode 100644 index 00000000..c5f79ba8 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyConfigurationOne.java @@ -0,0 +1,163 @@ +/** + * 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 = RateLimitPolicyConfigurationOne.Builder.class) +public final class RateLimitPolicyConfigurationOne { + private final RateLimitPolicyConfigurationOneAction action; + + private final int limit; + + private final Map additionalProperties; + + private RateLimitPolicyConfigurationOne( + RateLimitPolicyConfigurationOneAction action, int limit, Map additionalProperties) { + this.action = action; + this.limit = limit; + this.additionalProperties = additionalProperties; + } + + /** + * @return Determines the action to take when the rate limit is exceeded. + */ + @JsonProperty("action") + public RateLimitPolicyConfigurationOneAction getAction() { + return action; + } + + /** + * @return The maximum number of requests allowed in a single refresh window. + */ + @JsonProperty("limit") + public int getLimit() { + return limit; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RateLimitPolicyConfigurationOne && equalTo((RateLimitPolicyConfigurationOne) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RateLimitPolicyConfigurationOne other) { + return action.equals(other.action) && limit == other.limit; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.action, this.limit); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionStage builder() { + return new Builder(); + } + + public interface ActionStage { + /** + *

    Determines the action to take when the rate limit is exceeded.

    + */ + LimitStage action(@NotNull RateLimitPolicyConfigurationOneAction action); + + Builder from(RateLimitPolicyConfigurationOne other); + } + + public interface LimitStage { + /** + *

    The maximum number of requests allowed in a single refresh window.

    + */ + _FinalStage limit(int limit); + } + + public interface _FinalStage { + RateLimitPolicyConfigurationOne build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionStage, LimitStage, _FinalStage { + private RateLimitPolicyConfigurationOneAction action; + + private int limit; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RateLimitPolicyConfigurationOne other) { + action(other.getAction()); + limit(other.getLimit()); + return this; + } + + /** + *

    Determines the action to take when the rate limit is exceeded.

    + *

    Determines the action to take when the rate limit is exceeded.

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

    The maximum number of requests allowed in a single refresh window.

    + *

    The maximum number of requests allowed in a single refresh window.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("limit") + public _FinalStage limit(int limit) { + this.limit = limit; + return this; + } + + @java.lang.Override + public RateLimitPolicyConfigurationOne build() { + return new RateLimitPolicyConfigurationOne(action, limit, 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/RateLimitPolicyConfigurationOneAction.java b/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyConfigurationOneAction.java new file mode 100644 index 00000000..7a46eb1c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyConfigurationOneAction.java @@ -0,0 +1,86 @@ +/** + * 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 RateLimitPolicyConfigurationOneAction { + public static final RateLimitPolicyConfigurationOneAction BLOCK = + new RateLimitPolicyConfigurationOneAction(Value.BLOCK, "block"); + + public static final RateLimitPolicyConfigurationOneAction LOG = + new RateLimitPolicyConfigurationOneAction(Value.LOG, "log"); + + private final Value value; + + private final String string; + + RateLimitPolicyConfigurationOneAction(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 RateLimitPolicyConfigurationOneAction + && this.string.equals(((RateLimitPolicyConfigurationOneAction) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case BLOCK: + return visitor.visitBlock(); + case LOG: + return visitor.visitLog(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static RateLimitPolicyConfigurationOneAction valueOf(String value) { + switch (value) { + case "block": + return BLOCK; + case "log": + return LOG; + default: + return new RateLimitPolicyConfigurationOneAction(Value.UNKNOWN, value); + } + } + + public enum Value { + BLOCK, + + LOG, + + UNKNOWN + } + + public interface Visitor { + T visitBlock(); + + T visitLog(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyConfigurationZero.java b/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyConfigurationZero.java new file mode 100644 index 00000000..73859b4d --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyConfigurationZero.java @@ -0,0 +1,130 @@ +/** + * 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 = RateLimitPolicyConfigurationZero.Builder.class) +public final class RateLimitPolicyConfigurationZero { + private final RateLimitPolicyConfigurationZeroAction action; + + private final Map additionalProperties; + + private RateLimitPolicyConfigurationZero( + RateLimitPolicyConfigurationZeroAction action, Map additionalProperties) { + this.action = action; + this.additionalProperties = additionalProperties; + } + + /** + * @return Determines the action to take when the rate limit is exceeded. + */ + @JsonProperty("action") + public RateLimitPolicyConfigurationZeroAction getAction() { + return action; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RateLimitPolicyConfigurationZero && equalTo((RateLimitPolicyConfigurationZero) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RateLimitPolicyConfigurationZero other) { + return action.equals(other.action); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.action); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionStage builder() { + return new Builder(); + } + + public interface ActionStage { + /** + *

    Determines the action to take when the rate limit is exceeded.

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

    Determines the action to take when the rate limit is exceeded.

    + *

    Determines the action to take when the rate limit is exceeded.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action") + public _FinalStage action(@NotNull RateLimitPolicyConfigurationZeroAction action) { + this.action = Objects.requireNonNull(action, "action must not be null"); + return this; + } + + @java.lang.Override + public RateLimitPolicyConfigurationZero build() { + return new RateLimitPolicyConfigurationZero(action, 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/RateLimitPolicyConfigurationZeroAction.java b/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyConfigurationZeroAction.java new file mode 100644 index 00000000..21e3095c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyConfigurationZeroAction.java @@ -0,0 +1,75 @@ +/** + * 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 RateLimitPolicyConfigurationZeroAction { + public static final RateLimitPolicyConfigurationZeroAction ALLOW = + new RateLimitPolicyConfigurationZeroAction(Value.ALLOW, "allow"); + + private final Value value; + + private final String string; + + RateLimitPolicyConfigurationZeroAction(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 RateLimitPolicyConfigurationZeroAction + && this.string.equals(((RateLimitPolicyConfigurationZeroAction) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ALLOW: + return visitor.visitAllow(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static RateLimitPolicyConfigurationZeroAction valueOf(String value) { + switch (value) { + case "allow": + return ALLOW; + default: + return new RateLimitPolicyConfigurationZeroAction(Value.UNKNOWN, value); + } + } + + public enum Value { + ALLOW, + + UNKNOWN + } + + public interface Visitor { + T visitAllow(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyConsumerEnum.java b/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyConsumerEnum.java new file mode 100644 index 00000000..cf5dcac7 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyConsumerEnum.java @@ -0,0 +1,74 @@ +/** + * 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 RateLimitPolicyConsumerEnum { + public static final RateLimitPolicyConsumerEnum CLIENT = new RateLimitPolicyConsumerEnum(Value.CLIENT, "client"); + + private final Value value; + + private final String string; + + RateLimitPolicyConsumerEnum(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 RateLimitPolicyConsumerEnum + && this.string.equals(((RateLimitPolicyConsumerEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CLIENT: + return visitor.visitClient(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static RateLimitPolicyConsumerEnum valueOf(String value) { + switch (value) { + case "client": + return CLIENT; + default: + return new RateLimitPolicyConsumerEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + CLIENT, + + UNKNOWN + } + + public interface Visitor { + T visitClient(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyResourceEnum.java b/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyResourceEnum.java new file mode 100644 index 00000000..ee0c762c --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/RateLimitPolicyResourceEnum.java @@ -0,0 +1,75 @@ +/** + * 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 RateLimitPolicyResourceEnum { + public static final RateLimitPolicyResourceEnum OAUTH_AUTHENTICATION_API = + new RateLimitPolicyResourceEnum(Value.OAUTH_AUTHENTICATION_API, "oauth_authentication_api"); + + private final Value value; + + private final String string; + + RateLimitPolicyResourceEnum(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 RateLimitPolicyResourceEnum + && this.string.equals(((RateLimitPolicyResourceEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case OAUTH_AUTHENTICATION_API: + return visitor.visitOauthAuthenticationApi(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static RateLimitPolicyResourceEnum valueOf(String value) { + switch (value) { + case "oauth_authentication_api": + return OAUTH_AUTHENTICATION_API; + default: + return new RateLimitPolicyResourceEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + OAUTH_AUTHENTICATION_API, + + UNKNOWN + } + + public interface Visitor { + T visitOauthAuthenticationApi(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionOptions.java b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionOptions.java index e7599dfc..d9ac9894 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionOptions.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateConnectionOptions.java @@ -91,6 +91,8 @@ public final class UpdateConnectionOptions { private final OptionalNullable> idTokenSignedResponseAlgs; + private final Optional dpopSigningAlg; + private final OptionalNullable tokenEndpointAuthMethod; private final OptionalNullable tokenEndpointAuthSigningAlg; @@ -133,6 +135,7 @@ private UpdateConnectionOptions( Optional passwordOptions, Optional assertionDecryptionSettings, OptionalNullable> idTokenSignedResponseAlgs, + Optional dpopSigningAlg, OptionalNullable tokenEndpointAuthMethod, OptionalNullable tokenEndpointAuthSigningAlg, Optional tokenEndpointJwtcaAudFormat, @@ -170,6 +173,7 @@ private UpdateConnectionOptions( this.passwordOptions = passwordOptions; this.assertionDecryptionSettings = assertionDecryptionSettings; this.idTokenSignedResponseAlgs = idTokenSignedResponseAlgs; + this.dpopSigningAlg = dpopSigningAlg; this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; this.tokenEndpointAuthSigningAlg = tokenEndpointAuthSigningAlg; this.tokenEndpointJwtcaAudFormat = tokenEndpointJwtcaAudFormat; @@ -415,6 +419,11 @@ public OptionalNullable> getIdToken return idTokenSignedResponseAlgs; } + @JsonProperty("dpop_signing_alg") + public Optional getDpopSigningAlg() { + return dpopSigningAlg; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("token_endpoint_auth_method") public OptionalNullable getTokenEndpointAuthMethod() { @@ -580,6 +589,7 @@ private boolean equalTo(UpdateConnectionOptions other) { && passwordOptions.equals(other.passwordOptions) && assertionDecryptionSettings.equals(other.assertionDecryptionSettings) && idTokenSignedResponseAlgs.equals(other.idTokenSignedResponseAlgs) + && dpopSigningAlg.equals(other.dpopSigningAlg) && tokenEndpointAuthMethod.equals(other.tokenEndpointAuthMethod) && tokenEndpointAuthSigningAlg.equals(other.tokenEndpointAuthSigningAlg) && tokenEndpointJwtcaAudFormat.equals(other.tokenEndpointJwtcaAudFormat); @@ -621,6 +631,7 @@ public int hashCode() { this.passwordOptions, this.assertionDecryptionSettings, this.idTokenSignedResponseAlgs, + this.dpopSigningAlg, this.tokenEndpointAuthMethod, this.tokenEndpointAuthSigningAlg, this.tokenEndpointJwtcaAudFormat); @@ -708,6 +719,8 @@ public static final class Builder { private OptionalNullable> idTokenSignedResponseAlgs = OptionalNullable.absent(); + private Optional dpopSigningAlg = Optional.empty(); + private OptionalNullable tokenEndpointAuthMethod = OptionalNullable.absent(); @@ -755,6 +768,7 @@ public Builder from(UpdateConnectionOptions other) { passwordOptions(other.getPasswordOptions()); assertionDecryptionSettings(other.getAssertionDecryptionSettings()); idTokenSignedResponseAlgs(other.getIdTokenSignedResponseAlgs()); + dpopSigningAlg(other.getDpopSigningAlg()); tokenEndpointAuthMethod(other.getTokenEndpointAuthMethod()); tokenEndpointAuthSigningAlg(other.getTokenEndpointAuthSigningAlg()); tokenEndpointJwtcaAudFormat(other.getTokenEndpointJwtcaAudFormat()); @@ -1457,6 +1471,17 @@ public Builder idTokenSignedResponseAlgs( return this; } + @JsonSetter(value = "dpop_signing_alg", nulls = Nulls.SKIP) + public Builder dpopSigningAlg(Optional dpopSigningAlg) { + this.dpopSigningAlg = dpopSigningAlg; + return this; + } + + public Builder dpopSigningAlg(ConnectionDpopSigningAlgEnum dpopSigningAlg) { + this.dpopSigningAlg = Optional.ofNullable(dpopSigningAlg); + return this; + } + @JsonSetter(value = "token_endpoint_auth_method", nulls = Nulls.SKIP) public Builder tokenEndpointAuthMethod( @Nullable OptionalNullable tokenEndpointAuthMethod) { @@ -1575,6 +1600,7 @@ public UpdateConnectionOptions build() { passwordOptions, assertionDecryptionSettings, idTokenSignedResponseAlgs, + dpopSigningAlg, tokenEndpointAuthMethod, tokenEndpointAuthSigningAlg, tokenEndpointJwtcaAudFormat, diff --git a/src/main/java/com/auth0/client/mgmt/types/UpdateRateLimitPolicyResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateRateLimitPolicyResponseContent.java new file mode 100644 index 00000000..3b534755 --- /dev/null +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateRateLimitPolicyResponseContent.java @@ -0,0 +1,344 @@ +/** + * 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.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateRateLimitPolicyResponseContent.Builder.class) +public final class UpdateRateLimitPolicyResponseContent { + private final String id; + + private final RateLimitPolicyResourceEnum resource; + + private final RateLimitPolicyConsumerEnum consumer; + + private final String consumerSelector; + + private final RateLimitPolicyConfiguration configuration; + + private final Optional createdAt; + + private final Optional updatedAt; + + private final Map additionalProperties; + + private UpdateRateLimitPolicyResponseContent( + String id, + RateLimitPolicyResourceEnum resource, + RateLimitPolicyConsumerEnum consumer, + String consumerSelector, + RateLimitPolicyConfiguration configuration, + Optional createdAt, + Optional updatedAt, + Map additionalProperties) { + this.id = id; + this.resource = resource; + this.consumer = consumer; + this.consumerSelector = consumerSelector; + this.configuration = configuration; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return Unique identifier for the Rate Limit Policy. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("resource") + public RateLimitPolicyResourceEnum getResource() { + return resource; + } + + @JsonProperty("consumer") + public RateLimitPolicyConsumerEnum getConsumer() { + return consumer; + } + + /** + * @return Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted. + */ + @JsonProperty("consumer_selector") + public String getConsumerSelector() { + return consumerSelector; + } + + @JsonProperty("configuration") + public RateLimitPolicyConfiguration getConfiguration() { + return configuration; + } + + /** + * @return The date and time when the rate limit policy was created. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The date and time when the rate limit policy was last updated. + */ + @JsonProperty("updated_at") + public Optional getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateRateLimitPolicyResponseContent + && equalTo((UpdateRateLimitPolicyResponseContent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateRateLimitPolicyResponseContent other) { + return id.equals(other.id) + && resource.equals(other.resource) + && consumer.equals(other.consumer) + && consumerSelector.equals(other.consumerSelector) + && configuration.equals(other.configuration) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.resource, + this.consumer, + this.consumerSelector, + this.configuration, + this.createdAt, + this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

    Unique identifier for the Rate Limit Policy.

    + */ + ResourceStage id(@NotNull String id); + + Builder from(UpdateRateLimitPolicyResponseContent other); + } + + public interface ResourceStage { + ConsumerStage resource(@NotNull RateLimitPolicyResourceEnum resource); + } + + public interface ConsumerStage { + ConsumerSelectorStage consumer(@NotNull RateLimitPolicyConsumerEnum consumer); + } + + public interface ConsumerSelectorStage { + /** + *

    Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted.

    + */ + ConfigurationStage consumerSelector(@NotNull String consumerSelector); + } + + public interface ConfigurationStage { + _FinalStage configuration(@NotNull RateLimitPolicyConfiguration configuration); + } + + public interface _FinalStage { + UpdateRateLimitPolicyResponseContent build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

    The date and time when the rate limit policy was created.

    + */ + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + + /** + *

    The date and time when the rate limit policy was last updated.

    + */ + _FinalStage updatedAt(Optional updatedAt); + + _FinalStage updatedAt(OffsetDateTime updatedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, ResourceStage, ConsumerStage, ConsumerSelectorStage, ConfigurationStage, _FinalStage { + private String id; + + private RateLimitPolicyResourceEnum resource; + + private RateLimitPolicyConsumerEnum consumer; + + private String consumerSelector; + + private RateLimitPolicyConfiguration configuration; + + private Optional updatedAt = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdateRateLimitPolicyResponseContent other) { + id(other.getId()); + resource(other.getResource()); + consumer(other.getConsumer()); + consumerSelector(other.getConsumerSelector()); + configuration(other.getConfiguration()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + /** + *

    Unique identifier for the Rate Limit Policy.

    + *

    Unique identifier for the Rate Limit Policy.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public ResourceStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("resource") + public ConsumerStage resource(@NotNull RateLimitPolicyResourceEnum resource) { + this.resource = Objects.requireNonNull(resource, "resource must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("consumer") + public ConsumerSelectorStage consumer(@NotNull RateLimitPolicyConsumerEnum consumer) { + this.consumer = Objects.requireNonNull(consumer, "consumer must not be null"); + return this; + } + + /** + *

    Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted.

    + *

    Identifier or category within the consumer to which the policy applies. Supported values: client_id:<client_id> to target a specific client by ID, client_id:<cimd_uri> to target a CIMD client by URI, cimd_clients to target all CIMD clients, third_party_clients to target all third-party clients, or default to apply the policy to any consumer identifier not otherwise explicitly targeted.

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

    The date and time when the rate limit policy was last updated.

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

    The date and time when the rate limit policy was last updated.

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

    The date and time when the rate limit policy was created.

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

    The date and time when the rate limit policy was created.

    + */ + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + public UpdateRateLimitPolicyResponseContent build() { + return new UpdateRateLimitPolicyResponseContent( + id, + resource, + consumer, + consumerSelector, + configuration, + createdAt, + updatedAt, + 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/UpdateUserResponseContent.java b/src/main/java/com/auth0/client/mgmt/types/UpdateUserResponseContent.java index daf65370..c89554e6 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UpdateUserResponseContent.java +++ b/src/main/java/com/auth0/client/mgmt/types/UpdateUserResponseContent.java @@ -51,10 +51,14 @@ public final class UpdateUserResponseContent { private final Optional> multifactor; + private final Optional multifactorLastModified; + private final Optional lastIp; private final Optional lastLogin; + private final Optional lastPasswordReset; + private final Optional loginsCount; private final Optional blocked; @@ -81,8 +85,10 @@ private UpdateUserResponseContent( Optional name, Optional nickname, Optional> multifactor, + Optional multifactorLastModified, Optional lastIp, Optional lastLogin, + Optional lastPasswordReset, Optional loginsCount, Optional blocked, Optional givenName, @@ -103,8 +109,10 @@ private UpdateUserResponseContent( this.name = name; this.nickname = nickname; this.multifactor = multifactor; + this.multifactorLastModified = multifactorLastModified; this.lastIp = lastIp; this.lastLogin = lastLogin; + this.lastPasswordReset = lastPasswordReset; this.loginsCount = loginsCount; this.blocked = blocked; this.givenName = givenName; @@ -220,6 +228,11 @@ public Optional> getMultifactor() { return multifactor; } + @JsonProperty("multifactor_last_modified") + public Optional getMultifactorLastModified() { + return multifactorLastModified; + } + /** * @return Last IP address from which this user logged in. */ @@ -233,6 +246,11 @@ public Optional getLastLogin() { return lastLogin; } + @JsonProperty("last_password_reset") + public Optional getLastPasswordReset() { + return lastPasswordReset; + } + /** * @return Total number of logins this user has performed. */ @@ -292,8 +310,10 @@ private boolean equalTo(UpdateUserResponseContent other) { && name.equals(other.name) && nickname.equals(other.nickname) && multifactor.equals(other.multifactor) + && multifactorLastModified.equals(other.multifactorLastModified) && lastIp.equals(other.lastIp) && lastLogin.equals(other.lastLogin) + && lastPasswordReset.equals(other.lastPasswordReset) && loginsCount.equals(other.loginsCount) && blocked.equals(other.blocked) && givenName.equals(other.givenName) @@ -318,8 +338,10 @@ public int hashCode() { this.name, this.nickname, this.multifactor, + this.multifactorLastModified, this.lastIp, this.lastLogin, + this.lastPasswordReset, this.loginsCount, this.blocked, this.givenName, @@ -367,10 +389,14 @@ public static final class Builder { private Optional> multifactor = Optional.empty(); + private Optional multifactorLastModified = Optional.empty(); + private Optional lastIp = Optional.empty(); private Optional lastLogin = Optional.empty(); + private Optional lastPasswordReset = Optional.empty(); + private Optional loginsCount = Optional.empty(); private Optional blocked = Optional.empty(); @@ -400,8 +426,10 @@ public Builder from(UpdateUserResponseContent other) { name(other.getName()); nickname(other.getNickname()); multifactor(other.getMultifactor()); + multifactorLastModified(other.getMultifactorLastModified()); lastIp(other.getLastIp()); lastLogin(other.getLastLogin()); + lastPasswordReset(other.getLastPasswordReset()); loginsCount(other.getLoginsCount()); blocked(other.getBlocked()); givenName(other.getGivenName()); @@ -607,6 +635,17 @@ public Builder multifactor(List multifactor) { return this; } + @JsonSetter(value = "multifactor_last_modified", nulls = Nulls.SKIP) + public Builder multifactorLastModified(Optional multifactorLastModified) { + this.multifactorLastModified = multifactorLastModified; + return this; + } + + public Builder multifactorLastModified(UserDateSchema multifactorLastModified) { + this.multifactorLastModified = Optional.ofNullable(multifactorLastModified); + return this; + } + /** *

    Last IP address from which this user logged in.

    */ @@ -632,6 +671,17 @@ public Builder lastLogin(UserDateSchema lastLogin) { return this; } + @JsonSetter(value = "last_password_reset", nulls = Nulls.SKIP) + public Builder lastPasswordReset(Optional lastPasswordReset) { + this.lastPasswordReset = lastPasswordReset; + return this; + } + + public Builder lastPasswordReset(UserDateSchema lastPasswordReset) { + this.lastPasswordReset = Optional.ofNullable(lastPasswordReset); + return this; + } + /** *

    Total number of logins this user has performed.

    */ @@ -705,8 +755,10 @@ public UpdateUserResponseContent build() { name, nickname, multifactor, + multifactorLastModified, lastIp, lastLogin, + lastPasswordReset, loginsCount, blocked, givenName, diff --git a/src/main/java/com/auth0/client/mgmt/types/UserResponseSchema.java b/src/main/java/com/auth0/client/mgmt/types/UserResponseSchema.java index 781c690e..c5ef6022 100644 --- a/src/main/java/com/auth0/client/mgmt/types/UserResponseSchema.java +++ b/src/main/java/com/auth0/client/mgmt/types/UserResponseSchema.java @@ -51,10 +51,14 @@ public final class UserResponseSchema { private final Optional> multifactor; + private final Optional multifactorLastModified; + private final Optional lastIp; private final Optional lastLogin; + private final Optional lastPasswordReset; + private final Optional loginsCount; private final Optional blocked; @@ -81,8 +85,10 @@ private UserResponseSchema( Optional name, Optional nickname, Optional> multifactor, + Optional multifactorLastModified, Optional lastIp, Optional lastLogin, + Optional lastPasswordReset, Optional loginsCount, Optional blocked, Optional givenName, @@ -103,8 +109,10 @@ private UserResponseSchema( this.name = name; this.nickname = nickname; this.multifactor = multifactor; + this.multifactorLastModified = multifactorLastModified; this.lastIp = lastIp; this.lastLogin = lastLogin; + this.lastPasswordReset = lastPasswordReset; this.loginsCount = loginsCount; this.blocked = blocked; this.givenName = givenName; @@ -220,6 +228,11 @@ public Optional> getMultifactor() { return multifactor; } + @JsonProperty("multifactor_last_modified") + public Optional getMultifactorLastModified() { + return multifactorLastModified; + } + /** * @return Last IP address from which this user logged in. */ @@ -233,6 +246,11 @@ public Optional getLastLogin() { return lastLogin; } + @JsonProperty("last_password_reset") + public Optional getLastPasswordReset() { + return lastPasswordReset; + } + /** * @return Total number of logins this user has performed. */ @@ -292,8 +310,10 @@ private boolean equalTo(UserResponseSchema other) { && name.equals(other.name) && nickname.equals(other.nickname) && multifactor.equals(other.multifactor) + && multifactorLastModified.equals(other.multifactorLastModified) && lastIp.equals(other.lastIp) && lastLogin.equals(other.lastLogin) + && lastPasswordReset.equals(other.lastPasswordReset) && loginsCount.equals(other.loginsCount) && blocked.equals(other.blocked) && givenName.equals(other.givenName) @@ -318,8 +338,10 @@ public int hashCode() { this.name, this.nickname, this.multifactor, + this.multifactorLastModified, this.lastIp, this.lastLogin, + this.lastPasswordReset, this.loginsCount, this.blocked, this.givenName, @@ -367,10 +389,14 @@ public static final class Builder { private Optional> multifactor = Optional.empty(); + private Optional multifactorLastModified = Optional.empty(); + private Optional lastIp = Optional.empty(); private Optional lastLogin = Optional.empty(); + private Optional lastPasswordReset = Optional.empty(); + private Optional loginsCount = Optional.empty(); private Optional blocked = Optional.empty(); @@ -400,8 +426,10 @@ public Builder from(UserResponseSchema other) { name(other.getName()); nickname(other.getNickname()); multifactor(other.getMultifactor()); + multifactorLastModified(other.getMultifactorLastModified()); lastIp(other.getLastIp()); lastLogin(other.getLastLogin()); + lastPasswordReset(other.getLastPasswordReset()); loginsCount(other.getLoginsCount()); blocked(other.getBlocked()); givenName(other.getGivenName()); @@ -607,6 +635,17 @@ public Builder multifactor(List multifactor) { return this; } + @JsonSetter(value = "multifactor_last_modified", nulls = Nulls.SKIP) + public Builder multifactorLastModified(Optional multifactorLastModified) { + this.multifactorLastModified = multifactorLastModified; + return this; + } + + public Builder multifactorLastModified(UserDateSchema multifactorLastModified) { + this.multifactorLastModified = Optional.ofNullable(multifactorLastModified); + return this; + } + /** *

    Last IP address from which this user logged in.

    */ @@ -632,6 +671,17 @@ public Builder lastLogin(UserDateSchema lastLogin) { return this; } + @JsonSetter(value = "last_password_reset", nulls = Nulls.SKIP) + public Builder lastPasswordReset(Optional lastPasswordReset) { + this.lastPasswordReset = lastPasswordReset; + return this; + } + + public Builder lastPasswordReset(UserDateSchema lastPasswordReset) { + this.lastPasswordReset = Optional.ofNullable(lastPasswordReset); + return this; + } + /** *

    Total number of logins this user has performed.

    */ @@ -705,8 +755,10 @@ public UserResponseSchema build() { name, nickname, multifactor, + multifactorLastModified, lastIp, lastLogin, + lastPasswordReset, loginsCount, blocked, givenName, diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncIdentitiesClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncIdentitiesClient.java index 5328e3f2..9c96e4d4 100644 --- a/src/main/java/com/auth0/client/mgmt/users/AsyncIdentitiesClient.java +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncIdentitiesClient.java @@ -32,30 +32,30 @@ public AsyncRawIdentitiesClient withRawResponse() { /** * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. *

    Note: There are two ways of invoking the endpoint:

    - *

      - *
    • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope: - *
      -     *       POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *       Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      -     *       {
      -     *         "link_with": "SECONDARY_ACCOUNT_JWT"
      -     *       }
      -     *     
      - * In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. - *
    • - *
    • With a token generated by the API V2 containing the update:users scope: - *
      -     *     POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *     Authorization: "Bearer YOUR_API_V2_TOKEN"
      -     *     {
      -     *       "provider": "SECONDARY_ACCOUNT_PROVIDER",
      -     *       "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      -     *       "user_id": "SECONDARY_ACCOUNT_USER_ID"
      -     *     }
      -     *     
      - * In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider. - *
    • - *

    + *
      + *
    • + *

      With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      +     * {
      +     *   "link_with": "SECONDARY_ACCOUNT_JWT"
      +     * }
      +     * 
      + *

      In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication.

      + *
    • + *
    • + *

      With a token generated by the API V2 containing the update:users scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer YOUR_API_V2_TOKEN"
      +     * {
      +     *   "provider": "SECONDARY_ACCOUNT_PROVIDER",
      +     *   "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      +     *   "user_id": "SECONDARY_ACCOUNT_USER_ID"
      +     * }
      +     * 
      + *

      In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider.

      + *
    • + *
    */ public CompletableFuture> link(String id) { return this.rawClient.link(id).thenApply(response -> response.body()); @@ -64,30 +64,30 @@ public CompletableFuture> link(String id) { /** * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. *

    Note: There are two ways of invoking the endpoint:

    - *

      - *
    • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope: - *
      -     *       POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *       Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      -     *       {
      -     *         "link_with": "SECONDARY_ACCOUNT_JWT"
      -     *       }
      -     *     
      - * In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. - *
    • - *
    • With a token generated by the API V2 containing the update:users scope: - *
      -     *     POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *     Authorization: "Bearer YOUR_API_V2_TOKEN"
      -     *     {
      -     *       "provider": "SECONDARY_ACCOUNT_PROVIDER",
      -     *       "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      -     *       "user_id": "SECONDARY_ACCOUNT_USER_ID"
      -     *     }
      -     *     
      - * In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider. - *
    • - *

    + *
      + *
    • + *

      With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      +     * {
      +     *   "link_with": "SECONDARY_ACCOUNT_JWT"
      +     * }
      +     * 
      + *

      In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication.

      + *
    • + *
    • + *

      With a token generated by the API V2 containing the update:users scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer YOUR_API_V2_TOKEN"
      +     * {
      +     *   "provider": "SECONDARY_ACCOUNT_PROVIDER",
      +     *   "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      +     *   "user_id": "SECONDARY_ACCOUNT_USER_ID"
      +     * }
      +     * 
      + *

      In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider.

      + *
    • + *
    */ public CompletableFuture> link(String id, RequestOptions requestOptions) { return this.rawClient.link(id, requestOptions).thenApply(response -> response.body()); @@ -96,30 +96,30 @@ public CompletableFuture> link(String id, RequestOptions requ /** * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. *

    Note: There are two ways of invoking the endpoint:

    - *

      - *
    • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope: - *
      -     *       POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *       Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      -     *       {
      -     *         "link_with": "SECONDARY_ACCOUNT_JWT"
      -     *       }
      -     *     
      - * In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. - *
    • - *
    • With a token generated by the API V2 containing the update:users scope: - *
      -     *     POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *     Authorization: "Bearer YOUR_API_V2_TOKEN"
      -     *     {
      -     *       "provider": "SECONDARY_ACCOUNT_PROVIDER",
      -     *       "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      -     *       "user_id": "SECONDARY_ACCOUNT_USER_ID"
      -     *     }
      -     *     
      - * In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider. - *
    • - *

    + *
      + *
    • + *

      With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      +     * {
      +     *   "link_with": "SECONDARY_ACCOUNT_JWT"
      +     * }
      +     * 
      + *

      In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication.

      + *
    • + *
    • + *

      With a token generated by the API V2 containing the update:users scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer YOUR_API_V2_TOKEN"
      +     * {
      +     *   "provider": "SECONDARY_ACCOUNT_PROVIDER",
      +     *   "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      +     *   "user_id": "SECONDARY_ACCOUNT_USER_ID"
      +     * }
      +     * 
      + *

      In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider.

      + *
    • + *
    */ public CompletableFuture> link(String id, LinkUserIdentityRequestContent request) { return this.rawClient.link(id, request).thenApply(response -> response.body()); @@ -128,30 +128,30 @@ public CompletableFuture> link(String id, LinkUserIdentityReq /** * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. *

    Note: There are two ways of invoking the endpoint:

    - *

      - *
    • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope: - *
      -     *       POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *       Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      -     *       {
      -     *         "link_with": "SECONDARY_ACCOUNT_JWT"
      -     *       }
      -     *     
      - * In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. - *
    • - *
    • With a token generated by the API V2 containing the update:users scope: - *
      -     *     POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *     Authorization: "Bearer YOUR_API_V2_TOKEN"
      -     *     {
      -     *       "provider": "SECONDARY_ACCOUNT_PROVIDER",
      -     *       "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      -     *       "user_id": "SECONDARY_ACCOUNT_USER_ID"
      -     *     }
      -     *     
      - * In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider. - *
    • - *

    + *
      + *
    • + *

      With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      +     * {
      +     *   "link_with": "SECONDARY_ACCOUNT_JWT"
      +     * }
      +     * 
      + *

      In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication.

      + *
    • + *
    • + *

      With a token generated by the API V2 containing the update:users scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer YOUR_API_V2_TOKEN"
      +     * {
      +     *   "provider": "SECONDARY_ACCOUNT_PROVIDER",
      +     *   "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      +     *   "user_id": "SECONDARY_ACCOUNT_USER_ID"
      +     * }
      +     * 
      + *

      In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider.

      + *
    • + *
    */ public CompletableFuture> link( String id, LinkUserIdentityRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncRawIdentitiesClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncRawIdentitiesClient.java index e8e4622e..6ccf3ce8 100644 --- a/src/main/java/com/auth0/client/mgmt/users/AsyncRawIdentitiesClient.java +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncRawIdentitiesClient.java @@ -45,30 +45,30 @@ public AsyncRawIdentitiesClient(ClientOptions clientOptions) { /** * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. *

    Note: There are two ways of invoking the endpoint:

    - *

      - *
    • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope: - *
      -     *       POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *       Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      -     *       {
      -     *         "link_with": "SECONDARY_ACCOUNT_JWT"
      -     *       }
      -     *     
      - * In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. - *
    • - *
    • With a token generated by the API V2 containing the update:users scope: - *
      -     *     POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *     Authorization: "Bearer YOUR_API_V2_TOKEN"
      -     *     {
      -     *       "provider": "SECONDARY_ACCOUNT_PROVIDER",
      -     *       "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      -     *       "user_id": "SECONDARY_ACCOUNT_USER_ID"
      -     *     }
      -     *     
      - * In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider. - *
    • - *

    + *
      + *
    • + *

      With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      +     * {
      +     *   "link_with": "SECONDARY_ACCOUNT_JWT"
      +     * }
      +     * 
      + *

      In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication.

      + *
    • + *
    • + *

      With a token generated by the API V2 containing the update:users scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer YOUR_API_V2_TOKEN"
      +     * {
      +     *   "provider": "SECONDARY_ACCOUNT_PROVIDER",
      +     *   "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      +     *   "user_id": "SECONDARY_ACCOUNT_USER_ID"
      +     * }
      +     * 
      + *

      In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider.

      + *
    • + *
    */ public CompletableFuture>> link(String id) { return link(id, LinkUserIdentityRequestContent.builder().build()); @@ -77,30 +77,30 @@ public CompletableFuture>> link(Str /** * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. *

    Note: There are two ways of invoking the endpoint:

    - *

      - *
    • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope: - *
      -     *       POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *       Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      -     *       {
      -     *         "link_with": "SECONDARY_ACCOUNT_JWT"
      -     *       }
      -     *     
      - * In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. - *
    • - *
    • With a token generated by the API V2 containing the update:users scope: - *
      -     *     POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *     Authorization: "Bearer YOUR_API_V2_TOKEN"
      -     *     {
      -     *       "provider": "SECONDARY_ACCOUNT_PROVIDER",
      -     *       "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      -     *       "user_id": "SECONDARY_ACCOUNT_USER_ID"
      -     *     }
      -     *     
      - * In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider. - *
    • - *

    + *
      + *
    • + *

      With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      +     * {
      +     *   "link_with": "SECONDARY_ACCOUNT_JWT"
      +     * }
      +     * 
      + *

      In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication.

      + *
    • + *
    • + *

      With a token generated by the API V2 containing the update:users scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer YOUR_API_V2_TOKEN"
      +     * {
      +     *   "provider": "SECONDARY_ACCOUNT_PROVIDER",
      +     *   "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      +     *   "user_id": "SECONDARY_ACCOUNT_USER_ID"
      +     * }
      +     * 
      + *

      In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider.

      + *
    • + *
    */ public CompletableFuture>> link( String id, RequestOptions requestOptions) { @@ -110,30 +110,30 @@ public CompletableFuture>> link( /** * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. *

    Note: There are two ways of invoking the endpoint:

    - *

      - *
    • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope: - *
      -     *       POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *       Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      -     *       {
      -     *         "link_with": "SECONDARY_ACCOUNT_JWT"
      -     *       }
      -     *     
      - * In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. - *
    • - *
    • With a token generated by the API V2 containing the update:users scope: - *
      -     *     POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *     Authorization: "Bearer YOUR_API_V2_TOKEN"
      -     *     {
      -     *       "provider": "SECONDARY_ACCOUNT_PROVIDER",
      -     *       "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      -     *       "user_id": "SECONDARY_ACCOUNT_USER_ID"
      -     *     }
      -     *     
      - * In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider. - *
    • - *

    + *
      + *
    • + *

      With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      +     * {
      +     *   "link_with": "SECONDARY_ACCOUNT_JWT"
      +     * }
      +     * 
      + *

      In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication.

      + *
    • + *
    • + *

      With a token generated by the API V2 containing the update:users scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer YOUR_API_V2_TOKEN"
      +     * {
      +     *   "provider": "SECONDARY_ACCOUNT_PROVIDER",
      +     *   "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      +     *   "user_id": "SECONDARY_ACCOUNT_USER_ID"
      +     * }
      +     * 
      + *

      In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider.

      + *
    • + *
    */ public CompletableFuture>> link( String id, LinkUserIdentityRequestContent request) { @@ -143,30 +143,30 @@ public CompletableFuture>> link( /** * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. *

    Note: There are two ways of invoking the endpoint:

    - *

      - *
    • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope: - *
      -     *       POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *       Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      -     *       {
      -     *         "link_with": "SECONDARY_ACCOUNT_JWT"
      -     *       }
      -     *     
      - * In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. - *
    • - *
    • With a token generated by the API V2 containing the update:users scope: - *
      -     *     POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *     Authorization: "Bearer YOUR_API_V2_TOKEN"
      -     *     {
      -     *       "provider": "SECONDARY_ACCOUNT_PROVIDER",
      -     *       "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      -     *       "user_id": "SECONDARY_ACCOUNT_USER_ID"
      -     *     }
      -     *     
      - * In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider. - *
    • - *

    + *
      + *
    • + *

      With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      +     * {
      +     *   "link_with": "SECONDARY_ACCOUNT_JWT"
      +     * }
      +     * 
      + *

      In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication.

      + *
    • + *
    • + *

      With a token generated by the API V2 containing the update:users scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer YOUR_API_V2_TOKEN"
      +     * {
      +     *   "provider": "SECONDARY_ACCOUNT_PROVIDER",
      +     *   "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      +     *   "user_id": "SECONDARY_ACCOUNT_USER_ID"
      +     * }
      +     * 
      + *

      In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider.

      + *
    • + *
    */ public CompletableFuture>> link( String id, LinkUserIdentityRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncRawRolesClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncRawRolesClient.java index 0f6e322e..fe2a1167 100644 --- a/src/main/java/com/auth0/client/mgmt/users/AsyncRawRolesClient.java +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncRawRolesClient.java @@ -48,7 +48,7 @@ public AsyncRawRolesClient(ClientOptions clientOptions) { /** * Retrieve detailed list of all user roles currently assigned to a user. - *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    + *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    */ public CompletableFuture>> list(String id) { return list(id, ListUserRolesRequestParameters.builder().build()); @@ -56,7 +56,7 @@ public CompletableFuture>> li /** * Retrieve detailed list of all user roles currently assigned to a user. - *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    + *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    */ public CompletableFuture>> list( String id, RequestOptions requestOptions) { @@ -65,7 +65,7 @@ public CompletableFuture>> li /** * Retrieve detailed list of all user roles currently assigned to a user. - *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    + *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    */ public CompletableFuture>> list( String id, ListUserRolesRequestParameters request) { @@ -74,7 +74,7 @@ public CompletableFuture>> li /** * Retrieve detailed list of all user roles currently assigned to a user. - *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    + *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    */ public CompletableFuture>> list( String id, ListUserRolesRequestParameters request, RequestOptions requestOptions) { @@ -184,7 +184,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Assign one or more existing user roles to a user. For more information, review Role-Based Access Control. - *

    Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member.

    + *

    Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member.

    */ public CompletableFuture> assign(String id, AssignUserRolesRequestContent request) { return assign(id, request, null); @@ -192,7 +192,7 @@ public CompletableFuture> assign(String id, Assi /** * Assign one or more existing user roles to a user. For more information, review Role-Based Access Control. - *

    Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member.

    + *

    Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member.

    */ public CompletableFuture> assign( String id, AssignUserRolesRequestContent request, RequestOptions requestOptions) { @@ -279,7 +279,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Remove one or more specified user roles assigned to a user. - *

    Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member.

    + *

    Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member.

    */ public CompletableFuture> delete(String id, DeleteUserRolesRequestContent request) { return delete(id, request, null); @@ -287,7 +287,7 @@ public CompletableFuture> delete(String id, Dele /** * Remove one or more specified user roles assigned to a user. - *

    Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member.

    + *

    Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member.

    */ public CompletableFuture> delete( String id, DeleteUserRolesRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/users/AsyncRolesClient.java b/src/main/java/com/auth0/client/mgmt/users/AsyncRolesClient.java index 5366e593..488688e2 100644 --- a/src/main/java/com/auth0/client/mgmt/users/AsyncRolesClient.java +++ b/src/main/java/com/auth0/client/mgmt/users/AsyncRolesClient.java @@ -31,7 +31,7 @@ public AsyncRawRolesClient withRawResponse() { /** * Retrieve detailed list of all user roles currently assigned to a user. - *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    + *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    */ public CompletableFuture> list(String id) { return this.rawClient.list(id).thenApply(response -> response.body()); @@ -39,7 +39,7 @@ public CompletableFuture> list(String id) { /** * Retrieve detailed list of all user roles currently assigned to a user. - *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    + *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    */ public CompletableFuture> list(String id, RequestOptions requestOptions) { return this.rawClient.list(id, requestOptions).thenApply(response -> response.body()); @@ -47,7 +47,7 @@ public CompletableFuture> list(String id, RequestOption /** * Retrieve detailed list of all user roles currently assigned to a user. - *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    + *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    */ public CompletableFuture> list(String id, ListUserRolesRequestParameters request) { return this.rawClient.list(id, request).thenApply(response -> response.body()); @@ -55,7 +55,7 @@ public CompletableFuture> list(String id, ListUserRoles /** * Retrieve detailed list of all user roles currently assigned to a user. - *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    + *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    */ public CompletableFuture> list( String id, ListUserRolesRequestParameters request, RequestOptions requestOptions) { @@ -64,7 +64,7 @@ public CompletableFuture> list( /** * Assign one or more existing user roles to a user. For more information, review Role-Based Access Control. - *

    Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member.

    + *

    Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member.

    */ public CompletableFuture assign(String id, AssignUserRolesRequestContent request) { return this.rawClient.assign(id, request).thenApply(response -> response.body()); @@ -72,7 +72,7 @@ public CompletableFuture assign(String id, AssignUserRolesRequestContent r /** * Assign one or more existing user roles to a user. For more information, review Role-Based Access Control. - *

    Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member.

    + *

    Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member.

    */ public CompletableFuture assign( String id, AssignUserRolesRequestContent request, RequestOptions requestOptions) { @@ -81,7 +81,7 @@ public CompletableFuture assign( /** * Remove one or more specified user roles assigned to a user. - *

    Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member.

    + *

    Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member.

    */ public CompletableFuture delete(String id, DeleteUserRolesRequestContent request) { return this.rawClient.delete(id, request).thenApply(response -> response.body()); @@ -89,7 +89,7 @@ public CompletableFuture delete(String id, DeleteUserRolesRequestContent r /** * Remove one or more specified user roles assigned to a user. - *

    Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member.

    + *

    Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member.

    */ public CompletableFuture delete( String id, DeleteUserRolesRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/users/IdentitiesClient.java b/src/main/java/com/auth0/client/mgmt/users/IdentitiesClient.java index bf0db9bf..df57c259 100644 --- a/src/main/java/com/auth0/client/mgmt/users/IdentitiesClient.java +++ b/src/main/java/com/auth0/client/mgmt/users/IdentitiesClient.java @@ -31,30 +31,30 @@ public RawIdentitiesClient withRawResponse() { /** * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. *

    Note: There are two ways of invoking the endpoint:

    - *

      - *
    • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope: - *
      -     *       POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *       Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      -     *       {
      -     *         "link_with": "SECONDARY_ACCOUNT_JWT"
      -     *       }
      -     *     
      - * In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. - *
    • - *
    • With a token generated by the API V2 containing the update:users scope: - *
      -     *     POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *     Authorization: "Bearer YOUR_API_V2_TOKEN"
      -     *     {
      -     *       "provider": "SECONDARY_ACCOUNT_PROVIDER",
      -     *       "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      -     *       "user_id": "SECONDARY_ACCOUNT_USER_ID"
      -     *     }
      -     *     
      - * In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider. - *
    • - *

    + *
      + *
    • + *

      With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      +     * {
      +     *   "link_with": "SECONDARY_ACCOUNT_JWT"
      +     * }
      +     * 
      + *

      In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication.

      + *
    • + *
    • + *

      With a token generated by the API V2 containing the update:users scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer YOUR_API_V2_TOKEN"
      +     * {
      +     *   "provider": "SECONDARY_ACCOUNT_PROVIDER",
      +     *   "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      +     *   "user_id": "SECONDARY_ACCOUNT_USER_ID"
      +     * }
      +     * 
      + *

      In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider.

      + *
    • + *
    */ public List link(String id) { return this.rawClient.link(id).body(); @@ -63,30 +63,30 @@ public List link(String id) { /** * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. *

    Note: There are two ways of invoking the endpoint:

    - *

      - *
    • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope: - *
      -     *       POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *       Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      -     *       {
      -     *         "link_with": "SECONDARY_ACCOUNT_JWT"
      -     *       }
      -     *     
      - * In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. - *
    • - *
    • With a token generated by the API V2 containing the update:users scope: - *
      -     *     POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *     Authorization: "Bearer YOUR_API_V2_TOKEN"
      -     *     {
      -     *       "provider": "SECONDARY_ACCOUNT_PROVIDER",
      -     *       "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      -     *       "user_id": "SECONDARY_ACCOUNT_USER_ID"
      -     *     }
      -     *     
      - * In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider. - *
    • - *

    + *
      + *
    • + *

      With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      +     * {
      +     *   "link_with": "SECONDARY_ACCOUNT_JWT"
      +     * }
      +     * 
      + *

      In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication.

      + *
    • + *
    • + *

      With a token generated by the API V2 containing the update:users scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer YOUR_API_V2_TOKEN"
      +     * {
      +     *   "provider": "SECONDARY_ACCOUNT_PROVIDER",
      +     *   "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      +     *   "user_id": "SECONDARY_ACCOUNT_USER_ID"
      +     * }
      +     * 
      + *

      In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider.

      + *
    • + *
    */ public List link(String id, RequestOptions requestOptions) { return this.rawClient.link(id, requestOptions).body(); @@ -95,30 +95,30 @@ public List link(String id, RequestOptions requestOptions) { /** * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. *

    Note: There are two ways of invoking the endpoint:

    - *

      - *
    • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope: - *
      -     *       POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *       Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      -     *       {
      -     *         "link_with": "SECONDARY_ACCOUNT_JWT"
      -     *       }
      -     *     
      - * In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. - *
    • - *
    • With a token generated by the API V2 containing the update:users scope: - *
      -     *     POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *     Authorization: "Bearer YOUR_API_V2_TOKEN"
      -     *     {
      -     *       "provider": "SECONDARY_ACCOUNT_PROVIDER",
      -     *       "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      -     *       "user_id": "SECONDARY_ACCOUNT_USER_ID"
      -     *     }
      -     *     
      - * In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider. - *
    • - *

    + *
      + *
    • + *

      With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      +     * {
      +     *   "link_with": "SECONDARY_ACCOUNT_JWT"
      +     * }
      +     * 
      + *

      In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication.

      + *
    • + *
    • + *

      With a token generated by the API V2 containing the update:users scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer YOUR_API_V2_TOKEN"
      +     * {
      +     *   "provider": "SECONDARY_ACCOUNT_PROVIDER",
      +     *   "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      +     *   "user_id": "SECONDARY_ACCOUNT_USER_ID"
      +     * }
      +     * 
      + *

      In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider.

      + *
    • + *
    */ public List link(String id, LinkUserIdentityRequestContent request) { return this.rawClient.link(id, request).body(); @@ -127,30 +127,30 @@ public List link(String id, LinkUserIdentityRequestContent request /** * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. *

    Note: There are two ways of invoking the endpoint:

    - *

      - *
    • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope: - *
      -     *       POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *       Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      -     *       {
      -     *         "link_with": "SECONDARY_ACCOUNT_JWT"
      -     *       }
      -     *     
      - * In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. - *
    • - *
    • With a token generated by the API V2 containing the update:users scope: - *
      -     *     POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *     Authorization: "Bearer YOUR_API_V2_TOKEN"
      -     *     {
      -     *       "provider": "SECONDARY_ACCOUNT_PROVIDER",
      -     *       "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      -     *       "user_id": "SECONDARY_ACCOUNT_USER_ID"
      -     *     }
      -     *     
      - * In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider. - *
    • - *

    + *
      + *
    • + *

      With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      +     * {
      +     *   "link_with": "SECONDARY_ACCOUNT_JWT"
      +     * }
      +     * 
      + *

      In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication.

      + *
    • + *
    • + *

      With a token generated by the API V2 containing the update:users scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer YOUR_API_V2_TOKEN"
      +     * {
      +     *   "provider": "SECONDARY_ACCOUNT_PROVIDER",
      +     *   "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      +     *   "user_id": "SECONDARY_ACCOUNT_USER_ID"
      +     * }
      +     * 
      + *

      In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider.

      + *
    • + *
    */ public List link(String id, LinkUserIdentityRequestContent request, RequestOptions requestOptions) { return this.rawClient.link(id, request, requestOptions).body(); diff --git a/src/main/java/com/auth0/client/mgmt/users/RawIdentitiesClient.java b/src/main/java/com/auth0/client/mgmt/users/RawIdentitiesClient.java index a2d46793..31bb0f9b 100644 --- a/src/main/java/com/auth0/client/mgmt/users/RawIdentitiesClient.java +++ b/src/main/java/com/auth0/client/mgmt/users/RawIdentitiesClient.java @@ -41,30 +41,30 @@ public RawIdentitiesClient(ClientOptions clientOptions) { /** * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. *

    Note: There are two ways of invoking the endpoint:

    - *

      - *
    • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope: - *
      -     *       POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *       Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      -     *       {
      -     *         "link_with": "SECONDARY_ACCOUNT_JWT"
      -     *       }
      -     *     
      - * In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. - *
    • - *
    • With a token generated by the API V2 containing the update:users scope: - *
      -     *     POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *     Authorization: "Bearer YOUR_API_V2_TOKEN"
      -     *     {
      -     *       "provider": "SECONDARY_ACCOUNT_PROVIDER",
      -     *       "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      -     *       "user_id": "SECONDARY_ACCOUNT_USER_ID"
      -     *     }
      -     *     
      - * In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider. - *
    • - *

    + *
      + *
    • + *

      With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      +     * {
      +     *   "link_with": "SECONDARY_ACCOUNT_JWT"
      +     * }
      +     * 
      + *

      In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication.

      + *
    • + *
    • + *

      With a token generated by the API V2 containing the update:users scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer YOUR_API_V2_TOKEN"
      +     * {
      +     *   "provider": "SECONDARY_ACCOUNT_PROVIDER",
      +     *   "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      +     *   "user_id": "SECONDARY_ACCOUNT_USER_ID"
      +     * }
      +     * 
      + *

      In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider.

      + *
    • + *
    */ public ManagementApiHttpResponse> link(String id) { return link(id, LinkUserIdentityRequestContent.builder().build()); @@ -73,30 +73,30 @@ public ManagementApiHttpResponse> link(String id) { /** * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. *

    Note: There are two ways of invoking the endpoint:

    - *

      - *
    • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope: - *
      -     *       POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *       Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      -     *       {
      -     *         "link_with": "SECONDARY_ACCOUNT_JWT"
      -     *       }
      -     *     
      - * In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. - *
    • - *
    • With a token generated by the API V2 containing the update:users scope: - *
      -     *     POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *     Authorization: "Bearer YOUR_API_V2_TOKEN"
      -     *     {
      -     *       "provider": "SECONDARY_ACCOUNT_PROVIDER",
      -     *       "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      -     *       "user_id": "SECONDARY_ACCOUNT_USER_ID"
      -     *     }
      -     *     
      - * In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider. - *
    • - *

    + *
      + *
    • + *

      With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      +     * {
      +     *   "link_with": "SECONDARY_ACCOUNT_JWT"
      +     * }
      +     * 
      + *

      In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication.

      + *
    • + *
    • + *

      With a token generated by the API V2 containing the update:users scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer YOUR_API_V2_TOKEN"
      +     * {
      +     *   "provider": "SECONDARY_ACCOUNT_PROVIDER",
      +     *   "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      +     *   "user_id": "SECONDARY_ACCOUNT_USER_ID"
      +     * }
      +     * 
      + *

      In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider.

      + *
    • + *
    */ public ManagementApiHttpResponse> link(String id, RequestOptions requestOptions) { return link(id, LinkUserIdentityRequestContent.builder().build(), requestOptions); @@ -105,30 +105,30 @@ public ManagementApiHttpResponse> link(String id, RequestOpti /** * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. *

    Note: There are two ways of invoking the endpoint:

    - *

      - *
    • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope: - *
      -     *       POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *       Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      -     *       {
      -     *         "link_with": "SECONDARY_ACCOUNT_JWT"
      -     *       }
      -     *     
      - * In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. - *
    • - *
    • With a token generated by the API V2 containing the update:users scope: - *
      -     *     POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *     Authorization: "Bearer YOUR_API_V2_TOKEN"
      -     *     {
      -     *       "provider": "SECONDARY_ACCOUNT_PROVIDER",
      -     *       "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      -     *       "user_id": "SECONDARY_ACCOUNT_USER_ID"
      -     *     }
      -     *     
      - * In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider. - *
    • - *

    + *
      + *
    • + *

      With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      +     * {
      +     *   "link_with": "SECONDARY_ACCOUNT_JWT"
      +     * }
      +     * 
      + *

      In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication.

      + *
    • + *
    • + *

      With a token generated by the API V2 containing the update:users scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer YOUR_API_V2_TOKEN"
      +     * {
      +     *   "provider": "SECONDARY_ACCOUNT_PROVIDER",
      +     *   "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      +     *   "user_id": "SECONDARY_ACCOUNT_USER_ID"
      +     * }
      +     * 
      + *

      In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider.

      + *
    • + *
    */ public ManagementApiHttpResponse> link(String id, LinkUserIdentityRequestContent request) { return link(id, request, null); @@ -137,30 +137,30 @@ public ManagementApiHttpResponse> link(String id, LinkUserIde /** * Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities. *

    Note: There are two ways of invoking the endpoint:

    - *

      - *
    • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope: - *
      -     *       POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *       Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      -     *       {
      -     *         "link_with": "SECONDARY_ACCOUNT_JWT"
      -     *       }
      -     *     
      - * In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication. - *
    • - *
    • With a token generated by the API V2 containing the update:users scope: - *
      -     *     POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      -     *     Authorization: "Bearer YOUR_API_V2_TOKEN"
      -     *     {
      -     *       "provider": "SECONDARY_ACCOUNT_PROVIDER",
      -     *       "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      -     *       "user_id": "SECONDARY_ACCOUNT_USER_ID"
      -     *     }
      -     *     
      - * In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider. - *
    • - *

    + *
      + *
    • + *

      With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
      +     * {
      +     *   "link_with": "SECONDARY_ACCOUNT_JWT"
      +     * }
      +     * 
      + *

      In this case, only the link_with param is required in the body, which also contains the JWT obtained upon the secondary account's authentication.

      + *
    • + *
    • + *

      With a token generated by the API V2 containing the update:users scope:

      + *
      POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
      +     * Authorization: "Bearer YOUR_API_V2_TOKEN"
      +     * {
      +     *   "provider": "SECONDARY_ACCOUNT_PROVIDER",
      +     *   "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)",
      +     *   "user_id": "SECONDARY_ACCOUNT_USER_ID"
      +     * }
      +     * 
      + *

      In this case you need to send provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider.

      + *
    • + *
    */ public ManagementApiHttpResponse> link( String id, LinkUserIdentityRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/users/RawRolesClient.java b/src/main/java/com/auth0/client/mgmt/users/RawRolesClient.java index 0880036c..f83d4469 100644 --- a/src/main/java/com/auth0/client/mgmt/users/RawRolesClient.java +++ b/src/main/java/com/auth0/client/mgmt/users/RawRolesClient.java @@ -43,7 +43,7 @@ public RawRolesClient(ClientOptions clientOptions) { /** * Retrieve detailed list of all user roles currently assigned to a user. - *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    + *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    */ public ManagementApiHttpResponse> list(String id) { return list(id, ListUserRolesRequestParameters.builder().build()); @@ -51,7 +51,7 @@ public ManagementApiHttpResponse> list(String id) { /** * Retrieve detailed list of all user roles currently assigned to a user. - *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    + *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    */ public ManagementApiHttpResponse> list(String id, RequestOptions requestOptions) { return list(id, ListUserRolesRequestParameters.builder().build(), requestOptions); @@ -59,7 +59,7 @@ public ManagementApiHttpResponse> list(String id, Reque /** * Retrieve detailed list of all user roles currently assigned to a user. - *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    + *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    */ public ManagementApiHttpResponse> list(String id, ListUserRolesRequestParameters request) { return list(id, request, null); @@ -67,7 +67,7 @@ public ManagementApiHttpResponse> list(String id, ListU /** * Retrieve detailed list of all user roles currently assigned to a user. - *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    + *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    */ public ManagementApiHttpResponse> list( String id, ListUserRolesRequestParameters request, RequestOptions requestOptions) { @@ -146,7 +146,7 @@ public ManagementApiHttpResponse> list( /** * Assign one or more existing user roles to a user. For more information, review Role-Based Access Control. - *

    Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member.

    + *

    Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member.

    */ public ManagementApiHttpResponse assign(String id, AssignUserRolesRequestContent request) { return assign(id, request, null); @@ -154,7 +154,7 @@ public ManagementApiHttpResponse assign(String id, AssignUserRolesRequestC /** * Assign one or more existing user roles to a user. For more information, review Role-Based Access Control. - *

    Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member.

    + *

    Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member.

    */ public ManagementApiHttpResponse assign( String id, AssignUserRolesRequestContent request, RequestOptions requestOptions) { @@ -220,7 +220,7 @@ public ManagementApiHttpResponse assign( /** * Remove one or more specified user roles assigned to a user. - *

    Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member.

    + *

    Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member.

    */ public ManagementApiHttpResponse delete(String id, DeleteUserRolesRequestContent request) { return delete(id, request, null); @@ -228,7 +228,7 @@ public ManagementApiHttpResponse delete(String id, DeleteUserRolesRequestC /** * Remove one or more specified user roles assigned to a user. - *

    Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member.

    + *

    Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member.

    */ public ManagementApiHttpResponse delete( String id, DeleteUserRolesRequestContent request, RequestOptions requestOptions) { diff --git a/src/main/java/com/auth0/client/mgmt/users/RolesClient.java b/src/main/java/com/auth0/client/mgmt/users/RolesClient.java index 4f43afd0..c20bdf61 100644 --- a/src/main/java/com/auth0/client/mgmt/users/RolesClient.java +++ b/src/main/java/com/auth0/client/mgmt/users/RolesClient.java @@ -30,7 +30,7 @@ public RawRolesClient withRawResponse() { /** * Retrieve detailed list of all user roles currently assigned to a user. - *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    + *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    */ public SyncPagingIterable list(String id) { return this.rawClient.list(id).body(); @@ -38,7 +38,7 @@ public SyncPagingIterable list(String id) { /** * Retrieve detailed list of all user roles currently assigned to a user. - *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    + *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    */ public SyncPagingIterable list(String id, RequestOptions requestOptions) { return this.rawClient.list(id, requestOptions).body(); @@ -46,7 +46,7 @@ public SyncPagingIterable list(String id, RequestOptions requestOptions) { /** * Retrieve detailed list of all user roles currently assigned to a user. - *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    + *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    */ public SyncPagingIterable list(String id, ListUserRolesRequestParameters request) { return this.rawClient.list(id, request).body(); @@ -54,7 +54,7 @@ public SyncPagingIterable list(String id, ListUserRolesRequestParameters r /** * Retrieve detailed list of all user roles currently assigned to a user. - *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    + *

    Note: This action retrieves all roles assigned to a user in the context of your whole tenant. To retrieve Organization-specific roles, use the following endpoint: Get user roles assigned to an Organization member.

    */ public SyncPagingIterable list( String id, ListUserRolesRequestParameters request, RequestOptions requestOptions) { @@ -63,7 +63,7 @@ public SyncPagingIterable list( /** * Assign one or more existing user roles to a user. For more information, review Role-Based Access Control. - *

    Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member.

    + *

    Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member.

    */ public void assign(String id, AssignUserRolesRequestContent request) { this.rawClient.assign(id, request).body(); @@ -71,7 +71,7 @@ public void assign(String id, AssignUserRolesRequestContent request) { /** * Assign one or more existing user roles to a user. For more information, review Role-Based Access Control. - *

    Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member.

    + *

    Note: New roles cannot be created through this action. Additionally, this action is used to assign roles to a user in the context of your whole tenant. To assign roles in the context of a specific Organization, use the following endpoint: Assign user roles to an Organization member.

    */ public void assign(String id, AssignUserRolesRequestContent request, RequestOptions requestOptions) { this.rawClient.assign(id, request, requestOptions).body(); @@ -79,7 +79,7 @@ public void assign(String id, AssignUserRolesRequestContent request, RequestOpti /** * Remove one or more specified user roles assigned to a user. - *

    Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member.

    + *

    Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member.

    */ public void delete(String id, DeleteUserRolesRequestContent request) { this.rawClient.delete(id, request).body(); @@ -87,7 +87,7 @@ public void delete(String id, DeleteUserRolesRequestContent request) { /** * Remove one or more specified user roles assigned to a user. - *

    Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member.

    + *

    Note: This action removes a role from a user in the context of your whole tenant. If you want to unassign a role from a user in the context of a specific Organization, use the following endpoint: Delete user roles from an Organization member.

    */ public void delete(String id, DeleteUserRolesRequestContent request, RequestOptions requestOptions) { this.rawClient.delete(id, request, requestOptions).body(); diff --git a/src/test/java/com/auth0/client/mgmt/GroupsRolesWireTest.java b/src/test/java/com/auth0/client/mgmt/GroupsRolesWireTest.java new file mode 100644 index 00000000..428bbc47 --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/GroupsRolesWireTest.java @@ -0,0 +1,185 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.groups.types.CreateGroupRolesRequestParameters; +import com.auth0.client.mgmt.groups.types.DeleteGroupRolesRequestContent; +import com.auth0.client.mgmt.groups.types.ListGroupRolesRequestParameters; +import com.auth0.client.mgmt.types.Role; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Arrays; +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 GroupsRolesWireTest { + 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( + "{\"roles\":[{\"id\":\"id\",\"name\":\"name\",\"description\":\"description\"}],\"next\":\"next\"}")); + SyncPagingIterable response = client.groups() + .roles() + .list( + "id", + ListGroupRolesRequestParameters.builder() + .from(OptionalNullable.of("from")) + .take(OptionalNullable.of(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("{}")); + client.groups() + .roles() + .create( + "id", + CreateGroupRolesRequestParameters.builder() + .roles(Arrays.asList("roles")) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"roles\": [\n" + " \"roles\"\n" + " ]\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"); + } + } + + @Test + public void testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.groups() + .roles() + .delete( + "id", + DeleteGroupRolesRequestContent.builder() + .roles(Arrays.asList("roles")) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + "{\n" + " \"roles\": [\n" + " \"roles\"\n" + " ]\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"); + } + } + + /** + * 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/RateLimitPoliciesWireTest.java b/src/test/java/com/auth0/client/mgmt/RateLimitPoliciesWireTest.java new file mode 100644 index 00000000..e34af91e --- /dev/null +++ b/src/test/java/com/auth0/client/mgmt/RateLimitPoliciesWireTest.java @@ -0,0 +1,373 @@ +package com.auth0.client.mgmt; + +import com.auth0.client.mgmt.core.ObjectMappers; +import com.auth0.client.mgmt.core.OptionalNullable; +import com.auth0.client.mgmt.core.SyncPagingIterable; +import com.auth0.client.mgmt.types.CreateRateLimitPolicyRequestContent; +import com.auth0.client.mgmt.types.CreateRateLimitPolicyResponseContent; +import com.auth0.client.mgmt.types.GetRateLimitPolicyResponseContent; +import com.auth0.client.mgmt.types.ListRateLimitPoliciesRequestParameters; +import com.auth0.client.mgmt.types.PatchRateLimitPolicyConfigurationRequestContent; +import com.auth0.client.mgmt.types.PatchRateLimitPolicyConfigurationRequestContentZero; +import com.auth0.client.mgmt.types.PatchRateLimitPolicyConfigurationRequestContentZeroAction; +import com.auth0.client.mgmt.types.PatchRateLimitPolicyRequestContent; +import com.auth0.client.mgmt.types.RateLimitPolicy; +import com.auth0.client.mgmt.types.RateLimitPolicyConfiguration; +import com.auth0.client.mgmt.types.RateLimitPolicyConfigurationZero; +import com.auth0.client.mgmt.types.RateLimitPolicyConfigurationZeroAction; +import com.auth0.client.mgmt.types.RateLimitPolicyConsumerEnum; +import com.auth0.client.mgmt.types.RateLimitPolicyResourceEnum; +import com.auth0.client.mgmt.types.UpdateRateLimitPolicyResponseContent; +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 RateLimitPoliciesWireTest { + 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( + "{\"rate_limit_policies\":[{\"id\":\"id\",\"resource\":\"oauth_authentication_api\",\"consumer\":\"client\",\"consumer_selector\":\"consumer_selector\",\"configuration\":{\"action\":\"allow\"},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}],\"next\":\"next\"}")); + SyncPagingIterable response = client.rateLimitPolicies() + .list(ListRateLimitPoliciesRequestParameters.builder() + .resource(OptionalNullable.of(RateLimitPolicyResourceEnum.OAUTH_AUTHENTICATION_API)) + .consumer(OptionalNullable.of(RateLimitPolicyConsumerEnum.CLIENT)) + .consumerSelector(OptionalNullable.of("consumer_selector")) + .take(OptionalNullable.of(1)) + .from(OptionalNullable.of("from")) + .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\",\"resource\":\"oauth_authentication_api\",\"consumer\":\"client\",\"consumer_selector\":\"consumer_selector\",\"configuration\":{\"action\":\"allow\"},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}")); + CreateRateLimitPolicyResponseContent response = client.rateLimitPolicies() + .create(CreateRateLimitPolicyRequestContent.builder() + .resource(RateLimitPolicyResourceEnum.OAUTH_AUTHENTICATION_API) + .consumer(RateLimitPolicyConsumerEnum.CLIENT) + .consumerSelector("consumer_selector") + .configuration(RateLimitPolicyConfiguration.of(RateLimitPolicyConfigurationZero.builder() + .action(RateLimitPolicyConfigurationZeroAction.ALLOW) + .build())) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("POST", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = "" + + "{\n" + + " \"resource\": \"oauth_authentication_api\",\n" + + " \"consumer\": \"client\",\n" + + " \"consumer_selector\": \"consumer_selector\",\n" + + " \"configuration\": {\n" + + " \"action\": \"allow\"\n" + + " }\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" + + " \"resource\": \"oauth_authentication_api\",\n" + + " \"consumer\": \"client\",\n" + + " \"consumer_selector\": \"consumer_selector\",\n" + + " \"configuration\": {\n" + + " \"action\": \"allow\"\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\",\"resource\":\"oauth_authentication_api\",\"consumer\":\"client\",\"consumer_selector\":\"consumer_selector\",\"configuration\":{\"action\":\"allow\"},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}")); + GetRateLimitPolicyResponseContent response = client.rateLimitPolicies().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" + + " \"resource\": \"oauth_authentication_api\",\n" + + " \"consumer\": \"client\",\n" + + " \"consumer_selector\": \"consumer_selector\",\n" + + " \"configuration\": {\n" + + " \"action\": \"allow\"\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 testDelete() throws Exception { + server.enqueue(new MockResponse().setResponseCode(200).setBody("{}")); + client.rateLimitPolicies().delete("id"); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("DELETE", request.getMethod()); + } + + @Test + public void testUpdate() throws Exception { + server.enqueue( + new MockResponse() + .setResponseCode(200) + .setBody( + "{\"id\":\"id\",\"resource\":\"oauth_authentication_api\",\"consumer\":\"client\",\"consumer_selector\":\"consumer_selector\",\"configuration\":{\"action\":\"allow\"},\"created_at\":\"2024-01-15T09:30:00Z\",\"updated_at\":\"2024-01-15T09:30:00Z\"}")); + UpdateRateLimitPolicyResponseContent response = client.rateLimitPolicies() + .update( + "id", + PatchRateLimitPolicyRequestContent.builder() + .configuration(PatchRateLimitPolicyConfigurationRequestContent.of( + PatchRateLimitPolicyConfigurationRequestContentZero.builder() + .action(PatchRateLimitPolicyConfigurationRequestContentZeroAction.ALLOW) + .build())) + .build()); + RecordedRequest request = server.takeRequest(); + Assertions.assertNotNull(request); + Assertions.assertEquals("PATCH", request.getMethod()); + // Validate request body + String actualRequestBody = request.getBody().readUtf8(); + String expectedRequestBody = + "" + "{\n" + " \"configuration\": {\n" + " \"action\": \"allow\"\n" + " }\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" + + " \"resource\": \"oauth_authentication_api\",\n" + + " \"consumer\": \"client\",\n" + + " \"consumer_selector\": \"consumer_selector\",\n" + + " \"configuration\": {\n" + + " \"action\": \"allow\"\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"); + } + } + + /** + * 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/UsersWireTest.java b/src/test/java/com/auth0/client/mgmt/UsersWireTest.java index bfcac943..161dd86e 100644 --- a/src/test/java/com/auth0/client/mgmt/UsersWireTest.java +++ b/src/test/java/com/auth0/client/mgmt/UsersWireTest.java @@ -52,7 +52,7 @@ public void testList() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"start\":1.1,\"limit\":1.1,\"length\":1.1,\"total\":1.1,\"users\":[{\"user_id\":\"user_id\",\"email\":\"email\",\"email_verified\":true,\"username\":\"username\",\"phone_number\":\"phone_number\",\"phone_verified\":true,\"created_at\":\"created_at\",\"updated_at\":\"updated_at\",\"identities\":[{}],\"app_metadata\":{\"key\":\"value\"},\"user_metadata\":{\"key\":\"value\"},\"picture\":\"picture\",\"name\":\"name\",\"nickname\":\"nickname\",\"multifactor\":[\"multifactor\"],\"last_ip\":\"last_ip\",\"last_login\":\"last_login\",\"logins_count\":1,\"blocked\":true,\"given_name\":\"given_name\",\"family_name\":\"family_name\"}]}")); + "{\"start\":1.1,\"limit\":1.1,\"length\":1.1,\"total\":1.1,\"users\":[{\"user_id\":\"user_id\",\"email\":\"email\",\"email_verified\":true,\"username\":\"username\",\"phone_number\":\"phone_number\",\"phone_verified\":true,\"created_at\":\"created_at\",\"updated_at\":\"updated_at\",\"identities\":[{}],\"app_metadata\":{\"key\":\"value\"},\"user_metadata\":{\"key\":\"value\"},\"picture\":\"picture\",\"name\":\"name\",\"nickname\":\"nickname\",\"multifactor\":[\"multifactor\"],\"multifactor_last_modified\":\"multifactor_last_modified\",\"last_ip\":\"last_ip\",\"last_login\":\"last_login\",\"last_password_reset\":\"last_password_reset\",\"logins_count\":1,\"blocked\":true,\"given_name\":\"given_name\",\"family_name\":\"family_name\"}]}")); SyncPagingIterable response = client.users() .list(ListUsersRequestParameters.builder() .page(OptionalNullable.of(1)) @@ -82,7 +82,7 @@ public void testCreate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"user_id\":\"user_id\",\"email\":\"email\",\"email_verified\":true,\"username\":\"username\",\"phone_number\":\"phone_number\",\"phone_verified\":true,\"created_at\":\"created_at\",\"updated_at\":\"updated_at\",\"identities\":[{\"connection\":\"connection\",\"user_id\":\"user_id\",\"provider\":\"ad\",\"isSocial\":true,\"access_token\":\"access_token\",\"access_token_secret\":\"access_token_secret\",\"refresh_token\":\"refresh_token\"}],\"app_metadata\":{\"key\":\"value\"},\"user_metadata\":{\"key\":\"value\"},\"picture\":\"picture\",\"name\":\"name\",\"nickname\":\"nickname\",\"multifactor\":[\"multifactor\"],\"last_ip\":\"last_ip\",\"last_login\":\"last_login\",\"logins_count\":1,\"blocked\":true,\"given_name\":\"given_name\",\"family_name\":\"family_name\"}")); + "{\"user_id\":\"user_id\",\"email\":\"email\",\"email_verified\":true,\"username\":\"username\",\"phone_number\":\"phone_number\",\"phone_verified\":true,\"created_at\":\"created_at\",\"updated_at\":\"updated_at\",\"identities\":[{\"connection\":\"connection\",\"user_id\":\"user_id\",\"provider\":\"ad\",\"isSocial\":true,\"access_token\":\"access_token\",\"access_token_secret\":\"access_token_secret\",\"refresh_token\":\"refresh_token\"}],\"app_metadata\":{\"key\":\"value\"},\"user_metadata\":{\"key\":\"value\"},\"picture\":\"picture\",\"name\":\"name\",\"nickname\":\"nickname\",\"multifactor\":[\"multifactor\"],\"multifactor_last_modified\":\"multifactor_last_modified\",\"last_ip\":\"last_ip\",\"last_login\":\"last_login\",\"last_password_reset\":\"last_password_reset\",\"logins_count\":1,\"blocked\":true,\"given_name\":\"given_name\",\"family_name\":\"family_name\"}")); CreateUserResponseContent response = client.users() .create(CreateUserRequestContent.builder() .connection("connection") @@ -156,8 +156,10 @@ else if (actualJson.has("kind")) + " \"multifactor\": [\n" + " \"multifactor\"\n" + " ],\n" + + " \"multifactor_last_modified\": \"multifactor_last_modified\",\n" + " \"last_ip\": \"last_ip\",\n" + " \"last_login\": \"last_login\",\n" + + " \"last_password_reset\": \"last_password_reset\",\n" + " \"logins_count\": 1,\n" + " \"blocked\": true,\n" + " \"given_name\": \"given_name\",\n" @@ -200,7 +202,7 @@ public void testListUsersByEmail() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "[{\"user_id\":\"user_id\",\"email\":\"email\",\"email_verified\":true,\"username\":\"username\",\"phone_number\":\"phone_number\",\"phone_verified\":true,\"created_at\":\"created_at\",\"updated_at\":\"updated_at\",\"identities\":[{}],\"app_metadata\":{\"key\":\"value\"},\"user_metadata\":{\"key\":\"value\"},\"picture\":\"picture\",\"name\":\"name\",\"nickname\":\"nickname\",\"multifactor\":[\"multifactor\"],\"last_ip\":\"last_ip\",\"last_login\":\"last_login\",\"logins_count\":1,\"blocked\":true,\"given_name\":\"given_name\",\"family_name\":\"family_name\"}]")); + "[{\"user_id\":\"user_id\",\"email\":\"email\",\"email_verified\":true,\"username\":\"username\",\"phone_number\":\"phone_number\",\"phone_verified\":true,\"created_at\":\"created_at\",\"updated_at\":\"updated_at\",\"identities\":[{}],\"app_metadata\":{\"key\":\"value\"},\"user_metadata\":{\"key\":\"value\"},\"picture\":\"picture\",\"name\":\"name\",\"nickname\":\"nickname\",\"multifactor\":[\"multifactor\"],\"multifactor_last_modified\":\"multifactor_last_modified\",\"last_ip\":\"last_ip\",\"last_login\":\"last_login\",\"last_password_reset\":\"last_password_reset\",\"logins_count\":1,\"blocked\":true,\"given_name\":\"given_name\",\"family_name\":\"family_name\"}]")); List response = client.users() .listUsersByEmail(ListUsersByEmailRequestParameters.builder() .email("email") @@ -240,8 +242,10 @@ public void testListUsersByEmail() throws Exception { + " \"multifactor\": [\n" + " \"multifactor\"\n" + " ],\n" + + " \"multifactor_last_modified\": \"multifactor_last_modified\",\n" + " \"last_ip\": \"last_ip\",\n" + " \"last_login\": \"last_login\",\n" + + " \"last_password_reset\": \"last_password_reset\",\n" + " \"logins_count\": 1,\n" + " \"blocked\": true,\n" + " \"given_name\": \"given_name\",\n" @@ -285,7 +289,7 @@ public void testGet() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"user_id\":\"user_id\",\"email\":\"email\",\"email_verified\":true,\"username\":\"username\",\"phone_number\":\"phone_number\",\"phone_verified\":true,\"created_at\":\"created_at\",\"updated_at\":\"updated_at\",\"identities\":[{\"connection\":\"connection\",\"user_id\":\"user_id\",\"provider\":\"ad\",\"isSocial\":true,\"access_token\":\"access_token\",\"access_token_secret\":\"access_token_secret\",\"refresh_token\":\"refresh_token\"}],\"app_metadata\":{\"key\":\"value\"},\"user_metadata\":{\"key\":\"value\"},\"picture\":\"picture\",\"name\":\"name\",\"nickname\":\"nickname\",\"multifactor\":[\"multifactor\"],\"last_ip\":\"last_ip\",\"last_login\":\"last_login\",\"logins_count\":1,\"blocked\":true,\"given_name\":\"given_name\",\"family_name\":\"family_name\"}")); + "{\"user_id\":\"user_id\",\"email\":\"email\",\"email_verified\":true,\"username\":\"username\",\"phone_number\":\"phone_number\",\"phone_verified\":true,\"created_at\":\"created_at\",\"updated_at\":\"updated_at\",\"identities\":[{\"connection\":\"connection\",\"user_id\":\"user_id\",\"provider\":\"ad\",\"isSocial\":true,\"access_token\":\"access_token\",\"access_token_secret\":\"access_token_secret\",\"refresh_token\":\"refresh_token\"}],\"app_metadata\":{\"key\":\"value\"},\"user_metadata\":{\"key\":\"value\"},\"picture\":\"picture\",\"name\":\"name\",\"nickname\":\"nickname\",\"multifactor\":[\"multifactor\"],\"multifactor_last_modified\":\"multifactor_last_modified\",\"last_ip\":\"last_ip\",\"last_login\":\"last_login\",\"last_password_reset\":\"last_password_reset\",\"logins_count\":1,\"blocked\":true,\"given_name\":\"given_name\",\"family_name\":\"family_name\"}")); GetUserResponseContent response = client.users() .get( "id", @@ -333,8 +337,10 @@ public void testGet() throws Exception { + " \"multifactor\": [\n" + " \"multifactor\"\n" + " ],\n" + + " \"multifactor_last_modified\": \"multifactor_last_modified\",\n" + " \"last_ip\": \"last_ip\",\n" + " \"last_login\": \"last_login\",\n" + + " \"last_password_reset\": \"last_password_reset\",\n" + " \"logins_count\": 1,\n" + " \"blocked\": true,\n" + " \"given_name\": \"given_name\",\n" @@ -386,7 +392,7 @@ public void testUpdate() throws Exception { new MockResponse() .setResponseCode(200) .setBody( - "{\"user_id\":\"user_id\",\"email\":\"email\",\"email_verified\":true,\"username\":\"username\",\"phone_number\":\"phone_number\",\"phone_verified\":true,\"created_at\":\"created_at\",\"updated_at\":\"updated_at\",\"identities\":[{\"connection\":\"connection\",\"user_id\":\"user_id\",\"provider\":\"ad\",\"isSocial\":true,\"access_token\":\"access_token\",\"access_token_secret\":\"access_token_secret\",\"refresh_token\":\"refresh_token\"}],\"app_metadata\":{\"key\":\"value\"},\"user_metadata\":{\"key\":\"value\"},\"picture\":\"picture\",\"name\":\"name\",\"nickname\":\"nickname\",\"multifactor\":[\"multifactor\"],\"last_ip\":\"last_ip\",\"last_login\":\"last_login\",\"logins_count\":1,\"blocked\":true,\"given_name\":\"given_name\",\"family_name\":\"family_name\"}")); + "{\"user_id\":\"user_id\",\"email\":\"email\",\"email_verified\":true,\"username\":\"username\",\"phone_number\":\"phone_number\",\"phone_verified\":true,\"created_at\":\"created_at\",\"updated_at\":\"updated_at\",\"identities\":[{\"connection\":\"connection\",\"user_id\":\"user_id\",\"provider\":\"ad\",\"isSocial\":true,\"access_token\":\"access_token\",\"access_token_secret\":\"access_token_secret\",\"refresh_token\":\"refresh_token\"}],\"app_metadata\":{\"key\":\"value\"},\"user_metadata\":{\"key\":\"value\"},\"picture\":\"picture\",\"name\":\"name\",\"nickname\":\"nickname\",\"multifactor\":[\"multifactor\"],\"multifactor_last_modified\":\"multifactor_last_modified\",\"last_ip\":\"last_ip\",\"last_login\":\"last_login\",\"last_password_reset\":\"last_password_reset\",\"logins_count\":1,\"blocked\":true,\"given_name\":\"given_name\",\"family_name\":\"family_name\"}")); UpdateUserResponseContent response = client.users().update("id", UpdateUserRequestContent.builder().build()); RecordedRequest request = server.takeRequest(); @@ -458,8 +464,10 @@ else if (actualJson.has("kind")) + " \"multifactor\": [\n" + " \"multifactor\"\n" + " ],\n" + + " \"multifactor_last_modified\": \"multifactor_last_modified\",\n" + " \"last_ip\": \"last_ip\",\n" + " \"last_login\": \"last_login\",\n" + + " \"last_password_reset\": \"last_password_reset\",\n" + " \"logins_count\": 1,\n" + " \"blocked\": true,\n" + " \"given_name\": \"given_name\",\n"