class Pipedrive::PersonFieldsApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

person_fields_delete(ids, opts = {}) click to toggle source

Delete multiple person fields in bulk Marks multiple fields as deleted. @param ids [String] Comma-separated field IDs to delete @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/person_fields_api.rb, line 27
def person_fields_delete(ids, opts = {})
  person_fields_delete_with_http_info(ids, opts)
  nil
end
person_fields_delete_with_http_info(ids, opts = {}) click to toggle source

Delete multiple person fields in bulk Marks multiple fields as deleted. @param ids [String] Comma-separated field IDs to delete @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/person_fields_api.rb, line 37
def person_fields_delete_with_http_info(ids, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonFieldsApi.person_fields_delete ...'
  end
  # verify the required parameter 'ids' is set
  if @api_client.config.client_side_validation && ids.nil?
    fail ArgumentError, "Missing the required parameter 'ids' when calling PersonFieldsApi.person_fields_delete"
  end
  # resource path
  local_var_path = '/personFields'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ids'] = ids

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

Get all person fields Returns data about all person fields @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/person_fields_api.rb, line 87
def person_fields_get(opts = {})
  person_fields_get_with_http_info(opts)
  nil
end
person_fields_get_with_http_info(opts = {}) click to toggle source

Get all person fields Returns data about all person fields @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/person_fields_api.rb, line 96
def person_fields_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonFieldsApi.person_fields_get ...'
  end
  # resource path
  local_var_path = '/personFields'

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

Delete a person field Marks a field as deleted. For more information on how to delete a custom field, see <a href="pipedrive.readme.io/docs/deleting-a-custom-field" target="_blank" rel="noopener noreferrer">this tutorial</a>. @param id [Integer] ID of the field @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/person_fields_api.rb, line 142
def person_fields_id_delete(id, opts = {})
  person_fields_id_delete_with_http_info(id, opts)
  nil
end
person_fields_id_delete_with_http_info(id, opts = {}) click to toggle source

Delete a person field Marks a field as deleted. For more information on how to delete a custom field, see &lt;a href&#x3D;&quot;pipedrive.readme.io/docs/deleting-a-custom-field"; target&#x3D;&quot;_blank&quot; rel&#x3D;&quot;noopener noreferrer&quot;&gt;this tutorial&lt;/a&gt;. @param id [Integer] ID of the field @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/person_fields_api.rb, line 152
def person_fields_id_delete_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonFieldsApi.person_fields_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 PersonFieldsApi.person_fields_id_delete"
  end
  # resource path
  local_var_path = '/personFields/{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: PersonFieldsApi#person_fields_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
person_fields_id_get(id, opts = {}) click to toggle source

Get one person field Returns data about a specific person field. @param id [Integer] ID of the field @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/person_fields_api.rb, line 202
def person_fields_id_get(id, opts = {})
  person_fields_id_get_with_http_info(id, opts)
  nil
end
person_fields_id_get_with_http_info(id, opts = {}) click to toggle source

Get one person field Returns data about a specific person field. @param id [Integer] ID of the field @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/person_fields_api.rb, line 212
def person_fields_id_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonFieldsApi.person_fields_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 PersonFieldsApi.person_fields_id_get"
  end
  # resource path
  local_var_path = '/personFields/{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: PersonFieldsApi#person_fields_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
person_fields_id_put(id, name, opts = {}) click to toggle source

Update a person field Updates a person field. See an example of updating custom fields’ values in <a href="pipedrive.readme.io/docs/updating-custom-field-value" target="_blank" rel="noopener noreferrer">this tutorial</a>. @param id [Integer] ID of the field @param name [String] Name of the field @param [Hash] opts the optional parameters @option opts [String] :options When field_type is either set or enum, possible options must be supplied as a JSON-encoded sequential array of objects. All active items must be supplied and already existing items must have their ID supplied. New items only require a label. Example: [{\&quot;id\&quot;:123,\&quot;label\&quot;:\&quot;Existing Item\&quot;},{\&quot;label\&quot;:\&quot;New Item\&quot;}] @return [nil]

# File lib/pipedrive-openapi-client/api/person_fields_api.rb, line 264
def person_fields_id_put(id, name, opts = {})
  person_fields_id_put_with_http_info(id, name, opts)
  nil
end
person_fields_id_put_with_http_info(id, name, opts = {}) click to toggle source

Update a person field Updates a person field. See an example of updating custom fields’ values in &lt;a href&#x3D;&quot;pipedrive.readme.io/docs/updating-custom-field-value"; target&#x3D;&quot;_blank&quot; rel&#x3D;&quot;noopener noreferrer&quot;&gt;this tutorial&lt;/a&gt;. @param id [Integer] ID of the field @param name [String] Name of the field @param [Hash] opts the optional parameters @option opts [String] :options When field_type is either set or enum, possible options must be supplied as a JSON-encoded sequential array of objects. All active items must be supplied and already existing items must have their ID supplied. New items only require a label. Example: [{\&quot;id\&quot;:123,\&quot;label\&quot;:\&quot;Existing Item\&quot;},{\&quot;label\&quot;:\&quot;New Item\&quot;}] @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/person_fields_api.rb, line 276
def person_fields_id_put_with_http_info(id, name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonFieldsApi.person_fields_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 PersonFieldsApi.person_fields_id_put"
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling PersonFieldsApi.person_fields_id_put"
  end
  # resource path
  local_var_path = '/personFields/{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['name'] = name
  form_params['options'] = opts[:'options'] if !opts[:'options'].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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PersonFieldsApi#person_fields_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
person_fields_post(opts = {}) click to toggle source

Add a new person field Adds a new person field. For more information on adding a new custom field, see <a href="pipedrive.readme.io/docs/adding-a-new-custom-field" target="_blank" rel="noopener noreferrer">this tutorial</a>. @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/person_fields_api.rb, line 333
def person_fields_post(opts = {})
  person_fields_post_with_http_info(opts)
  nil
end
person_fields_post_with_http_info(opts = {}) click to toggle source

Add a new person field Adds a new person field. For more information on adding a new custom field, see &lt;a href&#x3D;&quot;pipedrive.readme.io/docs/adding-a-new-custom-field"; target&#x3D;&quot;_blank&quot; rel&#x3D;&quot;noopener noreferrer&quot;&gt;this tutorial&lt;/a&gt;. @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/person_fields_api.rb, line 342
def person_fields_post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonFieldsApi.person_fields_post ...'
  end
  # resource path
  local_var_path = '/personFields'

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