Class: CropwisePlatformSdk::AccountApi

Inherits:
Object
  • Object
show all
Defined in:
lib/cropwise-platform-sdk/api/account_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AccountApi

Returns a new instance of AccountApi.



19
20
21
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#batch_get_accunt_roles_by_ids(opts = {}) ⇒ PageableAccountRoleDTO

Batch get account roles by ids Return the roles of accounts

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :last_key (String)
  • :size (Integer)
  • :uuid_list_model (UUIDListModel)

Returns:



29
30
31
32
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 29

def batch_get_accunt_roles_by_ids(opts = {})
  data, _status_code, _headers = batch_get_accunt_roles_by_ids_with_http_info(opts)
  data
end

#batch_get_accunt_roles_by_ids_with_http_info(opts = {}) ⇒ Array<(PageableAccountRoleDTO, Integer, Hash)>

Batch get account roles by ids Return the roles of accounts

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :last_key (String)
  • :size (Integer)
  • :uuid_list_model (UUIDListModel)

Returns:

  • (Array<(PageableAccountRoleDTO, Integer, Hash)>)

    PageableAccountRoleDTO data, response status code and response headers



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 41

def batch_get_accunt_roles_by_ids_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.batch_get_accunt_roles_by_ids ...'
  end
  # resource path
  local_var_path = '/v2/accounts/ids/roles'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'last_key'] = opts[:'last_key'] if !opts[:'last_key'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'uuid_list_model'])

  # return_type
  return_type = opts[:debug_return_type] || 'PageableAccountRoleDTO'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.batch_get_accunt_roles_by_ids",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#batch_get_accunt_roles_by_ids\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_account_by_id(account_id, opts = {}) ⇒ nil

Delete an Account Delete the specified ‘Account`.

Parameters:

  • account_id (String)

    Account ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include_extended (Boolean)

Returns:

  • (nil)


98
99
100
101
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 98

def (, opts = {})
  (, opts)
  nil
end

#delete_account_by_id_with_http_info(account_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete an Account Delete the specified &#x60;Account&#x60;.

Parameters:

  • account_id (String)

    Account ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include_extended (Boolean)

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 109

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.delete_account_by_id ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountApi.delete_account_by_id"
  end
  # resource path
  local_var_path = '/v2/accounts/{account_id}'.sub('{' + 'account_id' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'include_extended'] = opts[:'include_extended'] if !opts[:'include_extended'].nil?

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.delete_account_by_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#delete_account_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_account_photo_by_account_id(account_id, opts = {}) ⇒ nil

Remove Account Photo Removes the ‘Account` photo.

Parameters:

  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


161
162
163
164
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 161

def (, opts = {})
  (, opts)
  nil
end

#delete_account_photo_by_account_id_with_http_info(account_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Remove Account Photo Removes the &#x60;Account&#x60; photo.

