Method: SDM::Accounts#create
- Defined in:
- lib/svc.rb
#create(account, deadline: nil) ⇒ Object
Create registers a new Account.
922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 |
# File 'lib/svc.rb', line 922 def create( account, deadline: nil ) req = V1::AccountCreateRequest.new() req.account = Plumbing::convert_account_to_plumbing(account) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.create(req, metadata: @parent.("Accounts.Create", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = AccountCreateResponse.new() resp.account = Plumbing::convert_account_to_porcelain(plumbing_response.account) resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp.token = (plumbing_response.token) resp end |