Class: CropwisePlatformSdk::PropertyApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PropertyApi

Returns a new instance of PropertyApi.



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

def api_client
  @api_client
end

Instance Method Details

#create_property(opts = {}) ⇒ Property

Create property Creates a property.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :client_id (String)
  • :editable_property (EditableProperty)

    Details of the Property to be created.

Returns:



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

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

#create_property_with_http_info(opts = {}) ⇒ Array<(Property, Integer, Hash)>

Create property Creates a property.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :client_id (String)
  • :editable_property (EditableProperty)

    Details of the Property to be created.

Returns:

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

    Property data, response status code and response headers



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
84
85
86
87
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 39

def create_property_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PropertyApi.create_property ...'
  end
  # resource path
  local_var_path = '/v2/properties'

  # 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
  header_params[:'client-id'] = opts[:'client_id'] if !opts[:'client_id'].nil?

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

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

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

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

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

#delete_property_by_id(property_id, opts = {}) ⇒ nil

Delete Property By ID Delete the specified property.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


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

def delete_property_by_id(property_id, opts = {})
  delete_property_by_id_with_http_info(property_id, opts)
  nil
end

#delete_property_by_id_with_http_info(property_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete Property By ID Delete the specified property.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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

def delete_property_by_id_with_http_info(property_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PropertyApi.delete_property_by_id ...'
  end
  # verify the required parameter 'property_id' is set
  if @api_client.config.client_side_validation && property_id.nil?
    fail ArgumentError, "Missing the required parameter 'property_id' when calling PropertyApi.delete_property_by_id"
  end
  # resource path
  local_var_path = '/v2/properties/{property_id}'.sub('{' + 'property_id' + '}', CGI.escape(property_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 => :"PropertyApi.delete_property_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: PropertyApi#delete_property_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#edit_property_by_id(property_id, opts = {}) ⇒ BasicProperty

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

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :client_id (String)
  • :editable_property (EditableProperty)

    Details of the Property to be updated.

Returns:



157
158
159
160
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 157

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

#edit_property_by_id_with_http_info(property_id, opts = {}) ⇒ Array<(BasicProperty, Integer, Hash)>

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

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :client_id (String)
  • :editable_property (EditableProperty)

    Details of the Property to be updated.

Returns:

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

    BasicProperty data, response status code and response headers



169
170
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
218
219
220
221
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 169

def edit_property_by_id_with_http_info(property_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PropertyApi.edit_property_by_id ...'
  end
  # verify the required parameter 'property_id' is set
  if @api_client.config.client_side_validation && property_id.nil?
    fail ArgumentError, "Missing the required parameter 'property_id' when calling PropertyApi.edit_property_by_id"
  end
  # resource path
  local_var_path = '/v2/properties/{property_id}'.sub('{' + 'property_id' + '}', CGI.escape(property_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
  header_params[:'client-id'] = opts[:'client_id'] if !opts[:'client_id'].nil?

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

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

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

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

  new_options = opts.merge(
    :operation => :"PropertyApi.edit_property_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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PropertyApi#edit_property_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_current_season_fields(property_id, deleted, opts = {}) ⇒ PagedSeasonField

List of property’s season fields Get the current season fields from a specifief property

Parameters:

  • property_id (String)
  • deleted (Boolean)

    Indicates which operation should be applied. If true find only deleted registers else created/updated

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :last_update_date (Time)

    The last updated date. It will find occurrences after or equals this date

Returns:



232
233
234
235
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 232

def get_current_season_fields(property_id, deleted, opts = {})
  data, _status_code, _headers = get_current_season_fields_with_http_info(property_id, deleted, opts)
  data
end

#get_current_season_fields_with_http_info(property_id, deleted, opts = {}) ⇒ Array<(PagedSeasonField, Integer, Hash)>

List of property&#39;s season fields Get the current season fields from a specifief property

Parameters:

  • property_id (String)
  • deleted (Boolean)

    Indicates which operation should be applied. If true find only deleted registers else created/updated

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :last_update_date (Time)

    The last updated date. It will find occurrences after or equals this date

Returns:

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

    PagedSeasonField data, response status code and response headers



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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 246

def get_current_season_fields_with_http_info(property_id, deleted, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PropertyApi.get_current_season_fields ...'
  end
  # verify the required parameter 'property_id' is set
  if @api_client.config.client_side_validation && property_id.nil?
    fail ArgumentError, "Missing the required parameter 'property_id' when calling PropertyApi.get_current_season_fields"
  end
  # verify the required parameter 'deleted' is set
  if @api_client.config.client_side_validation && deleted.nil?
    fail ArgumentError, "Missing the required parameter 'deleted' when calling PropertyApi.get_current_season_fields"
  end
  # resource path
  local_var_path = '/v2/properties/{property_id}/current-season-fields'.sub('{' + 'property_id' + '}', CGI.escape(property_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'deleted'] = deleted
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'lastUpdateDate'] = opts[:'last_update_date'] if !opts[:'last_update_date'].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] || 'PagedSeasonField'

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

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

#get_fields_by_property(property_id, opts = {}) ⇒ PagedField

List property fields Get the Fields of an specified property and optionally the Geometry of each Field

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :attributes (Array<String>)

    Enable fields in

  • :reference_date (String)

    Filter on reference_date

Returns:



311
312
313
314
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 311

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

#get_fields_by_property_extended_search(property_id, include_extended, opts = {}) ⇒ PagedField

List property fields with ExtendedAttribute Get the Fields of an specified property and optionally the Geometry of each Field

Parameters:

  • property_id (String)
  • include_extended (Boolean)

    Filtered extra-Attribute only if include_extended &#x3D; true

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :attributes (Array<String>)

    Enable fields in response

  • :extra_attribute (String)

    Filtered by multiple key-value pair &quot;name&quot;:&quot;some-name&quot;,&quot;type&quot;:&quot;some-type&quot;

  • :client_id (String)

Returns:



392
393
394
395
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 392

def get_fields_by_property_extended_search(property_id, include_extended, opts = {})
  data, _status_code, _headers = get_fields_by_property_extended_search_with_http_info(property_id, include_extended, opts)
  data
end

#get_fields_by_property_extended_search_with_http_info(property_id, include_extended, opts = {}) ⇒ Array<(PagedField, Integer, Hash)>

List property fields with ExtendedAttribute Get the Fields of an specified property and optionally the Geometry of each Field

Parameters:

  • property_id (String)
  • include_extended (Boolean)

    Filtered extra-Attribute only if include_extended &#x3D; true

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :attributes (Array<String>)

    Enable fields in response

  • :extra_attribute (String)

    Filtered by multiple key-value pair &quot;name&quot;:&quot;some-name&quot;,&quot;type&quot;:&quot;some-type&quot;

  • :client_id (String)

Returns:

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

    PagedField data, response status code and response headers



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
436
437
438
439
440
441
442
443
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
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 408

def get_fields_by_property_extended_search_with_http_info(property_id, include_extended, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PropertyApi.get_fields_by_property_extended_search ...'
  end
  # verify the required parameter 'property_id' is set
  if @api_client.config.client_side_validation && property_id.nil?
    fail ArgumentError, "Missing the required parameter 'property_id' when calling PropertyApi.get_fields_by_property_extended_search"
  end
  # verify the required parameter 'include_extended' is set
  if @api_client.config.client_side_validation && include_extended.nil?
    fail ArgumentError, "Missing the required parameter 'include_extended' when calling PropertyApi.get_fields_by_property_extended_search"
  end
  allowable_values = ["geometry"]
  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/properties/{property_id}/fields/extended-search'.sub('{' + 'property_id' + '}', CGI.escape(property_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'client-id'] = opts[:'client_id'] if !opts[:'client_id'].nil?

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

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

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

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

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

#get_fields_by_property_with_http_info(property_id, opts = {}) ⇒ Array<(PagedField, Integer, Hash)>

List property fields Get the Fields of an specified property and optionally the Geometry of each Field

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :attributes (Array<String>)

    Enable fields in

  • :reference_date (String)

    Filter on reference_date

Returns:

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

    PagedField data, response status code and response headers



325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 325

def get_fields_by_property_with_http_info(property_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PropertyApi.get_fields_by_property ...'
  end
  # verify the required parameter 'property_id' is set
  if @api_client.config.client_side_validation && property_id.nil?
    fail ArgumentError, "Missing the required parameter 'property_id' when calling PropertyApi.get_fields_by_property"
  end
  allowable_values = ["geometry"]
  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/properties/{property_id}/fields'.sub('{' + 'property_id' + '}', CGI.escape(property_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'attributes'] = @api_client.build_collection_param(opts[:'attributes'], :csv) if !opts[:'attributes'].nil?
  query_params[:'reference_date'] = opts[:'reference_date'] if !opts[:'reference_date'].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] || 'PagedField'

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

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

#get_fields_history_by_property(property_id, opts = {}) ⇒ PropertyFieldsHistoryDTO

List property fields history Get the Fields history of an specified property and optionally the Geometry of each Field

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :attributes (Array<String>)

    Enable fields in

  • :contract_id (String)

Returns:



477
478
479
480
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 477

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

#get_fields_history_by_property_with_http_info(property_id, opts = {}) ⇒ Array<(PropertyFieldsHistoryDTO, Integer, Hash)>

List property fields history Get the Fields history of an specified property and optionally the Geometry of each Field

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :attributes (Array<String>)

    Enable fields in

  • :contract_id (String)

Returns:

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

    PropertyFieldsHistoryDTO data, response status code and response headers



489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 489

def get_fields_history_by_property_with_http_info(property_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PropertyApi.get_fields_history_by_property ...'
  end
  # verify the required parameter 'property_id' is set
  if @api_client.config.client_side_validation && property_id.nil?
    fail ArgumentError, "Missing the required parameter 'property_id' when calling PropertyApi.get_fields_history_by_property"
  end
  allowable_values = ["geometry"]
  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/properties/{property_id}/fields/history'.sub('{' + 'property_id' + '}', CGI.escape(property_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'attributes'] = @api_client.build_collection_param(opts[:'attributes'], :csv) if !opts[:'attributes'].nil?
  query_params[:'contract_id'] = opts[:'contract_id'] if !opts[:'contract_id'].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] || 'PropertyFieldsHistoryDTO'

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

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

#get_properties_by_ids(opts = {}) ⇒ PagedProperty

Get Properties By Ids Get Properties 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 properties

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :uuid_list_model (UUIDListModel)

Returns:



551
552
553
554
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 551

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

#get_properties_by_ids_with_http_info(opts = {}) ⇒ Array<(PagedProperty, Integer, Hash)>

Get Properties By Ids Get Properties 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 properties

  • :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<(PagedProperty, Integer, Hash)>)

    PagedProperty data, response status code and response headers



564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
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
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 564

def get_properties_by_ids_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PropertyApi.get_properties_by_ids ...'
  end
  # resource path
  local_var_path = '/v2/properties/ids'

  # 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] || 'PagedProperty'

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

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

#get_properties_by_org(org_id, opts = {}) ⇒ PagedProperty

List Organization properties Gets all properties of an ‘Organization` and optionally the total area of each property.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :attributes (Array<String>)

    Optional area sum for property

Returns:



624
625
626
627
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 624

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

#get_properties_by_org_extended_search(org_id, include_extended, opts = {}) ⇒ PagedProperty

List Organization properties with filtered extra_attribute Gets all properties of an ‘Organization` and optionally the total area of each property.

Parameters:

  • org_id (String)
  • include_extended (Boolean)

    Filtered extra-Attribute only if include_extended &#x3D; true

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :attributes (Array<String>)

    Optional area sum for property

  • :extra_attribute (String)

    Filtered by multiple key-value pair &quot;name&quot;:&quot;some-name&quot;,&quot;type&quot;:&quot;some-type&quot;

  • :client_id (String)

Returns:



703
704
705
706
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 703

def get_properties_by_org_extended_search(org_id, include_extended, opts = {})
  data, _status_code, _headers = get_properties_by_org_extended_search_with_http_info(org_id, include_extended, opts)
  data
end

#get_properties_by_org_extended_search_with_http_info(org_id, include_extended, opts = {}) ⇒ Array<(PagedProperty, Integer, Hash)>

List Organization properties with filtered extra_attribute Gets all properties of an &#x60;Organization&#x60; and optionally the total area of each property.

Parameters:

  • org_id (String)
  • include_extended (Boolean)

    Filtered extra-Attribute only if include_extended &#x3D; true

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :attributes (Array<String>)

    Optional area sum for property

  • :extra_attribute (String)

    Filtered by multiple key-value pair &quot;name&quot;:&quot;some-name&quot;,&quot;type&quot;:&quot;some-type&quot;

  • :client_id (String)

Returns:

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

    PagedProperty data, response status code and response headers



719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
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
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 719

def get_properties_by_org_extended_search_with_http_info(org_id, include_extended, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PropertyApi.get_properties_by_org_extended_search ...'
  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 PropertyApi.get_properties_by_org_extended_search"
  end
  # verify the required parameter 'include_extended' is set
  if @api_client.config.client_side_validation && include_extended.nil?
    fail ArgumentError, "Missing the required parameter 'include_extended' when calling PropertyApi.get_properties_by_org_extended_search"
  end
  allowable_values = ["total_area"]
  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/orgs/{org_id}/properties/extended-search'.sub('{' + 'org_id' + '}', CGI.escape(org_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'client-id'] = opts[:'client_id'] if !opts[:'client_id'].nil?

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

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

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

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

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

#get_properties_by_org_with_http_info(org_id, opts = {}) ⇒ Array<(PagedProperty, Integer, Hash)>

List Organization properties Gets all properties of an &#x60;Organization&#x60; and optionally the total area of each property.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :attributes (Array<String>)

    Optional area sum for property

Returns:

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

    PagedProperty data, response status code and response headers



637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
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
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 637

def get_properties_by_org_with_http_info(org_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PropertyApi.get_properties_by_org ...'
  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 PropertyApi.get_properties_by_org"
  end
  allowable_values = ["total_area"]
  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/orgs/{org_id}/properties'.sub('{' + 'org_id' + '}', CGI.escape(org_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  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'])

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

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

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

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

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

#get_properties_by_orgs_id(opts = {}) ⇒ PagedProperty

Get Orgs’ Properties by Orgs’ Ids Get Properties 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 properties

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :uuid_list_model (UUIDListModel)

Returns:



789
790
791
792
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 789

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

#get_properties_by_orgs_id_with_http_info(opts = {}) ⇒ Array<(PagedProperty, Integer, Hash)>

Get Orgs&#39; Properties by Orgs&#39; Ids Get Properties 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 properties

  • :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<(PagedProperty, Integer, Hash)>)

    PagedProperty data, response status code and response headers



802
803
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
849
850
851
852
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 802

def get_properties_by_orgs_id_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PropertyApi.get_properties_by_orgs_id ...'
  end
  # resource path
  local_var_path = '/v2/orgs/ids/properties'

  # 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] || 'PagedProperty'

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

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

#get_property_by_id(property_id, opts = {}) ⇒ Property

Property Details Gets the property details and optionally total area. Possible query parameters: - total_area: get total area of this property’s Fields.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :attributes (Array<String>)

Returns:



860
861
862
863
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 860

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

#get_property_by_id_with_http_info(property_id, opts = {}) ⇒ Array<(Property, Integer, Hash)>

Property Details Gets the property details and optionally total area. Possible query parameters: - total_area: get total area of this property&#39;s Fields.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :attributes (Array<String>)

Returns:

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

    Property 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
921
922
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 871

def get_property_by_id_with_http_info(property_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PropertyApi.get_property_by_id ...'
  end
  # verify the required parameter 'property_id' is set
  if @api_client.config.client_side_validation && property_id.nil?
    fail ArgumentError, "Missing the required parameter 'property_id' when calling PropertyApi.get_property_by_id"
  end
  allowable_values = ["total_area"]
  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/properties/{property_id}'.sub('{' + 'property_id' + '}', CGI.escape(property_id.to_s))

  # 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'])

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

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

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

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

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

#get_property_cycles(property_id, opts = {}) ⇒ PagedCycleDTO

List Property’s Cycles Gets all cycles of an ‘Property`

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

Returns:



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

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

#get_property_cycles_with_http_info(property_id, opts = {}) ⇒ Array<(PagedCycleDTO, Integer, Hash)>

List Property&#39;s Cycles Gets all cycles of an &#x60;Property&#x60;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

Returns:

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

    PagedCycleDTO 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
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 943

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

  # query parameters
  query_params = opts[:query_params] || {}
  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] || 'PagedCycleDTO'

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

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

#get_region_tree_by_property_id(property_id, opts = {}) ⇒ Array<OutputRegionDTO>

List properties regionTree Get the regionTree of an specified property

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :reference_date (String)

    Filter on reference_date

Returns:



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

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

#get_region_tree_by_property_id_with_http_info(property_id, opts = {}) ⇒ Array<(Array<OutputRegionDTO>, Integer, Hash)>

List properties regionTree Get the regionTree of an specified property

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :reference_date (String)

    Filter on reference_date

Returns:

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

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



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
1056
1057
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 1010

def get_region_tree_by_property_id_with_http_info(property_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PropertyApi.get_region_tree_by_property_id ...'
  end
  # verify the required parameter 'property_id' is set
  if @api_client.config.client_side_validation && property_id.nil?
    fail ArgumentError, "Missing the required parameter 'property_id' when calling PropertyApi.get_region_tree_by_property_id"
  end
  # resource path
  local_var_path = '/v2/properties/{propertyId}/region-tree'.sub('{' + 'propertyId' + '}', CGI.escape(property_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'reference_date'] = opts[:'reference_date'] if !opts[:'reference_date'].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] || 'Array<OutputRegionDTO>'

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

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

#get_regions_by_property_id(property_id, opts = {}) ⇒ Array<OutputParent>

List regions Get the Region of an specified property

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :reference_date (String)

    Filter on reference_date

Returns:



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

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

#get_regions_by_property_id_with_http_info(property_id, opts = {}) ⇒ Array<(Array<OutputParent>, Integer, Hash)>

List regions Get the Region of an specified property

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :reference_date (String)

    Filter on reference_date

Returns:

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

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



1076
1077
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
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 1076

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'reference_date'] = opts[:'reference_date'] if !opts[:'reference_date'].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] || 'Array<OutputParent>'

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

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

#get_regions_history_by_property_id(property_id, opts = {}) ⇒ BasePropertyRegionsHistoryDTO

List regions history Get the Region history of an specified property

Parameters:

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

    the optional parameters

Returns:



1130
1131
1132
1133
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 1130

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

#get_regions_history_by_property_id_with_http_info(property_id, opts = {}) ⇒ Array<(BasePropertyRegionsHistoryDTO, Integer, Hash)>

List regions history Get the Region history of an specified property

Parameters:

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

    the optional parameters

Returns:



1140
1141
1142
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
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 1140

def get_regions_history_by_property_id_with_http_info(property_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PropertyApi.get_regions_history_by_property_id ...'
  end
  # verify the required parameter 'property_id' is set
  if @api_client.config.client_side_validation && property_id.nil?
    fail ArgumentError, "Missing the required parameter 'property_id' when calling PropertyApi.get_regions_history_by_property_id"
  end
  # resource path
  local_var_path = '/v2/properties/{propertyId}/regions/history'.sub('{' + 'propertyId' + '}', CGI.escape(property_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] || 'BasePropertyRegionsHistoryDTO'

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

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

#get_season_areas_by_property_id_and_updated_since(property_id, last_update_date, deleted, opts = {}) ⇒ PagedSeasonField

List season areas updates since last update Get the season areas updates since last update by property

Parameters:

  • property_id (String)
  • last_update_date (Time)
  • deleted (Boolean)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

Returns:



1197
1198
1199
1200
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 1197

def get_season_areas_by_property_id_and_updated_since(property_id, last_update_date, deleted, opts = {})
  data, _status_code, _headers = get_season_areas_by_property_id_and_updated_since_with_http_info(property_id, last_update_date, deleted, opts)
  data
end

#get_season_areas_by_property_id_and_updated_since_with_http_info(property_id, last_update_date, deleted, opts = {}) ⇒ Array<(PagedSeasonField, Integer, Hash)>

List season areas updates since last update Get the season areas updates since last update by property

Parameters:

  • property_id (String)
  • last_update_date (Time)
  • deleted (Boolean)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

Returns:

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

    PagedSeasonField data, response status code and response headers



1211
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
1262
1263
1264
1265
1266
1267
1268
1269
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 1211

def get_season_areas_by_property_id_and_updated_since_with_http_info(property_id, last_update_date, deleted, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PropertyApi.get_season_areas_by_property_id_and_updated_since ...'
  end
  # verify the required parameter 'property_id' is set
  if @api_client.config.client_side_validation && property_id.nil?
    fail ArgumentError, "Missing the required parameter 'property_id' when calling PropertyApi.get_season_areas_by_property_id_and_updated_since"
  end
  # verify the required parameter 'last_update_date' is set
  if @api_client.config.client_side_validation && last_update_date.nil?
    fail ArgumentError, "Missing the required parameter 'last_update_date' when calling PropertyApi.get_season_areas_by_property_id_and_updated_since"
  end
  # verify the required parameter 'deleted' is set
  if @api_client.config.client_side_validation && deleted.nil?
    fail ArgumentError, "Missing the required parameter 'deleted' when calling PropertyApi.get_season_areas_by_property_id_and_updated_since"
  end
  # resource path
  local_var_path = '/v2/properties/{property_id}/season-areas-updates'.sub('{' + 'property_id' + '}', CGI.escape(property_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'last_update_date'] = last_update_date
  query_params[:'deleted'] = deleted
  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] || 'PagedSeasonField'

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

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

#get_season_fields_by_seasons_ids_and_properties_ids(opts = {}) ⇒ PagedSeasonField

List Seasons Fields of Seasons and Properties List the Season/Field relationship for specifieds Seasons. It can be filtered by passing a property id. If none is passed, no season field is filtered.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :include_deleted (Boolean)

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

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :body (Object)

Returns:



1279
1280
1281
1282
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 1279

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

#get_season_fields_by_seasons_ids_and_properties_ids_with_http_info(opts = {}) ⇒ Array<(PagedSeasonField, Integer, Hash)>

List Seasons Fields of Seasons and Properties List the Season/Field relationship for specifieds Seasons. It can be filtered by passing a property id. If none is passed, no season field is filtered.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :include_deleted (Boolean)

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

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :body (Object)

Returns:

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

    PagedSeasonField data, response status code and response headers



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
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 1292

def get_season_fields_by_seasons_ids_and_properties_ids_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PropertyApi.get_season_fields_by_seasons_ids_and_properties_ids ...'
  end
  # resource path
  local_var_path = '/v2/seasons/ids/properties/ids/fields'

  # 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[:'body'])

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

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

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

#get_season_properties_by_season_id(season_id, opts = {}) ⇒ PagedSeasonProperty

List Properties of the Season List the Season/Property relationship of the specified Season and optionally the Season/Field relationship for each Season/Property.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

Returns:



1351
1352
1353
1354
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 1351

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

#get_season_properties_by_season_id_with_http_info(season_id, opts = {}) ⇒ Array<(PagedSeasonProperty, Integer, Hash)>

List Properties of the Season List the Season/Property relationship of the specified Season and optionally the Season/Field relationship for each Season/Property.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

Returns:

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

    PagedSeasonProperty data, response status code and response headers



1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 1363

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

  # query parameters
  query_params = opts[:query_params] || {}
  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] || 'PagedSeasonProperty'

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

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

#get_seasons_by_property(property_id, opts = {}) ⇒ PagedSeason

List property seasons Get the seasons of a specified property

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

Returns:



1420
1421
1422
1423
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 1420

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

#get_seasons_by_property_with_http_info(property_id, opts = {}) ⇒ Array<(PagedSeason, Integer, Hash)>

List property seasons Get the seasons of a specified property

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

Returns:

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

    PagedSeason data, response status code and response headers



1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 1432

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

  # query parameters
  query_params = opts[:query_params] || {}
  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] || 'PagedSeason'

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

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

#get_tasks_by_property(property_id, opts = {}) ⇒ PagedTask

List property tasks Get the tasks of a specified property

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :season_id (String)

    Tasks will be filtered by season_id

  • :since (Time)

    Tasks will be filtered by dates (start and end date)

  • :_until (Time)

    Tasks will be filtered by dates (start and end date)

  • :attributes (Array<String>)

    Enable fields in response

  • :tags (Array<String>)

    Tasks will be filtered by tags when containing one or more of those strings

Returns:



1494
1495
1496
1497
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 1494

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

#get_tasks_by_property_extended_search(property_id, include_extended, opts = {}) ⇒ PagedTask

List property tasks with filtered extra_attribute Get the tasks of a specified property

Parameters:

  • property_id (String)
  • include_extended (Boolean)

    Filtered extra-Attribute only if include_extended &#x3D; true

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :season_id (String)

    Tasks will be filtered by season_id

  • :since (Time)

    Tasks will be filtered by dates (start and end date)

  • :_until (Time)

    Tasks will be filtered by dates (start and end date)

  • :attributes (Array<String>)

    Enable fields in response

  • :tags (Array<String>)

    Tasks will be filtered by tags when containing one or more of those strings

  • :extra_attribute (String)

    Filtered by multiple key-value pair &quot;name&quot;:&quot;some-name&quot;,&quot;type&quot;:&quot;some-type&quot;

  • :client_id (String)

Returns:



1585
1586
1587
1588
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 1585

def get_tasks_by_property_extended_search(property_id, include_extended, opts = {})
  data, _status_code, _headers = get_tasks_by_property_extended_search_with_http_info(property_id, include_extended, opts)
  data
end

#get_tasks_by_property_extended_search_with_http_info(property_id, include_extended, opts = {}) ⇒ Array<(PagedTask, Integer, Hash)>

List property tasks with filtered extra_attribute Get the tasks of a specified property

Parameters:

  • property_id (String)
  • include_extended (Boolean)

    Filtered extra-Attribute only if include_extended &#x3D; true

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :season_id (String)

    Tasks will be filtered by season_id

  • :since (Time)

    Tasks will be filtered by dates (start and end date)

  • :_until (Time)

    Tasks will be filtered by dates (start and end date)

  • :attributes (Array<String>)

    Enable fields in response

  • :tags (Array<String>)

    Tasks will be filtered by tags when containing one or more of those strings

  • :extra_attribute (String)

    Filtered by multiple key-value pair &quot;name&quot;:&quot;some-name&quot;,&quot;type&quot;:&quot;some-type&quot;

  • :client_id (String)

Returns:

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

    PagedTask data, response status code and response headers



1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 1605

def get_tasks_by_property_extended_search_with_http_info(property_id, include_extended, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PropertyApi.get_tasks_by_property_extended_search ...'
  end
  # verify the required parameter 'property_id' is set
  if @api_client.config.client_side_validation && property_id.nil?
    fail ArgumentError, "Missing the required parameter 'property_id' when calling PropertyApi.get_tasks_by_property_extended_search"
  end
  # verify the required parameter 'include_extended' is set
  if @api_client.config.client_side_validation && include_extended.nil?
    fail ArgumentError, "Missing the required parameter 'include_extended' when calling PropertyApi.get_tasks_by_property_extended_search"
  end
  allowable_values = ["geometry"]
  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/properties/{property_id}/tasks/extended-search'.sub('{' + 'property_id' + '}', CGI.escape(property_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'include_extended'] = include_extended
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'season_id'] = opts[:'season_id'] if !opts[:'season_id'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'until'] = opts[:'_until'] if !opts[:'_until'].nil?
  query_params[:'attributes'] = @api_client.build_collection_param(opts[:'attributes'], :csv) if !opts[:'attributes'].nil?
  query_params[:'tags'] = @api_client.build_collection_param(opts[:'tags'], :csv) if !opts[:'tags'].nil?
  query_params[:'extra_attribute'] = opts[:'extra_attribute'] if !opts[:'extra_attribute'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'client-id'] = opts[:'client_id'] if !opts[:'client_id'].nil?

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

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

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

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

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

#get_tasks_by_property_with_http_info(property_id, opts = {}) ⇒ Array<(PagedTask, Integer, Hash)>

List property tasks Get the tasks of a specified property

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :season_id (String)

    Tasks will be filtered by season_id

  • :since (Time)

    Tasks will be filtered by dates (start and end date)

  • :_until (Time)

    Tasks will be filtered by dates (start and end date)

  • :attributes (Array<String>)

    Enable fields in response

  • :tags (Array<String>)

    Tasks will be filtered by tags when containing one or more of those strings

Returns:

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

    PagedTask data, response status code and response headers



1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
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
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 1511

def get_tasks_by_property_with_http_info(property_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PropertyApi.get_tasks_by_property ...'
  end
  # verify the required parameter 'property_id' is set
  if @api_client.config.client_side_validation && property_id.nil?
    fail ArgumentError, "Missing the required parameter 'property_id' when calling PropertyApi.get_tasks_by_property"
  end
  allowable_values = ["geometry"]
  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/properties/{property_id}/tasks'.sub('{' + 'property_id' + '}', CGI.escape(property_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'season_id'] = opts[:'season_id'] if !opts[:'season_id'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'until'] = opts[:'_until'] if !opts[:'_until'].nil?
  query_params[:'attributes'] = @api_client.build_collection_param(opts[:'attributes'], :csv) if !opts[:'attributes'].nil?
  query_params[:'tags'] = @api_client.build_collection_param(opts[:'tags'], :csv) if !opts[:'tags'].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] || 'PagedTask'

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

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

#get_workers_by_org_id_and_properties_ids(org_id, opts = {}) ⇒ PagedWorker

List Organization Workers by Property Id and Name List Worker in a Organization by properties ids. If an empty list is sent, it return all workers from that organization

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :name (String)

    Filter worker by its name

  • :uuid_list_model (UUIDListModel)

Returns:



1678
1679
1680
1681
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 1678

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

#get_workers_by_org_id_and_properties_ids_with_http_info(org_id, opts = {}) ⇒ Array<(PagedWorker, Integer, Hash)>

List Organization Workers by Property Id and Name List Worker in a Organization by properties ids. If an empty list is sent, it return all workers from that organization

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :name (String)

    Filter worker by its name

  • :uuid_list_model (UUIDListModel)

Returns:

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

    PagedWorker data, response status code and response headers



1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 1690

def get_workers_by_org_id_and_properties_ids_with_http_info(org_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PropertyApi.get_workers_by_org_id_and_properties_ids ...'
  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 PropertyApi.get_workers_by_org_id_and_properties_ids"
  end
  # resource path
  local_var_path = '/v2/orgs/{org_id}/properties/ids/workers'.sub('{' + 'org_id' + '}', CGI.escape(org_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].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] || 'PagedWorker'

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

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

#season_land_batch_updates(opts = {}) ⇒ nil

Perform batch of operations related to each Season and ‘land` (Properties and Fields) Associate/dissociate properties and/or fields to/from each Season.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


1749
1750
1751
1752
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 1749

def season_land_batch_updates(opts = {})
  season_land_batch_updates_with_http_info(opts)
  nil
end

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

Perform batch of operations related to each Season and &#x60;land&#x60; (Properties and Fields) Associate/dissociate properties and/or fields to/from each Season.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    nil, response status code and response headers



1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 1759

def season_land_batch_updates_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PropertyApi.season_land_batch_updates ...'
  end
  # resource path
  local_var_path = '/v2/seasons/land/updates'

  # 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[:'season_land_batch_list'])

  # return_type
  return_type = opts[:debug_return_type]

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

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

#season_land_updates(season_id, opts = {}) ⇒ nil

Perform a batch of operations related to Season and ‘land` (Properties and Fields) Associate/dissociate properties and/or fields to/from a Season.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


1812
1813
1814
1815
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 1812

def season_land_updates(season_id, opts = {})
  season_land_updates_with_http_info(season_id, opts)
  nil
end

#season_land_updates_with_http_info(season_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Perform a batch of operations related to Season and &#x60;land&#x60; (Properties and Fields) Associate/dissociate properties and/or fields to/from a Season.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    nil, response status code and response headers



1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
# File 'lib/cropwise-platform-sdk/api/property_api.rb', line 1823

def season_land_updates_with_http_info(season_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PropertyApi.season_land_updates ...'
  end
  # verify the required parameter 'season_id' is set
  if @api_client.config.client_side_validation && season_id.nil?
    fail ArgumentError, "Missing the required parameter 'season_id' when calling PropertyApi.season_land_updates"
  end
  # resource path
  local_var_path = '/v2/seasons/{season_id}/land/updates'.sub('{' + 'season_id' + '}', CGI.escape(season_id.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[:'season_land_updates_list'])

  # return_type
  return_type = opts[:debug_return_type]

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

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