Class: SDM::Organizations
- Inherits:
-
Object
- Object
- SDM::Organizations
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/svc.rb
Overview
Organizations exposes organization configuration. Most RPCs remain private to the go_private SDK; public MFA management is exposed to all public SDK targets. The terraform-provider target is opted out at the service level because the provider's data-source generator assumes every service has a List RPC; MFA is instead surfaced via a hand-written resource template.
See Organization.
Instance Method Summary collapse
-
#get_mfa(deadline: nil) ⇒ Object
GetMFA gets the organization's MFA configuration.
-
#initialize(channel, parent) ⇒ Organizations
constructor
A new instance of Organizations.
-
#test_mfa(mfa, deadline: nil) ⇒ Object
TestMFA validates MFA connectivity without persisting changes.
-
#update_mfa(mfa, deadline: nil) ⇒ Object
UpdateMFA updates the organization's MFA configuration.
Constructor Details
#initialize(channel, parent) ⇒ Organizations
Returns a new instance of Organizations.
5258 5259 5260 5261 5262 5263 5264 5265 |
# File 'lib/svc.rb', line 5258 def initialize(channel, parent) begin @stub = V1::Organizations::Stub.new(nil, nil, channel_override: channel) rescue => exception raise Plumbing::convert_error_to_porcelain(exception) end @parent = parent end |
Instance Method Details
#get_mfa(deadline: nil) ⇒ Object
GetMFA gets the organization's MFA configuration.
5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 |
# File 'lib/svc.rb', line 5268 def get_mfa( deadline: nil ) req = V1::OrganizationGetMFARequest.new() # Execute before interceptor hooks req = @parent.interceptor.execute_before("Organizations.GetMFA", self, req) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.get_mfa(req, metadata: @parent.("Organizations.GetMFA", 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 # Execute after interceptor hooks plumbing_response = @parent.interceptor.execute_after("Organizations.GetMFA", self, req, plumbing_response) resp = OrganizationGetMFAResponse.new() resp. = Plumbing::(plumbing_response.) resp.mfa = Plumbing::convert_mfa_config_to_porcelain(plumbing_response.mfa) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#test_mfa(mfa, deadline: nil) ⇒ Object
TestMFA validates MFA connectivity without persisting changes.
5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 |
# File 'lib/svc.rb', line 5335 def test_mfa( mfa, deadline: nil ) req = V1::OrganizationTestMFARequest.new() req.mfa = Plumbing::convert_mfa_config_to_plumbing(mfa) # Execute before interceptor hooks req = @parent.interceptor.execute_before("Organizations.TestMFA", self, req) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.test_mfa(req, metadata: @parent.("Organizations.TestMFA", 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 # Execute after interceptor hooks plumbing_response = @parent.interceptor.execute_after("Organizations.TestMFA", self, req, plumbing_response) resp = OrganizationTestMFAResponse.new() resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#update_mfa(mfa, deadline: nil) ⇒ Object
UpdateMFA updates the organization's MFA configuration.
5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 |
# File 'lib/svc.rb', line 5301 def update_mfa( mfa, deadline: nil ) req = V1::OrganizationUpdateMFARequest.new() req.mfa = Plumbing::convert_mfa_config_to_plumbing(mfa) # Execute before interceptor hooks req = @parent.interceptor.execute_before("Organizations.UpdateMFA", self, req) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.update_mfa(req, metadata: @parent.("Organizations.UpdateMFA", 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 # Execute after interceptor hooks plumbing_response = @parent.interceptor.execute_after("Organizations.UpdateMFA", self, req, plumbing_response) resp = OrganizationUpdateMFAResponse.new() resp.mfa = Plumbing::convert_mfa_config_to_porcelain(plumbing_response.mfa) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |