class Pipedrive::PersonsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/pipedrive-openapi-client/api/persons_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

persons_delete(opts = {}) click to toggle source

Delete multiple persons in bulk Marks multiple persons as deleted. @param [Hash] opts the optional parameters @option opts [String] :ids Comma-separated IDs that will be deleted @return [nil]

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 27
def persons_delete(opts = {})
  persons_delete_with_http_info(opts)
  nil
end
persons_delete_with_http_info(opts = {}) click to toggle source

Delete multiple persons in bulk Marks multiple persons as deleted. @param [Hash] opts the optional parameters @option opts [String] :ids Comma-separated IDs that will be deleted @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 37
def persons_delete_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_delete ...'
  end
  # resource path
  local_var_path = '/persons'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ids'] = opts[:'ids'] if !opts[:'ids'].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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PersonsApi#persons_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
persons_find_get_with_http_info(term, opts = {}) click to toggle source

Find persons by name &lt;strong&gt;This endpoint is deprecated. Please use &lt;a href&#x3D;&quot;developers.pipedrive.com/docs/api/v1/#!/Persons/get_persons_search">/v1/persons/search</a>; or &lt;a href&#x3D;&quot;developers.pipedrive.com/docs/api/v1/#!/ItemSearch/get_itemSearch">/v1/itemSearch</a>; instead&lt;/strong&gt;. &lt;br&gt; Searches all persons by their name. @param term [String] Search term to look for @param [Hash] opts the optional parameters @option opts [Integer] :org_id ID of the organization person is associated with. @option opts [Integer] :start Pagination start @option opts [Integer] :limit Items shown per page @option opts [NumberBoolean] :search_by_email When enabled, term will only be matched against email addresses of people. Default: false @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 102
def persons_find_get_with_http_info(term, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_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 PersonsApi.persons_find_get"
  end
  # resource path
  local_var_path = '/persons/find'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'term'] = term
  query_params[:'org_id'] = opts[:'org_id'] if !opts[:'org_id'].nil?
  query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'search_by_email'] = opts[:'search_by_email'] if !opts[:'search_by_email'].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: PersonsApi#persons_find_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
persons_get(opts = {}) click to toggle source

Get all persons Returns all persons @param [Hash] opts the optional parameters @option opts [Integer] :user_id If supplied, only persons owned by the given user will be returned. @option opts [Integer] :filter_id ID of the filter to use. @option opts [String] :first_char If supplied, only persons whose name starts with the specified letter will be returned (case insensitive). @option opts [Integer] :start Pagination start (default to 0) @option opts [Integer] :limit Items shown per page @option opts [String] :sort 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). @return [nil]

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 162
def persons_get(opts = {})
  persons_get_with_http_info(opts)
  nil
end
persons_get_with_http_info(opts = {}) click to toggle source

Get all persons Returns all persons @param [Hash] opts the optional parameters @option opts [Integer] :user_id If supplied, only persons owned by the given user will be returned. @option opts [Integer] :filter_id ID of the filter to use. @option opts [String] :first_char If supplied, only persons whose name starts with the specified letter will be returned (case insensitive). @option opts [Integer] :start Pagination start @option opts [Integer] :limit Items shown per page @option opts [String] :sort 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). @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 177
def persons_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_get ...'
  end
  # resource path
  local_var_path = '/persons'

  # 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?
  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: PersonsApi#persons_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
persons_id_activities_get(id, opts = {}) click to toggle source

List activities associated with a person Lists activities associated with a person. @param id [Integer] ID of a person @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start (default to 0) @option opts [Integer] :limit Items shown per page @option opts [NumberBoolean] :done Whether the activity is done or not. 0 &#x3D; Not done, 1 &#x3D; Done. If omitted returns both Done and Not done activities. @option opts [String] :exclude A comma-separated string of activity IDs to exclude from result @return [nil]

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 233
def persons_id_activities_get(id, opts = {})
  persons_id_activities_get_with_http_info(id, opts)
  nil
end
persons_id_activities_get_with_http_info(id, opts = {}) click to toggle source

List activities associated with a person Lists activities associated with a person. @param id [Integer] ID of a person @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start @option opts [Integer] :limit Items shown per page @option opts [NumberBoolean] :done Whether the activity is done or not. 0 &#x3D; Not done, 1 &#x3D; Done. If omitted returns both Done and Not done activities. @option opts [String] :exclude A comma-separated string of activity IDs to exclude from result @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 247
def persons_id_activities_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_activities_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 PersonsApi.persons_id_activities_get"
  end
  # resource path
  local_var_path = '/persons/{id}/activities'.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[:'done'] = opts[:'done'] if !opts[:'done'].nil?
  query_params[:'exclude'] = opts[:'exclude'] if !opts[:'exclude'].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: PersonsApi#persons_id_activities_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