Parameters:

  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 171

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.delete_account_photo_by_account_id ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountApi.delete_account_photo_by_account_id"
  end
  # resource path
  local_var_path = '/v2/accounts/{account_id}/photo'.sub('{' + 'account_id' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.delete_account_photo_by_account_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#delete_account_photo_by_account_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_v2_accounts_account_id_support(account_id, opts = {}) ⇒ nil

Remove SUPPORT Authority Removes SUPPORT authority from a user. Only super-users will be able to call this endpoint.

Parameters:

  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


224
225
226
227
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 224

def (, opts = {})
  (, opts)
  nil
end

#delete_v2_accounts_account_id_support_with_http_info(account_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Remove SUPPORT Authority Removes SUPPORT authority from a user. Only super-users will be able to call this endpoint.

Parameters:

  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
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
277
278
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 234

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.delete_v2_accounts_account_id_support ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountApi.delete_v2_accounts_account_id_support"
  end
  # resource path
  local_var_path = '/v2/accounts/{account_id}/support'.sub('{' + 'account_id' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.delete_v2_accounts_account_id_support",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#delete_v2_accounts_account_id_support\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#edit_account_by_account_id(account_id, opts = {}) ⇒ UserAccount

Edit Account Edits an existing ‘Account` with the specified id.

Parameters:

  • account_id (String)

    Account ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



287
288
289
290
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 287

def (, opts = {})
  data, _status_code, _headers = (, opts)
  data
end

#edit_account_by_account_id_with_http_info(account_id, opts = {}) ⇒ Array<(UserAccount, Integer, Hash)>

Edit Account Edits an existing &#x60;Account&#x60; with the specified id.

Parameters:

  • account_id (String)

    Account ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(UserAccount, Integer, Hash)>)

    UserAccount data, response status code and response headers



299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
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
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 299

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.edit_account_by_account_id ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountApi.edit_account_by_account_id"
  end
  # resource path
  local_var_path = '/v2/accounts/{account_id}'.sub('{' + 'account_id' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'include_extended'] = opts[:'include_extended'] if !opts[:'include_extended'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'editable_account_info'])

  # return_type
  return_type = opts[:debug_return_type] || 'UserAccount'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.edit_account_by_account_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#edit_account_by_account_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_account_by_account_id(account_id, opts = {}) ⇒ UserAccount

Get Account By Id Retrieve an ‘Account` with the specified id.

Parameters:

  • account_id (String)

    Account ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include_extended (Boolean)
  • :exclude_attributes (String)

    Attributes to exclude

  • :internal_authorities (Boolean)

    Include internal authorities

Returns:



361
362
363
364
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 361

def (, opts = {})
  data, _status_code, _headers = (, opts)
  data
end

#get_account_by_account_id_with_http_info(account_id, opts = {}) ⇒ Array<(UserAccount, Integer, Hash)>

Get Account By Id Retrieve an &#x60;Account&#x60; with the specified id.

Parameters:

  • account_id (String)

    Account ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include_extended (Boolean)
  • :exclude_attributes (String)

    Attributes to exclude

  • :internal_authorities (Boolean)

    Include internal authorities

Returns:

  • (Array<(UserAccount, Integer, Hash)>)

    UserAccount data, response status code and response headers



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
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 374

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.get_account_by_account_id ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountApi.get_account_by_account_id"
  end
  # resource path
  local_var_path = '/v2/accounts/{account_id}'.sub('{' + 'account_id' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'include_extended'] = opts[:'include_extended'] if !opts[:'include_extended'].nil?
  query_params[:'exclude_attributes'] = opts[:'exclude_attributes'] if !opts[:'exclude_attributes'].nil?
  query_params[:'internal_authorities'] = opts[:'internal_authorities'] if !opts[:'internal_authorities'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UserAccount'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.get_account_by_account_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#get_account_by_account_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_account_roles_by_id(account_id, opts = {}) ⇒ PageableAccountRoleDTO

Get Account’s Roles Return the roles of an account

Parameters:

  • account_id (String)

    Account ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :last_key (String)
  • :size (Integer)

Returns:



432
433
434
435
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 432

def (, opts = {})
  data, _status_code, _headers = (, opts)
  data
end

#get_account_roles_by_id_with_http_info(account_id, opts = {}) ⇒ Array<(PageableAccountRoleDTO, Integer, Hash)>

Get Account&#39;s Roles Return the roles of an account

Parameters:

  • account_id (String)

    Account ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :last_key (String)
  • :size (Integer)

Returns:

  • (Array<(PageableAccountRoleDTO, Integer, Hash)>)

    PageableAccountRoleDTO data, response status code and response headers



444
445
446
447
448
449
450
451
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
485
486
487
488
489
490
491
492
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 444

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.get_account_roles_by_id ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountApi.get_account_roles_by_id"
  end
  # resource path
  local_var_path = '/v2/accounts/{account_id}/roles'.sub('{' + 'account_id' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'last_key'] = opts[:'last_key'] if !opts[:'last_key'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'PageableAccountRoleDTO'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.get_account_roles_by_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#get_account_roles_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_accounts_by_accounts_id(opts = {}) ⇒ PagedAccount

Get Accounts by Ids Get Accounts by its Ids. If an id does not exist, it does not return it.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :attributes (Array<String>)

    Return the users&#39; relantionship workspace-organization

  • :uuid_list_model (UUIDListModel)

Returns:



500
501
502
503
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 500

def get_accounts_by_accounts_id(opts = {})
  data, _status_code, _headers = get_accounts_by_accounts_id_with_http_info(opts)
  data
end

#get_accounts_by_accounts_id_with_http_info(opts = {}) ⇒ Array<(PagedAccount, Integer, Hash)>

Get Accounts by Ids Get Accounts by its Ids. If an id does not exist, it does not return it.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :attributes (Array<String>)

    Return the users&#39; relantionship workspace-organization

  • :uuid_list_model (UUIDListModel)

Returns:

  • (Array<(PagedAccount, Integer, Hash)>)

    PagedAccount data, response status code and response headers



511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 511

def get_accounts_by_accounts_id_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.get_accounts_by_accounts_id ...'
  end
  allowable_values = ["workspaces", "licensing_accounts"]
  if @api_client.config.client_side_validation && opts[:'attributes'] && !opts[:'attributes'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"attributes\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v2/accounts/ids'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'attributes'] = @api_client.build_collection_param(opts[:'attributes'], :csv) if !opts[:'attributes'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'uuid_list_model'])

  # return_type
  return_type = opts[:debug_return_type] || 'PagedAccount'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.get_accounts_by_accounts_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#get_accounts_by_accounts_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_accounts_by_defualt_workspace_id(opts = {}) ⇒ PagedAccount

Get Accounts from its default workspaces ids Get Accounts by their default workspace ids. If an id does not exist, it does not return it.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include_deleted (Boolean)

    Return only non-deleted or both deleted and non-deleted accounts

  • :page (Integer)

    Requested page number. Starting from zero. Default is zero.

  • :size (Integer)

    Requested page size. Default is unpaged

  • :uuid_list_model (UUIDListModel)

Returns:



573
574
575
576
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 573

def get_accounts_by_defualt_workspace_id(opts = {})
  data, _status_code, _headers = get_accounts_by_defualt_workspace_id_with_http_info(opts)
  data
end

#get_accounts_by_defualt_workspace_id_with_http_info(opts = {}) ⇒ Array<(PagedAccount, Integer, Hash)>

Get Accounts from its default workspaces ids Get Accounts by their default workspace ids. If an id does not exist, it does not return it.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include_deleted (Boolean)

    Return only non-deleted or both deleted and non-deleted accounts

  • :page (Integer)

    Requested page number. Starting from zero. Default is zero.

  • :size (Integer)

    Requested page size. Default is unpaged

  • :uuid_list_model (UUIDListModel)

Returns:

  • (Array<(PagedAccount, Integer, Hash)>)

    PagedAccount data, response status code and response headers



586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
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
628
629
630
631
632
633
634
635
636
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 586

def get_accounts_by_defualt_workspace_id_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.get_accounts_by_defualt_workspace_id ...'
  end
  # resource path
  local_var_path = '/v2/workspaces/ids/accounts'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'include_deleted'] = opts[:'include_deleted'] if !opts[:'include_deleted'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'uuid_list_model'])

  # return_type
  return_type = opts[:debug_return_type] || 'PagedAccount'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.get_accounts_by_defualt_workspace_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#get_accounts_by_defualt_workspace_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_accounts_by_orgs_id(opts = {}) ⇒ PagedAccount

Get Orgs’ Accounts by Orgs’ Ids Get Accounts by its org’s Ids. If an id does not exist, it does not return it.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include_deleted (Boolean)

    Return only non-deleted or both deleted and non-deleted accounts

  • :exclude_attributes (String)

    List of attributes to be excluded

  • :page (Integer)

    Requested page number. Starting from zero. Default is zero.

  • :size (Integer)

    Requested page size. Default is unpaged

  • :uuid_list_model (UUIDListModel)

Returns:



647
648
649
650
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 647

def get_accounts_by_orgs_id(opts = {})
  data, _status_code, _headers = get_accounts_by_orgs_id_with_http_info(opts)
  data
end

#get_accounts_by_orgs_id_with_http_info(opts = {}) ⇒ Array<(PagedAccount, Integer, Hash)>

Get Orgs&#39; Accounts by Orgs&#39; Ids Get Accounts by its org&#39;s Ids. If an id does not exist, it does not return it.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include_deleted (Boolean)

    Return only non-deleted or both deleted and non-deleted accounts

  • :exclude_attributes (String)

    List of attributes to be excluded

  • :page (Integer)

    Requested page number. Starting from zero. Default is zero.

  • :size (Integer)

    Requested page size. Default is unpaged

  • :uuid_list_model (UUIDListModel)

Returns:

  • (Array<(PagedAccount, Integer, Hash)>)

    PagedAccount data, response status code and response headers



661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 661

def get_accounts_by_orgs_id_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.get_accounts_by_orgs_id ...'
  end
  # resource path
  local_var_path = '/v2/orgs/ids/accounts'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'include_deleted'] = opts[:'include_deleted'] if !opts[:'include_deleted'].nil?
  query_params[:'exclude_attributes'] = opts[:'exclude_attributes'] if !opts[:'exclude_attributes'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'uuid_list_model'])

  # return_type
  return_type = opts[:debug_return_type] || 'PagedAccount'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.get_accounts_by_orgs_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#get_accounts_by_orgs_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invites_by_orgs_id(opts = {}) ⇒ PagedInviteStatus

Get Orgs’ Invites by Orgs’ Ids and its status Get Invites by its org’s Ids. If an id does not exist, it does not return it.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :status_list (String)

    A comma seperated list of status to be returned in response.

  • :page (Integer)

    Requested page number. Starting from zero. Default is zero.

  • :size (Integer)

    Requested page size. Default is unpaged

  • :uuid_list_model (UUIDListModel)

Returns:



722
723
724
725
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 722

def get_invites_by_orgs_id(opts = {})
  data, _status_code, _headers = get_invites_by_orgs_id_with_http_info(opts)
  data
end

#get_invites_by_orgs_id_with_http_info(opts = {}) ⇒ Array<(PagedInviteStatus, Integer, Hash)>

Get Orgs&#39; Invites by Orgs&#39; Ids and its status Get Invites by its org&#39;s Ids. If an id does not exist, it does not return it.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :status_list (String)

    A comma seperated list of status to be returned in response.

  • :page (Integer)

    Requested page number. Starting from zero. Default is zero.

  • :size (Integer)

    Requested page size. Default is unpaged

  • :uuid_list_model (UUIDListModel)

Returns:

  • (Array<(PagedInviteStatus, Integer, Hash)>)

    PagedInviteStatus data, response status code and response headers



735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 735

def get_invites_by_orgs_id_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.get_invites_by_orgs_id ...'
  end
  # resource path
  local_var_path = '/v2/orgs/ids/invite-status'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'status_list'] = opts[:'status_list'] if !opts[:'status_list'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'uuid_list_model'])

  # return_type
  return_type = opts[:debug_return_type] || 'PagedInviteStatus'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.get_invites_by_orgs_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#get_invites_by_orgs_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_me(opts = {}) ⇒ UserAccount

