Class: CropwisePlatformSdk::SeasonApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SeasonApi

Returns a new instance of SeasonApi.



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

def api_client
  @api_client
end

Instance Method Details

#attach_cycle_seasons(cycle_id, opts = {}) ⇒ AttachSeasonResultDTO

Attach/Deattach Cycle’s season Attach/Deattach Cycle’s season

Parameters:

  • cycle_id (String)

    Cycle ID.

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

    the optional parameters

Options Hash (opts):

Returns:



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

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

#attach_cycle_seasons_with_http_info(cycle_id, opts = {}) ⇒ Array<(AttachSeasonResultDTO, Integer, Hash)>

Attach/Deattach Cycle&#39;s season Attach/Deattach Cycle&#39;s season

Parameters:

  • cycle_id (String)

    Cycle ID.

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

    the optional parameters

Options Hash (opts):

Returns:

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

    AttachSeasonResultDTO 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
88
89
90
# File 'lib/cropwise-platform-sdk/api/season_api.rb', line 39

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

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

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

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

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

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

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

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

#create_season(opts = {}) ⇒ Season

Season Creator Create a season.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :client_id (String)
  • :season_with_land (SeasonWithLand)

    Details of the Season to be created

Returns:



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

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

#create_season_with_http_info(opts = {}) ⇒ Array<(Season, Integer, Hash)>

Season Creator Create a season.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :client_id (String)
  • :season_with_land (SeasonWithLand)

    Details of the Season to be created

Returns:

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

    Season data, response status code and response headers



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

def create_season_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SeasonApi.create_season ...'
  end
  # resource path
  local_var_path = '/v2/seasons'

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

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

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

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

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

Delete the specified Season.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


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

def delete_season_by_id(season_id, opts = {})
  delete_season_by_id_with_http_info(season_id, opts)
  nil
end

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

Delete the specified Season.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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

def delete_season_by_id_with_http_info(season_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SeasonApi.delete_season_by_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 SeasonApi.delete_season_by_id"
  end
  # resource path
  local_var_path = '/v2/seasons/{season_id}'.sub('{' + 'season_id' + '}', CGI.escape(season_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 => :"SeasonApi.delete_season_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: SeasonApi#delete_season_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_current_season_by_field_id(id, opts = {}) ⇒ GetCurrentSeasonByFieldId200Response

Get Current Season by Field Id Get Current Season by Field Id

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :client_id (String)
  • :include_extended (Boolean)

Returns:



227
228
229
230
# File 'lib/cropwise-platform-sdk/api/season_api.rb', line 227

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

#get_current_season_by_field_id_with_http_info(id, opts = {}) ⇒ Array<(GetCurrentSeasonByFieldId200Response, Integer, Hash)>

Get Current Season by Field Id Get Current Season by Field Id

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :client_id (String)
  • :include_extended (Boolean)

Returns:



239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/cropwise-platform-sdk/api/season_api.rb', line 239

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

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  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] || 'GetCurrentSeasonByFieldId200Response'

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

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

#get_cycle_seasons(cycle_id, opts = {}) ⇒ PagedSeason

Get Cycle’s season Get Cycle’s Seasons

Parameters:

  • cycle_id (String)

    Cycle ID.

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

    the optional parameters

Options Hash (opts):

  • :include_deleted (Boolean)

Returns:



295
296
297
298
# File 'lib/cropwise-platform-sdk/api/season_api.rb', line 295

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

#get_cycle_seasons_with_http_info(cycle_id, opts = {}) ⇒ Array<(PagedSeason, Integer, Hash)>

Get Cycle&#39;s season Get Cycle&#39;s Seasons

Parameters:

  • cycle_id (String)

    Cycle ID.

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

    the optional parameters

Options Hash (opts):

  • :include_deleted (Boolean)

Returns:

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

    PagedSeason data, response status code and response headers



306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
# File 'lib/cropwise-platform-sdk/api/season_api.rb', line 306

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'include_deleted'] = opts[:'include_deleted'] if !opts[:'include_deleted'].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 => :"SeasonApi.get_cycle_seasons",
    :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: SeasonApi#get_cycle_seasons\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_season_by_id(season_id, opts = {}) ⇒ GetCurrentSeasonByFieldId200Response

Season Details Gets the specified Season details.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :include_extended (Boolean)
  • :client_id (String)

Returns:



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

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

#get_season_by_id_with_http_info(season_id, opts = {}) ⇒ Array<(GetCurrentSeasonByFieldId200Response, Integer, Hash)>

Season Details Gets the specified Season details.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :include_extended (Boolean)
  • :client_id (String)

Returns:



374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/cropwise-platform-sdk/api/season_api.rb', line 374

def get_season_by_id_with_http_info(season_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SeasonApi.get_season_by_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 SeasonApi.get_season_by_id"
  end
  # resource path
  local_var_path = '/v2/seasons/{season_id}'.sub('{' + 'season_id' + '}', CGI.escape(season_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  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] || 'GetCurrentSeasonByFieldId200Response'

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

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

#get_season_fields_by_season_id(season_id, opts = {}) ⇒ PagedSeasonField

List Fields of the Season List the Season/Field relationship of the specified Season. It can be filtered using a query parameter to specify a 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

  • :property_id (String)

    An UUID &#x60;Property&#x60; id

Returns:



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

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

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

List Fields of the Season List the Season/Field relationship of the specified Season. It can be filtered using a query parameter to specify a 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

  • :property_id (String)

    An UUID &#x60;Property&#x60; id

Returns:

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

    PagedSeasonField data, response status code and response headers



445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
# File 'lib/cropwise-platform-sdk/api/season_api.rb', line 445

def get_season_fields_by_season_id_with_http_info(season_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SeasonApi.get_season_fields_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 SeasonApi.get_season_fields_by_season_id"
  end
  # resource path
  local_var_path = '/v2/seasons/{season_id}/fields'.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?
  query_params[:'property_id'] = opts[:'property_id'] if !opts[:'property_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] || 'PagedSeasonField'

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

  new_options = opts.merge(
    :operation => :"SeasonApi.get_season_fields_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: SeasonApi#get_season_fields_by_season_id\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:



504
505
506
507
# File 'lib/cropwise-platform-sdk/api/season_api.rb', line 504

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



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

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: SeasonApi.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 => :"SeasonApi.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: SeasonApi#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:



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

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



588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
# File 'lib/cropwise-platform-sdk/api/season_api.rb', line 588

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: SeasonApi.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 SeasonApi.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 => :"SeasonApi.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: SeasonApi#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_field_id(id, opts = {}) ⇒ GetSeasonsByFieldId200Response

Get Seasons by Field Id Get Seasons by Field Id

Parameters:

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

    the optional parameters

Returns:



643
644
645
646
# File 'lib/cropwise-platform-sdk/api/season_api.rb', line 643

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

#get_seasons_by_field_id_with_http_info(id, opts = {}) ⇒ Array<(GetSeasonsByFieldId200Response, Integer, Hash)>

Get Seasons by Field Id Get Seasons by Field Id

Parameters:

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

    the optional parameters

Returns:



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
691
692
693
694
695
696
697
698
699
# File 'lib/cropwise-platform-sdk/api/season_api.rb', line 653

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

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

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

#get_seasons_by_ids(opts = {}) ⇒ PagedSeason

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

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :include_deleted (Boolean)

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

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :uuid_list_model (UUIDListModel)

Returns:



709
710
711
712
# File 'lib/cropwise-platform-sdk/api/season_api.rb', line 709

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

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

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

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :include_deleted (Boolean)

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

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

    PagedSeason data, response status code and response headers



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

def get_seasons_by_ids_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SeasonApi.get_seasons_by_ids ...'
  end
  # resource path
  local_var_path = '/v2/seasons/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] || 'PagedSeason'

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

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

#get_seasons_by_org(org_id, opts = {}) ⇒ PagedSeason

List Organization seasons Gets all seasons of an ‘Organization`

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :client_id (String)
  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :include_extended (Boolean)

Returns:



783
784
785
786
# File 'lib/cropwise-platform-sdk/api/season_api.rb', line 783

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

#get_seasons_by_org_with_extended_attribute(org_id, opts = {}) ⇒ PagedSeason

List Organization seasons with filtered extra_attribute Gets all seasons of an ‘Organization with ExtendedAttribute`

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :client_id (String)
  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :include_extended (Boolean)
  • :extra_attribute (String)

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

Returns:



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

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

#get_seasons_by_org_with_extended_attribute_with_http_info(org_id, opts = {}) ⇒ Array<(PagedSeason, Integer, Hash)>

List Organization seasons with filtered extra_attribute Gets all seasons of an &#x60;Organization with ExtendedAttribute&#x60;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :client_id (String)
  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :include_extended (Boolean)
  • :extra_attribute (String)

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

Returns:

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

    PagedSeason data, response status code and response headers



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
923
924
925
# File 'lib/cropwise-platform-sdk/api/season_api.rb', line 874

def get_seasons_by_org_with_extended_attribute_with_http_info(org_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SeasonApi.get_seasons_by_org_with_extended_attribute ...'
  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 SeasonApi.get_seasons_by_org_with_extended_attribute"
  end
  # resource path
  local_var_path = '/v2/orgs/{org_id}/seasons/extended-search'.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[:'include_extended'] = opts[:'include_extended'] if !opts[:'include_extended'].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] || 'PagedSeason'

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

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

#get_seasons_by_org_with_http_info(org_id, opts = {}) ⇒ Array<(PagedSeason, Integer, Hash)>

List Organization seasons Gets all seasons of an &#x60;Organization&#x60;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :client_id (String)
  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :include_extended (Boolean)

Returns:

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

    PagedSeason data, response status code and response headers



797
798
799
800
801
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
# File 'lib/cropwise-platform-sdk/api/season_api.rb', line 797

def get_seasons_by_org_with_http_info(org_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SeasonApi.get_seasons_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 SeasonApi.get_seasons_by_org"
  end
  # resource path
  local_var_path = '/v2/orgs/{org_id}/seasons'.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[:'include_extended'] = opts[:'include_extended'] if !opts[:'include_extended'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  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] || 'PagedSeason'

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

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

#get_seasons_by_orgs_id(opts = {}) ⇒ PagedSeason

Get Orgs’ Seasons by Orgs’ Ids Get Seasons 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 seasons

  • :page (Integer)

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

  • :size (Integer)

    Requested page size. Default is unpaged

  • :uuid_list_model (UUIDListModel)

Returns:



935
936
937
938
# File 'lib/cropwise-platform-sdk/api/season_api.rb', line 935

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

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

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

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

    PagedSeason data, response status code and response headers



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

def get_seasons_by_orgs_id_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SeasonApi.get_seasons_by_orgs_id ...'
  end
  # resource path
  local_var_path = '/v2/orgs/ids/seasons'

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

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

  new_options = opts.merge(
    :operation => :"SeasonApi.get_seasons_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: SeasonApi#get_seasons_by_orgs_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:



1007
1008
1009
1010
# File 'lib/cropwise-platform-sdk/api/season_api.rb', line 1007

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



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
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
# File 'lib/cropwise-platform-sdk/api/season_api.rb', line 1019

def get_seasons_by_property_with_http_info(property_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SeasonApi.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 SeasonApi.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 => :"SeasonApi.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: SeasonApi#get_seasons_by_property\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)


1074
1075
1076
1077
# File 'lib/cropwise-platform-sdk/api/season_api.rb', line 1074

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



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

def season_land_batch_updates_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SeasonApi.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 => :"SeasonApi.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: SeasonApi#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)


1137
1138
1139
1140
# File 'lib/cropwise-platform-sdk/api/season_api.rb', line 1137

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



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

def season_land_updates_with_http_info(season_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SeasonApi.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 SeasonApi.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 => :"SeasonApi.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: SeasonApi#season_land_updates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_season_by_id(season_id, opts = {}) ⇒ Season

Season Updater Update the specified Season.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :client_id (String)
  • :season (Season)

    Details of the Season to be updated.

Returns:



1206
1207
1208
1209
# File 'lib/cropwise-platform-sdk/api/season_api.rb', line 1206

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

#update_season_by_id_with_http_info(season_id, opts = {}) ⇒ Array<(Season, Integer, Hash)>

Season Updater Update the specified Season.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :client_id (String)
  • :season (Season)

    Details of the Season to be updated.

Returns:

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

    Season data, response status code and response headers



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
1270
# File 'lib/cropwise-platform-sdk/api/season_api.rb', line 1218

def update_season_by_id_with_http_info(season_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SeasonApi.update_season_by_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 SeasonApi.update_season_by_id"
  end
  # resource path
  local_var_path = '/v2/seasons/{season_id}'.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 '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[:'season'])

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

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

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