Class: Pipedrive::GoalsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ GoalsApi

Returns a new instance of GoalsApi.



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

def api_client
  @api_client
end

Instance Method Details

#goals_find_get(opts = {}) ⇒ nil

Find goals Returns data about goals based on criteria. For searching, append ‘searchField=searchValue` to the URL, where `searchField` can be any one of the lowest-level fields in dot-notation (e.g. `type.params.pipeline_id`; `title`). `searchValue` should be the value you are looking for on that field. Additionally, `is_active=<true|false>` can be provided to search for only active/inactive goals. When providing `period.start`, `period.end` must also be provided and vice versa.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :type_name (String)

    Type of the goal. If provided, everyone&#39;s goals will be returned.

  • :title (String)

    Title of the goal.

  • :is_active (Boolean)

    Whether goal is active or not. (default to true)

  • :assignee_id (Integer)

    ID of the user who&#39;s goal to fetch. When omitted, only your goals will be returned.

  • :assignee_type (String)

    Type of the goal&#39;s assignee. If provided, everyone&#39;s goals will be returned.

  • :expected_outcome_target (Float)

    Numeric value of the outcome. If provided, everyone&#39;s goals will be returned.

  • :expected_outcome_tracking_metric (String)

    Tracking metric of the expected outcome of the goal. If provided, everyone&#39;s goals will be returned.

  • :expected_outcome_currency_id (Integer)

    Numeric ID of the goal&#39;s currency. Only applicable to goals with &#x60;expected_outcome.tracking_metric&#x60; with value &#x60;sum&#x60;. If provided, everyone&#39;s goals will be returned.

  • :type_params_pipeline_id (Integer)

    ID of the pipeline or &#x60;null&#x60; for all pipelines. If provided, everyone&#39;s goals will be returned.

  • :type_params_stage_id (Integer)

    ID of the stage. Applicable to only &#x60;deals_progressed&#x60; type of goals. If provided, everyone&#39;s goals will be returned.

  • :type_params_activity_type_id (Integer)

    ID of the activity type. Applicable to only &#x60;activities_completed&#x60; or &#x60;activities_added&#x60; types of goals. If provided, everyone&#39;s goals will be returned.

  • :period_start (Date)

    Start date of the period for which to find goals. Date in format of YYYY-MM-DD. When &#x60;period.start&#x60; is provided, &#x60;period.end&#x60; must be provided too.

  • :period_end (Date)

    End date of the period for which to find goals. Date in format of YYYY-MM-DD.

Returns:

  • (nil)


39
40
41
42
# File 'lib/pipedrive-openapi-client/api/goals_api.rb', line 39

def goals_find_get(opts = {})
  goals_find_get_with_http_info(opts)
  nil
end

#goals_find_get_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>

Find goals Returns data about goals based on criteria. For searching, append &#x60;searchField&#x3D;searchValue&#x60; to the URL, where &#x60;searchField&#x60; can be any one of the lowest-level fields in dot-notation (e.g. &#x60;type.params.pipeline_id&#x60;; &#x60;title&#x60;). &#x60;searchValue&#x60; should be the value you are looking for on that field. Additionally, &#x60;is_active&#x3D;&lt;true|false&gt;&#x60; can be provided to search for only active/inactive goals. When providing &#x60;period.start&#x60;, &#x60;period.end&#x60; must also be provided and vice versa.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :type_name (String)

    Type of the goal. If provided, everyone&#39;s goals will be returned.

  • :title (String)

    Title of the goal.

  • :is_active (Boolean)

    Whether goal is active or not.

  • :assignee_id (Integer)

    ID of the user who&#39;s goal to fetch. When omitted, only your goals will be returned.

  • :assignee_type (String)

    Type of the goal&#39;s assignee. If provided, everyone&#39;s goals will be returned.

  • :expected_outcome_target (Float)

    Numeric value of the outcome. If provided, everyone&#39;s goals will be returned.

  • :expected_outcome_tracking_metric (String)

    Tracking metric of the expected outcome of the goal. If provided, everyone&#39;s goals will be returned.

  • :expected_outcome_currency_id (Integer)

    Numeric ID of the goal&#39;s currency. Only applicable to goals with &#x60;expected_outcome.tracking_metric&#x60; with value &#x60;sum&#x60;. If provided, everyone&#39;s goals will be returned.

  • :type_params_pipeline_id (Integer)

    ID of the pipeline or &#x60;null&#x60; for all pipelines. If provided, everyone&#39;s goals will be returned.

  • :type_params_stage_id (Integer)

    ID of the stage. Applicable to only &#x60;deals_progressed&#x60; type of goals. If provided, everyone&#39;s goals will be returned.

  • :type_params_activity_type_id (Integer)

    ID of the activity type. Applicable to only &#x60;activities_completed&#x60; or &#x60;activities_added&#x60; types of goals. If provided, everyone&#39;s goals will be returned.

  • :period_start (Date)

    Start date of the period for which to find goals. Date in format of YYYY-MM-DD. When &#x60;period.start&#x60; is provided, &#x60;period.end&#x60; must be provided too.

  • :period_end (Date)

    End date of the period for which to find goals. Date in format of YYYY-MM-DD.

Returns:

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

    nil, response status code and response headers



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
93
94
95
96
97
98
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
# File 'lib/pipedrive-openapi-client/api/goals_api.rb', line 61

def goals_find_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GoalsApi.goals_find_get ...'
  end
  allowable_values = ["deals_won", "deals_progressed", "activities_completed", "activities_added", "deals_started"]
  if @api_client.config.client_side_validation && opts[:'type_name'] && !allowable_values.include?(opts[:'type_name'])
    fail ArgumentError, "invalid value for \"type_name\", must be one of #{allowable_values}"
  end
  allowable_values = ["true", "false"]
  if @api_client.config.client_side_validation && opts[:'is_active'] && !allowable_values.include?(opts[:'is_active'])
    fail ArgumentError, "invalid value for \"is_active\", must be one of #{allowable_values}"
  end
  allowable_values = ["person", "company", "team"]
  if @api_client.config.client_side_validation && opts[:'assignee_type'] && !allowable_values.include?(opts[:'assignee_type'])
    fail ArgumentError, "invalid value for \"assignee_type\", must be one of #{allowable_values}"
  end
  allowable_values = ["quantity", "sum"]
  if @api_client.config.client_side_validation && opts[:'expected_outcome_tracking_metric'] && !allowable_values.include?(opts[:'expected_outcome_tracking_metric'])
    fail ArgumentError, "invalid value for \"expected_outcome_tracking_metric\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/goals/find'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'type.name'] = opts[:'type_name'] if !opts[:'type_name'].nil?
  query_params[:'title'] = opts[:'title'] if !opts[:'title'].nil?
  query_params[:'is_active'] = opts[:'is_active'] if !opts[:'is_active'].nil?
  query_params[:'assignee.id'] = opts[:'assignee_id'] if !opts[:'assignee_id'].nil?
  query_params[:'assignee.type'] = opts[:'assignee_type'] if !opts[:'assignee_type'].nil?
  query_params[:'expected_outcome.target'] = opts[:'expected_outcome_target'] if !opts[:'expected_outcome_target'].nil?
  query_params[:'expected_outcome.tracking_metric'] = opts[:'expected_outcome_tracking_metric'] if !opts[:'expected_outcome_tracking_metric'].nil?
  query_params[:'expected_outcome.currency_id'] = opts[:'expected_outcome_currency_id'] if !opts[:'expected_outcome_currency_id'].nil?
  query_params[:'type.params.pipeline_id'] = opts[:'type_params_pipeline_id'] if !opts[:'type_params_pipeline_id'].nil?
  query_params[:'type.params.stage_id'] = opts[:'type_params_stage_id'] if !opts[:'type_params_stage_id'].nil?
  query_params[:'type.params.activity_type_id'] = opts[:'type_params_activity_type_id'] if !opts[:'type_params_activity_type_id'].nil?
  query_params[:'period.start'] = opts[:'period_start'] if !opts[:'period_start'].nil?
  query_params[:'period.end'] = opts[:'period_end'] if !opts[:'period_end'].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']

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

#goals_id_delete(id, opts = {}) ⇒ nil

Delete existing goal Marks goal as deleted.

Parameters:

  • id (String)

    ID of the goal to be deleted.

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

    the optional parameters

Returns:

  • (nil)


136
137
138
139
# File 'lib/pipedrive-openapi-client/api/goals_api.rb', line 136

def goals_id_delete(id, opts = {})
  goals_id_delete_with_http_info(id, opts)
  nil
end

#goals_id_delete_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete existing goal Marks goal as deleted.

Parameters:

  • id (String)

    ID of the goal to be deleted.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/pipedrive-openapi-client/api/goals_api.rb', line 146

def goals_id_delete_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GoalsApi.goals_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 GoalsApi.goals_id_delete"
  end
  # resource path
  local_var_path = '/goals/{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']

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

#goals_id_put(id, opts = {}) ⇒ nil

Update existing goal Updates existing goal.

Parameters:

  • id (String)

    ID of the goal to be updated.

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

    the optional parameters

Options Hash (opts):

  • :title (String)

    Title of the goal.

  • :assignee (Object)

    Who is this goal assigned to. It requires the following JSON structure: { \&quot;id\&quot;: \&quot;1\&quot;, \&quot;type\&quot;: \&quot;person\&quot; }. &#x60;type&#x60; can be either &#x60;person&#x60;, &#x60;company&#x60; or &#x60;team&#x60;. ID of the assignee person, company or team.

  • :type (Object)

    Type of the goal. It requires the following JSON structure: { \&quot;name\&quot;: \&quot;deals_started\&quot;, \&quot;params\&quot;: { \&quot;pipeline_id\&quot;: 1 } }. Type can be one of: &#x60;deals_won&#x60;,&#x60;deals_progressed&#x60;,&#x60;activities_completed&#x60;,&#x60;activities_added&#x60; or &#x60;deals_started&#x60;. &#x60;params&#x60; can include &#x60;pipeline_id&#x60;, &#x60;stage_id&#x60; or &#x60;activity_type_id&#x60;. &#x60;stage_id&#x60; is related to only &#x60;deals_progressed&#x60; type of goals and &#x60;activity_type_id&#x60; to &#x60;activities_completed&#x60; or &#x60;activities_added&#x60; types of goals. To track goal in all pipelines set &#x60;pipeline_id&#x60; as &#x60;null&#x60;.

  • :expected_outcome (Object)

    Expected outcome of the goal. Expected outcome can be tracked either by &#x60;quantity&#x60; or by &#x60;sum&#x60;. It requires the following JSON structure: { \&quot;target\&quot;: \&quot;50\&quot;, \&quot;tracking_metric\&quot;: \&quot;quantity\&quot; } or { \&quot;target\&quot;: \&quot;50\&quot;, \&quot;tracking_metric\&quot;: \&quot;sum\&quot;, \&quot;currency_id\&quot;: 1 }. &#x60;currency_id&#x60; should only be added to &#x60;sum&#x60; type of goals.

  • :duration (Object)

    Date when the goal starts and ends. It requires the following JSON structure: { \&quot;start\&quot;: \&quot;2019-01-01\&quot;, \&quot;end\&quot;: \&quot;2022-12-31\&quot; }. Date in format of YYYY-MM-DD.

  • :interval (String)

    Date when the goal starts and ends. It requires the following JSON structure: { \&quot;start\&quot;: \&quot;2019-01-01\&quot;, \&quot;end\&quot;: \&quot;2022-12-31\&quot; }. Date in format of YYYY-MM-DD.

Returns:

  • (nil)


202
203
204
205
# File 'lib/pipedrive-openapi-client/api/goals_api.rb', line 202

def goals_id_put(id, opts = {})
  goals_id_put_with_http_info(id, opts)
  nil
end

#goals_id_put_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Update existing goal Updates existing goal.

Parameters:

  • id (String)

    ID of the goal to be updated.

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

    the optional parameters

Options Hash (opts):

  • :title (String)

    Title of the goal.

  • :assignee (Object)

    Who is this goal assigned to. It requires the following JSON structure: { \&quot;id\&quot;: \&quot;1\&quot;, \&quot;type\&quot;: \&quot;person\&quot; }. &#x60;type&#x60; can be either &#x60;person&#x60;, &#x60;company&#x60; or &#x60;team&#x60;. ID of the assignee person, company or team.

  • :type (Object)

    Type of the goal. It requires the following JSON structure: { \&quot;name\&quot;: \&quot;deals_started\&quot;, \&quot;params\&quot;: { \&quot;pipeline_id\&quot;: 1 } }. Type can be one of: &#x60;deals_won&#x60;,&#x60;deals_progressed&#x60;,&#x60;activities_completed&#x60;,&#x60;activities_added&#x60; or &#x60;deals_started&#x60;. &#x60;params&#x60; can include &#x60;pipeline_id&#x60;, &#x60;stage_id&#x60; or &#x60;activity_type_id&#x60;. &#x60;stage_id&#x60; is related to only &#x60;deals_progressed&#x60; type of goals and &#x60;activity_type_id&#x60; to &#x60;activities_completed&#x60; or &#x60;activities_added&#x60; types of goals. To track goal in all pipelines set &#x60;pipeline_id&#x60; as &#x60;null&#x60;.

  • :expected_outcome (Object)

    Expected outcome of the goal. Expected outcome can be tracked either by &#x60;quantity&#x60; or by &#x60;sum&#x60;. It requires the following JSON structure: { \&quot;target\&quot;: \&quot;50\&quot;, \&quot;tracking_metric\&quot;: \&quot;quantity\&quot; } or { \&quot;target\&quot;: \&quot;50\&quot;, \&quot;tracking_metric\&quot;: \&quot;sum\&quot;, \&quot;currency_id\&quot;: 1 }. &#x60;currency_id&#x60; should only be added to &#x60;sum&#x60; type of goals.

  • :duration (Object)

    Date when the goal starts and ends. It requires the following JSON structure: { \&quot;start\&quot;: \&quot;2019-01-01\&quot;, \&quot;end\&quot;: \&quot;2022-12-31\&quot; }. Date in format of YYYY-MM-DD.

  • :interval (String)

    Date when the goal starts and ends. It requires the following JSON structure: { \&quot;start\&quot;: \&quot;2019-01-01\&quot;, \&quot;end\&quot;: \&quot;2022-12-31\&quot; }. Date in format of YYYY-MM-DD.

Returns:

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

    nil, response status code and response headers



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'lib/pipedrive-openapi-client/api/goals_api.rb', line 218

def goals_id_put_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GoalsApi.goals_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 GoalsApi.goals_id_put"
  end
  allowable_values = ["weekly", "monthly", "quarterly", "yearly"]
  if @api_client.config.client_side_validation && opts[:'interval'] && !allowable_values.include?(opts[:'interval'])
    fail ArgumentError, "invalid value for \"interval\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/goals/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['title'] = opts[:'title'] if !opts[:'title'].nil?
  form_params['assignee'] = opts[:'assignee'] if !opts[:'assignee'].nil?
  form_params['type'] = opts[:'type'] if !opts[:'type'].nil?
  form_params['expected_outcome'] = opts[:'expected_outcome'] if !opts[:'expected_outcome'].nil?
  form_params['duration'] = opts[:'duration'] if !opts[:'duration'].nil?
  form_params['interval'] = opts[:'interval'] if !opts[:'interval'].nil?

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

  # return_type
  return_type = opts[:return_type] 

  # 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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GoalsApi#goals_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#goals_id_results_get(id, period_start, period_end, opts = {}) ⇒ nil

Get result of a goal Gets progress of a goal for specified period.

Parameters:

  • id (String)

    ID of the goal that the results are looked for.

  • period_start (Date)

    Start date of the period for which to find progress of a goal. Date in format of YYYY-MM-DD.

  • period_end (Date)

    End date of the period for which to find progress of a goal. Date in format of YYYY-MM-DD.

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

    the optional parameters

Returns:

  • (nil)


282
283
284
285
# File 'lib/pipedrive-openapi-client/api/goals_api.rb', line 282

def goals_id_results_get(id, period_start, period_end, opts = {})
  goals_id_results_get_with_http_info(id, period_start, period_end, opts)
  nil
end

#goals_id_results_get_with_http_info(id, period_start, period_end, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Get result of a goal Gets progress of a goal for specified period.

Parameters:

  • id (String)

    ID of the goal that the results are looked for.

  • period_start (Date)

    Start date of the period for which to find progress of a goal. Date in format of YYYY-MM-DD.

  • period_end (Date)

    End date of the period for which to find progress of a goal. Date in format of YYYY-MM-DD.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/pipedrive-openapi-client/api/goals_api.rb', line 294

def goals_id_results_get_with_http_info(id, period_start, period_end, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GoalsApi.goals_id_results_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 GoalsApi.goals_id_results_get"
  end
  # verify the required parameter 'period_start' is set
  if @api_client.config.client_side_validation && period_start.nil?
    fail ArgumentError, "Missing the required parameter 'period_start' when calling GoalsApi.goals_id_results_get"
  end
  # verify the required parameter 'period_end' is set
  if @api_client.config.client_side_validation && period_end.nil?
    fail ArgumentError, "Missing the required parameter 'period_end' when calling GoalsApi.goals_id_results_get"
  end
  # resource path
  local_var_path = '/goals/{id}/results'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'period.start'] = period_start
  query_params[:'period.end'] = period_end

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

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

#goals_post(opts = {}) ⇒ nil

Add a new goal Adds a new goal.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


353
354
355
356
# File 'lib/pipedrive-openapi-client/api/goals_api.rb', line 353

def goals_post(opts = {})
  goals_post_with_http_info(opts)
  nil
end

#goals_post_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>

Add a new goal Adds a new goal.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# File 'lib/pipedrive-openapi-client/api/goals_api.rb', line 362

def goals_post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GoalsApi.goals_post ...'
  end
  # resource path
  local_var_path = '/goals'

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

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

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