Class: Schematic::Accounts::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/schematic/accounts/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ void



9
10
11
# File 'lib/schematic/accounts/client.rb', line 9

def initialize(client:)
  @client = client
end

Instance Method Details

#count_account_members(request_options: {}, **params) ⇒ Schematic::Accounts::Types::CountAccountMembersResponse

Parameters:

  • request_options (Hash) (defaults to: {})
  • params (Hash)

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Options Hash (**params):

  • :ids (String, nil)
  • :q (String, nil)
  • :limit (Integer, nil)
  • :offset (Integer, nil)

Returns:



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/schematic/accounts/client.rb', line 102

def (request_options: {}, **params)
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
  query_param_names = %i[ids q limit offset]
  query_params = {}
  query_params["ids"] = params[:ids] if params.key?(:ids)
  query_params["q"] = params[:q] if params.key?(:q)
  query_params["limit"] = params[:limit] if params.key?(:limit)
  query_params["offset"] = params[:offset] if params.key?(:offset)
  params.except(*query_param_names)

  request = Schematic::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "GET",
    path: "account-members/count",
    query: query_params,
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Schematic::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    Schematic::Accounts::Types::CountAccountMembersResponse.load(response.body)
  else
    error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(response.body, code: code)
  end
end

#count_api_keys(request_options: {}, **params) ⇒ Schematic::Accounts::Types::CountApiKeysResponse

Parameters:

  • request_options (Hash) (defaults to: {})
  • params (Hash)

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Options Hash (**params):

  • :environment_id (String, nil)
  • :require_environment (Boolean)
  • :limit (Integer, nil)
  • :offset (Integer, nil)

Returns:



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# File 'lib/schematic/accounts/client.rb', line 323

def count_api_keys(request_options: {}, **params)
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
  query_param_names = %i[environment_id require_environment limit offset]
  query_params = {}
  query_params["environment_id"] = params[:environment_id] if params.key?(:environment_id)
  query_params["require_environment"] = params[:require_environment] if params.key?(:require_environment)
  query_params["limit"] = params[:limit] if params.key?(:limit)
  query_params["offset"] = params[:offset] if params.key?(:offset)
  params.except(*query_param_names)

  request = Schematic::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "GET",
    path: "api-keys/count",
    query: query_params,
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Schematic::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    Schematic::Accounts::Types::CountApiKeysResponse.load(response.body)
  else
    error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(response.body, code: code)
  end
end

#count_audit_logs(request_options: {}, **params) ⇒ Schematic::Accounts::Types::CountAuditLogsResponse

Parameters:

  • request_options (Hash) (defaults to: {})
  • params (Hash)

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Options Hash (**params):

  • :actor_type (Schematic::Types::ActorType, nil)
  • :end_time (String, nil)
  • :environment_id (String, nil)
  • :q (String, nil)
  • :start_time (String, nil)
  • :limit (Integer, nil)
  • :offset (Integer, nil)

Returns:



452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
# File 'lib/schematic/accounts/client.rb', line 452

def count_audit_logs(request_options: {}, **params)
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
  query_param_names = %i[actor_type end_time environment_id q start_time limit offset]
  query_params = {}
  query_params["actor_type"] = params[:actor_type] if params.key?(:actor_type)
  query_params["end_time"] = params[:end_time] if params.key?(:end_time)
  query_params["environment_id"] = params[:environment_id] if params.key?(:environment_id)
  query_params["q"] = params[:q] if params.key?(:q)
  query_params["start_time"] = params[:start_time] if params.key?(:start_time)
  query_params["limit"] = params[:limit] if params.key?(:limit)
  query_params["offset"] = params[:offset] if params.key?(:offset)
  params.except(*query_param_names)

  request = Schematic::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "GET",
    path: "audit-log/count",
    query: query_params,
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Schematic::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    Schematic::Accounts::Types::CountAuditLogsResponse.load(response.body)
  else
    error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(response.body, code: code)
  end
end

#create_api_key(request_options: {}, **params) ⇒ Schematic::Accounts::Types::CreateApiKeyResponse

Parameters:

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Returns:



186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/schematic/accounts/client.rb', line 186

