Class: OrderCloud::SpecApi

Inherits:
Object
  • Object
show all
Defined in:
lib/order_cloud/api/spec_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SpecApi

Returns a new instance of SpecApi.



30
31
32
# File 'lib/order_cloud/api/spec_api.rb', line 30

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



28
29
30
# File 'lib/order_cloud/api/spec_api.rb', line 28

def api_client
  @api_client
end

Instance Method Details

#create(spec, opts = {}) ⇒ Spec

Parameters:

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

    the optional parameters

Returns:



39
40
41
42
# File 'lib/order_cloud/api/spec_api.rb', line 39

def create(spec, opts = {})
  data, _status_code, _headers = create_with_http_info(spec, opts)
  return data
end

#create_option(spec_id, option, opts = {}) ⇒ SpecOption

Parameters:

  • spec_id

    ID of the spec.

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

    the optional parameters

Returns:



97
98
99
100
# File 'lib/order_cloud/api/spec_api.rb', line 97

def create_option(spec_id, option, opts = {})
  data, _status_code, _headers = create_option_with_http_info(spec_id, option, opts)
  return data
end

#create_option_with_http_info(spec_id, option, opts = {}) ⇒ Array<(SpecOption, Fixnum, Hash)>

Returns SpecOption data, response status code and response headers.

Parameters:

  • spec_id

    ID of the spec.

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

    the optional parameters

Returns:

  • (Array<(SpecOption, Fixnum, Hash)>)

    SpecOption data, response status code and response headers



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

def create_option_with_http_info(spec_id, option, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SpecApi.create_option ..."
  end
  # verify the required parameter 'spec_id' is set
  fail ArgumentError, "Missing the required parameter 'spec_id' when calling SpecApi.create_option" if spec_id.nil?
  # verify the required parameter 'option' is set
  fail ArgumentError, "Missing the required parameter 'option' when calling SpecApi.create_option" if option.nil?
  # resource path
  local_var_path = "/specs/{specID}/options".sub('{format}','json').sub('{' + 'specID' + '}', spec_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(option)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SpecOption')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SpecApi#create_option\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_with_http_info(spec, opts = {}) ⇒ Array<(Spec, Fixnum, Hash)>

Returns Spec data, response status code and response headers.

Parameters:

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

    the optional parameters

Returns:

  • (Array<(Spec, Fixnum, Hash)>)

    Spec data, response status code and response headers



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
# File 'lib/order_cloud/api/spec_api.rb', line 49

def create_with_http_info(spec, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SpecApi.create ..."
  end
  # verify the required parameter 'spec' is set
  fail ArgumentError, "Missing the required parameter 'spec' when calling SpecApi.create" if spec.nil?
  # resource path
  local_var_path = "/specs".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(spec)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Spec')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SpecApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete(spec_id, opts = {}) ⇒ nil

Parameters:

  • spec_id

    ID of the spec.

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

    the optional parameters

Returns:

  • (nil)


157
158
159
160
# File 'lib/order_cloud/api/spec_api.rb', line 157

def delete(spec_id, opts = {})
  delete_with_http_info(spec_id, opts)
  return nil
end

#delete_option(spec_id, option_id, opts = {}) ⇒ nil

Parameters:

  • spec_id

    ID of the spec.

  • option_id

    ID of the option.

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

    the optional parameters

Returns:

  • (nil)


214
215
216
217
# File 'lib/order_cloud/api/spec_api.rb', line 214

def delete_option(spec_id, option_id, opts = {})
  delete_option_with_http_info(spec_id, option_id, opts)
  return nil
end

#delete_option_with_http_info(spec_id, option_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Returns nil, response status code and response headers.

Parameters:

  • spec_id

    ID of the spec.

  • option_id

    ID of the option.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/order_cloud/api/spec_api.rb', line 225

def delete_option_with_http_info(spec_id, option_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SpecApi.delete_option ..."
  end
  # verify the required parameter 'spec_id' is set
  fail ArgumentError, "Missing the required parameter 'spec_id' when calling SpecApi.delete_option" if spec_id.nil?
  # verify the required parameter 'option_id' is set
  fail ArgumentError, "Missing the required parameter 'option_id' when calling SpecApi.delete_option" if option_id.nil?
  # resource path
  local_var_path = "/specs/{specID}/options/{optionID}".sub('{format}','json').sub('{' + 'specID' + '}', spec_id.to_s).sub('{' + 'optionID' + '}', option_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SpecApi#delete_option\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_product_assignment(spec_id, product_id, opts = {}) ⇒ nil

Parameters:

  • spec_id

    ID of the spec.

  • product_id

    ID of the product.

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

    the optional parameters

Returns:

  • (nil)


274
275
276
277
# File 'lib/order_cloud/api/spec_api.rb', line 274

def delete_product_assignment(spec_id, product_id, opts = {})
  delete_product_assignment_with_http_info(spec_id, product_id, opts)
  return nil
end

#delete_product_assignment_with_http_info(spec_id, product_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Returns nil, response status code and response headers.

Parameters:

  • spec_id

    ID of the spec.

  • product_id

    ID of the product.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/order_cloud/api/spec_api.rb', line 285

def delete_product_assignment_with_http_info(spec_id, product_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SpecApi.delete_product_assignment ..."
  end
  # verify the required parameter 'spec_id' is set
  fail ArgumentError, "Missing the required parameter 'spec_id' when calling SpecApi.delete_product_assignment" if spec_id.nil?
  # verify the required parameter 'product_id' is set
  fail ArgumentError, "Missing the required parameter 'product_id' when calling SpecApi.delete_product_assignment" if product_id.nil?
  # resource path
  local_var_path = "/specs/{specID}/productassignments/{productID}".sub('{format}','json').sub('{' + 'specID' + '}', spec_id.to_s).sub('{' + 'productID' + '}', product_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SpecApi#delete_product_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_with_http_info(spec_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Returns nil, response status code and response headers.

Parameters:

  • spec_id

    ID of the spec.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



167
168
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
# File 'lib/order_cloud/api/spec_api.rb', line 167

def delete_with_http_info(spec_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SpecApi.delete ..."
  end
  # verify the required parameter 'spec_id' is set
  fail ArgumentError, "Missing the required parameter 'spec_id' when calling SpecApi.delete" if spec_id.nil?
  # resource path
  local_var_path = "/specs/{specID}".sub('{format}','json').sub('{' + 'specID' + '}', spec_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SpecApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get(spec_id, opts = {}) ⇒ Spec

Parameters:

  • spec_id

    ID of the spec.

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

    the optional parameters

Returns:



333
334
335
336
# File 'lib/order_cloud/api/spec_api.rb', line 333

def get(spec_id, opts = {})
  data, _status_code, _headers = get_with_http_info(spec_id, opts)
  return data
end

#get_option(spec_id, option_id, opts = {}) ⇒ SpecOption

Parameters:

  • spec_id

    ID of the spec.

  • option_id

    ID of the option.

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

    the optional parameters

Returns:



391
392
393
394
# File 'lib/order_cloud/api/spec_api.rb', line 391

def get_option(spec_id, option_id, opts = {})
  data, _status_code, _headers = get_option_with_http_info(spec_id, option_id, opts)
  return data
end

#get_option_with_http_info(spec_id, option_id, opts = {}) ⇒ Array<(SpecOption, Fixnum, Hash)>

Returns SpecOption data, response status code and response headers.

Parameters:

  • spec_id

    ID of the spec.

  • option_id

    ID of the option.

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

    the optional parameters

Returns:

  • (Array<(SpecOption, Fixnum, Hash)>)

    SpecOption data, response status code and response headers



402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
# File 'lib/order_cloud/api/spec_api.rb', line 402

def get_option_with_http_info(spec_id, option_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SpecApi.get_option ..."
  end
  # verify the required parameter 'spec_id' is set
  fail ArgumentError, "Missing the required parameter 'spec_id' when calling SpecApi.get_option" if spec_id.nil?
  # verify the required parameter 'option_id' is set
  fail ArgumentError, "Missing the required parameter 'option_id' when calling SpecApi.get_option" if option_id.nil?
  # resource path
  local_var_path = "/specs/{specID}/options/{optionID}".sub('{format}','json').sub('{' + 'specID' + '}', spec_id.to_s).sub('{' + 'optionID' + '}', option_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SpecOption')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SpecApi#get_option\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_with_http_info(spec_id, opts = {}) ⇒ Array<(Spec, Fixnum, Hash)>

Returns Spec data, response status code and response headers.

Parameters:

  • spec_id

    ID of the spec.

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

    the optional parameters

Returns:

  • (Array<(Spec, Fixnum, Hash)>)

    Spec data, response status code and response headers



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
380
381
382
383
# File 'lib/order_cloud/api/spec_api.rb', line 343

def get_with_http_info(spec_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SpecApi.get ..."
  end
  # verify the required parameter 'spec_id' is set
  fail ArgumentError, "Missing the required parameter 'spec_id' when calling SpecApi.get" if spec_id.nil?
  # resource path
  local_var_path = "/specs/{specID}".sub('{format}','json').sub('{' + 'specID' + '}', spec_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Spec')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SpecApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list(opts = {}) ⇒ ListSpec

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Word or phrase to search for.

  • :search_on (String)

    Comma-delimited list of fields to search on.

  • :sort_by (String)

    Comma-delimited list of fields to sort by.

  • :page (Integer)

    Page of results to return. Default: 1

  • :page_size (Integer)

    Number of results to return per page. Default: 20, max: 100.

  • :filters (Hash<String, String>)

    Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or &#39;xp.???&#39;

Returns:



456
457
458
459
# File 'lib/order_cloud/api/spec_api.rb', line 456

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

#list_options(spec_id, opts = {}) ⇒ ListSpecOption

Parameters:

  • spec_id

    ID of the spec.

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Word or phrase to search for.

  • :search_on (String)

    Comma-delimited list of fields to search on.

  • :sort_by (String)

    Comma-delimited list of fields to sort by.

  • :page (Integer)

    Page of results to return. Default: 1

  • :page_size (Integer)

    Number of results to return per page. Default: 20, max: 100.

  • :filters (Hash<String, String>)

    Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or &#39;xp.???&#39;

Returns:



528
529
530
531
# File 'lib/order_cloud/api/spec_api.rb', line 528

def list_options(spec_id, opts = {})
  data, _status_code, _headers = list_options_with_http_info(spec_id, opts)
  return data
end

#list_options_with_http_info(spec_id, opts = {}) ⇒ Array<(ListSpecOption, Fixnum, Hash)>

Returns ListSpecOption data, response status code and response headers.

Parameters:

  • spec_id

    ID of the spec.

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Word or phrase to search for.

  • :search_on (String)

    Comma-delimited list of fields to search on.

  • :sort_by (String)

    Comma-delimited list of fields to sort by.

  • :page (Integer)

    Page of results to return. Default: 1

  • :page_size (Integer)

    Number of results to return per page. Default: 20, max: 100.

  • :filters (Hash<String, String>)

    Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or &#39;xp.???&#39;

Returns:

  • (Array<(ListSpecOption, Fixnum, Hash)>)

    ListSpecOption data, response status code and response headers



544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
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
# File 'lib/order_cloud/api/spec_api.rb', line 544

def list_options_with_http_info(spec_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SpecApi.list_options ..."
  end
  # verify the required parameter 'spec_id' is set
  fail ArgumentError, "Missing the required parameter 'spec_id' when calling SpecApi.list_options" if spec_id.nil?
  # resource path
  local_var_path = "/specs/{specID}/options".sub('{format}','json').sub('{' + 'specID' + '}', spec_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'searchOn'] = opts[:'search_on'] if !opts[:'search_on'].nil?
  query_params[:'sortBy'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'filters'] = opts[:'filters'] if !opts[:'filters'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListSpecOption')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SpecApi#list_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_product_assignments(opts = {}) ⇒ ListSpecProductAssignment

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :spec_id (String)

    ID of the spec.

  • :product_id (String)

    ID of the product.

  • :page (Integer)

    Page of results to return. Default: 1

  • :page_size (Integer)

    Number of results to return per page. Default: 20, max: 100.

Returns:



600
601
602
603
# File 'lib/order_cloud/api/spec_api.rb', line 600

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

#list_product_assignments_with_http_info(opts = {}) ⇒ Array<(ListSpecProductAssignment, Fixnum, Hash)>

Returns ListSpecProductAssignment data, response status code and response headers.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :spec_id (String)

    ID of the spec.

  • :product_id (String)

    ID of the product.

  • :page (Integer)

    Page of results to return. Default: 1

  • :page_size (Integer)

    Number of results to return per page. Default: 20, max: 100.

Returns:

  • (Array<(ListSpecProductAssignment, Fixnum, Hash)>)

    ListSpecProductAssignment data, response status code and response headers



613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
# File 'lib/order_cloud/api/spec_api.rb', line 613

def list_product_assignments_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SpecApi.list_product_assignments ..."
  end
  # resource path
  local_var_path = "/specs/productassignments".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'specID'] = opts[:'spec_id'] if !opts[:'spec_id'].nil?
  query_params[:'productID'] = opts[:'product_id'] if !opts[:'product_id'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListSpecProductAssignment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SpecApi#list_product_assignments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_with_http_info(opts = {}) ⇒ Array<(ListSpec, Fixnum, Hash)>

Returns ListSpec data, response status code and response headers.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Word or phrase to search for.

  • :search_on (String)

    Comma-delimited list of fields to search on.

  • :sort_by (String)

    Comma-delimited list of fields to sort by.

  • :page (Integer)

    Page of results to return. Default: 1

  • :page_size (Integer)

    Number of results to return per page. Default: 20, max: 100.

  • :filters (Hash<String, String>)

    Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or &#39;xp.???&#39;

Returns:

  • (Array<(ListSpec, Fixnum, Hash)>)

    ListSpec data, response status code and response headers



471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
# File 'lib/order_cloud/api/spec_api.rb', line 471

def list_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SpecApi.list ..."
  end
  # resource path
  local_var_path = "/specs".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'searchOn'] = opts[:'search_on'] if !opts[:'search_on'].nil?
  query_params[:'sortBy'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'filters'] = opts[:'filters'] if !opts[:'filters'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListSpec')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SpecApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#patch(spec_id, spec, opts = {}) ⇒ Spec

Parameters:

  • spec_id

    ID of the spec.

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

    the optional parameters

Returns:



663
664
665
666
# File 'lib/order_cloud/api/spec_api.rb', line 663

def patch(spec_id, spec, opts = {})
  data, _status_code, _headers = patch_with_http_info(spec_id, spec, opts)
  return data
end

#patch_option(spec_id, option_id, option, opts = {}) ⇒ SpecOption

Parameters:

  • spec_id

    ID of the spec.

  • option_id

    ID of the option.

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

    the optional parameters

Returns:



725
726
727
728
# File 'lib/order_cloud/api/spec_api.rb', line 725

def patch_option(spec_id, option_id, option, opts = {})
  data, _status_code, _headers = patch_option_with_http_info(spec_id, option_id, option, opts)
  return data
end

#patch_option_with_http_info(spec_id, option_id, option, opts = {}) ⇒ Array<(SpecOption, Fixnum, Hash)>

Returns SpecOption data, response status code and response headers.

Parameters:

  • spec_id

    ID of the spec.

  • option_id

    ID of the option.

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

    the optional parameters

Returns:

  • (Array<(SpecOption, Fixnum, Hash)>)

    SpecOption data, response status code and response headers



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

def patch_option_with_http_info(spec_id, option_id, option, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SpecApi.patch_option ..."
  end
  # verify the required parameter 'spec_id' is set
  fail ArgumentError, "Missing the required parameter 'spec_id' when calling SpecApi.patch_option" if spec_id.nil?
  # verify the required parameter 'option_id' is set
  fail ArgumentError, "Missing the required parameter 'option_id' when calling SpecApi.patch_option" if option_id.nil?
  # verify the required parameter 'option' is set
  fail ArgumentError, "Missing the required parameter 'option' when calling SpecApi.patch_option" if option.nil?
  # resource path
  local_var_path = "/specs/{specID}/options/{optionID}".sub('{format}','json').sub('{' + 'specID' + '}', spec_id.to_s).sub('{' + 'optionID' + '}', option_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(option)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SpecOption')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SpecApi#patch_option\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#patch_with_http_info(spec_id, spec, opts = {}) ⇒ Array<(Spec, Fixnum, Hash)>

Returns Spec data, response status code and response headers.

Parameters:

  • spec_id

    ID of the spec.

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

    the optional parameters

Returns:

  • (Array<(Spec, Fixnum, Hash)>)

    Spec data, response status code and response headers



674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
# File 'lib/order_cloud/api/spec_api.rb', line 674

def patch_with_http_info(spec_id, spec, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SpecApi.patch ..."
  end
  # verify the required parameter 'spec_id' is set
  fail ArgumentError, "Missing the required parameter 'spec_id' when calling SpecApi.patch" if spec_id.nil?
  # verify the required parameter 'spec' is set
  fail ArgumentError, "Missing the required parameter 'spec' when calling SpecApi.patch" if spec.nil?
  # resource path
  local_var_path = "/specs/{specID}".sub('{format}','json').sub('{' + 'specID' + '}', spec_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(spec)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Spec')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SpecApi#patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#save_product_assignment(product_assignment, opts = {}) ⇒ nil

Parameters:

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

    the optional parameters

Returns:

  • (nil)


788
789
790
791
# File 'lib/order_cloud/api/spec_api.rb', line 788

def save_product_assignment(product_assignment, opts = {})
  save_product_assignment_with_http_info(product_assignment, opts)
  return nil
end

#save_product_assignment_with_http_info(product_assignment, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Returns nil, response status code and response headers.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
# File 'lib/order_cloud/api/spec_api.rb', line 798

def save_product_assignment_with_http_info(product_assignment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SpecApi.save_product_assignment ..."
  end
  # verify the required parameter 'product_assignment' is set
  fail ArgumentError, "Missing the required parameter 'product_assignment' when calling SpecApi.save_product_assignment" if product_assignment.nil?
  # resource path
  local_var_path = "/specs/productassignments".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(product_assignment)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SpecApi#save_product_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update(spec_id, spec, opts = {}) ⇒ Spec

Parameters:

  • spec_id

    ID of the spec.

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

    the optional parameters

Returns:



845
846
847
848
# File 'lib/order_cloud/api/spec_api.rb', line 845

def update(spec_id, spec, opts = {})
  data, _status_code, _headers = update_with_http_info(spec_id, spec, opts)
  return data
end

#update_option(spec_id, option_id, option, opts = {}) ⇒ SpecOption

Parameters:

  • spec_id

    ID of the spec.

  • option_id

    ID of the option.

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

    the optional parameters

Returns:



907
908
909
910
# File 'lib/order_cloud/api/spec_api.rb', line 907

def update_option(spec_id, option_id, option, opts = {})
  data, _status_code, _headers = update_option_with_http_info(spec_id, option_id, option, opts)
  return data
end

#update_option_with_http_info(spec_id, option_id, option, opts = {}) ⇒ Array<(SpecOption, Fixnum, Hash)>

Returns SpecOption data, response status code and response headers.

Parameters:

  • spec_id

    ID of the spec.

  • option_id

    ID of the option.

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

    the optional parameters

Returns:

  • (Array<(SpecOption, Fixnum, Hash)>)

    SpecOption data, response status code and response headers



919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
# File 'lib/order_cloud/api/spec_api.rb', line 919

def update_option_with_http_info(spec_id, option_id, option, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SpecApi.update_option ..."
  end
  # verify the required parameter 'spec_id' is set
  fail ArgumentError, "Missing the required parameter 'spec_id' when calling SpecApi.update_option" if spec_id.nil?
  # verify the required parameter 'option_id' is set
  fail ArgumentError, "Missing the required parameter 'option_id' when calling SpecApi.update_option" if option_id.nil?
  # verify the required parameter 'option' is set
  fail ArgumentError, "Missing the required parameter 'option' when calling SpecApi.update_option" if option.nil?
  # resource path
  local_var_path = "/specs/{specID}/options/{optionID}".sub('{format}','json').sub('{' + 'specID' + '}', spec_id.to_s).sub('{' + 'optionID' + '}', option_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(option)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SpecOption')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SpecApi#update_option\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_with_http_info(spec_id, spec, opts = {}) ⇒ Array<(Spec, Fixnum, Hash)>

Returns Spec data, response status code and response headers.

Parameters:

  • spec_id

    ID of the spec.

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

    the optional parameters

Returns:

  • (Array<(Spec, Fixnum, Hash)>)

    Spec data, response status code and response headers



856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
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
# File 'lib/order_cloud/api/spec_api.rb', line 856

def update_with_http_info(spec_id, spec, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SpecApi.update ..."
  end
  # verify the required parameter 'spec_id' is set
  fail ArgumentError, "Missing the required parameter 'spec_id' when calling SpecApi.update" if spec_id.nil?
  # verify the required parameter 'spec' is set
  fail ArgumentError, "Missing the required parameter 'spec' when calling SpecApi.update" if spec.nil?
  # resource path
  local_var_path = "/specs/{specID}".sub('{format}','json').sub('{' + 'specID' + '}', spec_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(spec)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Spec')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SpecApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end