Get current user Requests current signed user basic info, permissions and organizations.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :exclude_attributes (String)

    Attributes to exclude

  • :internal_authorities (Boolean)

    Include internal authorities

Returns:



793
794
795
796
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 793

def get_me(opts = {})
  data, _status_code, _headers = get_me_with_http_info(opts)
  data
end

#get_me_with_http_info(opts = {}) ⇒ Array<(UserAccount, Integer, Hash)>

Get current user Requests current signed user basic info, permissions and organizations.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :exclude_attributes (String)

    Attributes to exclude

  • :internal_authorities (Boolean)

    Include internal authorities

Returns:

  • (Array<(UserAccount, Integer, Hash)>)

    UserAccount data, response status code and response headers



804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 804

def get_me_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.get_me ...'
  end
  # resource path
  local_var_path = '/v2/accounts/me'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'exclude_attributes'] = opts[:'exclude_attributes'] if !opts[:'exclude_attributes'].nil?
  query_params[:'internal_authorities'] = opts[:'internal_authorities'] if !opts[:'internal_authorities'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UserAccount'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.get_me",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#get_me\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_org_accounts_by_org_id(org_id, opts = {}) ⇒ PagedAccount

Get Org Accounts

Parameters:

  • org_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :exclude_attributes (String)

    List of attributes to be excluded, must be separated by comma

  • :page (Integer)

    Requested page number. Starting from zero. Default is zero.

  • :size (Integer)

    Requested page size. Default is unpaged

Returns:



858
859
860
861
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 858

def get_org_accounts_by_org_id(org_id, opts = {})
  data, _status_code, _headers = get_org_accounts_by_org_id_with_http_info(org_id, opts)
  data
end

#get_org_accounts_by_org_id_with_http_info(org_id, opts = {}) ⇒ Array<(PagedAccount, Integer, Hash)>

Get Org Accounts

Parameters:

  • org_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :exclude_attributes (String)

    List of attributes to be excluded, must be separated by comma

  • :page (Integer)

    Requested page number. Starting from zero. Default is zero.

  • :size (Integer)

    Requested page size. Default is unpaged

Returns:

  • (Array<(PagedAccount, Integer, Hash)>)

    PagedAccount data, response status code and response headers



871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 871

def get_org_accounts_by_org_id_with_http_info(org_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.get_org_accounts_by_org_id ...'
  end
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling AccountApi.get_org_accounts_by_org_id"
  end
  # resource path
  local_var_path = '/v2/orgs/{org_id}/accounts/'.sub('{' + 'org_id' + '}', CGI.escape(org_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'exclude_attributes'] = opts[:'exclude_attributes'] if !opts[:'exclude_attributes'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'PagedAccount'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.get_org_accounts_by_org_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#get_org_accounts_by_org_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_root_owners_workspace_id(opts = {}) ⇒ PagedAccount

Get Root owners from the orgs that the workspace id is linked Get Root owners from the orgs that the workspace id is linked. If an id does not exist, it does not return it.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include_deleted (Boolean)

    Return only non-deleted or both deleted and non-deleted accounts

  • :page (Integer)

    Requested page number. Starting from zero. Default is zero.

  • :size (Integer)

    Requested page size. Default is unpaged

  • :uuid_list_model (UUIDListModel)

Returns:



930
931
932
933
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 930

def get_root_owners_workspace_id(opts = {})
  data, _status_code, _headers = get_root_owners_workspace_id_with_http_info(opts)
  data
end

#get_root_owners_workspace_id_with_http_info(opts = {}) ⇒ Array<(PagedAccount, Integer, Hash)>

Get Root owners from the orgs that the workspace id is linked Get Root owners from the orgs that the workspace id is linked. If an id does not exist, it does not return it.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include_deleted (Boolean)

    Return only non-deleted or both deleted and non-deleted accounts

  • :page (Integer)

    Requested page number. Starting from zero. Default is zero.

  • :size (Integer)

    Requested page size. Default is unpaged

  • :uuid_list_model (UUIDListModel)

Returns:

  • (Array<(PagedAccount, Integer, Hash)>)

    PagedAccount data, response status code and response headers



943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 943

def get_root_owners_workspace_id_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.get_root_owners_workspace_id ...'
  end
  # resource path
  local_var_path = '/v2/workspaces/ids/root-owners'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'include_deleted'] = opts[:'include_deleted'] if !opts[:'include_deleted'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'uuid_list_model'])

  # return_type
  return_type = opts[:debug_return_type] || 'PagedAccount'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.get_root_owners_workspace_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#get_root_owners_workspace_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_signup_info(email, opts = {}) ⇒ String

Get information about the email which will signup

Parameters:

  • email (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


999
1000
1001
1002
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 999

def (email, opts = {})
  data, _status_code, _headers = (email, opts)
  data
end

#get_signup_info_with_http_info(email, opts = {}) ⇒ Array<(String, Integer, Hash)>

Get information about the email which will signup

Parameters:

  • email (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Integer, Hash)>)

    String data, response status code and response headers



1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 1008

def (email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.get_signup_info ...'
  end
  # verify the required parameter 'email' is set
  if @api_client.config.client_side_validation && email.nil?
    fail ArgumentError, "Missing the required parameter 'email' when calling AccountApi.get_signup_info"
  end
  # resource path
  local_var_path = '/v2/accounts/signup/info'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'email'] = email

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/html', 'application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'String'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.get_signup_info",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#get_signup_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_v2_accounts_login_name_phone(opts = {}) ⇒ UserAccount

Get Account by parameters. Get the ‘Account`s related to given parameters.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :login (String)
  • :name (String)
  • :phone (String)
  • :exclude_attributes (String)

Returns:



1065
1066
1067
1068
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 1065

def (opts = {})
  data, _status_code, _headers = (opts)
  data
end

#get_v2_accounts_login_name_phone_with_http_info(opts = {}) ⇒ Array<(UserAccount, Integer, Hash)>

Get Account by parameters. Get the &#x60;Account&#x60;s related to given parameters.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :login (String)
  • :name (String)
  • :phone (String)
  • :exclude_attributes (String)

Returns:

  • (Array<(UserAccount, Integer, Hash)>)

    UserAccount data, response status code and response headers



1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 1078

def (opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.get_v2_accounts_login_name_phone ...'
  end
  # resource path
  local_var_path = '/v2/accounts'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'login'] = opts[:'login'] if !opts[:'login'].nil?
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
  query_params[:'phone'] = opts[:'phone'] if !opts[:'phone'].nil?
  query_params[:'exclude_attributes'] = opts[:'exclude_attributes'] if !opts[:'exclude_attributes'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UserAccount'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.get_v2_accounts_login_name_phone",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#get_v2_accounts_login_name_phone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_account_photo(account_id, opts = {}) ⇒ PostAccountPhoto200Response

Upload Account Photo Uploads Account photo.

Parameters:

  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :photo (File)

Returns:



1132
1133
1134
1135
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 1132

def (, opts = {})
  data, _status_code, _headers = (, opts)
  data
end

#post_account_photo_with_http_info(account_id, opts = {}) ⇒ Array<(PostAccountPhoto200Response, Integer, Hash)>

Upload Account Photo Uploads Account photo.

Parameters:

  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :photo (File)

Returns:

  • (Array<(PostAccountPhoto200Response, Integer, Hash)>)

    PostAccountPhoto200Response data, response status code and response headers



1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 1143

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.post_account_photo ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountApi.post_account_photo"
  end
  # resource path
  local_var_path = '/v2/accounts/{account_id}/photo'.sub('{' + 'account_id' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['multipart/form-data'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['photo'] = opts[:'photo'] if !opts[:'photo'].nil?

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'PostAccountPhoto200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.post_account_photo",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#post_account_photo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_v2_accounts_account_id_authorities_updates(account_id, opts = {}) ⇒ nil

update authorities

Parameters:

  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


1202
1203
1204
1205
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 1202

def (, opts = {})
  (, opts)
  nil
end

#post_v2_accounts_account_id_authorities_updates_with_http_info(account_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

update authorities

Parameters:

  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 1212

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.post_v2_accounts_account_id_authorities_updates ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountApi.post_v2_accounts_account_id_authorities_updates"
  end
  # resource path
  local_var_path = '/v2/accounts/{account_id}/authorities/updates'.sub('{' + 'account_id' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'authority_updates_list'])

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.post_v2_accounts_account_id_authorities_updates",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#post_v2_accounts_account_id_authorities_updates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_v2_accounts_account_id_support(account_id, opts = {}) ⇒ nil

Give SUPPORT Authority Gives SUPPORT authority to a user. Only super-users will be able to call this endpoint.

Parameters:

  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


1268
1269
1270
1271
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 1268

def (, opts = {})
  (, opts)
  nil
end

#post_v2_accounts_account_id_support_with_http_info(account_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Give SUPPORT Authority Gives SUPPORT authority to a user. Only super-users will be able to call this endpoint.

Parameters:

  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 1278

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.post_v2_accounts_account_id_support ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountApi.post_v2_accounts_account_id_support"
  end
  # resource path
  local_var_path = '/v2/accounts/{account_id}/support'.sub('{' + 'account_id' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.post_v2_accounts_account_id_support",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#post_v2_accounts_account_id_support\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#revoke_invite_by_id(id, opts = {}) ⇒ nil

Revoke Sent Invitation Revoke Sent Invitation

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


1329
1330
1331
1332
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 1329

def revoke_invite_by_id(id, opts = {})
  revoke_invite_by_id_with_http_info(id, opts)
  nil
end

#revoke_invite_by_id_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Revoke Sent Invitation Revoke Sent Invitation

Parameters:

  • id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 1339

def revoke_invite_by_id_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.revoke_invite_by_id ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AccountApi.revoke_invite_by_id"
  end
  # resource path
  local_var_path = '/v2/accounts/invitation/{id}/revoke'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.revoke_invite_by_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#revoke_invite_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#translate_roles_to_legacy_permissions(account_id, opts = {}) ⇒ nil

Translate Roles to Legacy permissions To the given user, it translates the provided Role to Legacy permissions, it can be done synchronously or asynchronously.

Parameters:

  • account_id (String)

    Account ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :run_async (Boolean)

    Run process asynchronously

  • :role_translate_legacy (RoleTranslateLegacy)

Returns:

  • (nil)


1392
1393
1394
1395
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 1392

def translate_roles_to_legacy_permissions(, opts = {})
  translate_roles_to_legacy_permissions_with_http_info(, opts)
  nil
end

#translate_roles_to_legacy_permissions_with_http_info(account_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Translate Roles to Legacy permissions To the given user, it translates the provided Role to Legacy permissions, it can be done synchronously or asynchronously.

Parameters:

  • account_id (String)

    Account ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :run_async (Boolean)

    Run process asynchronously

  • :role_translate_legacy (RoleTranslateLegacy)

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 1404

def translate_roles_to_legacy_permissions_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.translate_roles_to_legacy_permissions ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountApi.translate_roles_to_legacy_permissions"
  end
  # resource path
  local_var_path = '/v2/accounts/{account_id}/roles/legacy-translation'.sub('{' + 'account_id' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'run_async'] = opts[:'run_async'] if !opts[:'run_async'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'role_translate_legacy'])

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.translate_roles_to_legacy_permissions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#translate_roles_to_legacy_permissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v2_accounts_by_name_get(name, opts = {}) ⇒ PagedAccount

Get Account by name.

Parameters:

  • name (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1460
1461
1462
1463
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 1460

def v2_accounts_by_name_get(name, opts = {})
  data, _status_code, _headers = v2_accounts_by_name_get_with_http_info(name, opts)
  data
end

#v2_accounts_by_name_get_with_http_info(name, opts = {}) ⇒ Array<(PagedAccount, Integer, Hash)>

Get Account by name.

Parameters:

  • name (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PagedAccount, Integer, Hash)>)

    PagedAccount data, response status code and response headers



1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 1469

def v2_accounts_by_name_get_with_http_info(name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.v2_accounts_by_name_get ...'
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling AccountApi.v2_accounts_by_name_get"
  end
  # resource path
  local_var_path = '/v2/accounts/by-name'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'name'] = name

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'PagedAccount'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.v2_accounts_by_name_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#v2_accounts_by_name_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v2_accounts_check_get(login, opts = {}) ⇒ V2AccountsCheckGet200Response

Get If Account exists.

Parameters:

  • login (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1522
1523
1524
1525
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 1522

def v2_accounts_check_get(, opts = {})
  data, _status_code, _headers = v2_accounts_check_get_with_http_info(, opts)
  data
end

#v2_accounts_check_get_with_http_info(login, opts = {}) ⇒ Array<(V2AccountsCheckGet200Response, Integer, Hash)>

Get If Account exists.

Parameters:

  • login (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
# File 'lib/cropwise-platform-sdk/api/account_api.rb', line 1531

def v2_accounts_check_get_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountApi.v2_accounts_check_get ...'
  end
  # verify the required parameter 'login' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'login' when calling AccountApi.v2_accounts_check_get"
  end
  # resource path
  local_var_path = '/v2/accounts/check'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'login'] = 

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'V2AccountsCheckGet200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AccountApi.v2_accounts_check_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountApi#v2_accounts_check_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end