class Pipedrive::ActivityTypesApi
Attributes
Public Class Methods
# File lib/pipedrive-openapi-client/api/activity_types_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Delete multiple activity types in bulk Marks multiple activity types as deleted. @param ids [String] Comma-separated activity type IDs to delete @param [Hash] opts the optional parameters @return [nil]
# File lib/pipedrive-openapi-client/api/activity_types_api.rb, line 27 def activity_types_delete(ids, opts = {}) activity_types_delete_with_http_info(ids, opts) nil end
Delete multiple activity types in bulk Marks multiple activity types as deleted. @param ids [String] Comma-separated activity type 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/activity_types_api.rb, line 37 def activity_types_delete_with_http_info(ids, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActivityTypesApi.activity_types_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 ActivityTypesApi.activity_types_delete" end # resource path local_var_path = '/activityTypes' # 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: ActivityTypesApi#activity_types_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get all activity types Returns all activity types @param [Hash] opts the optional parameters @return [nil]
# File lib/pipedrive-openapi-client/api/activity_types_api.rb, line 87 def activity_types_get(opts = {}) activity_types_get_with_http_info(opts) nil end
Get all activity types Returns all activity types @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/activity_types_api.rb, line 96 def activity_types_get_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActivityTypesApi.activity_types_get ...' end # resource path local_var_path = '/activityTypes' # 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: ActivityTypesApi#activity_types_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Delete an activity type Marks an activity type as deleted. @param id [Integer] ID of the activity type @param [Hash] opts the optional parameters @return [nil]
# File lib/pipedrive-openapi-client/api/activity_types_api.rb, line 142 def activity_types_id_delete(id, opts = {}) activity_types_id_delete_with_http_info(id, opts) nil end
Delete an activity type Marks an activity type as deleted. @param id [Integer] ID of the activity type @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/activity_types_api.rb, line 152 def activity_types_id_delete_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActivityTypesApi.activity_types_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 ActivityTypesApi.activity_types_id_delete" end # resource path local_var_path = '/activityTypes/{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: ActivityTypesApi#activity_types_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Edit activity type Updates an activity type. @param id [Integer] ID of the activity type @param [Hash] opts the optional parameters @option opts [String] :name Name of the activity type @option opts [IconKey] :icon_key @option opts [String] :color A designated color for the activity type in 6-character HEX format (e.g. FFFFFF for white, 000000 for black). @option opts [Integer] :order_nr An order number for this activity type. Order numbers should be used to order the types in the activity type selections. @return [nil]
# File lib/pipedrive-openapi-client/api/activity_types_api.rb, line 206 def activity_types_id_put(id, opts = {}) activity_types_id_put_with_http_info(id, opts) nil end
Edit activity type Updates an activity type. @param id [Integer] ID of the activity type @param [Hash] opts the optional parameters @option opts [String] :name Name of the activity type @option opts [IconKey] :icon_key @option opts [String] :color A designated color for the activity type in 6-character HEX format (e.g. FFFFFF for white, 000000 for black). @option opts [Integer] :order_nr An order number for this activity type. Order numbers should be used to order the types in the activity type selections. @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/activity_types_api.rb, line 220 def activity_types_id_put_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActivityTypesApi.activity_types_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 ActivityTypesApi.activity_types_id_put" end # resource path local_var_path = '/activityTypes/{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'] = opts[:'name'] if !opts[:'name'].nil? form_params['icon_key'] = opts[:'icon_key'] if !opts[:'icon_key'].nil? form_params['color'] = opts[:'color'] if !opts[:'color'].nil? form_params['order_nr'] = opts[:'order_nr'] if !opts[:'order_nr'].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: ActivityTypesApi#activity_types_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Add new activity type Adds a new activity type, returns the ID, the key_string and the order number of the newly added activity type upon success. @param name [String] Name of the activity type @param icon_key [IconKey] @param [Hash] opts the optional parameters @option opts [String] :color A designated color for the activity type in 6-character HEX format (e.g. FFFFFF for white, 000000 for black). @return [nil]
# File lib/pipedrive-openapi-client/api/activity_types_api.rb, line 278 def activity_types_post(name, icon_key, opts = {}) activity_types_post_with_http_info(name, icon_key, opts) nil end
Add new activity type Adds a new activity type, returns the ID, the key_string and the order number of the newly added activity type upon success. @param name [String] Name of the activity type @param icon_key [IconKey] @param [Hash] opts the optional parameters @option opts [String] :color A designated color for the activity type in 6-character HEX format (e.g. FFFFFF for white, 000000 for black). @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/activity_types_api.rb, line 290 def activity_types_post_with_http_info(name, icon_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActivityTypesApi.activity_types_post ...' 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 ActivityTypesApi.activity_types_post" end # verify the required parameter 'icon_key' is set if @api_client.config.client_side_validation && icon_key.nil? fail ArgumentError, "Missing the required parameter 'icon_key' when calling ActivityTypesApi.activity_types_post" end # resource path local_var_path = '/activityTypes' # 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['icon_key'] = icon_key form_params['color'] = opts[:'color'] if !opts[:'color'].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: ActivityTypesApi#activity_types_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end