auth0 6.0.0.beta.4 → 6.0.0.beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/.fern/metadata.json +1 -1
  3. data/.fern/replay.lock +7 -1
  4. data/.version +1 -1
  5. data/CHANGELOG.md +6 -0
  6. data/lib/auth0/agents/client.rb +201 -0
  7. data/lib/auth0/agents/types/create_agent_request_content.rb +17 -0
  8. data/lib/auth0/agents/types/list_agents_request_parameters.rb +13 -0
  9. data/lib/auth0/agents/types/patch_agent_request_parameters.rb +15 -0
  10. data/lib/auth0/client.rb +5 -0
  11. data/lib/auth0/client_grants/client.rb +2 -0
  12. data/lib/auth0/client_grants/organizations/client.rb +2 -0
  13. data/lib/auth0/client_grants/organizations/types/list_client_grant_organizations_request_parameters.rb +2 -0
  14. data/lib/auth0/client_grants/types/list_client_grants_request_parameters.rb +2 -0
  15. data/lib/auth0/connections/client.rb +2 -0
  16. data/lib/auth0/connections/directory_provisioning/client.rb +76 -0
  17. data/lib/auth0/connections/directory_provisioning/types/add_synchronized_groups_request_content.rb +15 -0
  18. data/lib/auth0/connections/directory_provisioning/types/delete_synchronized_groups_request_content.rb +15 -0
  19. data/lib/auth0/connections/directory_provisioning/types/list_synchronized_groups_request_parameters.rb +2 -0
  20. data/lib/auth0/connections/types/list_connections_query_parameters.rb +2 -0
  21. data/lib/auth0/event_streams/deliveries/client.rb +27 -17
  22. data/lib/auth0/flows/executions/client.rb +2 -0
  23. data/lib/auth0/flows/executions/types/list_flow_executions_request_parameters.rb +2 -0
  24. data/lib/auth0/groups/client.rb +2 -0
  25. data/lib/auth0/groups/types/list_groups_request_parameters.rb +2 -0
  26. data/lib/auth0/organizations/client.rb +9 -0
  27. data/lib/auth0/organizations/clients/client.rb +223 -0
  28. data/lib/auth0/organizations/clients/types/create_organization_clients_request_content.rb +15 -0
  29. data/lib/auth0/organizations/clients/types/delete_organization_clients_request_content.rb +15 -0
  30. data/lib/auth0/organizations/clients/types/list_organization_clients_request_parameters.rb +17 -0
  31. data/lib/auth0/organizations/clients/types/update_organization_client_request_content.rb +17 -0
  32. data/lib/auth0/organizations/members/client.rb +5 -1
  33. data/lib/auth0/organizations/members/roles/client.rb +3 -0
  34. data/lib/auth0/organizations/members/types/list_organization_members_request_parameters.rb +2 -0
  35. data/lib/auth0/organizations/roles/client.rb +5 -0
  36. data/lib/auth0/organizations/roles/groups/client.rb +68 -0
  37. data/lib/auth0/organizations/roles/groups/types/list_organization_role_groups_request_parameters.rb +21 -0
  38. data/lib/auth0/organizations/roles/members/client.rb +6 -0
  39. data/lib/auth0/organizations/types/create_organization_request_content.rb +2 -0
  40. data/lib/auth0/organizations/types/list_organizations_request_parameters.rb +4 -0
  41. data/lib/auth0/organizations/types/update_organization_request_content.rb +2 -0
  42. data/lib/auth0/roles/client.rb +4 -0
  43. data/lib/auth0/roles/types/create_role_request_content.rb +4 -0
  44. data/lib/auth0/roles/types/list_roles_request_parameters.rb +4 -0
  45. data/lib/auth0/roles/users/client.rb +5 -0
  46. data/lib/auth0/roles/users/types/list_role_users_request_parameters.rb +2 -0
  47. data/lib/auth0/types/acul_context_enum.rb +1 -0
  48. data/lib/auth0/types/agent_metadata.rb +23 -0
  49. data/lib/auth0/types/agent_response_content.rb +19 -0
  50. data/lib/auth0/types/conflict_schema.rb +14 -0
  51. data/lib/auth0/types/conflict_schema_error.rb +11 -0
  52. data/lib/auth0/types/connection_connected_accounts_purpose.rb +2 -0
  53. data/lib/auth0/types/connection_connected_accounts_purpose_xaa.rb +2 -0
  54. data/lib/auth0/types/create_organization_client_request_item.rb +11 -0
  55. data/lib/auth0/types/create_organization_clients_response_content.rb +23 -0
  56. data/lib/auth0/types/create_organization_response_content.rb +4 -0
  57. data/lib/auth0/types/create_role_response_content.rb +4 -0
  58. data/lib/auth0/types/event_stream_cloud_event.rb +1 -1
  59. data/lib/auth0/types/event_stream_cloud_event_data.rb +23 -0
  60. data/lib/auth0/types/event_stream_delivery_attempt.rb +2 -0
  61. data/lib/auth0/types/get_organization_by_name_response_content.rb +4 -0
  62. data/lib/auth0/types/get_organization_client_response_content.rb +13 -0
  63. data/lib/auth0/types/get_organization_response_content.rb +4 -0
  64. data/lib/auth0/types/get_role_response_content.rb +4 -0
  65. data/lib/auth0/types/guardian_factor.rb +2 -0
  66. data/lib/auth0/types/guardian_factor_settings.rb +12 -0
  67. data/lib/auth0/types/list_agents_response_content.rb +11 -0
  68. data/lib/auth0/types/list_event_stream_deliveries_response_content.rb +11 -0
  69. data/lib/auth0/types/list_organization_clients_response_content.rb +11 -0
  70. data/lib/auth0/types/list_organization_role_groups_response_content.rb +12 -0
  71. data/lib/auth0/types/not_found_schema.rb +14 -0
  72. data/lib/auth0/types/not_found_schema_error.rb +11 -0
  73. data/lib/auth0/types/oauth_scope.rb +8 -0
  74. data/lib/auth0/types/organization.rb +4 -0
  75. data/lib/auth0/types/organization_client.rb +13 -0
  76. data/lib/auth0/types/organization_client_association.rb +11 -0
  77. data/lib/auth0/types/organization_client_metadata.rb +20 -0
  78. data/lib/auth0/types/organization_client_metadata_organization_usage_enum.rb +13 -0
  79. data/lib/auth0/types/role.rb +4 -0
  80. data/lib/auth0/types/role_group.rb +26 -0
  81. data/lib/auth0/types/role_type_enum.rb +12 -0
  82. data/lib/auth0/types/self_service_profile_sso_ticket_google_workspace_config.rb +2 -0
  83. data/lib/auth0/types/synchronized_group_payload.rb +6 -0
  84. data/lib/auth0/types/synchronized_group_selection_id.rb +9 -0
  85. data/lib/auth0/types/update_organization_client_response_content.rb +13 -0
  86. data/lib/auth0/types/update_organization_response_content.rb +4 -0
  87. data/lib/auth0/types/update_role_response_content.rb +4 -0
  88. data/lib/auth0/types/user_effective_permission_role_source_response_content.rb +4 -0
  89. data/lib/auth0/users/groups/client.rb +2 -0
  90. data/lib/auth0/users/groups/types/get_user_groups_request_parameters.rb +2 -0
  91. data/lib/auth0/users/permissions/client.rb +3 -0
  92. data/lib/auth0/users/refresh_token/client.rb +2 -0
  93. data/lib/auth0/users/refresh_token/types/list_refresh_tokens_request_parameters.rb +2 -0
  94. data/lib/auth0/users/roles/client.rb +3 -0
  95. data/lib/auth0/users/sessions/client.rb +2 -0
  96. data/lib/auth0/users/sessions/types/list_user_sessions_request_parameters.rb +2 -0
  97. data/lib/auth0/version.rb +1 -1
  98. data/lib/auth0.rb +38 -2
  99. data/wiremock/wiremock-mappings.json +592 -55
  100. metadata +38 -2