persons_id_deals_get(id, opts = {}) click to toggle source

List deals associated with a person Lists deals associated with a person. @param id [Integer] ID of a person @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start (default to 0) @option opts [Integer] :limit Items shown per page @option opts [String] :status Only fetch deals with specific status. If omitted, all not deleted deals are fetched. (default to 'all_not_deleted') @option opts [String] :sort 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). @return [nil]

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 305
def persons_id_deals_get(id, opts = {})
  persons_id_deals_get_with_http_info(id, opts)
  nil
end
persons_id_deals_get_with_http_info(id, opts = {}) click to toggle source

List deals associated with a person Lists deals associated with a person. @param id [Integer] ID of a person @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start @option opts [Integer] :limit Items shown per page @option opts [String] :status Only fetch deals with specific status. If omitted, all not deleted deals are fetched. @option opts [String] :sort 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). @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 319
def persons_id_deals_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_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 PersonsApi.persons_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 = '/persons/{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?
  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: PersonsApi#persons_id_deals_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
persons_id_delete(id, opts = {}) click to toggle source

Delete a person Marks a person as deleted. @param id [Integer] ID of a person @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 377
def persons_id_delete(id, opts = {})
  persons_id_delete_with_http_info(id, opts)
  nil
end
persons_id_delete_with_http_info(id, opts = {}) click to toggle source

Delete a person Marks a person as deleted. @param id [Integer] ID of a person @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 387
def persons_id_delete_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_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 PersonsApi.persons_id_delete"
  end
  # resource path
  local_var_path = '/persons/{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: PersonsApi#persons_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
persons_id_files_get(id, opts = {}) click to toggle source

List files attached to a person Lists files associated with a person. @param id [Integer] ID of a person @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start (default to 0) @option opts [Integer] :limit Items shown per page @option opts [NumberBoolean] :include_deleted_files When enabled, the list of files will also include deleted files. Please note that trying to download these files will not work. @option opts [String] :sort 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. @return [nil]

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 441
def persons_id_files_get(id, opts = {})
  persons_id_files_get_with_http_info(id, opts)
  nil
end
persons_id_files_get_with_http_info(id, opts = {}) click to toggle source

List files attached to a person Lists files associated with a person. @param id [Integer] ID of a person @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start @option opts [Integer] :limit Items shown per page @option opts [NumberBoolean] :include_deleted_files When enabled, the list of files will also include deleted files. Please note that trying to download these files will not work. @option opts [String] :sort 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. @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 455
def persons_id_files_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_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 PersonsApi.persons_id_files_get"
  end
  # resource path
  local_var_path = '/persons/{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: PersonsApi#persons_id_files_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
persons_id_flow_get(id, opts = {}) click to toggle source

List updates about a person Lists updates about a person. @param id [Integer] ID of a person @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start (default to 0) @option opts [Integer] :limit Items shown per page @option opts [String] :all_changes Whether to show custom field updates or not. 1 &#x3D; Include custom field changes. If omitted returns changes without custom field updates. @option opts [String] :items A comma-separated string for filtering out item specific updates. (Possible values - activity, plannedActivity, note, file, change, deal, follower, participant, mailMessage, mailMessageWithAttachment, invoice, activityFile, document) @return [nil]

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 513
def persons_id_flow_get(id, opts = {})
  persons_id_flow_get_with_http_info(id, opts)
  nil
end
persons_id_flow_get_with_http_info(id, opts = {}) click to toggle source

List updates about a person Lists updates about a person. @param id [Integer] ID of a person @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start @option opts [Integer] :limit Items shown per page @option opts [String] :all_changes Whether to show custom field updates or not. 1 &#x3D; Include custom field changes. If omitted returns changes without custom field updates. @option opts [String] :items A comma-separated string for filtering out item specific updates. (Possible values - activity, plannedActivity, note, file, change, deal, follower, participant, mailMessage, mailMessageWithAttachment, invoice, activityFile, document) @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 527
def persons_id_flow_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_flow_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 PersonsApi.persons_id_flow_get"
  end
  # resource path
  local_var_path = '/persons/{id}/flow'.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[:'all_changes'] = opts[:'all_changes'] if !opts[:'all_changes'].nil?
  query_params[:'items'] = opts[:'items'] if !opts[:'items'].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: PersonsApi#persons_id_flow_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
persons_id_followers_follower_id_delete(id, follower_id, opts = {}) click to toggle source

