Class: Pipedrive::ProductsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/pipedrive-openapi-client/api/products_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_clientObject

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.

Parameters:

  • term (String)

    Search term to look for, minimum 3 characters.

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

    the optional parameters

Options Hash (opts):

  • :currency (String)

    Currency code in which prices should be returned in. If omitted, prices in user&#39;s default currency will be returned.

  • :start (Integer)

    Pagination start (default to 0)

  • :limit (Integer)

    Items shown per page

Returns:



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 &lt;strong&gt;This endpoint is deprecated. Please use &lt;a href&#x3D;&quot;developers.pipedrive.com/docs/api/v1/#!/Products/get_products_search&quot;&gt;/v1/products/search&lt;/a&gt; or &lt;a href&#x3D;&quot;developers.pipedrive.com/docs/api/v1/#!/ItemSearch/get_itemSearch&quot;&gt;/v1/itemSearch&lt;/a&gt; instead&lt;/strong&gt;. &lt;br&gt; Returns data about the products that were found. If currency was set in request, prices in that currency are served back.

Parameters:

  • term (String)

    Search term to look for, minimum 3 characters.

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

    the optional parameters

Options Hash (opts):

  • :currency (String)

    Currency code in which prices should be returned in. If omitted, prices in user&#39;s default currency will be returned.

  • :start (Integer)

    Pagination start

  • :limit (Integer)

    Items shown per page

Returns:

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

    FindProductsByNameResponse data, response status code and response headers



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

  new_options = 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, new_options)
  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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :user_id (Integer)

    If supplied, only products owned by the given user will be returned.

  • :filter_id (Integer)

    ID of the filter to use

  • :first_char (String)

    If supplied, only products whose name starts with the specified letter will be returned (case insensitive).

  • :start (Integer)

    Pagination start (default to 0)

  • :limit (Integer)

    Items shown per page

Returns:



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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :user_id (Integer)

    If supplied, only products owned by the given user will be returned.

  • :filter_id (Integer)

    ID of the filter to use

  • :first_char (String)

    If supplied, only products whose name starts with the specified letter will be returned (case insensitive).

  • :start (Integer)

    Pagination start

  • :limit (Integer)

    Items shown per page

Returns:

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

    Product data, response status code and response headers



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

  new_options = 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, new_options)
  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.

Parameters:

  • id (Integer)

    ID of the product

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

    the optional parameters

Options Hash (opts):

  • :start (Integer)

    Pagination start (default to 0)

  • :limit (Integer)

    Items shown per page

  • :status (String)

    Only fetch deals with specific status. If omitted, all not deleted deals are fetched. (default to ‘all_not_deleted’)

Returns:



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.

Parameters:

  • id (Integer)

    ID of the product

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

    the optional parameters

Options Hash (opts):

  • :start (Integer)

    Pagination start

  • :limit (Integer)

    Items shown per page

  • :status (String)

    Only fetch deals with specific status. If omitted, all not deleted deals are fetched.

Returns:

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

    BasicDeal data, response status code and response headers



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

  new_options = 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, new_options)
  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.

Parameters:

  • id (Integer)

    ID of the product

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

    the optional parameters

Returns:

  • (nil)


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.

Parameters:

  • id (Integer)

    ID of the product

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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

  new_options = 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, new_options)
  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.

Parameters:

  • id (Integer)

    ID of the product

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

    the optional parameters

Options Hash (opts):

  • :start (Integer)

    Pagination start (default to 0)

  • :limit (Integer)

    Items shown per page

  • :include_deleted_files (NumberBoolean)

    When enabled, the list of files will also include deleted files. Please note that trying to download these files will not work.

  • :sort (String)

    Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). Supported fields: id, user_id, deal_id, person_id, org_id, product_id, add_time, update_time, file_name, file_type, file_size, comment.

Returns:

  • (nil)


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.

Parameters:

  • id (Integer)

    ID of the product

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

    the optional parameters

Options Hash (opts):

  • :start (Integer)

    Pagination start

  • :limit (Integer)

    Items shown per page

  • :include_deleted_files (NumberBoolean)

    When enabled, the list of files will also include deleted files. Please note that trying to download these files will not work.

  • :sort (String)

    Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). Supported fields: id, user_id, deal_id, person_id, org_id, product_id, add_time, update_time, file_name, file_type, file_size, comment.

Returns:

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

    nil, response status code and response headers



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

  new_options = 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, new_options)
  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.

Parameters:

  • id (Integer)

    ID of the product

  • follower_id (Integer)

    ID of the follower

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

    the optional parameters

Returns:



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.

Parameters:

  • id (Integer)

    ID of the product

  • follower_id (Integer)

    ID of the follower

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

    the optional parameters

Returns:



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

  new_options = 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, new_options)
  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

Parameters:

  • id (Integer)

    ID of the product

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

    the optional parameters

Returns:



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

Parameters:

  • id (Integer)

    ID of the product

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

    the optional parameters

Returns:

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

    UserIDs data, response status code and response headers



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

  new_options = 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, new_options)
  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.

Parameters:

  • id (Integer)

    ID of the product

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

    the optional parameters

Options Hash (opts):

Returns:



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.

Parameters:

  • id (Integer)

    ID of the product

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

    the optional parameters

Options Hash (opts):

Returns:

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

    NewFollowerResponse data, response status code and response headers



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

  new_options = 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, new_options)
  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.

Parameters:

  • id (Integer)

    ID of the product

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

    the optional parameters

Returns:

  • (nil)


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.

Parameters:

  • id (Integer)

    ID of the product

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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

  new_options = 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, new_options)
  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.

Parameters:

  • id (Integer)

    ID of the product

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

    the optional parameters

Returns:



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.

Parameters:

  • id (Integer)

    ID of the product

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

    the optional parameters

Returns:

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

    UserIDs data, response status code and response headers



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

  new_options = 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, new_options)
  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.

Parameters:

  • id (Integer)

    ID of the product

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

    the optional parameters

Options Hash (opts):

Returns:



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.

Parameters:

  • id (Integer)

    ID of the product

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

    the optional parameters

Options Hash (opts):

Returns:

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

    Product data, response status code and response headers



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

  new_options = 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, new_options)
  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>.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :unknown_base_type (UNKNOWN_BASE_TYPE)

Returns:

  • (nil)


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 &lt;a href&#x3D;&quot;pipedrive.readme.io/docs/adding-a-product&quot; target&#x3D;&quot;_blank&quot; rel&#x3D;&quot;noopener noreferrer&quot;&gt;this tutorial&lt;/a&gt;.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :unknown_base_type (UNKNOWN_BASE_TYPE)

Returns:

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

    nil, response status code and response headers



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

  new_options = 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, new_options)
  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.

Parameters:

  • term (String)

    The search term to look for. Minimum 2 characters (or 1 if using exact_match).

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

    the optional parameters

Options Hash (opts):

  • :fields (String)

    A comma-separated string array. The fields to perform the search from. Defaults to all of them.

  • :exact_match (Boolean)

    When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.

  • :include_fields (String)

    Supports including optional fields in the results which are not provided by default.

  • :start (Integer)

    Pagination start. Note that the pagination is based on main results and does not include related items when using search_for_related_items parameter. (default to 0)

  • :limit (Integer)

    Items shown per page

Returns:



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 &lt;a href&#x3D;&quot;developers.pipedrive.com/docs/api/v1/#!/ItemSearch/get_itemSearch&quot;&gt;/v1/itemSearch&lt;/a&gt; with a narrower OAuth scope.

Parameters:

  • term (String)

    The search term to look for. Minimum 2 characters (or 1 if using exact_match).

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

    the optional parameters

Options Hash (opts):

  • :fields (String)

    A comma-separated string array. The fields to perform the search from. Defaults to all of them.

  • :exact_match (Boolean)

    When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.

  • :include_fields (String)

    Supports including optional fields in the results which are not provided by default.

  • :start (Integer)

    Pagination start. Note that the pagination is based on main results and does not include related items when using search_for_related_items parameter.

  • :limit (Integer)

    Items shown per page

Returns:

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

    BaseResponse data, response status code and response headers



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

  new_options = 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, new_options)
  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