Class: SDM::IdentityAliases
- Inherits:
-
Object
- Object
- SDM::IdentityAliases
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/svc.rb
Overview
IdentityAliases assign an alias to an account within an IdentitySet. The alias is used as the username when connecting to a identity supported resource.
See IdentityAlias.
Instance Method Summary collapse
-
#create(identity_alias, deadline: nil) ⇒ Object
Create registers a new IdentityAlias.
-
#delete(id, deadline: nil) ⇒ Object
Delete removes a IdentityAlias by ID.
-
#get(id, deadline: nil) ⇒ Object
Get reads one IdentityAlias by ID.
-
#initialize(channel, parent) ⇒ IdentityAliases
constructor
A new instance of IdentityAliases.
-
#list(filter, *args, deadline: nil) ⇒ Object
List gets a list of IdentityAliases matching a given set of criteria.
-
#update(identity_alias, deadline: nil) ⇒ Object
Update replaces all the fields of a IdentityAlias by ID.
Constructor Details
#initialize(channel, parent) ⇒ IdentityAliases
Returns a new instance of IdentityAliases.
2388 2389 2390 2391 2392 2393 2394 2395 |
# File 'lib/svc.rb', line 2388 def initialize(channel, parent) begin @stub = V1::IdentityAliases::Stub.new(nil, nil, channel_override: channel) rescue => exception raise Plumbing::convert_error_to_porcelain(exception) end @parent = parent end |
Instance Method Details
#create(identity_alias, deadline: nil) ⇒ Object
Create registers a new IdentityAlias.
2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 |
# File 'lib/svc.rb', line 2398 def create( identity_alias, deadline: nil ) req = V1::IdentityAliasCreateRequest.new() req.identity_alias = Plumbing::convert_identity_alias_to_plumbing(identity_alias) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.create(req, metadata: @parent.("IdentityAliases.Create", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception, deadline)) tries + +sleep(@parent.exponentialBackoff(tries, deadline)) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = IdentityAliasCreateResponse.new() resp.identity_alias = Plumbing::convert_identity_alias_to_porcelain(plumbing_response.identity_alias) resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#delete(id, deadline: nil) ⇒ Object
Delete removes a IdentityAlias by ID.
2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 |
# File 'lib/svc.rb', line 2492 def delete( id, deadline: nil ) req = V1::IdentityAliasDeleteRequest.new() req.id = (id) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.delete(req, metadata: @parent.("IdentityAliases.Delete", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception, deadline)) tries + +sleep(@parent.exponentialBackoff(tries, deadline)) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = IdentityAliasDeleteResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#get(id, deadline: nil) ⇒ Object
Get reads one IdentityAlias by ID.
2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 |
# File 'lib/svc.rb', line 2428 def get( id, deadline: nil ) req = V1::IdentityAliasGetRequest.new() if not @parent.snapshot_time.nil? req. = V1::GetRequestMetadata.new() req..snapshot_at = @parent.snapshot_time end req.id = (id) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.get(req, metadata: @parent.("IdentityAliases.Get", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception, deadline)) tries + +sleep(@parent.exponentialBackoff(tries, deadline)) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = IdentityAliasGetResponse.new() resp.identity_alias = Plumbing::convert_identity_alias_to_porcelain(plumbing_response.identity_alias) resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#list(filter, *args, deadline: nil) ⇒ Object
List gets a list of IdentityAliases matching a given set of criteria.
2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 |
# File 'lib/svc.rb', line 2521 def list( filter, *args, deadline: nil ) req = V1::IdentityAliasListRequest.new() req. = V1::ListRequestMetadata.new() if not @parent.page_limit.nil? req..limit = @parent.page_limit end if not @parent.snapshot_time.nil? req..snapshot_at = @parent.snapshot_time end req.filter = Plumbing::quote_filter_args(filter, *args) resp = Enumerator::Generator.new { |g| tries = 0 loop do begin plumbing_response = @stub.list(req, metadata: @parent.("IdentityAliases.List", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception, deadline)) tries + +sleep(@parent.exponentialBackoff(tries, deadline)) next end raise Plumbing::convert_error_to_porcelain(exception) end tries = 0 plumbing_response.identity_aliases.each do |plumbing_item| g.yield Plumbing::convert_identity_alias_to_porcelain(plumbing_item) end break if plumbing_response..next_cursor == "" req..cursor = plumbing_response..next_cursor end } resp end |
#update(identity_alias, deadline: nil) ⇒ Object
Update replaces all the fields of a IdentityAlias by ID.
2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 |
# File 'lib/svc.rb', line 2462 def update( identity_alias, deadline: nil ) req = V1::IdentityAliasUpdateRequest.new() req.identity_alias = Plumbing::convert_identity_alias_to_plumbing(identity_alias) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.update(req, metadata: @parent.("IdentityAliases.Update", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception, deadline)) tries + +sleep(@parent.exponentialBackoff(tries, deadline)) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = IdentityAliasUpdateResponse.new() resp.identity_alias = Plumbing::convert_identity_alias_to_porcelain(plumbing_response.identity_alias) resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |