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.
3156 3157 3158 3159 3160 3161 3162 3163 |
# File 'lib/svc.rb', line 3156 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.
3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 |
# File 'lib/svc.rb', line 3166 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.
3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 |
# File 'lib/svc.rb', line 3260 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.
3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 |
# File 'lib/svc.rb', line 3196 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.
3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 |
# File 'lib/svc.rb', line 3289 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.
3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 |
# File 'lib/svc.rb', line 3230 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 |