@@ -38,17 +38,21 @@ module Auth0
38
38
  # @option request_options [Hash{String => Object}] :additional_query_parameters
39
39
  # @option request_options [Hash{String => Object}] :additional_body_parameters
40
40
  # @option request_options [Integer] :timeout_in_seconds
41
+ # @option params [Boolean, nil] :include_totals
41
42
  # @option params [String, nil] :from
42
43
  # @option params [Integer, nil] :take
43
44
  # @option params [String, nil] :sort
45
+ # @option params [String, nil] :include_client_association_for
44
46
  #
45
47
  # @return [Auth0::Types::ListOrganizationsPaginatedResponseContent]
46
48
  def list(request_options: {}, **params)
47
49
  params = Auth0::Internal::Types::Utils.normalize_keys(params)
48
50
  query_params = {}
51
+ query_params["include_totals"] = params.fetch(:include_totals, true)
49
52
  query_params["from"] = params[:from] if params.key?(:from)
50
53
  query_params["take"] = params.fetch(:take, 50)
51
54
  query_params["sort"] = params[:sort] if params.key?(:sort)
55
+ query_params["include_client_association_for"] = params[:include_client_association_for] if params.key?(:include_client_association_for)
52
56
 
53
57
  Auth0::Internal::CursorItemIterator.new(
54
58
  cursor_field: :next_,
@@ -264,6 +268,11 @@ module Auth0
264
268
  @client_grants ||= Auth0::Organizations::ClientGrants::Client.new(client: @client)
265
269
  end
266
270
 
271
+ # @return [Auth0::Clients::Client]
272
+ def clients
273
+ @clients ||= Auth0::Organizations::Clients::Client.new(client: @client)
274
+ end
275
+
267
276
  # @return [Auth0::Connections::Client]
268
277
  def connections
269
278
  @connections ||= Auth0::Organizations::Connections::Client.new(client: @client)
@@ -0,0 +1,223 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Auth0
4
+ module Organizations
5
+ module Clients
6
+ class Client
7
+ # @param client [Auth0::Internal::Http::RawClient]
8
+ #
9
+ # @return [void]
10
+ def initialize(client:)
11
+ @client = client
12
+ end
13
+
14
+ # List all clients associated with an organization, using checkpoint pagination.
15
+ # <ul>
16
+ # <li>
17
+ # <b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more
18
+ # results, a <code>next</code> value is included in the response. You can use this for subsequent API calls.
19
+ # When <code>next</code> is no longer included in the response, no further results are remaining.
20
+ # </li>
21
+ # </ul>
22
+ #
23
+ # @param request_options [Hash]
24
+ # @param params [Hash]
25
+ # @option request_options [String] :base_url
26
+ # @option request_options [Hash{String => Object}] :additional_headers
27
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
28
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
29
+ # @option request_options [Integer] :timeout_in_seconds
30
+ # @option params [String] :id
31
+ # @option params [String, nil] :from
32
+ # @option params [Integer, nil] :take
33
+ #
34
+ # @return [Auth0::Types::ListOrganizationClientsResponseContent]
35
+ def list(request_options: {}, **params)
36
+ params = Auth0::Internal::Types::Utils.normalize_keys(params)
37
+ query_params = {}
38
+ query_params["from"] = params[:from] if params.key?(:from)
39
+ query_params["take"] = params.fetch(:take, 50)
40
+
41
+ Auth0::Internal::CursorItemIterator.new(
42
+ cursor_field: :next_,
43
+ item_field: :clients,
44
+ initial_cursor: query_params["from"]
45
+ ) do |next_cursor|
46
+ query_params["from"] = next_cursor
47
+ request = Auth0::Internal::JSON::Request.new(
48
+ base_url: request_options[:base_url],
49
+ method: "GET",
50
+ path: "organizations/#{URI.encode_uri_component(params[:id].to_s)}/clients",
51
+ query: query_params,
52
+ request_options: request_options
53
+ )
54
+ begin
55
+ response = @client.send(request)
56
+ rescue Net::HTTPRequestTimeout
57
+ raise Auth0::Errors::TimeoutError
58
+ end
59
+ code = response.code.to_i
60
+ if code.between?(200, 299)
61
+ parsed_response = Auth0::Types::ListOrganizationClientsResponseContent.load(response.body)
62
+ [parsed_response, response]
63
+ else
64
+ error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
65
+ raise error_class.new(response.body, code: code)
66
+ end
67
+ end
68
+ end
69
+
70
+ # Associate one or more clients with an organization.
71
+ #
72
+ # @param request_options [Hash]
73
+ # @param params [Auth0::Organizations::Clients::Types::CreateOrganizationClientsRequestContent]
74
+ # @option request_options [String] :base_url
75
+ # @option request_options [Hash{String => Object}] :additional_headers
76
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
77
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
78
+ # @option request_options [Integer] :timeout_in_seconds
79
+ # @option params [String] :id
80
+ #
81
+ # @return [Array[Auth0::Types::OrganizationClient]]
82
+ def create(request_options: {}, **params)
83
+ params = Auth0::Internal::Types::Utils.normalize_keys(params)
84
+ request_data = Auth0::Organizations::Clients::Types::CreateOrganizationClientsRequestContent.new(params).to_h
85
+ non_body_param_names = %w[id]
86
+ body = request_data.except(*non_body_param_names)
87
+
88
+ request = Auth0::Internal::JSON::Request.new(
89
+ base_url: request_options[:base_url],
90
+ method: "POST",
91
+ path: "organizations/#{URI.encode_uri_component(params[:id].to_s)}/clients",
92
+ body: body,
93
+ request_options: request_options
94
+ )
95
+ begin
96
+ response = @client.send(request)
97
+ rescue Net::HTTPRequestTimeout
98
+ raise Auth0::Errors::TimeoutError
99
+ end
100
+ code = response.code.to_i
101
+ if code.between?(200, 299)
102
+ Auth0::Types::CreateOrganizationClientsResponseContent.load(response.body)
103
+ else
104
+ error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
105
+ raise error_class.new(response.body, code: code)
106
+ end
107
+ end
108
+
109
+ # Remove one or more client associations from an organization.
110
+ #
111
+ # @param request_options [Hash]
112
+ # @param params [Auth0::Organizations::Clients::Types::DeleteOrganizationClientsRequestContent]
113
+ # @option request_options [String] :base_url
114
+ # @option request_options [Hash{String => Object}] :additional_headers
115
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
116
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
117
+ # @option request_options [Integer] :timeout_in_seconds
118
+ # @option params [String] :id
119
+ #
120
+ # @return [untyped]
121
+ def delete(request_options: {}, **params)
122
+ params = Auth0::Internal::Types::Utils.normalize_keys(params)
123
+ request_data = Auth0::Organizations::Clients::Types::DeleteOrganizationClientsRequestContent.new(params).to_h
124
+ non_body_param_names = %w[id]
125
+ body = request_data.except(*non_body_param_names)
126
+
127
+ request = Auth0::Internal::JSON::Request.new(
128
+ base_url: request_options[:base_url],
129
+ method: "DELETE",
130
+ path: "organizations/#{URI.encode_uri_component(params[:id].to_s)}/clients",
131
+ body: body,
132
+ request_options: request_options
133
+ )
134
+ begin
135
+ response = @client.send(request)
136
+ rescue Net::HTTPRequestTimeout
137
+ raise Auth0::Errors::TimeoutError
138
+ end
139
+ code = response.code.to_i
140
+ return if code.between?(200, 299)
141
+
142
+ error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
143
+ raise error_class.new(response.body, code: code)
144
+ end
145
+
146
+ # Get a specific client association for an organization.
147
+ #
148
+ # @param request_options [Hash]
149
+ # @param params [Hash]
150
+ # @option request_options [String] :base_url
151
+ # @option request_options [Hash{String => Object}] :additional_headers
152
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
153
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
154
+ # @option request_options [Integer] :timeout_in_seconds
155
+ # @option params [String] :id
156
+ # @option params [String] :client_id
157
+ #
158
+ # @return [Auth0::Types::GetOrganizationClientResponseContent]
159
+ def get(request_options: {}, **params)
160
+ params = Auth0::Internal::Types::Utils.normalize_keys(params)
161
+ request = Auth0::Internal::JSON::Request.new(
162
+ base_url: request_options[:base_url],
163
+ method: "GET",
164
+ path: "organizations/#{URI.encode_uri_component(params[:id].to_s)}/clients/#{URI.encode_uri_component(params[:client_id].to_s)}",
165
+ request_options: request_options
166
+ )
167
+ begin
168
+ response = @client.send(request)
169
+ rescue Net::HTTPRequestTimeout
170
+ raise Auth0::Errors::TimeoutError
171
+ end
172
+ code = response.code.to_i
173
+ if code.between?(200, 299)
174
+ Auth0::Types::GetOrganizationClientResponseContent.load(response.body)
175
+ else
176
+ error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
177
+ raise error_class.new(response.body, code: code)
178
+ end
179
+ end
180
+
181
+ # Update an organization client association.
182
+ #
183
+ # @param request_options [Hash]
184
+ # @param params [Auth0::Organizations::Clients::Types::UpdateOrganizationClientRequestContent]
185
+ # @option request_options [String] :base_url
186
+ # @option request_options [Hash{String => Object}] :additional_headers
187
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
188
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
189
+ # @option request_options [Integer] :timeout_in_seconds
190
+ # @option params [String] :id
191
+ # @option params [String] :client_id
192
+ #
193
+ # @return [Auth0::Types::UpdateOrganizationClientResponseContent]
194
+ def update(request_options: {}, **params)
195
+ params = Auth0::Internal::Types::Utils.normalize_keys(params)
196
+ request_data = Auth0::Organizations::Clients::Types::UpdateOrganizationClientRequestContent.new(params).to_h
197
+ non_body_param_names = %w[id client_id]
198
+ body = request_data.except(*non_body_param_names)
199
+
200
+ request = Auth0::Internal::JSON::Request.new(
201
+ base_url: request_options[:base_url],
202
+ method: "PATCH",
203
+ path: "organizations/#{URI.encode_uri_component(params[:id].to_s)}/clients/#{URI.encode_uri_component(params[:client_id].to_s)}",
204
+ body: body,
205
+ request_options: request_options
206
+ )
207
+ begin
208
+ response = @client.send(request)
209
+ rescue Net::HTTPRequestTimeout
210
+ raise Auth0::Errors::TimeoutError
211
+ end
212
+ code = response.code.to_i
213
+ if code.between?(200, 299)
214
+ Auth0::Types::UpdateOrganizationClientResponseContent.load(response.body)
215
+ else
216
+ error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
217
+ raise error_class.new(response.body, code: code)
218
+ end
219
+ end
220
+ end
221
+ end
222
+ end
223
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Auth0
4
+ module Organizations
5
+ module Clients
6
+ module Types
7
+ class CreateOrganizationClientsRequestContent < Internal::Types::Model
8
+ field :id, -> { String }, optional: false, nullable: false
9
+
10
+ field :clients, -> { Internal::Types::Array[Auth0::Types::CreateOrganizationClientRequestItem] }, optional: false, nullable: false
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Auth0
4
+ module Organizations
5
+ module Clients
6
+ module Types
7
+ class DeleteOrganizationClientsRequestContent < Internal::Types::Model
8
+ field :id, -> { String }, optional: false, nullable: false
9
+
10
+ field :clients, -> { Internal::Types::Array[String] }, optional: false, nullable: false
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Auth0
4
+ module Organizations
5
+ module Clients
6
+ module Types
7
+ class ListOrganizationClientsRequestParameters < Internal::Types::Model
8
+ field :id, -> { String }, optional: false, nullable: false
9
+
10
+ field :from, -> { String }, optional: true, nullable: false
11
+
12
+ field :take, -> { Integer }, optional: true, nullable: false
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Auth0
4
+ module Organizations
5
+ module Clients
6
+ module Types
7
+ class UpdateOrganizationClientRequestContent < Internal::Types::Model
8
+ field :id, -> { String }, optional: false, nullable: false
9
+
10
+ field :client_id, -> { String }, optional: false, nullable: false
11
+
12
+ field :use_for_member_access, -> { Internal::Types::Boolean }, optional: true, nullable: false
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -18,7 +18,9 @@ module Auth0
18
18
  # - Use the `fields` parameter to optionally define the specific member details retrieved. If `fields` is left
19
19
  # blank, all fields (except roles) are returned.
20
20
  # - Member roles are not sent by default. Use `fields=roles` to retrieve the roles assigned to each listed
21
- # member. To use this parameter, you must include the `read:organization_member_roles` scope in the token.
21
+ # member. To use this parameter, you must include the `read:organization_member_roles` scope in the token. Only
22
+ # directly assigned roles are returned. To also include group-based role assignments, use `GET
23
+ # /api/v2/organizations/{id}/members/{user_id}/effective-roles`.
22
24
  #
23
25
  # This endpoint supports two types of pagination:
24
26
  #
@@ -43,6 +45,7 @@ module Auth0
43
45
  # @option request_options [Hash{String => Object}] :additional_body_parameters
44
46
  # @option request_options [Integer] :timeout_in_seconds
45
47
  # @option params [String] :id
48
+ # @option params [Boolean, nil] :include_totals
46
49
  # @option params [String, nil] :from
47
50
  # @option params [Integer, nil] :take
48
51
  # @option params [String, nil] :fields
@@ -52,6 +55,7 @@ module Auth0
52
55
  def list(request_options: {}, **params)
53
56
  params = Auth0::Internal::Types::Utils.normalize_keys(params)
54
57
  query_params = {}
58
+ query_params["include_totals"] = params.fetch(:include_totals, true)
55
59
  query_params["from"] = params[:from] if params.key?(:from)
56
60
  query_params["take"] = params.fetch(:take, 50)
57
61
  query_params["fields"] = params[:fields] if params.key?(:fields)
@@ -18,6 +18,9 @@ module Auth0
18
18
  # only returns the roles associated with the specified Organization; any roles assigned to the user within
19
19
  # other Organizations are not included.
20
20
  #
21
+ # **Note**: Returns only direct role assignments for this member. To also include group-based role
22
+ # assignments, use `GET /api/v2/organizations/{id}/members/{user_id}/effective-roles`.
23
+ #
21
24
  # @param request_options [Hash]
22
25
  # @param params [Hash]
23
26
  # @option request_options [String] :base_url
@@ -7,6 +7,8 @@ module Auth0
7
7
  class ListOrganizationMembersRequestParameters < Internal::Types::Model
8
8
  field :id, -> { String }, optional: false, nullable: false
9
9
 
10
+ field :include_totals, -> { Internal::Types::Boolean }, optional: true, nullable: false
11
+
10
12
  field :from, -> { String }, optional: true, nullable: false
11
13
 
12
14
  field :take, -> { Integer }, optional: true, nullable: false
@@ -15,6 +15,11 @@ module Auth0
15
15
  def members
16
16
  @members ||= Auth0::Organizations::Roles::Members::Client.new(client: @client)
17
17
  end
18
+
19
+ # @return [Auth0::Groups::Client]
20
+ def groups
21
+ @groups ||= Auth0::Organizations::Roles::Groups::Client.new(client: @client)
22
+ end
18
23
  end
19
24
  end
20
25
  end
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Auth0
4
+ module Organizations
5
+ module Roles
6
+ module Groups
7
+ class Client
8
+ # @param client [Auth0::Internal::Http::RawClient]
9
+ #
10
+ # @return [void]
11
+ def initialize(client:)
12
+ @client = client
13
+ end
14
+
15
+ # Retrieve the list of groups assigned to a role in the context of an organization.
16
+ #
17
+ # @param request_options [Hash]
18
+ # @param params [Hash]
19
+ # @option request_options [String] :base_url
20
+ # @option request_options [Hash{String => Object}] :additional_headers
21
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
22
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
23
+ # @option request_options [Integer] :timeout_in_seconds
24
+ # @option params [String] :organization_id
25
+ # @option params [String] :role_id
26
+ # @option params [String, nil] :from
27
+ # @option params [Integer, nil] :take
28
+ #
29
+ # @return [Auth0::Types::ListOrganizationRoleGroupsResponseContent]
30
+ def list(request_options: {}, **params)
31
+ params = Auth0::Internal::Types::Utils.normalize_keys(params)
32
+ query_params = {}
33
+ query_params["from"] = params[:from] if params.key?(:from)
34
+ query_params["take"] = params.fetch(:take, 50)
35
+
36
+ Auth0::Internal::CursorItemIterator.new(
37
+ cursor_field: :next_,
38
+ item_field: :groups,
39
+ initial_cursor: query_params["from"]
40
+ ) do |next_cursor|
41
+ query_params["from"] = next_cursor
42
+ request = Auth0::Internal::JSON::Request.new(
43
+ base_url: request_options[:base_url],
44
+ method: "GET",
45
+ path: "organizations/#{URI.encode_uri_component(params[:organization_id].to_s)}/roles/#{URI.encode_uri_component(params[:role_id].to_s)}/groups",
46
+ query: query_params,
47
+ request_options: request_options
48
+ )
49
+ begin
50
+ response = @client.send(request)
51
+ rescue Net::HTTPRequestTimeout
52
+ raise Auth0::Errors::TimeoutError
53
+ end
54
+ code = response.code.to_i
55
+ if code.between?(200, 299)
56
+ parsed_response = Auth0::Types::ListOrganizationRoleGroupsResponseContent.load(response.body)
57
+ [parsed_response, response]
58
+ else
59
+ error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
60
+ raise error_class.new(response.body, code: code)
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Auth0
4
+ module Organizations
5
+ module Roles
6
+ module Groups
7
+ module Types
8
+ class ListOrganizationRoleGroupsRequestParameters < Internal::Types::Model
9
+ field :organization_id, -> { String }, optional: false, nullable: false
10
+
11
+ field :role_id, -> { String }, optional: false, nullable: false
12
+
13
+ field :from, -> { String }, optional: true, nullable: false
14
+
15
+ field :take, -> { Integer }, optional: true, nullable: false
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -13,6 +13,12 @@ module Auth0
13
13
  end
14
14
 
15
15
  # List the organization members assigned a specific role within the context of an organization.
16
+ # <ul>
17
+ # <li>
18
+ # <b>Note</b>: Returns only members with direct role assignments. For groups assigned to this role within the
19
+ # organization, use <code>GET /api/v2/organizations/{organization_id}/roles/{role_id}/groups</code>.
20
+ # </li>
21
+ # </ul>
16
22
  #
17
23
  # @param request_options [Hash]
18
24
  # @param params [Hash]
@@ -17,6 +17,8 @@ module Auth0
17
17
  field :token_quota, -> { Auth0::Types::CreateTokenQuota }, optional: true, nullable: false
18
18
 
19
19
  field :third_party_client_access, -> { Auth0::Types::OrganizationThirdPartyClientAccessEnum }, optional: true, nullable: false
20
+
21
+ field :is_app_entitlement_active, -> { Internal::Types::Boolean }, optional: true, nullable: false
20
22
  end
21
23
  end
22
24
  end
@@ -4,11 +4,15 @@ module Auth0
4
4
  module Organizations
5
5
  module Types
6
6
  class ListOrganizationsRequestParameters < Internal::Types::Model
7
+ field :include_totals, -> { Internal::Types::Boolean }, optional: true, nullable: false
8
+
7
9
  field :from, -> { String }, optional: true, nullable: false
8
10
 
9
11
  field :take, -> { Integer }, optional: true, nullable: false
10
12
 
11
13
  field :sort, -> { String }, optional: true, nullable: false
14
+
15
+ field :include_client_association_for, -> { String }, optional: true, nullable: false
12
16
  end
13
17
  end
14
18
  end
@@ -17,6 +17,8 @@ module Auth0
17
17
  field :token_quota, -> { Auth0::Types::UpdateTokenQuota }, optional: true, nullable: false
18
18
 
19
19
  field :third_party_client_access, -> { Auth0::Types::OrganizationThirdPartyClientAccessEnum }, optional: true, nullable: false
20
+
21
+ field :is_app_entitlement_active, -> { Internal::Types::Boolean }, optional: true, nullable: false
20
22
  end
21
23
  end
22
24
  end
@@ -26,6 +26,8 @@ module Auth0
26
26
  # @option params [Integer, nil] :page
27
27
  # @option params [Boolean, nil] :include_totals
28
28
  # @option params [String, nil] :name_filter
29
+ # @option params [Auth0::Types::RoleTypeEnum, nil] :type
30
+ # @option params [String, nil] :owner_id
29
31
  #
30
32
  # @return [Auth0::Types::ListRolesOffsetPaginatedResponseContent]
31
33
  def list(request_options: {}, **params)
@@ -35,6 +37,8 @@ module Auth0
35
37
  query_params["page"] = params.fetch(:page, 0)
36
38
  query_params["include_totals"] = params.fetch(:include_totals, true)
37
39
  query_params["name_filter"] = params[:name_filter] if params.key?(:name_filter)
40
+ query_params["type"] = params[:type] if params.key?(:type)
41
+ query_params["owner_id"] = params[:owner_id] if params.key?(:owner_id)
38
42
 
39
43
  Auth0::Internal::OffsetItemIterator.new(
40
44
  initial_page: query_params["page"],
@@ -7,6 +7,10 @@ module Auth0
7
7
  field :name, -> { String }, optional: false, nullable: false
8
8
 
9
9
  field :description, -> { String }, optional: true, nullable: false
10
+
11
+ field :type, -> { Auth0::Types::RoleTypeEnum }, optional: true, nullable: false
12
+
13
+ field :owner_id, -> { String }, optional: true, nullable: false
10
14
  end
11
15
  end
12
16
  end
@@ -11,6 +11,10 @@ module Auth0
11
11
  field :include_totals, -> { Internal::Types::Boolean }, optional: true, nullable: false
12
12
 
13
13
  field :name_filter, -> { String }, optional: true, nullable: false
14
+
15
+ field :type, -> { Auth0::Types::RoleTypeEnum }, optional: true, nullable: false
16
+
17
+ field :owner_id, -> { String }, optional: true, nullable: false
14
18
  end
15
19
  end
16
20
  end
@@ -15,6 +15,9 @@ module Auth0
15
15
  # Assigned to
16
16
  # Roles](https://auth0.com/docs/manage-users/access-control/configure-core-rbac/roles/view-users-assigned-to-roles).
17
17
  #
18
+ # **Note**: Returns only users with direct role assignments. For groups assigned to this role, use `GET
19
+ # /api/v2/roles/{id}/groups`.
20
+ #
18
21
  # This endpoint supports two types of pagination:
19
22
  #
20
23
  # - Offset pagination
@@ -41,6 +44,7 @@ module Auth0
41
44
  # @option request_options [Hash{String => Object}] :additional_body_parameters
42
45
  # @option request_options [Integer] :timeout_in_seconds
43
46
  # @option params [String] :id
47
+ # @option params [Boolean, nil] :include_totals
44
48
  # @option params [String, nil] :from
45
49
  # @option params [Integer, nil] :take
46
50
  #
@@ -48,6 +52,7 @@ module Auth0
48
52
  def list(request_options: {}, **params)
49
53
  params = Auth0::Internal::Types::Utils.normalize_keys(params)
50
54
  query_params = {}
55
+ query_params["include_totals"] = params.fetch(:include_totals, true)
51
56
  query_params["from"] = params[:from] if params.key?(:from)
52
57
  query_params["take"] = params.fetch(:take, 50)
53
58
 
@@ -7,6 +7,8 @@ module Auth0
7
7
  class ListRoleUsersRequestParameters < Internal::Types::Model
8
8
  field :id, -> { String }, optional: false, nullable: false
9
9
 
10
+ field :include_totals, -> { Internal::Types::Boolean }, optional: true, nullable: false
11
+
10
12
  field :from, -> { String }, optional: true, nullable: false
11
13
 
12
14
  field :take, -> { Integer }, optional: true, nullable: false
@@ -7,6 +7,7 @@ module Auth0
7
7
 
8
8
  BRANDING_SETTINGS = "branding.settings"
9
9
  BRANDING_THEMES_DEFAULT = "branding.themes.default"
10
+ COUNTRY_CODES = "country_codes"
10
11
  CLIENT_LOGO_URI = "client.logo_uri"
11
12
  CLIENT_DESCRIPTION = "client.description"
12
13
  ORGANIZATION_DISPLAY_NAME = "organization.display_name"
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Auth0
4
+ module Types
5
+ module AgentMetadata
6
+ # AgentMetadata is an alias for Hash
7
+
8
+ # @option str [String]
9
+ #
10
+ # @return [untyped]
11
+ def self.load(str)
12
+ ::JSON.parse(str)
13
+ end
14
+
15
+ # @option value [untyped]
16
+ #
17
+ # @return [String]
18
+ def self.dump(value)
19
+ ::JSON.generate(value)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Auth0
4
+ module Types
5
+ class AgentResponseContent < Internal::Types::Model
6
+ field :agent_id, -> { String }, optional: false, nullable: false
7
+
8
+ field :name, -> { String }, optional: false, nullable: false
9
+
10
+ field :created_at, -> { String }, optional: false, nullable: false
11
+
12
+ field :updated_at, -> { String }, optional: false, nullable: false
13
+
14
+ field :external_agent_id, -> { String }, optional: true, nullable: false
15
+
16
+ field :metadata, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
17
+ end
18
+ end
19
+ end