Class: CropwisePlatformSdk::EntitlementsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ EntitlementsApi

Returns a new instance of EntitlementsApi.



19
20
21
# File 'lib/cropwise-platform-sdk/api/entitlements_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/entitlements_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_entitlements(entitlement_id, opts = {}) ⇒ DeleteEntitlements200Response

Soft Delete a Entitlement Delete an Entitlement

Parameters:

  • entitlement_id (String)

    Numeric ID of the Entitlement to remove

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

    the optional parameters

Returns:



27
28
29
30
# File 'lib/cropwise-platform-sdk/api/entitlements_api.rb', line 27

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

#delete_entitlements_with_http_info(entitlement_id, opts = {}) ⇒ Array<(DeleteEntitlements200Response, Integer, Hash)>

Soft Delete a Entitlement Delete an Entitlement

Parameters:

  • entitlement_id (String)

    Numeric ID of the Entitlement to remove

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

    the optional parameters

Returns:



37
38
39
40
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
# File 'lib/cropwise-platform-sdk/api/entitlements_api.rb', line 37

def delete_entitlements_with_http_info(entitlement_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EntitlementsApi.delete_entitlements ...'
  end
  # verify the required parameter 'entitlement_id' is set
  if @api_client.config.client_side_validation && entitlement_id.nil?
    fail ArgumentError, "Missing the required parameter 'entitlement_id' when calling EntitlementsApi.delete_entitlements"
  end
  # resource path
  local_var_path = '/v2/entitlements/{entitlementId}'.sub('{' + 'entitlementId' + '}', CGI.escape(entitlement_id.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] || 'DeleteEntitlements200Response'

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

  new_options = opts.merge(
    :operation => :"EntitlementsApi.delete_entitlements",
    :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: EntitlementsApi#delete_entitlements\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_contracts_by_entitlement(opts = {}) ⇒ ContractsByEntitlements

Get contracts by entitlements

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :entitlements (Array<String>)
  • :should_contract_have_all_entitlements (Boolean)
  • :should_consider_deleted_contracts (Boolean)
  • :last_key (String)
  • :last_key_complement (Integer)

Returns:



93
94
95
96
# File 'lib/cropwise-platform-sdk/api/entitlements_api.rb', line 93

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

#get_contracts_by_entitlement_ids(opts = {}) ⇒ PageableContractsEntitlementAsId

Get contracts by entitlements ids

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :contains (Array<String>)

    If a contract must have all entitlement&#39;s keys or just some of them. Default is SOME_ENTITLEMENTS

  • :include_deleted (Boolean)

    If deleted contracts will be retrieved as well. Default is FALSE

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

Returns:



163
164
165
166
# File 'lib/cropwise-platform-sdk/api/entitlements_api.rb', line 163

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

#get_contracts_by_entitlement_ids_with_http_info(opts = {}) ⇒ Array<(PageableContractsEntitlementAsId, Integer, Hash)>

Get contracts by entitlements ids

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :contains (Array<String>)

    If a contract must have all entitlement&#39;s keys or just some of them. Default is SOME_ENTITLEMENTS

  • :include_deleted (Boolean)

    If deleted contracts will be retrieved as well. Default is FALSE

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

Returns:



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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/cropwise-platform-sdk/api/entitlements_api.rb', line 176

def get_contracts_by_entitlement_ids_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EntitlementsApi.get_contracts_by_entitlement_ids ...'
  end
  allowable_values = []
  if @api_client.config.client_side_validation && opts[:'contains'] && !opts[:'contains'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"contains\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v2/entitlements/ids/contracts'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'contains'] = @api_client.build_collection_param(opts[:'contains'], :multi) if !opts[:'contains'].nil?
  query_params[:'include_deleted'] = opts[:'include_deleted'] if !opts[:'include_deleted'].nil?
  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] || 'PageableContractsEntitlementAsId'

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

  new_options = opts.merge(
    :operation => :"EntitlementsApi.get_contracts_by_entitlement_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: EntitlementsApi#get_contracts_by_entitlement_ids\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_contracts_by_entitlement_keys(opts = {}) ⇒ PageableContractsEntitlementAsId

Get contracts by entitlements keys

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :contains (Array<String>)

    If a contract must have all entitlement&#39;s keys or just some of them. Default is SOME_ENTITLEMENTS

  • :include_deleted (Boolean)

    If deleted contracts will be retrieved as well. Default is FALSE

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

Returns:



241
242
243
244
# File 'lib/cropwise-platform-sdk/api/entitlements_api.rb', line 241

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

#get_contracts_by_entitlement_keys_with_http_info(opts = {}) ⇒ Array<(PageableContractsEntitlementAsId, Integer, Hash)>

Get contracts by entitlements keys

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :contains (Array<String>)

    If a contract must have all entitlement&#39;s keys or just some of them. Default is SOME_ENTITLEMENTS

  • :include_deleted (Boolean)

    If deleted contracts will be retrieved as well. Default is FALSE

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

Returns:



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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
# File 'lib/cropwise-platform-sdk/api/entitlements_api.rb', line 254

def get_contracts_by_entitlement_keys_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EntitlementsApi.get_contracts_by_entitlement_keys ...'
  end
  allowable_values = []
  if @api_client.config.client_side_validation && opts[:'contains'] && !opts[:'contains'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"contains\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v2/entitlements/keys/contracts'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'contains'] = @api_client.build_collection_param(opts[:'contains'], :multi) if !opts[:'contains'].nil?
  query_params[:'include_deleted'] = opts[:'include_deleted'] if !opts[:'include_deleted'].nil?
  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[:'keys_list_model'])

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

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

  new_options = opts.merge(
    :operation => :"EntitlementsApi.get_contracts_by_entitlement_keys",
    :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: EntitlementsApi#get_contracts_by_entitlement_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_contracts_by_entitlement_with_http_info(opts = {}) ⇒ Array<(ContractsByEntitlements, Integer, Hash)>

Get contracts by entitlements

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :entitlements (Array<String>)
  • :should_contract_have_all_entitlements (Boolean)
  • :should_consider_deleted_contracts (Boolean)
  • :last_key (String)
  • :last_key_complement (Integer)

Returns:

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

    ContractsByEntitlements data, response status code and response headers



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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/cropwise-platform-sdk/api/entitlements_api.rb', line 106

def get_contracts_by_entitlement_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EntitlementsApi.get_contracts_by_entitlement ...'
  end
  # resource path
  local_var_path = '/v2/workspaces/contracts/by-entitlements'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'entitlements'] = @api_client.build_collection_param(opts[:'entitlements'], :multi) if !opts[:'entitlements'].nil?
  query_params[:'shouldContractHaveAllEntitlements'] = opts[:'should_contract_have_all_entitlements'] if !opts[:'should_contract_have_all_entitlements'].nil?
  query_params[:'shouldConsiderDeletedContracts'] = opts[:'should_consider_deleted_contracts'] if !opts[:'should_consider_deleted_contracts'].nil?
  query_params[:'lastKey'] = opts[:'last_key'] if !opts[:'last_key'].nil?
  query_params[:'lastKeyComplement'] = opts[:'last_key_complement'] if !opts[:'last_key_complement'].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] || 'ContractsByEntitlements'

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

  new_options = opts.merge(
    :operation => :"EntitlementsApi.get_contracts_by_entitlement",
    :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: EntitlementsApi#get_contracts_by_entitlement\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_entitlements(entitlement_id, opts = {}) ⇒ Entitlement

Get an Entitlement Get an Entitlement

Parameters:

  • entitlement_id (String)

    Numeric ID of the Entitlement

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

    the optional parameters

Returns:



316
317
318
319
# File 'lib/cropwise-platform-sdk/api/entitlements_api.rb', line 316

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

#get_entitlements_by_appid(app_id, opts = {}) ⇒ PageableEntitlements

Get an Entitlements From an App Get an Entitlements From an App

Parameters:

  • app_id (String)

    Numeric ID of the App

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

    the optional parameters

Returns:



379
380
381
382
# File 'lib/cropwise-platform-sdk/api/entitlements_api.rb', line 379

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

#get_entitlements_by_appid_with_http_info(app_id, opts = {}) ⇒ Array<(PageableEntitlements, Integer, Hash)>

Get an Entitlements From an App Get an Entitlements From an App

Parameters:

  • app_id (String)

    Numeric ID of the App

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

    the optional parameters

Returns:

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

    PageableEntitlements data, response status code and response headers



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
424
425
426
427
428
429
430
431
432
433
434
435
# File 'lib/cropwise-platform-sdk/api/entitlements_api.rb', line 389

def get_entitlements_by_appid_with_http_info(app_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EntitlementsApi.get_entitlements_by_appid ...'
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling EntitlementsApi.get_entitlements_by_appid"
  end
  # resource path
  local_var_path = '/v2/apps/{appId}/entitlements'.sub('{' + 'appId' + '}', CGI.escape(app_id.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] || 'PageableEntitlements'

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

  new_options = opts.merge(
    :operation => :"EntitlementsApi.get_entitlements_by_appid",
    :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: EntitlementsApi#get_entitlements_by_appid\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_entitlements_by_ids(opts = {}) ⇒ Array<Entitlement>

Get Entitlements by Ids Get an Entitlements By Ids

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



442
443
444
445
# File 'lib/cropwise-platform-sdk/api/entitlements_api.rb', line 442

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

#get_entitlements_by_ids_with_http_info(opts = {}) ⇒ Array<(Array<Entitlement>, Integer, Hash)>

Get Entitlements by Ids Get an Entitlements By Ids

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    Array<Entitlement> data, response status code and response headers



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
493
494
495
496
497
498
499
# File 'lib/cropwise-platform-sdk/api/entitlements_api.rb', line 452

def get_entitlements_by_ids_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EntitlementsApi.get_entitlements_by_ids ...'
  end
  # resource path
  local_var_path = '/v2/entitlements/ids'

  # 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(['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] || 'Array<Entitlement>'

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

  new_options = opts.merge(
    :operation => :"EntitlementsApi.get_entitlements_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: EntitlementsApi#get_entitlements_by_ids\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_entitlements_with_http_info(entitlement_id, opts = {}) ⇒ Array<(Entitlement, Integer, Hash)>

Get an Entitlement Get an Entitlement

Parameters:

  • entitlement_id (String)

    Numeric ID of the Entitlement

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

    the optional parameters

Returns:

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

    Entitlement data, response status code and response headers



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
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
# File 'lib/cropwise-platform-sdk/api/entitlements_api.rb', line 326

def get_entitlements_with_http_info(entitlement_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EntitlementsApi.get_entitlements ...'
  end
  # verify the required parameter 'entitlement_id' is set
  if @api_client.config.client_side_validation && entitlement_id.nil?
    fail ArgumentError, "Missing the required parameter 'entitlement_id' when calling EntitlementsApi.get_entitlements"
  end
  # resource path
  local_var_path = '/v2/entitlements/{entitlementId}'.sub('{' + 'entitlementId' + '}', CGI.escape(entitlement_id.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] || 'Entitlement'

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

  new_options = opts.merge(
    :operation => :"EntitlementsApi.get_entitlements",
    :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: EntitlementsApi#get_entitlements\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_entitlements(post_entitlements_request, opts = {}) ⇒ Entitlement

Create a Entitlement Creates a new Entitlement

Parameters:

Returns:



506
507
508
509
# File 'lib/cropwise-platform-sdk/api/entitlements_api.rb', line 506

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

#post_entitlements_with_http_info(post_entitlements_request, opts = {}) ⇒ Array<(Entitlement, Integer, Hash)>

Create a Entitlement Creates a new Entitlement

Parameters:

Returns:

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

    Entitlement data, response status code and response headers



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
564
565
566
567
# File 'lib/cropwise-platform-sdk/api/entitlements_api.rb', line 516

def post_entitlements_with_http_info(post_entitlements_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EntitlementsApi.post_entitlements ...'
  end
  # verify the required parameter 'post_entitlements_request' is set
  if @api_client.config.client_side_validation && post_entitlements_request.nil?
    fail ArgumentError, "Missing the required parameter 'post_entitlements_request' when calling EntitlementsApi.post_entitlements"
  end
  # resource path
  local_var_path = '/v2/entitlements'

  # 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(['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(post_entitlements_request)

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

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

  new_options = opts.merge(
    :operation => :"EntitlementsApi.post_entitlements",
    :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: EntitlementsApi#post_entitlements\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_entitlements_entitlement_id(entitlement_id, opts = {}) ⇒ Entitlement

Edit Entitlement Updates a single entitlement

Parameters:

  • entitlement_id (String)

    Numeric ID of the entitlement to update

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

    the optional parameters

Options Hash (opts):

Returns:



575
576
577
578
# File 'lib/cropwise-platform-sdk/api/entitlements_api.rb', line 575

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

#put_entitlements_entitlement_id_with_http_info(entitlement_id, opts = {}) ⇒ Array<(Entitlement, Integer, Hash)>

Edit Entitlement Updates a single entitlement

Parameters:

  • entitlement_id (String)

    Numeric ID of the entitlement to update

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

    the optional parameters

Options Hash (opts):

Returns:

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

    Entitlement 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
637
# File 'lib/cropwise-platform-sdk/api/entitlements_api.rb', line 586

def put_entitlements_entitlement_id_with_http_info(entitlement_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EntitlementsApi.put_entitlements_entitlement_id ...'
  end
  # verify the required parameter 'entitlement_id' is set
  if @api_client.config.client_side_validation && entitlement_id.nil?
    fail ArgumentError, "Missing the required parameter 'entitlement_id' when calling EntitlementsApi.put_entitlements_entitlement_id"
  end
  # resource path
  local_var_path = '/v2/entitlements/{entitlementId}'.sub('{' + 'entitlementId' + '}', CGI.escape(entitlement_id.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(['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[:'put_entitlements_entitlement_id_request'])

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

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

  new_options = opts.merge(
    :operation => :"EntitlementsApi.put_entitlements_entitlement_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: EntitlementsApi#put_entitlements_entitlement_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end