class Pipedrive::DealFieldsApi
Attributes
Public Class Methods
# File lib/pipedrive-openapi-client/api/deal_fields_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Delete multiple deal 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/deal_fields_api.rb, line 27 def deal_fields_delete(ids, opts = {}) deal_fields_delete_with_http_info(ids, opts) nil end
Delete multiple deal 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/deal_fields_api.rb, line 37 def deal_fields_delete_with_http_info(ids, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DealFieldsApi.deal_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 DealFieldsApi.deal_fields_delete" end # resource path local_var_path = '/dealFields' # 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: DealFieldsApi#deal_fields_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get all deal fields Returns data about all fields deals can have @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/deal_fields_api.rb, line 89 def deal_fields_get(opts = {}) deal_fields_get_with_http_info(opts) nil end
Get all deal fields Returns data about all fields deals can have @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/deal_fields_api.rb, line 100 def deal_fields_get_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DealFieldsApi.deal_fields_get ...' end # resource path local_var_path = '/dealFields' # 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: DealFieldsApi#deal_fields_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Delete a deal 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/deal_fields_api.rb, line 148 def deal_fields_id_delete(id, opts = {}) deal_fields_id_delete_with_http_info(id, opts) nil end
Delete a deal 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 [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/deal_fields_api.rb, line 158 def deal_fields_id_delete_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DealFieldsApi.deal_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 DealFieldsApi.deal_fields_id_delete" end # resource path local_var_path = '/dealFields/{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: DealFieldsApi#deal_fields_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get one deal field Returns data about a specific deal field. @param id [Integer] ID of the field @param [Hash] opts the optional parameters @return [nil]
# File lib/pipedrive-openapi-client/api/deal_fields_api.rb, line 208 def deal_fields_id_get(id, opts = {}) deal_fields_id_get_with_http_info(id, opts) nil end
Get one deal field Returns data about a specific deal 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/deal_fields_api.rb, line 218 def deal_fields_id_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DealFieldsApi.deal_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 DealFieldsApi.deal_fields_id_get" end # resource path local_var_path = '/dealFields/{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: DealFieldsApi#deal_fields_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update a deal field Updates a deal 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, for example: [\"red\",\"blue\",\"lilac\"] @return [nil]
# File lib/pipedrive-openapi-client/api/deal_fields_api.rb, line 270 def deal_fields_id_put(id, name, opts = {}) deal_fields_id_put_with_http_info(id, name, opts) nil end
Update a deal field Updates a deal 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, for example: [\"red\",\"blue\",\"lilac\"] @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/deal_fields_api.rb, line 282 def deal_fields_id_put_with_http_info(id, name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DealFieldsApi.deal_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 DealFieldsApi.deal_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 DealFieldsApi.deal_fields_id_put" end # resource path local_var_path = '/dealFields/{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: DealFieldsApi#deal_fields_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Add a new deal field Adds a new deal 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/deal_fields_api.rb, line 339 def deal_fields_post(opts = {}) deal_fields_post_with_http_info(opts) nil end
Add a new deal field Adds a new deal 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 [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/deal_fields_api.rb, line 348 def deal_fields_post_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DealFieldsApi.deal_fields_post ...' end # resource path local_var_path = '/dealFields' # 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: DealFieldsApi#deal_fields_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end