Deletes a follower from a person. Delete a follower from a person @param id [Integer] ID of a person @param follower_id [Integer] ID of the follower @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 582
def persons_id_followers_follower_id_delete(id, follower_id, opts = {})
  persons_id_followers_follower_id_delete_with_http_info(id, follower_id, opts)
  nil
end
persons_id_followers_follower_id_delete_with_http_info(id, follower_id, opts = {}) click to toggle source

Deletes a follower from a person. Delete a follower from a person @param id [Integer] ID of a person @param follower_id [Integer] ID of the follower @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 593
def persons_id_followers_follower_id_delete_with_http_info(id, follower_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_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 PersonsApi.persons_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 PersonsApi.persons_id_followers_follower_id_delete"
  end
  # resource path
  local_var_path = '/persons/{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] || {}

  # 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: PersonsApi#persons_id_followers_follower_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
persons_id_followers_get(id, opts = {}) click to toggle source

List followers of a person Lists the followers of a person. @param id [Integer] ID of a person @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 647
def persons_id_followers_get(id, opts = {})
  persons_id_followers_get_with_http_info(id, opts)
  nil
end
persons_id_followers_get_with_http_info(id, opts = {}) click to toggle source

List followers of a person Lists the followers of a person. @param id [Integer] ID of a person @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 657
def persons_id_followers_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_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 PersonsApi.persons_id_followers_get"
  end
  # resource path
  local_var_path = '/persons/{id}/followers'.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: PersonsApi#persons_id_followers_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
persons_id_followers_post(id, user_id, opts = {}) click to toggle source

Add a follower to a person Adds a follower to a person. @param id [Integer] ID of a person @param user_id [Integer] ID of the user @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 708
def persons_id_followers_post(id, user_id, opts = {})
  persons_id_followers_post_with_http_info(id, user_id, opts)
  nil
end
persons_id_followers_post_with_http_info(id, user_id, opts = {}) click to toggle source

Add a follower to a person Adds a follower to a person. @param id [Integer] ID of a person @param user_id [Integer] ID of the user @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 719
def persons_id_followers_post_with_http_info(id, user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_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 PersonsApi.persons_id_followers_post"
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling PersonsApi.persons_id_followers_post"
  end
  # resource path
  local_var_path = '/persons/{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 '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['user_id'] = user_id

  # 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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PersonsApi#persons_id_followers_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
persons_id_get(id, opts = {}) click to toggle source

Get details of a person Returns details of a person. Note that this also returns some additional fields which are not present when asking for all persons. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the 'key' value of personFields. @param id [Integer] ID of a person @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 776
def persons_id_get(id, opts = {})
  persons_id_get_with_http_info(id, opts)
  nil
end
persons_id_get_with_http_info(id, opts = {}) click to toggle source

Get details of a person Returns details of a person. Note that this also returns some additional fields which are not present when asking for all persons. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the &#39;key&#39; value of personFields. @param id [Integer] ID of a person @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 786
def persons_id_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_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 PersonsApi.persons_id_get"
  end
  # resource path
  local_var_path = '/persons/{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: PersonsApi#persons_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
persons_id_mail_messages_get(id, opts = {}) click to toggle source

List mail messages associated with a person Lists mail messages associated with a person. @param id [Integer] ID of a person @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start (default to 0) @option opts [Integer] :limit Items shown per page @return [nil]

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 838
def persons_id_mail_messages_get(id, opts = {})
  persons_id_mail_messages_get_with_http_info(id, opts)
  nil
end
persons_id_mail_messages_get_with_http_info(id, opts = {}) click to toggle source

List mail messages associated with a person Lists mail messages associated with a person. @param id [Integer] ID of a person @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start @option opts [Integer] :limit Items shown per page @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 850
def persons_id_mail_messages_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_mail_messages_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 PersonsApi.persons_id_mail_messages_get"
  end
  # resource path
  local_var_path = '/persons/{id}/mailMessages'.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?

  # 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: PersonsApi#persons_id_mail_messages_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
persons_id_merge_put(id, merge_with_id, opts = {}) click to toggle source

Merge two persons Merges a person with another person. For more information on how to merge two persons, see <a href="pipedrive.readme.io/docs/merging-two-persons" target="_blank" rel="noopener noreferrer">this tutorial</a>. @param id [Integer] ID of a person @param merge_with_id [Integer] The ID of the Person that will not be overwritten. This Person’s data will be prioritized in case of conflict with the other Person. @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 903
def persons_id_merge_put(id, merge_with_id, opts = {})
  persons_id_merge_put_with_http_info(id, merge_with_id, opts)
  nil
end
persons_id_merge_put_with_http_info(id, merge_with_id, opts = {}) click to toggle source

Merge two persons Merges a person with another person. For more information on how to merge two persons, see &lt;a href&#x3D;&quot;pipedrive.readme.io/docs/merging-two-persons"; target&#x3D;&quot;_blank&quot; rel&#x3D;&quot;noopener noreferrer&quot;&gt;this tutorial&lt;/a&gt;. @param id [Integer] ID of a person @param merge_with_id [Integer] The ID of the Person that will not be overwritten. This Person’s data will be prioritized in case of conflict with the other Person. @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 914
def persons_id_merge_put_with_http_info(id, merge_with_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_merge_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 PersonsApi.persons_id_merge_put"
  end
  # verify the required parameter 'merge_with_id' is set
  if @api_client.config.client_side_validation && merge_with_id.nil?
    fail ArgumentError, "Missing the required parameter 'merge_with_id' when calling PersonsApi.persons_id_merge_put"
  end
  # resource path
  local_var_path = '/persons/{id}/merge'.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['merge_with_id'] = merge_with_id

  # 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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PersonsApi#persons_id_merge_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
persons_id_permitted_users_get(id, opts = {}) click to toggle source

List permitted users List users permitted to access a person @param id [Integer] ID of a person @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 971
def persons_id_permitted_users_get(id, opts = {})
  persons_id_permitted_users_get_with_http_info(id, opts)
  nil
end
persons_id_permitted_users_get_with_http_info(id, opts = {}) click to toggle source

List permitted users List users permitted to access a person @param id [Integer] ID of a person @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 981
def persons_id_permitted_users_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_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 PersonsApi.persons_id_permitted_users_get"
  end
  # resource path
  local_var_path = '/persons/{id}/permittedUsers'.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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PersonsApi#persons_id_permitted_users_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
persons_id_picture_delete(id, opts = {}) click to toggle source

Delete person picture Delete person picture @param id [Integer] ID of a person @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 1031
def persons_id_picture_delete(id, opts = {})
  persons_id_picture_delete_with_http_info(id, opts)
  nil
end
persons_id_picture_delete_with_http_info(id, opts = {}) click to toggle source

Delete person picture Delete person picture @param id [Integer] ID of a person @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 1041
def persons_id_picture_delete_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_picture_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 PersonsApi.persons_id_picture_delete"
  end
  # resource path
  local_var_path = '/persons/{id}/picture'.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: PersonsApi#persons_id_picture_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
persons_id_picture_post(id, file, opts = {}) click to toggle source

Add person picture Add a picture to a person. If a picture is already set, the old picture will be replaced. Added image (or the cropping parameters supplied with the request) should have an equal width and height and should be at least 128 pixels. GIF, JPG and PNG are accepted. All added images will be resized to 128 and 512 pixel wide squares. @param id [Integer] ID of a person @param file [File] One image supplied in the multipart/form-data encoding. @param [Hash] opts the optional parameters @option opts [Integer] :crop_x X coordinate to where start cropping form (in pixels) @option opts [Integer] :crop_y Y coordinate to where start cropping form (in pixels) @option opts [Integer] :crop_width Width of cropping area (in pixels) @option opts [Integer] :crop_height Height of cropping area (in pixels) @return [nil]

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 1096
def persons_id_picture_post(id, file, opts = {})
  persons_id_picture_post_with_http_info(id, file, opts)
  nil
end
persons_id_picture_post_with_http_info(id, file, opts = {}) click to toggle source

Add person picture Add a picture to a person. If a picture is already set, the old picture will be replaced. Added image (or the cropping parameters supplied with the request) should have an equal width and height and should be at least 128 pixels. GIF, JPG and PNG are accepted. All added images will be resized to 128 and 512 pixel wide squares. @param id [Integer] ID of a person @param file [File] One image supplied in the multipart/form-data encoding. @param [Hash] opts the optional parameters @option opts [Integer] :crop_x X coordinate to where start cropping form (in pixels) @option opts [Integer] :crop_y Y coordinate to where start cropping form (in pixels) @option opts [Integer] :crop_width Width of cropping area (in pixels) @option opts [Integer] :crop_height Height of cropping area (in pixels) @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 1111
def persons_id_picture_post_with_http_info(id, file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_picture_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 PersonsApi.persons_id_picture_post"
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling PersonsApi.persons_id_picture_post"
  end
  # resource path
  local_var_path = '/persons/{id}/picture'.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(['multipart/form-data'])

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['file'] = file
  form_params['crop_x'] = opts[:'crop_x'] if !opts[:'crop_x'].nil?
  form_params['crop_y'] = opts[:'crop_y'] if !opts[:'crop_y'].nil?
  form_params['crop_width'] = opts[:'crop_width'] if !opts[:'crop_width'].nil?
  form_params['crop_height'] = opts[:'crop_height'] if !opts[:'crop_height'].nil?

  # 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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PersonsApi#persons_id_picture_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
persons_id_products_get(id, opts = {}) click to toggle source

List products associated with a person Lists products associated with a person. @param id [Integer] ID of a person @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start (default to 0) @option opts [Integer] :limit Items shown per page @return [nil]

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 1174
def persons_id_products_get(id, opts = {})
  persons_id_products_get_with_http_info(id, opts)
  nil
end
persons_id_products_get_with_http_info(id, opts = {}) click to toggle source

List products associated with a person Lists products associated with a person. @param id [Integer] ID of a person @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start @option opts [Integer] :limit Items shown per page @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 1186
def persons_id_products_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_products_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 PersonsApi.persons_id_products_get"
  end
  # resource path
  local_var_path = '/persons/{id}/products'.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?

  # 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: PersonsApi#persons_id_products_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
persons_id_put(id, opts = {}) click to toggle source

Update a person Updates the properties of a person. For more information on how to update a person, see <a href="pipedrive.readme.io/docs/updating-a-person" target="_blank" rel="noopener noreferrer">this tutorial</a>. @param id [Integer] ID of a person @param [Hash] opts the optional parameters @option opts [BasicPerson] :basic_person @return [nil]

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 1239
def persons_id_put(id, opts = {})
  persons_id_put_with_http_info(id, opts)
  nil
end
persons_id_put_with_http_info(id, opts = {}) click to toggle source

Update a person Updates the properties of a person. For more information on how to update a person, see &lt;a href&#x3D;&quot;pipedrive.readme.io/docs/updating-a-person"; target&#x3D;&quot;_blank&quot; rel&#x3D;&quot;noopener noreferrer&quot;&gt;this tutorial&lt;/a&gt;. @param id [Integer] ID of a person @param [Hash] opts the optional parameters @option opts [BasicPerson] :basic_person @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 1250
def persons_id_put_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_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 PersonsApi.persons_id_put"
  end
  # resource path
  local_var_path = '/persons/{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/json'])

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

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(opts[:'basic_person']) 

  # 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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PersonsApi#persons_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
persons_post(opts = {}) click to toggle source

Add a person Adds a new person. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the personFields and look for 'key' values. @param [Hash] opts the optional parameters @option opts [NewPerson] :new_person @return [nil]

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 1302
def persons_post(opts = {})
  persons_post_with_http_info(opts)
  nil
end
persons_post_with_http_info(opts = {}) click to toggle source

Add a person Adds a new person. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the personFields and look for &#39;key&#39; values. @param [Hash] opts the optional parameters @option opts [NewPerson] :new_person @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 1312
def persons_post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_post ...'
  end
  # resource path
  local_var_path = '/persons'

  # 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[:'new_person']) 

  # 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: PersonsApi#persons_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
persons_search_get(term, opts = {}) click to toggle source
persons_search_get_with_http_info(term, opts = {}) click to toggle source

Search persons Searches all Persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of &lt;a href&#x3D;&quot;developers.pipedrive.com/docs/api/v1/#!/ItemSearch/get_itemSearch">/v1/itemSearch</a>; with a narrower OAuth scope. Found Persons can be filtered by Organization ID. @param term [String] The search term to look for. Minimum 2 characters (or 1 if using exact_match). @param [Hash] opts the optional parameters @option opts [String] :fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. @option opts [Boolean] :exact_match When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive. @option opts [Integer] :organization_id Will filter Deals by the provided Organization ID. The upper limit of found Deals associated with the Organization is 2000. @option opts [String] :include_fields Supports including optional fields in the results which are not provided by default. @option opts [Integer] :start Pagination start. Note that the pagination is based on main results and does not include related items when using search_for_related_items parameter. @option opts [Integer] :limit Items shown per page @return [Array<(BaseResponse, Integer, Hash)>] BaseResponse data, response status code and response headers

# File lib/pipedrive-openapi-client/api/persons_api.rb, line 1382
def persons_search_get_with_http_info(term, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_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 PersonsApi.persons_search_get"
  end
  allowable_values = ["custom_fields", "email", "notes", "phone", "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 = ["person.picture"]
  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 = '/persons/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[:'organization_id'] = opts[:'organization_id'] if !opts[:'organization_id'].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: PersonsApi#persons_search_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end