Class: Pipedrive::ProductsApi
- Inherits:
-
Object
- Object
- Pipedrive::ProductsApi
- Defined in:
- lib/pipedrive-openapi-client/api/products_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ ProductsApi
constructor
A new instance of ProductsApi.
-
#products_find_get(term, opts = {}) ⇒ FindProductsByNameResponse
Find products by name <strong>This endpoint is deprecated.
-
#products_find_get_with_http_info(term, opts = {}) ⇒ Array<(FindProductsByNameResponse, Integer, Hash)>
Find products by name <strong>This endpoint is deprecated.
-
#products_get(opts = {}) ⇒ Product
Get all products Returns data about all products.
-
#products_get_with_http_info(opts = {}) ⇒ Array<(Product, Integer, Hash)>
Get all products Returns data about all products.
-
#products_id_deals_get(id, opts = {}) ⇒ BasicDeal
Get deals where a product is attached to Returns data about deals that have a product attached to.
-
#products_id_deals_get_with_http_info(id, opts = {}) ⇒ Array<(BasicDeal, Integer, Hash)>
Get deals where a product is attached to Returns data about deals that have a product attached to.
-
#products_id_delete(id, opts = {}) ⇒ nil
Delete a product Marks a product as deleted.
-
#products_id_delete_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete a product Marks a product as deleted.
-
#products_id_files_get(id, opts = {}) ⇒ nil
List files attached to a product Lists files associated with a product.
-
#products_id_files_get_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
List files attached to a product Lists files associated with a product.
-
#products_id_followers_follower_id_delete(id, follower_id, opts = {}) ⇒ DeleteProductFollowerResponse
Delete a follower from a product Deletes a follower from a product.
-
#products_id_followers_follower_id_delete_with_http_info(id, follower_id, opts = {}) ⇒ Array<(DeleteProductFollowerResponse, Integer, Hash)>
Delete a follower from a product Deletes a follower from a product.
-
#products_id_followers_get(id, opts = {}) ⇒ UserIDs
List followers of a product Lists the followers of a Product.
-
#products_id_followers_get_with_http_info(id, opts = {}) ⇒ Array<(UserIDs, Integer, Hash)>
List followers of a product Lists the followers of a Product.
-
#products_id_followers_post(id, opts = {}) ⇒ NewFollowerResponse
Add a follower to a product Adds a follower to a product.
-
#products_id_followers_post_with_http_info(id, opts = {}) ⇒ Array<(NewFollowerResponse, Integer, Hash)>
Add a follower to a product Adds a follower to a product.
-
#products_id_get(id, opts = {}) ⇒ nil
Get one product Returns data about a specific product.
-
#products_id_get_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Get one product Returns data about a specific product.
-
#products_id_permitted_users_get(id, opts = {}) ⇒ UserIDs
List permitted users Lists users permitted to access a product.
-
#products_id_permitted_users_get_with_http_info(id, opts = {}) ⇒ Array<(UserIDs, Integer, Hash)>
List permitted users Lists users permitted to access a product.
-
#products_id_put(id, opts = {}) ⇒ Product
Update a product Updates product data.
-
#products_id_put_with_http_info(id, opts = {}) ⇒ Array<(Product, Integer, Hash)>
Update a product Updates product data.
-
#products_post(opts = {}) ⇒ nil
Add a product Adds a new product to the products inventory.
-
#products_post_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>
Add a product Adds a new product to the products inventory.
-
#products_search_get(term, opts = {}) ⇒ BaseResponse
Search products Searches all Products by name, code and/or custom fields.
-
#products_search_get_with_http_info(term, opts = {}) ⇒ Array<(BaseResponse, Integer, Hash)>
Search products Searches all Products by name, code and/or custom fields.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ProductsApi
Returns a new instance of ProductsApi.
19 20 21 |
# File 'lib/pipedrive-openapi-client/api/products_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/pipedrive-openapi-client/api/products_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#products_find_get(term, opts = {}) ⇒ FindProductsByNameResponse
Find products by name <strong>This endpoint is deprecated. Please use <a href="developers.pipedrive.com/docs/api/v1/#!/Products/get_products_search">/v1/products/search</a> or <a href="developers.pipedrive.com/docs/api/v1/#!/ItemSearch/get_itemSearch">/v1/itemSearch</a> instead</strong>.
Returns data about the products that were found. If currency was set in request, prices in that currency are served back.
30 31 32 33 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 30 def products_find_get(term, opts = {}) data, _status_code, _headers = products_find_get_with_http_info(term, opts) data end |
#products_find_get_with_http_info(term, opts = {}) ⇒ Array<(FindProductsByNameResponse, Integer, Hash)>
Find products by name <strong>This endpoint is deprecated. Please use <a href="developers.pipedrive.com/docs/api/v1/#!/Products/get_products_search">/v1/products/search</a> or <a href="developers.pipedrive.com/docs/api/v1/#!/ItemSearch/get_itemSearch">/v1/itemSearch</a> instead</strong>. <br> Returns data about the products that were found. If currency was set in request, prices in that currency are served back.
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 91 92 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 43 def products_find_get_with_http_info(term, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductsApi.products_find_get ...' end # verify the required parameter 'term' is set if @api_client.config.client_side_validation && term.nil? fail ArgumentError, "Missing the required parameter 'term' when calling ProductsApi.products_find_get" end # resource path local_var_path = '/products/find' # query parameters query_params = opts[:query_params] || {} query_params[:'term'] = term query_params[:'currency'] = opts[:'currency'] if !opts[:'currency'].nil? query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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[:body] # return_type return_type = opts[:return_type] || 'FindProductsByNameResponse' # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] = opts.merge( :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: ProductsApi#products_find_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#products_get(opts = {}) ⇒ Product
Get all products Returns data about all products.
103 104 105 106 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 103 def products_get(opts = {}) data, _status_code, _headers = products_get_with_http_info(opts) data end |
#products_get_with_http_info(opts = {}) ⇒ Array<(Product, Integer, Hash)>
Get all products Returns data about all products.
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 158 159 160 161 162 163 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 117 def products_get_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductsApi.products_get ...' end # resource path local_var_path = '/products' # query parameters query_params = opts[:query_params] || {} query_params[:'user_id'] = opts[:'user_id'] if !opts[:'user_id'].nil? query_params[:'filter_id'] = opts[:'filter_id'] if !opts[:'filter_id'].nil? query_params[:'first_char'] = opts[:'first_char'] if !opts[:'first_char'].nil? query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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[:body] # return_type return_type = opts[:return_type] || 'Product' # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] = opts.merge( :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: ProductsApi#products_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#products_id_deals_get(id, opts = {}) ⇒ BasicDeal
Get deals where a product is attached to Returns data about deals that have a product attached to.
173 174 175 176 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 173 def products_id_deals_get(id, opts = {}) data, _status_code, _headers = products_id_deals_get_with_http_info(id, opts) data end |
#products_id_deals_get_with_http_info(id, opts = {}) ⇒ Array<(BasicDeal, Integer, Hash)>
Get deals where a product is attached to Returns data about deals that have a product attached to.
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 186 def products_id_deals_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductsApi.products_id_deals_get ...' 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 ProductsApi.products_id_deals_get" end allowable_values = ["open", "won", "lost", "deleted", "all_not_deleted"] if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status']) fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}" end # resource path local_var_path = '/products/{id}/deals'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'status'] = opts[:'status'] if !opts[:'status'].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[:body] # return_type return_type = opts[:return_type] || 'BasicDeal' # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] = opts.merge( :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: ProductsApi#products_id_deals_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#products_id_delete(id, opts = {}) ⇒ nil
Delete a product Marks a product as deleted.
245 246 247 248 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 245 def products_id_delete(id, opts = {}) products_id_delete_with_http_info(id, opts) nil end |
#products_id_delete_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete a product Marks a product as deleted.
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 255 def products_id_delete_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductsApi.products_id_delete ...' 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 ProductsApi.products_id_delete" end # resource path local_var_path = '/products/{id}'.sub('{' + 'id' + '}', CGI.escape(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[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] = opts.merge( :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: ProductsApi#products_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#products_id_files_get(id, opts = {}) ⇒ nil
List files attached to a product Lists files associated with a product.
309 310 311 312 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 309 def products_id_files_get(id, opts = {}) products_id_files_get_with_http_info(id, opts) nil end |
#products_id_files_get_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
List files attached to a product Lists files associated with a product.
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 364 365 366 367 368 369 370 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 323 def products_id_files_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductsApi.products_id_files_get ...' 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 ProductsApi.products_id_files_get" end # resource path local_var_path = '/products/{id}/files'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'include_deleted_files'] = opts[:'include_deleted_files'] if !opts[:'include_deleted_files'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] = opts.merge( :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: ProductsApi#products_id_files_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#products_id_followers_follower_id_delete(id, follower_id, opts = {}) ⇒ DeleteProductFollowerResponse
Delete a follower from a product Deletes a follower from a product.
378 379 380 381 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 378 def products_id_followers_follower_id_delete(id, follower_id, opts = {}) data, _status_code, _headers = products_id_followers_follower_id_delete_with_http_info(id, follower_id, opts) data end |
#products_id_followers_follower_id_delete_with_http_info(id, follower_id, opts = {}) ⇒ Array<(DeleteProductFollowerResponse, Integer, Hash)>
Delete a follower from a product Deletes a follower from a product.
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 436 437 438 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 389 def products_id_followers_follower_id_delete_with_http_info(id, follower_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductsApi.products_id_followers_follower_id_delete ...' 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 ProductsApi.products_id_followers_follower_id_delete" end # verify the required parameter 'follower_id' is set if @api_client.config.client_side_validation && follower_id.nil? fail ArgumentError, "Missing the required parameter 'follower_id' when calling ProductsApi.products_id_followers_follower_id_delete" end # resource path local_var_path = '/products/{id}/followers/{follower_id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'follower_id' + '}', CGI.escape(follower_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[:body] # return_type return_type = opts[:return_type] || 'DeleteProductFollowerResponse' # auth_names auth_names = opts[:auth_names] || ['api_key'] = opts.merge( :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: ProductsApi#products_id_followers_follower_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#products_id_followers_get(id, opts = {}) ⇒ UserIDs
List followers of a product Lists the followers of a Product
445 446 447 448 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 445 def products_id_followers_get(id, opts = {}) data, _status_code, _headers = products_id_followers_get_with_http_info(id, opts) data end |
#products_id_followers_get_with_http_info(id, opts = {}) ⇒ Array<(UserIDs, Integer, Hash)>
List followers of a product Lists the followers of a Product
455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 455 def products_id_followers_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductsApi.products_id_followers_get ...' 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 ProductsApi.products_id_followers_get" end # resource path local_var_path = '/products/{id}/followers'.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[:body] # return_type return_type = opts[:return_type] || 'UserIDs' # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] = opts.merge( :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: ProductsApi#products_id_followers_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#products_id_followers_post(id, opts = {}) ⇒ NewFollowerResponse
Add a follower to a product Adds a follower to a product.
508 509 510 511 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 508 def products_id_followers_post(id, opts = {}) data, _status_code, _headers = products_id_followers_post_with_http_info(id, opts) data end |
#products_id_followers_post_with_http_info(id, opts = {}) ⇒ Array<(NewFollowerResponse, Integer, Hash)>
Add a follower to a product Adds a follower to a product.
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 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 519 def products_id_followers_post_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductsApi.products_id_followers_post ...' 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 ProductsApi.products_id_followers_post" end # resource path local_var_path = '/products/{id}/followers'.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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(opts[:'inline_object24']) # return_type return_type = opts[:return_type] || 'NewFollowerResponse' # auth_names auth_names = opts[:auth_names] || ['api_key'] = opts.merge( :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: ProductsApi#products_id_followers_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#products_id_get(id, opts = {}) ⇒ nil
Get one product Returns data about a specific product.
573 574 575 576 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 573 def products_id_get(id, opts = {}) products_id_get_with_http_info(id, opts) nil end |
#products_id_get_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Get one product Returns data about a specific product.
583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 583 def products_id_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductsApi.products_id_get ...' 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 ProductsApi.products_id_get" end # resource path local_var_path = '/products/{id}'.sub('{' + 'id' + '}', CGI.escape(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[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] = opts.merge( :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: ProductsApi#products_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#products_id_permitted_users_get(id, opts = {}) ⇒ UserIDs
List permitted users Lists users permitted to access a product.
633 634 635 636 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 633 def products_id_permitted_users_get(id, opts = {}) data, _status_code, _headers = products_id_permitted_users_get_with_http_info(id, opts) data end |
#products_id_permitted_users_get_with_http_info(id, opts = {}) ⇒ Array<(UserIDs, Integer, Hash)>
List permitted users Lists users permitted to access a product.
643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 643 def products_id_permitted_users_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductsApi.products_id_permitted_users_get ...' 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 ProductsApi.products_id_permitted_users_get" end # resource path local_var_path = '/products/{id}/permittedUsers'.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[:body] # return_type return_type = opts[:return_type] || 'UserIDs' # auth_names auth_names = opts[:auth_names] || ['api_key'] = opts.merge( :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: ProductsApi#products_id_permitted_users_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#products_id_put(id, opts = {}) ⇒ Product
Update a product Updates product data.
696 697 698 699 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 696 def products_id_put(id, opts = {}) data, _status_code, _headers = products_id_put_with_http_info(id, opts) data end |
#products_id_put_with_http_info(id, opts = {}) ⇒ Array<(Product, Integer, Hash)>
Update a product Updates product data.
707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 707 def products_id_put_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductsApi.products_id_put ...' 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 ProductsApi.products_id_put" end # resource path local_var_path = '/products/{id}'.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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(opts[:'product']) # return_type return_type = opts[:return_type] || 'Product' # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] = opts.merge( :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: ProductsApi#products_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#products_post(opts = {}) ⇒ nil
Add a product Adds a new product to the products inventory. For more information on how to add a product, see <a href="pipedrive.readme.io/docs/adding-a-product" target="_blank" rel="noopener noreferrer">this tutorial</a>.
761 762 763 764 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 761 def products_post(opts = {}) products_post_with_http_info(opts) nil end |
#products_post_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>
Add a product Adds a new product to the products inventory. For more information on how to add a product, see <a href="pipedrive.readme.io/docs/adding-a-product" target="_blank" rel="noopener noreferrer">this tutorial</a>.
771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 771 def products_post_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductsApi.products_post ...' end # resource path local_var_path = '/products' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(opts[:'unknown_base_type']) # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] = opts.merge( :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: ProductsApi#products_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#products_search_get(term, opts = {}) ⇒ BaseResponse
Search products Searches all Products by name, code and/or custom fields. This endpoint is a wrapper of <a href="developers.pipedrive.com/docs/api/v1/#!/ItemSearch/get_itemSearch">/v1/itemSearch</a> with a narrower OAuth scope.
824 825 826 827 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 824 def products_search_get(term, opts = {}) data, _status_code, _headers = products_search_get_with_http_info(term, opts) data end |
#products_search_get_with_http_info(term, opts = {}) ⇒ Array<(BaseResponse, Integer, Hash)>
Search products Searches all Products by name, code and/or custom fields. This endpoint is a wrapper of <a href="developers.pipedrive.com/docs/api/v1/#!/ItemSearch/get_itemSearch">/v1/itemSearch</a> with a narrower OAuth scope.
839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 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 899 900 901 902 |
# File 'lib/pipedrive-openapi-client/api/products_api.rb', line 839 def products_search_get_with_http_info(term, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductsApi.products_search_get ...' end # verify the required parameter 'term' is set if @api_client.config.client_side_validation && term.nil? fail ArgumentError, "Missing the required parameter 'term' when calling ProductsApi.products_search_get" end allowable_values = ["code", "custom_fields", "name"] if @api_client.config.client_side_validation && opts[:'fields'] && !allowable_values.include?(opts[:'fields']) fail ArgumentError, "invalid value for \"fields\", must be one of #{allowable_values}" end allowable_values = ["true", "false"] if @api_client.config.client_side_validation && opts[:'exact_match'] && !allowable_values.include?(opts[:'exact_match']) fail ArgumentError, "invalid value for \"exact_match\", must be one of #{allowable_values}" end allowable_values = ["product.price"] if @api_client.config.client_side_validation && opts[:'include_fields'] && !allowable_values.include?(opts[:'include_fields']) fail ArgumentError, "invalid value for \"include_fields\", must be one of #{allowable_values}" end # resource path local_var_path = '/products/search' # query parameters query_params = opts[:query_params] || {} query_params[:'term'] = term query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil? query_params[:'exact_match'] = opts[:'exact_match'] if !opts[:'exact_match'].nil? query_params[:'include_fields'] = opts[:'include_fields'] if !opts[:'include_fields'].nil? query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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[:body] # return_type return_type = opts[:return_type] || 'BaseResponse' # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] = opts.merge( :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: ProductsApi#products_search_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |