Class: Auth0::Connections::DirectoryProvisioning::Client
- Inherits:
-
Object
- Object
- Auth0::Connections::DirectoryProvisioning::Client
- Defined in:
- lib/auth0/connections/directory_provisioning/client.rb
Instance Method Summary collapse
-
#add_synchronized_group_selections(request_options: {}, **params) ⇒ untyped
Add synchronized group selections to a directory provisioning configuration.
-
#create(request_options: {}, **params) ⇒ Auth0::Types::CreateDirectoryProvisioningResponseContent
Create a directory provisioning configuration for a connection.
-
#delete(request_options: {}, **params) ⇒ untyped
Delete the directory provisioning configuration of a connection.
-
#delete_synchronized_group_selections(request_options: {}, **params) ⇒ untyped
Delete synchronized group selections for a directory provisioning configuration.
-
#get(request_options: {}, **params) ⇒ Auth0::Types::GetDirectoryProvisioningResponseContent
Retrieve the directory provisioning configuration of a connection.
-
#get_default_mapping(request_options: {}, **params) ⇒ Auth0::Types::GetDirectoryProvisioningDefaultMappingResponseContent
Retrieve the directory provisioning default attribute mapping of a connection.
- #initialize(client:) ⇒ void constructor
-
#list(request_options: {}, **params) ⇒ Auth0::Types::ListDirectoryProvisioningsResponseContent
Retrieve a list of directory provisioning configurations of a tenant.
-
#list_synchronized_groups(request_options: {}, **params) ⇒ Auth0::Types::ListSynchronizedGroupsResponseContent
Retrieve the configured synchronized groups for a connection directory provisioning configuration.
-
#set(request_options: {}, **params) ⇒ untyped
Create or replace the selected groups for a connection directory provisioning configuration.
- #synchronizations ⇒ Auth0::Synchronizations::Client
-
#update(request_options: {}, **params) ⇒ Auth0::Types::UpdateDirectoryProvisioningResponseContent
Update the directory provisioning configuration of a connection.
Constructor Details
#initialize(client:) ⇒ void
10 11 12 |
# File 'lib/auth0/connections/directory_provisioning/client.rb', line 10 def initialize(client:) @client = client end |
Instance Method Details
#add_synchronized_group_selections(request_options: {}, **params) ⇒ untyped
Add synchronized group selections to a directory provisioning configuration.
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/auth0/connections/directory_provisioning/client.rb', line 344 def add_synchronized_group_selections(request_options: {}, **params) params = Auth0::Internal::Types::Utils.normalize_keys(params) request_data = Auth0::Connections::DirectoryProvisioning::Types::AddSynchronizedGroupsRequestContent.new(params).to_h non_body_param_names = %w[id] body = request_data.except(*non_body_param_names) request = Auth0::Internal::JSON::Request.new( base_url: [:base_url], method: "POST", path: "connections/#{URI.encode_uri_component(params[:id].to_s)}/directory-provisioning/synchronized-groups", body: body, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Auth0::Errors::TimeoutError end code = response.code.to_i return if code.between?(200, 299) error_class = Auth0::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end |
#create(request_options: {}, **params) ⇒ Auth0::Types::CreateDirectoryProvisioningResponseContent
Create a directory provisioning configuration for a connection.
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/auth0/connections/directory_provisioning/client.rb', line 123 def create(request_options: {}, **params) params = Auth0::Internal::Types::Utils.normalize_keys(params) path_param_names = %i[id] body_params = params.except(*path_param_names) request = Auth0::Internal::JSON::Request.new( base_url: [:base_url], method: "POST", path: "connections/#{URI.encode_uri_component(params[:id].to_s)}/directory-provisioning", body: body_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Auth0::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) (response.body.to_s.empty? ? nil : Auth0::Types::CreateDirectoryProvisioningResponseContent.load(response.body)) else error_class = Auth0::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#delete(request_options: {}, **params) ⇒ untyped
Delete the directory provisioning configuration of a connection.
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
# File 'lib/auth0/connections/directory_provisioning/client.rb', line 164 def delete(request_options: {}, **params) params = Auth0::Internal::Types::Utils.normalize_keys(params) request = Auth0::Internal::JSON::Request.new( base_url: [:base_url], method: "DELETE", path: "connections/#{URI.encode_uri_component(params[:id].to_s)}/directory-provisioning", request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Auth0::Errors::TimeoutError end code = response.code.to_i return if code.between?(200, 299) error_class = Auth0::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end |
#delete_synchronized_group_selections(request_options: {}, **params) ⇒ untyped
Delete synchronized group selections for a directory provisioning configuration
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 |
# File 'lib/auth0/connections/directory_provisioning/client.rb', line 434 def delete_synchronized_group_selections(request_options: {}, **params) params = Auth0::Internal::Types::Utils.normalize_keys(params) request_data = Auth0::Connections::DirectoryProvisioning::Types::DeleteSynchronizedGroupsRequestContent.new(params).to_h non_body_param_names = %w[id] body = request_data.except(*non_body_param_names) request = Auth0::Internal::JSON::Request.new( base_url: [:base_url], method: "DELETE", path: "connections/#{URI.encode_uri_component(params[:id].to_s)}/directory-provisioning/synchronized-groups", body: body, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Auth0::Errors::TimeoutError end code = response.code.to_i return if code.between?(200, 299) error_class = Auth0::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end |
#get(request_options: {}, **params) ⇒ Auth0::Types::GetDirectoryProvisioningResponseContent
Retrieve the directory provisioning configuration of a connection.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/auth0/connections/directory_provisioning/client.rb', line 83 def get(request_options: {}, **params) params = Auth0::Internal::Types::Utils.normalize_keys(params) request = Auth0::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "connections/#{URI.encode_uri_component(params[:id].to_s)}/directory-provisioning", request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Auth0::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) (response.body.to_s.empty? ? nil : Auth0::Types::GetDirectoryProvisioningResponseContent.load(response.body)) else error_class = Auth0::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#get_default_mapping(request_options: {}, **params) ⇒ Auth0::Types::GetDirectoryProvisioningDefaultMappingResponseContent
Retrieve the directory provisioning default attribute mapping of a connection.
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 |
# File 'lib/auth0/connections/directory_provisioning/client.rb', line 243 def get_default_mapping(request_options: {}, **params) params = Auth0::Internal::Types::Utils.normalize_keys(params) request = Auth0::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "connections/#{URI.encode_uri_component(params[:id].to_s)}/directory-provisioning/default-mapping", request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Auth0::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) (response.body.to_s.empty? ? nil : Auth0::Types::GetDirectoryProvisioningDefaultMappingResponseContent.load(response.body)) else error_class = Auth0::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#list(request_options: {}, **params) ⇒ Auth0::Types::ListDirectoryProvisioningsResponseContent
Retrieve a list of directory provisioning configurations of a tenant.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/auth0/connections/directory_provisioning/client.rb', line 33 def list(request_options: {}, **params) params = Auth0::Internal::Types::Utils.normalize_keys(params) query_params = {} query_params["from"] = params[:from] if params.key?(:from) query_params["take"] = params.fetch(:take, 50) Auth0::Internal::CursorItemIterator.new( cursor_field: :next_, item_field: :directory_provisionings, initial_cursor: query_params["from"] ) do |next_cursor| query_params["from"] = next_cursor request = Auth0::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "connections-directory-provisionings", query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Auth0::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) parsed_response = (response.body.to_s.empty? ? nil : Auth0::Types::ListDirectoryProvisioningsResponseContent.load(response.body)) [parsed_response, response] else error_class = Auth0::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end end |
#list_synchronized_groups(request_options: {}, **params) ⇒ Auth0::Types::ListSynchronizedGroupsResponseContent
Retrieve the configured synchronized groups for a connection directory provisioning configuration.
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 |
# File 'lib/auth0/connections/directory_provisioning/client.rb', line 288 def list_synchronized_groups(request_options: {}, **params) params = Auth0::Internal::Types::Utils.normalize_keys(params) query_params = {} query_params["from"] = params[:from] if params.key?(:from) query_params["take"] = params.fetch(:take, 50) query_params["q"] = params[:q] if params.key?(:q) Auth0::Internal::CursorItemIterator.new( cursor_field: :next_, item_field: :groups, initial_cursor: query_params["from"] ) do |next_cursor| query_params["from"] = next_cursor request = Auth0::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "connections/#{URI.encode_uri_component(params[:id].to_s)}/directory-provisioning/synchronized-groups", query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Auth0::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) parsed_response = (response.body.to_s.empty? ? nil : Auth0::Types::ListSynchronizedGroupsResponseContent.load(response.body)) [parsed_response, response] else error_class = Auth0::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end end |
#set(request_options: {}, **params) ⇒ untyped
Create or replace the selected groups for a connection directory provisioning configuration.
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 |
# File 'lib/auth0/connections/directory_provisioning/client.rb', line 389 def set(request_options: {}, **params) params = Auth0::Internal::Types::Utils.normalize_keys(params) request_data = Auth0::Connections::DirectoryProvisioning::Types::ReplaceSynchronizedGroupsRequestContent.new(params).to_h non_body_param_names = %w[id] body = request_data.except(*non_body_param_names) request = Auth0::Internal::JSON::Request.new( base_url: [:base_url], method: "PUT", path: "connections/#{URI.encode_uri_component(params[:id].to_s)}/directory-provisioning/synchronized-groups", body: body, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Auth0::Errors::TimeoutError end code = response.code.to_i return if code.between?(200, 299) error_class = Auth0::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end |
#synchronizations ⇒ Auth0::Synchronizations::Client
460 461 462 |
# File 'lib/auth0/connections/directory_provisioning/client.rb', line 460 def synchronizations @synchronizations ||= Auth0::Connections::DirectoryProvisioning::Synchronizations::Client.new(client: @client) end |
#update(request_options: {}, **params) ⇒ Auth0::Types::UpdateDirectoryProvisioningResponseContent
Update the directory provisioning configuration of a connection.
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/auth0/connections/directory_provisioning/client.rb', line 202 def update(request_options: {}, **params) params = Auth0::Internal::Types::Utils.normalize_keys(params) path_param_names = %i[id] body_params = params.except(*path_param_names) request = Auth0::Internal::JSON::Request.new( base_url: [:base_url], method: "PATCH", path: "connections/#{URI.encode_uri_component(params[:id].to_s)}/directory-provisioning", body: body_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Auth0::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) (response.body.to_s.empty? ? nil : Auth0::Types::UpdateDirectoryProvisioningResponseContent.load(response.body)) else error_class = Auth0::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |