Class: CropwisePlatformSdk::CatalogProductApi
- Inherits:
-
Object
- Object
- CropwisePlatformSdk::CatalogProductApi
- Defined in:
- lib/cropwise-platform-sdk/api/catalog_product_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#change_canon_catalog_product_visibility(opts = {}) ⇒ nil
Change the visibility of a canon product for a organization Change Catalog Canon Product’s Visibility.
-
#change_canon_catalog_product_visibility_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>
Change the visibility of a canon product for a organization Change Catalog Canon Product's Visibility.
-
#create_custom_catalog_product(opts = {}) ⇒ nil
Create a Custom Product in the Catalog Create Catalog Custom Product.
-
#create_custom_catalog_product_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>
Create a Custom Product in the Catalog Create Catalog Custom Product.
-
#delete_custom_catalog_product(product_id, opts = {}) ⇒ nil
Edit a Custom Product in the Catalog Delete Catalog Custom Product.
-
#delete_custom_catalog_product_0(product_id, opts = {}) ⇒ nil
Delete a Custom Product in the Catalog Delete Catalog Custom Product.
-
#delete_custom_catalog_product_0_with_http_info(product_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete a Custom Product in the Catalog Delete Catalog Custom Product.
-
#delete_custom_catalog_product_with_http_info(product_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Edit a Custom Product in the Catalog Delete Catalog Custom Product.
-
#get_canon_catalog_product_country_source(country, opts = {}) ⇒ nil
Get Canon Products in the Catalog Get Catalog Canon Product-country-source.
-
#get_canon_catalog_product_country_source_with_http_info(country, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Get Canon Products in the Catalog Get Catalog Canon Product-country-source.
-
#get_custom_catalog_product(product_id, opts = {}) ⇒ CustomProductDTO
Get a Product in the Catalog Get Catalog Custom Product.
-
#get_custom_catalog_product_with_http_info(product_id, opts = {}) ⇒ Array<(CustomProductDTO, Integer, Hash)>
Get a Product in the Catalog Get Catalog Custom Product.
-
#get_org_catalog_products(org_id, opts = {}) ⇒ nil
Get an Organization’s Product in the Catalog Get Organization Custom and Canon Products.
-
#get_org_catalog_products_with_http_info(org_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Get an Organization's Product in the Catalog Get Organization Custom and Canon Products.
-
#initialize(api_client = ApiClient.default) ⇒ CatalogProductApi
constructor
A new instance of CatalogProductApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ CatalogProductApi
Returns a new instance of CatalogProductApi.
19 20 21 |
# File 'lib/cropwise-platform-sdk/api/catalog_product_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/cropwise-platform-sdk/api/catalog_product_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#change_canon_catalog_product_visibility(opts = {}) ⇒ nil
Change the visibility of a canon product for a organization Change Catalog Canon Product’s Visibility.
27 28 29 30 |
# File 'lib/cropwise-platform-sdk/api/catalog_product_api.rb', line 27 def change_canon_catalog_product_visibility(opts = {}) change_canon_catalog_product_visibility_with_http_info(opts) nil end |
#change_canon_catalog_product_visibility_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>
Change the visibility of a canon product for a organization Change Catalog Canon Product's Visibility.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/cropwise-platform-sdk/api/catalog_product_api.rb', line 37 def change_canon_catalog_product_visibility_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogProductApi.change_canon_catalog_product_visibility ...' end # resource path local_var_path = '/v2/catalog/products/hidden' # 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[:'product_visibility_list_dto']) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"CatalogProductApi.change_canon_catalog_product_visibility", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogProductApi#change_canon_catalog_product_visibility\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_custom_catalog_product(opts = {}) ⇒ nil
Create a Custom Product in the Catalog Create Catalog Custom Product.
91 92 93 94 |
# File 'lib/cropwise-platform-sdk/api/catalog_product_api.rb', line 91 def create_custom_catalog_product(opts = {}) create_custom_catalog_product_with_http_info(opts) nil end |
#create_custom_catalog_product_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>
Create a Custom Product in the Catalog Create Catalog Custom Product.
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/cropwise-platform-sdk/api/catalog_product_api.rb', line 101 def create_custom_catalog_product_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogProductApi.create_custom_catalog_product ...' end # resource path local_var_path = '/v2/catalog/products' # 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[:'create_custom_product_dto']) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"CatalogProductApi.create_custom_catalog_product", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogProductApi#create_custom_catalog_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_custom_catalog_product(product_id, opts = {}) ⇒ nil
Edit a Custom Product in the Catalog Delete Catalog Custom Product.
156 157 158 159 |
# File 'lib/cropwise-platform-sdk/api/catalog_product_api.rb', line 156 def delete_custom_catalog_product(product_id, opts = {}) delete_custom_catalog_product_with_http_info(product_id, opts) nil end |
#delete_custom_catalog_product_0(product_id, opts = {}) ⇒ nil
Delete a Custom Product in the Catalog Delete Catalog Custom Product.
225 226 227 228 |
# File 'lib/cropwise-platform-sdk/api/catalog_product_api.rb', line 225 def delete_custom_catalog_product_0(product_id, opts = {}) delete_custom_catalog_product_0_with_http_info(product_id, opts) nil end |
#delete_custom_catalog_product_0_with_http_info(product_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete a Custom Product in the Catalog Delete Catalog Custom Product.
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 |
# File 'lib/cropwise-platform-sdk/api/catalog_product_api.rb', line 235 def delete_custom_catalog_product_0_with_http_info(product_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogProductApi.delete_custom_catalog_product_0 ...' end # verify the required parameter 'product_id' is set if @api_client.config.client_side_validation && product_id.nil? fail ArgumentError, "Missing the required parameter 'product_id' when calling CatalogProductApi.delete_custom_catalog_product_0" end # resource path local_var_path = '/v2/catalog/products/{product_id}'.sub('{' + 'product_id' + '}', CGI.escape(product_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] # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"CatalogProductApi.delete_custom_catalog_product_0", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogProductApi#delete_custom_catalog_product_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_custom_catalog_product_with_http_info(product_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Edit a Custom Product in the Catalog Delete Catalog Custom Product.
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 207 208 209 210 211 212 213 214 215 216 217 218 |
# File 'lib/cropwise-platform-sdk/api/catalog_product_api.rb', line 167 def delete_custom_catalog_product_with_http_info(product_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogProductApi.delete_custom_catalog_product ...' end # verify the required parameter 'product_id' is set if @api_client.config.client_side_validation && product_id.nil? fail ArgumentError, "Missing the required parameter 'product_id' when calling CatalogProductApi.delete_custom_catalog_product" end # resource path local_var_path = '/v2/catalog/products/{product_id}'.sub('{' + 'product_id' + '}', CGI.escape(product_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[:'edit_custom_product_dto']) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"CatalogProductApi.delete_custom_catalog_product", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogProductApi#delete_custom_catalog_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_canon_catalog_product_country_source(country, opts = {}) ⇒ nil
Get Canon Products in the Catalog Get Catalog Canon Product-country-source.
294 295 296 297 |
# File 'lib/cropwise-platform-sdk/api/catalog_product_api.rb', line 294 def get_canon_catalog_product_country_source(country, opts = {}) get_canon_catalog_product_country_source_with_http_info(country, opts) nil end |
#get_canon_catalog_product_country_source_with_http_info(country, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Get Canon Products in the Catalog Get Catalog Canon Product-country-source.
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 354 355 356 357 358 359 360 361 362 363 |
# File 'lib/cropwise-platform-sdk/api/catalog_product_api.rb', line 310 def get_canon_catalog_product_country_source_with_http_info(country, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogProductApi.get_canon_catalog_product_country_source ...' end # verify the required parameter 'country' is set if @api_client.config.client_side_validation && country.nil? fail ArgumentError, "Missing the required parameter 'country' when calling CatalogProductApi.get_canon_catalog_product_country_source" end # resource path local_var_path = '/v2/catalog/products' # query parameters query_params = opts[:query_params] || {} query_params[:'country'] = country query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil? query_params[:'include_deleted'] = opts[:'include_deleted'] if !opts[:'include_deleted'].nil? query_params[:'include_attributes'] = @api_client.build_collection_param(opts[:'include_attributes'], :multi) if !opts[:'include_attributes'].nil? query_params[:'indication'] = opts[:'indication'] if !opts[:'indication'].nil? query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil? query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # 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] || [] = opts.merge( :operation => :"CatalogProductApi.get_canon_catalog_product_country_source", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogProductApi#get_canon_catalog_product_country_source\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_custom_catalog_product(product_id, opts = {}) ⇒ CustomProductDTO
Get a Product in the Catalog Get Catalog Custom Product.
373 374 375 376 |
# File 'lib/cropwise-platform-sdk/api/catalog_product_api.rb', line 373 def get_custom_catalog_product(product_id, opts = {}) data, _status_code, _headers = get_custom_catalog_product_with_http_info(product_id, opts) data end |
#get_custom_catalog_product_with_http_info(product_id, opts = {}) ⇒ Array<(CustomProductDTO, Integer, Hash)>
Get a Product in the Catalog Get Catalog Custom Product.
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 |
# File 'lib/cropwise-platform-sdk/api/catalog_product_api.rb', line 386 def get_custom_catalog_product_with_http_info(product_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogProductApi.get_custom_catalog_product ...' end # verify the required parameter 'product_id' is set if @api_client.config.client_side_validation && product_id.nil? fail ArgumentError, "Missing the required parameter 'product_id' when calling CatalogProductApi.get_custom_catalog_product" end # resource path local_var_path = '/v2/catalog/products/{product_id}'.sub('{' + 'product_id' + '}', CGI.escape(product_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil? query_params[:'include_deleted'] = opts[:'include_deleted'] if !opts[:'include_deleted'].nil? query_params[:'include_attributes'] = opts[:'include_attributes'] if !opts[:'include_attributes'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CustomProductDTO' # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"CatalogProductApi.get_custom_catalog_product", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogProductApi#get_custom_catalog_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_org_catalog_products(org_id, opts = {}) ⇒ nil
Get an Organization’s Product in the Catalog Get Organization Custom and Canon Products.
449 450 451 452 |
# File 'lib/cropwise-platform-sdk/api/catalog_product_api.rb', line 449 def get_org_catalog_products(org_id, opts = {}) get_org_catalog_products_with_http_info(org_id, opts) nil end |
#get_org_catalog_products_with_http_info(org_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Get an Organization's Product in the Catalog Get Organization Custom and Canon Products.
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 |
# File 'lib/cropwise-platform-sdk/api/catalog_product_api.rb', line 466 def get_org_catalog_products_with_http_info(org_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogProductApi.get_org_catalog_products ...' 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 CatalogProductApi.get_org_catalog_products" end # resource path local_var_path = '/v2/catalog/orgs/{org_id}/products'.sub('{' + 'org_id' + '}', CGI.escape(org_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil? query_params[:'include_hidden'] = opts[:'include_hidden'] if !opts[:'include_hidden'].nil? query_params[:'include_deleted'] = opts[:'include_deleted'] if !opts[:'include_deleted'].nil? query_params[:'include_attributes'] = @api_client.build_collection_param(opts[:'include_attributes'], :multi) if !opts[:'include_attributes'].nil? query_params[:'indication'] = opts[:'indication'] if !opts[:'indication'].nil? query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil? query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # 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] || [] = opts.merge( :operation => :"CatalogProductApi.get_org_catalog_products", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogProductApi#get_org_catalog_products\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |