Class: Pipedrive::PipelinesApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PipelinesApi

Returns a new instance of PipelinesApi.



19
20
21
# File 'lib/pipedrive-openapi-client/api/pipelines_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/pipelines_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#pipelines_get(opts = {}) ⇒ GetAllPipelines

Get all pipelines Returns data about all pipelines

Parameters:

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

    the optional parameters

Returns:



26
27
28
29
# File 'lib/pipedrive-openapi-client/api/pipelines_api.rb', line 26

def pipelines_get(opts = {})
  data, _status_code, _headers = pipelines_get_with_http_info(opts)
  data
end

#pipelines_get_with_http_info(opts = {}) ⇒ Array<(GetAllPipelines, Integer, Hash)>

Get all pipelines Returns data about all pipelines

Parameters:

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

    the optional parameters

Returns:

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

    GetAllPipelines data, response status code and response headers



35
36
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
# File 'lib/pipedrive-openapi-client/api/pipelines_api.rb', line 35

def pipelines_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PipelinesApi.pipelines_get ...'
  end
  # resource path
  local_var_path = '/pipelines'

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

  # 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: PipelinesApi#pipelines_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#pipelines_id_conversion_statistics_get(id, start_date, end_date, opts = {}) ⇒ GetDealsConversionRatesInPipeline

Get deals conversion rates in pipeline Returns all stage-to-stage conversion and pipeline-to-close rates for given time period.

Parameters:

  • id (Integer)

    ID of the pipeline

  • start_date (Date)

    Start of the period. Date in format of YYYY-MM-DD.

  • end_date (Date)

    End of the period. Date in format of YYYY-MM-DD.

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

    the optional parameters

Options Hash (opts):

  • :user_id (Integer)

    ID of the user who&#39;s pipeline metrics statistics to fetch. If omitted, the authorized user will be used.

Returns:



86
87
88
89
# File 'lib/pipedrive-openapi-client/api/pipelines_api.rb', line 86

def pipelines_id_conversion_statistics_get(id, start_date, end_date, opts = {})
  data, _status_code, _headers = pipelines_id_conversion_statistics_get_with_http_info(id, start_date, end_date, opts)
  data
end

#pipelines_id_conversion_statistics_get_with_http_info(id, start_date, end_date, opts = {}) ⇒ Array<(GetDealsConversionRatesInPipeline, Integer, Hash)>

Get deals conversion rates in pipeline Returns all stage-to-stage conversion and pipeline-to-close rates for given time period.

Parameters:

  • id (Integer)

    ID of the pipeline

  • start_date (Date)

    Start of the period. Date in format of YYYY-MM-DD.

  • end_date (Date)

    End of the period. Date in format of YYYY-MM-DD.

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

    the optional parameters

Options Hash (opts):

  • :user_id (Integer)

    ID of the user who&#39;s pipeline metrics statistics to fetch. If omitted, the authorized user will be used.

Returns:



99
100
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
149
150
151
152
153
154
155
# File 'lib/pipedrive-openapi-client/api/pipelines_api.rb', line 99

def pipelines_id_conversion_statistics_get_with_http_info(id, start_date, end_date, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PipelinesApi.pipelines_id_conversion_statistics_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 PipelinesApi.pipelines_id_conversion_statistics_get"
  end
  # verify the required parameter 'start_date' is set
  if @api_client.config.client_side_validation && start_date.nil?
    fail ArgumentError, "Missing the required parameter 'start_date' when calling PipelinesApi.pipelines_id_conversion_statistics_get"
  end
  # verify the required parameter 'end_date' is set
  if @api_client.config.client_side_validation && end_date.nil?
    fail ArgumentError, "Missing the required parameter 'end_date' when calling PipelinesApi.pipelines_id_conversion_statistics_get"
  end
  # resource path
  local_var_path = '/pipelines/{id}/conversion_statistics'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'GetDealsConversionRatesInPipeline' 

  # 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: PipelinesApi#pipelines_id_conversion_statistics_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#pipelines_id_deals_get(id, opts = {}) ⇒ GetStageDeals

Get deals in a pipeline Lists deals in a specific pipeline across all its stages

Parameters:

  • id (Integer)

    ID of the pipeline

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

    the optional parameters

Options Hash (opts):

  • :filter_id (Integer)

    If supplied, only deals matching the given filter will be returned.

  • :user_id (Integer)

    If supplied, filter_id will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned.

  • :everyone (NumberBoolean)

    If supplied, filter_id and user_id will not be considered – instead, deals owned by everyone will be returned.

  • :stage_id (Integer)

    If supplied, only deals within the given stage will be returned.

  • :start (Integer)

    Pagination start (default to 0)

  • :limit (Integer)

    Items shown per page

  • :get_summary (NumberBoolean)

    Whether to include summary of the pipeline in the additional_data or not.

  • :totals_convert_currency (String)

    3-letter currency code of any of the supported currencies. When supplied, per_stages_converted is returned inside deals_summary inside additional_data which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to &#39;default_currency&#39; in which case users default currency is used. Only works when get_summary parameter flag is enabled.

Returns:



170
171
172
173
# File 'lib/pipedrive-openapi-client/api/pipelines_api.rb', line 170

def pipelines_id_deals_get(id, opts = {})
  data, _status_code, _headers = pipelines_id_deals_get_with_http_info(id, opts)
  data
end

#pipelines_id_deals_get_with_http_info(id, opts = {}) ⇒ Array<(GetStageDeals, Integer, Hash)>

Get deals in a pipeline Lists deals in a specific pipeline across all its stages

Parameters:

  • id (Integer)

    ID of the pipeline

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

    the optional parameters

Options Hash (opts):

  • :filter_id (Integer)

    If supplied, only deals matching the given filter will be returned.

  • :user_id (Integer)

    If supplied, filter_id will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned.

  • :everyone (NumberBoolean)

    If supplied, filter_id and user_id will not be considered – instead, deals owned by everyone will be returned.

  • :stage_id (Integer)

    If supplied, only deals within the given stage will be returned.

  • :start (Integer)

    Pagination start

  • :limit (Integer)

    Items shown per page

  • :get_summary (NumberBoolean)

    Whether to include summary of the pipeline in the additional_data or not.

  • :totals_convert_currency (String)

    3-letter currency code of any of the supported currencies. When supplied, per_stages_converted is returned inside deals_summary inside additional_data which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to &#39;default_currency&#39; in which case users default currency is used. Only works when get_summary parameter flag is enabled.

Returns:

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

    GetStageDeals data, response status code and response headers



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
239
240
241
# File 'lib/pipedrive-openapi-client/api/pipelines_api.rb', line 188

def pipelines_id_deals_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PipelinesApi.pipelines_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 PipelinesApi.pipelines_id_deals_get"
  end
  # resource path
  local_var_path = '/pipelines/{id}/deals'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'filter_id'] = opts[:'filter_id'] if !opts[:'filter_id'].nil?
  query_params[:'user_id'] = opts[:'user_id'] if !opts[:'user_id'].nil?
  query_params[:'everyone'] = opts[:'everyone'] if !opts[:'everyone'].nil?
  query_params[:'stage_id'] = opts[:'stage_id'] if !opts[:'stage_id'].nil?
  query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'get_summary'] = opts[:'get_summary'] if !opts[:'get_summary'].nil?
  query_params[:'totals_convert_currency'] = opts[:'totals_convert_currency'] if !opts[:'totals_convert_currency'].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] || 'GetStageDeals' 

  # 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: PipelinesApi#pipelines_id_deals_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#pipelines_id_delete(id, opts = {}) ⇒ InlineResponse2009

Delete a pipeline Marks a pipeline as deleted.

Parameters:

  • id (Integer)

    ID of the pipeline

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

    the optional parameters

Returns:



248
249
250
251
# File 'lib/pipedrive-openapi-client/api/pipelines_api.rb', line 248

def pipelines_id_delete(id, opts = {})
  data, _status_code, _headers = pipelines_id_delete_with_http_info(id, opts)
  data
end

#pipelines_id_delete_with_http_info(id, opts = {}) ⇒ Array<(InlineResponse2009, Integer, Hash)>

Delete a pipeline Marks a pipeline as deleted.

Parameters:

  • id (Integer)

    ID of the pipeline

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

    the optional parameters

Returns:

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

    InlineResponse2009 data, response status code and response headers



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
299
300
301
302
303
# File 'lib/pipedrive-openapi-client/api/pipelines_api.rb', line 258

def pipelines_id_delete_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PipelinesApi.pipelines_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 PipelinesApi.pipelines_id_delete"
  end
  # resource path
  local_var_path = '/pipelines/{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'])

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

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'InlineResponse2009' 

  # 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: PipelinesApi#pipelines_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#pipelines_id_get(id, opts = {}) ⇒ GetOnePipeline

Get one pipeline Returns data about a specific pipeline. Also returns the summary of the deals in this pipeline across its stages.

Parameters:

  • id (Integer)

    ID of the pipeline

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

    the optional parameters

Options Hash (opts):

  • :totals_convert_currency (String)

    3-letter currency code of any of the supported currencies. When supplied, per_stages_converted is returned in deals_summary which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to &#39;default_currency&#39; in which case users default currency is used.

Returns:



311
312
313
314
# File 'lib/pipedrive-openapi-client/api/pipelines_api.rb', line 311

def pipelines_id_get(id, opts = {})
  data, _status_code, _headers = pipelines_id_get_with_http_info(id, opts)
  data
end

#pipelines_id_get_with_http_info(id, opts = {}) ⇒ Array<(GetOnePipeline, Integer, Hash)>

Get one pipeline Returns data about a specific pipeline. Also returns the summary of the deals in this pipeline across its stages.

Parameters:

  • id (Integer)

    ID of the pipeline

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

    the optional parameters

Options Hash (opts):

  • :totals_convert_currency (String)

    3-letter currency code of any of the supported currencies. When supplied, per_stages_converted is returned in deals_summary which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to &#39;default_currency&#39; in which case users default currency is used.

Returns:

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

    GetOnePipeline data, response status code and response headers



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
364
365
366
367
368
# File 'lib/pipedrive-openapi-client/api/pipelines_api.rb', line 322

def pipelines_id_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PipelinesApi.pipelines_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 PipelinesApi.pipelines_id_get"
  end
  # resource path
  local_var_path = '/pipelines/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'totals_convert_currency'] = opts[:'totals_convert_currency'] if !opts[:'totals_convert_currency'].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] || 'GetOnePipeline' 

  # 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: PipelinesApi#pipelines_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#pipelines_id_movement_statistics_get(id, start_date, end_date, opts = {}) ⇒ GetDealsMovementsInPipeline

Get deals movements in pipeline Returns statistics for deals movements for given time period.

Parameters:

  • id (Integer)

    ID of the pipeline

  • start_date (Date)

    Start of the period. Date in format of YYYY-MM-DD.

  • end_date (Date)

    End of the period. Date in format of YYYY-MM-DD.

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

    the optional parameters

Options Hash (opts):

  • :user_id (Integer)

    ID of the user who&#39;s pipeline statistics to fetch. If omitted, the authorized user will be used.

Returns:



378
379
380
381
# File 'lib/pipedrive-openapi-client/api/pipelines_api.rb', line 378

def pipelines_id_movement_statistics_get(id, start_date, end_date, opts = {})
  data, _status_code, _headers = pipelines_id_movement_statistics_get_with_http_info(id, start_date, end_date, opts)
  data
end

#pipelines_id_movement_statistics_get_with_http_info(id, start_date, end_date, opts = {}) ⇒ Array<(GetDealsMovementsInPipeline, Integer, Hash)>

Get deals movements in pipeline Returns statistics for deals movements for given time period.

Parameters:

  • id (Integer)

    ID of the pipeline

  • start_date (Date)

    Start of the period. Date in format of YYYY-MM-DD.

  • end_date (Date)

    End of the period. Date in format of YYYY-MM-DD.

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

    the optional parameters

Options Hash (opts):

  • :user_id (Integer)

    ID of the user who&#39;s pipeline statistics to fetch. If omitted, the authorized user will be used.

Returns:

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

    GetDealsMovementsInPipeline data, response status code and response headers



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
439
440
441
442
443
444
445
446
447
# File 'lib/pipedrive-openapi-client/api/pipelines_api.rb', line 391

def pipelines_id_movement_statistics_get_with_http_info(id, start_date, end_date, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PipelinesApi.pipelines_id_movement_statistics_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 PipelinesApi.pipelines_id_movement_statistics_get"
  end
  # verify the required parameter 'start_date' is set
  if @api_client.config.client_side_validation && start_date.nil?
    fail ArgumentError, "Missing the required parameter 'start_date' when calling PipelinesApi.pipelines_id_movement_statistics_get"
  end
  # verify the required parameter 'end_date' is set
  if @api_client.config.client_side_validation && end_date.nil?
    fail ArgumentError, "Missing the required parameter 'end_date' when calling PipelinesApi.pipelines_id_movement_statistics_get"
  end
  # resource path
  local_var_path = '/pipelines/{id}/movement_statistics'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'GetDealsMovementsInPipeline' 

  # 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: PipelinesApi#pipelines_id_movement_statistics_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#pipelines_id_put(id, opts = {}) ⇒ EditPipeline

Edit a pipeline Updates pipeline properties

Parameters:

  • id (Integer)

    ID of the pipeline

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

    the optional parameters

Options Hash (opts):

  • :name (String)

    The name of the Pipeline

  • :deal_probability (NumberBoolean)
  • :order_nr (Integer)

    Defines the order of Pipelines. First order (order_nr&#x3D;0) is the default Pipeline.

  • :active (NumberBoolean)

Returns:



458
459
460
461
# File 'lib/pipedrive-openapi-client/api/pipelines_api.rb', line 458

def pipelines_id_put(id, opts = {})
  data, _status_code, _headers = pipelines_id_put_with_http_info(id, opts)
  data
end

#pipelines_id_put_with_http_info(id, opts = {}) ⇒ Array<(EditPipeline, Integer, Hash)>

Edit a pipeline Updates pipeline properties

Parameters:

  • id (Integer)

    ID of the pipeline

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

    the optional parameters

Options Hash (opts):

  • :name (String)

    The name of the Pipeline

  • :deal_probability (NumberBoolean)
  • :order_nr (Integer)

    Defines the order of Pipelines. First order (order_nr&#x3D;0) is the default Pipeline.

  • :active (NumberBoolean)

Returns:

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

    EditPipeline data, response status code and response headers



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
520
521
522
523
# File 'lib/pipedrive-openapi-client/api/pipelines_api.rb', line 472

def pipelines_id_put_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PipelinesApi.pipelines_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 PipelinesApi.pipelines_id_put"
  end
  # resource path
  local_var_path = '/pipelines/{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/x-www-form-urlencoded'])

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['name'] = opts[:'name'] if !opts[:'name'].nil?
  form_params['deal_probability'] = opts[:'deal_probability'] if !opts[:'deal_probability'].nil?
  form_params['order_nr'] = opts[:'order_nr'] if !opts[:'order_nr'].nil?
  form_params['active'] = opts[:'active'] if !opts[:'active'].nil?

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'EditPipeline' 

  # 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: PipelinesApi#pipelines_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#pipelines_post(opts = {}) ⇒ AddNewPipeline

Add a new pipeline Adds a new pipeline

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :name (String)

    The name of the Pipeline

  • :deal_probability (NumberBoolean)
  • :order_nr (Integer)

    Defines the order of Pipelines. First order (order_nr&#x3D;0) is the default Pipeline.

  • :active (NumberBoolean)

Returns:



533
534
535
536
# File 'lib/pipedrive-openapi-client/api/pipelines_api.rb', line 533

def pipelines_post(opts = {})
  data, _status_code, _headers = pipelines_post_with_http_info(opts)
  data
end

#pipelines_post_with_http_info(opts = {}) ⇒ Array<(AddNewPipeline, Integer, Hash)>

Add a new pipeline Adds a new pipeline

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :name (String)

    The name of the Pipeline

  • :deal_probability (NumberBoolean)
  • :order_nr (Integer)

    Defines the order of Pipelines. First order (order_nr&#x3D;0) is the default Pipeline.

  • :active (NumberBoolean)

Returns:

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

    AddNewPipeline data, response status code and response headers



546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
# File 'lib/pipedrive-openapi-client/api/pipelines_api.rb', line 546

def pipelines_post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PipelinesApi.pipelines_post ...'
  end
  # resource path
  local_var_path = '/pipelines'

  # 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/x-www-form-urlencoded'])

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['name'] = opts[:'name'] if !opts[:'name'].nil?
  form_params['deal_probability'] = opts[:'deal_probability'] if !opts[:'deal_probability'].nil?
  form_params['order_nr'] = opts[:'order_nr'] if !opts[:'order_nr'].nil?
  form_params['active'] = opts[:'active'] if !opts[:'active'].nil?

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'AddNewPipeline' 

  # 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: PipelinesApi#pipelines_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end