def create_api_key(request_options: {}, **params)
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
  request = Schematic::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "POST",
    path: "api-keys",
    body: Schematic::Accounts::Types::CreateApiKeyRequestBody.new(params).to_h,
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Schematic::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    Schematic::Accounts::Types::CreateApiKeyResponse.load(response.body)
  else
    error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(response.body, code: code)
  end
end

#create_environment(request_options: {}, **params) ⇒ Schematic::Accounts::Types::CreateEnvironmentResponse

Parameters:

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Returns:



537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
# File 'lib/schematic/accounts/client.rb', line 537

def create_environment(request_options: {}, **params)
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
  request = Schematic::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "POST",
    path: "environments",
    body: Schematic::Accounts::Types::CreateEnvironmentRequestBody.new(params).to_h,
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Schematic::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    Schematic::Accounts::Types::CreateEnvironmentResponse.load(response.body)
  else
    error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(response.body, code: code)
  end
end

#delete_api_key(request_options: {}, **params) ⇒ Schematic::Accounts::Types::DeleteApiKeyResponse

Parameters:

  • request_options (Hash) (defaults to: {})
  • params (Hash)

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Options Hash (**params):

  • :api_key_id (String)

Returns:



288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
# File 'lib/schematic/accounts/client.rb', line 288

def delete_api_key(request_options: {}, **params)
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
  request = Schematic::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "DELETE",
    path: "api-keys/#{URI.encode_uri_component(params[:api_key_id].to_s)}",
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Schematic::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    Schematic::Accounts::Types::DeleteApiKeyResponse.load(response.body)
  else
    error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(response.body, code: code)
  end
end

#delete_environment(request_options: {}, **params) ⇒ Schematic::Accounts::Types::DeleteEnvironmentResponse

Parameters:

  • request_options (Hash) (defaults to: {})
  • params (Hash)

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Options Hash (**params):

  • :environment_id (String)

Returns:



639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
# File 'lib/schematic/accounts/client.rb', line 639

def delete_environment(request_options: {}, **params)
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
  request = Schematic::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "DELETE",
    path: "environments/#{URI.encode_uri_component(params[:environment_id].to_s)}",
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Schematic::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    Schematic::Accounts::Types::DeleteEnvironmentResponse.load(response.body)
  else
    error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(response.body, code: code)
  end
end

#get_account_member(request_options: {}, **params) ⇒ Schematic::Accounts::Types::GetAccountMemberResponse

Parameters:

  • request_options (Hash) (defaults to: {})
  • params (Hash)

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Options Hash (**params):

  • :account_member_id (String)

Returns:



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/schematic/accounts/client.rb', line 67

def (request_options: {}, **params)
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
  request = Schematic::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "GET",
    path: "account-members/#{URI.encode_uri_component(params[:account_member_id].to_s)}",
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Schematic::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    Schematic::Accounts::Types::GetAccountMemberResponse.load(response.body)
  else
    error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(response.body, code: code)
  end
end

#get_api_key(request_options: {}, **params) ⇒ Schematic::Accounts::Types::GetApiKeyResponse

Parameters:

  • request_options (Hash) (defaults to: {})
  • params (Hash)

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Options Hash (**params):

  • :api_key_id (String)

Returns:



219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/schematic/accounts/client.rb', line 219

def get_api_key(request_options: {}, **params)
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
  request = Schematic::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "GET",
    path: "api-keys/#{URI.encode_uri_component(params[:api_key_id].to_s)}",
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Schematic::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    Schematic::Accounts::Types::GetApiKeyResponse.load(response.body)
  else
    error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(response.body, code: code)
  end
end

#get_audit_log(request_options: {}, **params) ⇒ Schematic::Accounts::Types::GetAuditLogResponse

Parameters:

  • request_options (Hash) (defaults to: {})
  • params (Hash)

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Options Hash (**params):

  • :audit_log_id (String)

Returns:



414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
# File 'lib/schematic/accounts/client.rb', line 414

def get_audit_log(request_options: {}, **params)
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
  request = Schematic::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "GET",
    path: "audit-log/#{URI.encode_uri_component(params[:audit_log_id].to_s)}",
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Schematic::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    Schematic::Accounts::Types::GetAuditLogResponse.load(response.body)
  else
    error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(response.body, code: code)
  end
end

#get_environment(request_options: {}, **params) ⇒ Schematic::Accounts::Types::GetEnvironmentResponse

Parameters:

  • request_options (Hash) (defaults to: {})
  • params (Hash)

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Options Hash (**params):

  • :environment_id (String)

Returns:



570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
# File 'lib/schematic/accounts/client.rb', line 570

def get_environment(request_options: {}, **params)
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
  request = Schematic::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "GET",
    path: "environments/#{URI.encode_uri_component(params[:environment_id].to_s)}",
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Schematic::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    Schematic::Accounts::Types::GetEnvironmentResponse.load(response.body)
  else
    error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(response.body, code: code)
  end
end

#get_who_am_i(request_options: {}, **params) ⇒ Schematic::Accounts::Types::GetWhoAmIResponse

Parameters:

  • request_options (Hash) (defaults to: {})
  • params (Hash)

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Returns:



701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
# File 'lib/schematic/accounts/client.rb', line 701

def get_who_am_i(request_options: {}, **params)
  Schematic::Internal::Types::Utils.normalize_keys(params)
  request = Schematic::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "GET",
    path: "whoami",
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Schematic::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    Schematic::Accounts::Types::GetWhoAmIResponse.load(response.body)
  else
    error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(response.body, code: code)
  end
end

#list_account_members(request_options: {}, **params) ⇒ Schematic::Accounts::Types::ListAccountMembersResponse

Parameters:

  • request_options (Hash) (defaults to: {})
  • params (Hash)

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Options Hash (**params):

  • :ids (String, nil)
  • :q (String, nil)
  • :limit (Integer, nil)
  • :offset (Integer, nil)

Returns:



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/schematic/accounts/client.rb', line 26

def (request_options: {}, **params)
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
  query_param_names = %i[ids q limit offset]
  query_params = {}
  query_params["ids"] = params[:ids] if params.key?(:ids)
  query_params["q"] = params[:q] if params.key?(:q)
  query_params["limit"] = params[:limit] if params.key?(:limit)
  query_params["offset"] = params[:offset] if params.key?(:offset)
  params.except(*query_param_names)

  request = Schematic::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "GET",
    path: "account-members",
    query: query_params,
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Schematic::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    Schematic::Accounts::Types::ListAccountMembersResponse.load(response.body)
  else
    error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(response.body, code: code)
  end
end

#list_api_keys(request_options: {}, **params) ⇒ Schematic::Accounts::Types::ListApiKeysResponse

Parameters:

  • request_options (Hash) (defaults to: {})
  • params (Hash)

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Options Hash (**params):

  • :environment_id (String, nil)
  • :require_environment (Boolean)
  • :limit (Integer, nil)
  • :offset (Integer, nil)

Returns:



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/schematic/accounts/client.rb', line 146

def list_api_keys(request_options: {}, **params)
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
  query_param_names = %i[environment_id require_environment limit offset]
  query_params = {}
  query_params["environment_id"] = params[:environment_id] if params.key?(:environment_id)
  query_params["require_environment"] = params[:require_environment] if params.key?(:require_environment)
  query_params["limit"] = params[:limit] if params.key?(:limit)
  query_params["offset"] = params[:offset] if params.key?(:offset)
  params.except(*query_param_names)

  request = Schematic::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "GET",
    path: "api-keys",
    query: query_params,
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Schematic::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    Schematic::Accounts::Types::ListApiKeysResponse.load(response.body)
  else
    error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(response.body, code: code)
  end
end

#list_audit_logs(request_options: {}, **params) ⇒ Schematic::Accounts::Types::ListAuditLogsResponse

Parameters:

  • request_options (Hash) (defaults to: {})
  • params (Hash)

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Options Hash (**params):

  • :actor_type (Schematic::Types::ActorType, nil)
  • :end_time (String, nil)
  • :environment_id (String, nil)
  • :q (String, nil)
  • :start_time (String, nil)
  • :limit (Integer, nil)
  • :offset (Integer, nil)

Returns:



370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
# File 'lib/schematic/accounts/client.rb', line 370

def list_audit_logs(request_options: {}, **params)
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
  query_param_names = %i[actor_type end_time environment_id q start_time limit offset]
  query_params = {}
  query_params["actor_type"] = params[:actor_type] if params.key?(:actor_type)
  query_params["end_time"] = params[:end_time] if params.key?(:end_time)
  query_params["environment_id"] = params[:environment_id] if params.key?(:environment_id)
  query_params["q"] = params[:q] if params.key?(:q)
  query_params["start_time"] = params[:start_time] if params.key?(:start_time)
  query_params["limit"] = params[:limit] if params.key?(:limit)
  query_params["offset"] = params[:offset] if params.key?(:offset)
  params.except(*query_param_names)

  request = Schematic::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "GET",
    path: "audit-log",
    query: query_params,
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Schematic::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    Schematic::Accounts::Types::ListAuditLogsResponse.load(response.body)
  else
    error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(response.body, code: code)
  end
end

#list_environments(request_options: {}, **params) ⇒ Schematic::Accounts::Types::ListEnvironmentsResponse

Parameters:

  • request_options (Hash) (defaults to: {})
  • params (Hash)

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Options Hash (**params):

  • :ids (String, nil)
  • :limit (Integer, nil)
  • :offset (Integer, nil)

Returns:



498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
# File 'lib/schematic/accounts/client.rb', line 498

def list_environments(request_options: {}, **params)
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
  query_param_names = %i[ids limit offset]
  query_params = {}
  query_params["ids"] = params[:ids] if params.key?(:ids)
  query_params["limit"] = params[:limit] if params.key?(:limit)
  query_params["offset"] = params[:offset] if params.key?(:offset)
  params.except(*query_param_names)

  request = Schematic::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "GET",
    path: "environments",
    query: query_params,
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Schematic::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    Schematic::Accounts::Types::ListEnvironmentsResponse.load(response.body)
  else
    error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(response.body, code: code)
  end
end

#quickstart(request_options: {}, **params) ⇒ Schematic::Accounts::Types::QuickstartResponse

Parameters:

  • request_options (Hash) (defaults to: {})
  • params (Hash)

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Returns:



670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
# File 'lib/schematic/accounts/client.rb', line 670

def quickstart(request_options: {}, **params)
  Schematic::Internal::Types::Utils.normalize_keys(params)
  request = Schematic::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "POST",
    path: "quickstart",
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Schematic::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    Schematic::Accounts::Types::QuickstartResponse.load(response.body)
  else
    error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(response.body, code: code)
  end
end

#update_api_key(request_options: {}, **params) ⇒ Schematic::Accounts::Types::UpdateApiKeyResponse

Parameters:

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Options Hash (**params):

  • :api_key_id (String)

Returns:



251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
# File 'lib/schematic/accounts/client.rb', line 251

def update_api_key(request_options: {}, **params)
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
  request_data = Schematic::Accounts::Types::UpdateApiKeyRequestBody.new(params).to_h
  non_body_param_names = ["api_key_id"]
  body = request_data.except(*non_body_param_names)

  request = Schematic::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "PUT",
    path: "api-keys/#{URI.encode_uri_component(params[:api_key_id].to_s)}",
    body: body,
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Schematic::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    Schematic::Accounts::Types::UpdateApiKeyResponse.load(response.body)
  else
    error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(response.body, code: code)
  end
end

#update_environment(request_options: {}, **params) ⇒ Schematic::Accounts::Types::UpdateEnvironmentResponse

Parameters:

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Options Hash (**params):

  • :environment_id (String)

Returns:



602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
# File 'lib/schematic/accounts/client.rb', line 602

def update_environment(request_options: {}, **params)
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
  request_data = Schematic::Accounts::Types::UpdateEnvironmentRequestBody.new(params).to_h
  non_body_param_names = ["environment_id"]
  body = request_data.except(*non_body_param_names)

  request = Schematic::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "PUT",
    path: "environments/#{URI.encode_uri_component(params[:environment_id].to_s)}",
    body: body,
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Schematic::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    Schematic::Accounts::Types::UpdateEnvironmentResponse.load(response.body)
  else
    error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(response.body, code: code)
  end
end