class Pipedrive::ProductFieldsApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

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

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

# File lib/pipedrive-openapi-client/api/product_fields_api.rb, line 27
def product_fields_delete(ids, opts = {})
  data, _status_code, _headers = product_fields_delete_with_http_info(ids, opts)
  data
end
product_fields_delete_with_http_info(ids, opts = {}) click to toggle source

Delete multiple product 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<(DeleteMultipleProductFieldsResponse, Integer, Hash)>] DeleteMultipleProductFieldsResponse data, response status code and response headers

# File lib/pipedrive-openapi-client/api/product_fields_api.rb, line 37
def product_fields_delete_with_http_info(ids, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductFieldsApi.product_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 ProductFieldsApi.product_fields_delete"
  end
  # resource path
  local_var_path = '/productFields'

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

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

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

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

# File lib/pipedrive-openapi-client/api/product_fields_api.rb, line 89
def product_fields_get(opts = {})
  data, _status_code, _headers = product_fields_get_with_http_info(opts)
  data
end
product_fields_get_with_http_info(opts = {}) click to toggle source

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

# File lib/pipedrive-openapi-client/api/product_fields_api.rb, line 98
def product_fields_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductFieldsApi.product_fields_get ...'
  end
  # resource path
  local_var_path = '/productFields'

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

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

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

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

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

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

Delete a product 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 Product Field @param [Hash] opts the optional parameters @return [DeleteProductFieldResponse]

# File lib/pipedrive-openapi-client/api/product_fields_api.rb, line 146
def product_fields_id_delete(id, opts = {})
  data, _status_code, _headers = product_fields_id_delete_with_http_info(id, opts)
  data
end
product_fields_id_delete_with_http_info(id, opts = {}) click to toggle source

Delete a product 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 Product Field @param [Hash] opts the optional parameters @return [Array<(DeleteProductFieldResponse, Integer, Hash)>] DeleteProductFieldResponse data, response status code and response headers

# File lib/pipedrive-openapi-client/api/product_fields_api.rb, line 156
def product_fields_id_delete_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductFieldsApi.product_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 ProductFieldsApi.product_fields_id_delete"
  end
  # resource path
  local_var_path = '/productFields/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

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

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

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

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

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

Get one product field Returns data about a specific product field. @param id [Integer] ID of the Product Field @param [Hash] opts the optional parameters @return [GetProductFieldResponse]

# File lib/pipedrive-openapi-client/api/product_fields_api.rb, line 208
def product_fields_id_get(id, opts = {})
  data, _status_code, _headers = product_fields_id_get_with_http_info(id, opts)
  data
end
product_fields_id_get_with_http_info(id, opts = {}) click to toggle source

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

# File lib/pipedrive-openapi-client/api/product_fields_api.rb, line 218
def product_fields_id_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductFieldsApi.product_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 ProductFieldsApi.product_fields_id_get"
  end
  # resource path
  local_var_path = '/productFields/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

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

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

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

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

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

Update a product field Updates a product 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 Product Field @param [Hash] opts the optional parameters @option opts [BasicProductField] :basic_product_field @return [GetProductFieldResponse]

# File lib/pipedrive-openapi-client/api/product_fields_api.rb, line 271
def product_fields_id_put(id, opts = {})
  data, _status_code, _headers = product_fields_id_put_with_http_info(id, opts)
  data
end
product_fields_id_put_with_http_info(id, opts = {}) click to toggle source

Update a product field Updates a product 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 Product Field @param [Hash] opts the optional parameters @option opts [BasicProductField] :basic_product_field @return [Array<(GetProductFieldResponse, Integer, Hash)>] GetProductFieldResponse data, response status code and response headers

# File lib/pipedrive-openapi-client/api/product_fields_api.rb, line 282
def product_fields_id_put_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductFieldsApi.product_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 ProductFieldsApi.product_fields_id_put"
  end
  # resource path
  local_var_path = '/productFields/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

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

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

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

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

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

Add a new product field Adds a new product 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 @option opts [NewProductField] :new_product_field @return [GetProductFieldResponse]

# File lib/pipedrive-openapi-client/api/product_fields_api.rb, line 336
def product_fields_post(opts = {})
  data, _status_code, _headers = product_fields_post_with_http_info(opts)
  data
end
product_fields_post_with_http_info(opts = {}) click to toggle source

Add a new product field Adds a new product 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 @option opts [NewProductField] :new_product_field @return [Array<(GetProductFieldResponse, Integer, Hash)>] GetProductFieldResponse data, response status code and response headers

# File lib/pipedrive-openapi-client/api/product_fields_api.rb, line 346
def product_fields_post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductFieldsApi.product_fields_post ...'
  end
  # resource path
  local_var_path = '/productFields'

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

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

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

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

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

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