class Pipedrive::StagesApi
Attributes
Public Class Methods
# File lib/pipedrive-openapi-client/api/stages_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Delete multiple stages in bulk Marks multiple stages as deleted. @param ids [String] Comma-separated stage IDs to delete @param [Hash] opts the optional parameters @return [InlineResponse20010]
# File lib/pipedrive-openapi-client/api/stages_api.rb, line 27 def stages_delete(ids, opts = {}) data, _status_code, _headers = stages_delete_with_http_info(ids, opts) data end
Delete multiple stages in bulk Marks multiple stages as deleted. @param ids [String] Comma-separated stage IDs to delete @param [Hash] opts the optional parameters @return [Array<(InlineResponse20010
, Integer, Hash)>] InlineResponse20010
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/stages_api.rb, line 37 def stages_delete_with_http_info(ids, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StagesApi.stages_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 StagesApi.stages_delete" end # resource path local_var_path = '/stages' # 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] || 'InlineResponse20010' # 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: StagesApi#stages_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get all stages Returns data about all stages. @param [Hash] opts the optional parameters @option opts [Integer] :pipeline_id The ID of the pipeline to fetch stages for. If omitted, stages for all pipelines will be fetched. @return [GetStages]
# File lib/pipedrive-openapi-client/api/stages_api.rb, line 90 def stages_get(opts = {}) data, _status_code, _headers = stages_get_with_http_info(opts) data end
Get all stages Returns data about all stages. @param [Hash] opts the optional parameters @option opts [Integer] :pipeline_id The ID of the pipeline to fetch stages for. If omitted, stages for all pipelines will be fetched. @return [Array<(GetStages
, Integer, Hash)>] GetStages
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/stages_api.rb, line 100 def stages_get_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StagesApi.stages_get ...' end # resource path local_var_path = '/stages' # query parameters query_params = opts[:query_params] || {} query_params[:'pipeline_id'] = opts[:'pipeline_id'] if !opts[:'pipeline_id'].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] || 'GetStages' # 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: StagesApi#stages_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get deals in a stage Lists deals in a specific stage. @param id [Integer] ID of the stage @param [Hash] opts the optional parameters @option opts [Integer] :filter_id If supplied, only deals matching the given filter will be returned. @option opts [Integer] :user_id If supplied, filter_id will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. @option opts [NumberBoolean] :everyone If supplied, filter_id and user_id will not be considered – instead, deals owned by everyone will be returned. @option opts [Integer] :start Pagination start (default to 0) @option opts [Integer] :limit Items shown per page @return [GetStageDeals]
# File lib/pipedrive-openapi-client/api/stages_api.rb, line 154 def stages_id_deals_get(id, opts = {}) data, _status_code, _headers = stages_id_deals_get_with_http_info(id, opts) data end
Get deals in a stage Lists deals in a specific stage. @param id [Integer] ID of the stage @param [Hash] opts the optional parameters @option opts [Integer] :filter_id If supplied, only deals matching the given filter will be returned. @option opts [Integer] :user_id If supplied, filter_id will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. @option opts [NumberBoolean] :everyone If supplied, filter_id and user_id will not be considered – instead, deals owned by everyone will be returned. @option opts [Integer] :start Pagination start @option opts [Integer] :limit Items shown per page @return [Array<(GetStageDeals
, Integer, Hash)>] GetStageDeals
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/stages_api.rb, line 169 def stages_id_deals_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StagesApi.stages_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 StagesApi.stages_id_deals_get" end # resource path local_var_path = '/stages/{id}/deals'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'filter_id'] = opts[:'filter_id'] if !opts[:'filter_id'].nil? query_params[:'user_id'] = opts[:'user_id'] if !opts[:'user_id'].nil? query_params[:'everyone'] = opts[:'everyone'] if !opts[:'everyone'].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] || 'GetStageDeals' # 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: StagesApi#stages_id_deals_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Delete a stage Marks a stage as deleted. @param id [Integer] ID of the stage @param [Hash] opts the optional parameters @return [InlineResponse20011]
# File lib/pipedrive-openapi-client/api/stages_api.rb, line 226 def stages_id_delete(id, opts = {}) data, _status_code, _headers = stages_id_delete_with_http_info(id, opts) data end
Delete a stage Marks a stage as deleted. @param id [Integer] ID of the stage @param [Hash] opts the optional parameters @return [Array<(InlineResponse20011
, Integer, Hash)>] InlineResponse20011
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/stages_api.rb, line 236 def stages_id_delete_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StagesApi.stages_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 StagesApi.stages_id_delete" end # resource path local_var_path = '/stages/{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] || 'InlineResponse20011' # 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: StagesApi#stages_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get one stage Returns data about a specific stage. @param id [Integer] ID of the stage @param [Hash] opts the optional parameters @return [GetOneStage]
# File lib/pipedrive-openapi-client/api/stages_api.rb, line 288 def stages_id_get(id, opts = {}) data, _status_code, _headers = stages_id_get_with_http_info(id, opts) data end
Get one stage Returns data about a specific stage. @param id [Integer] ID of the stage @param [Hash] opts the optional parameters @return [Array<(GetOneStage
, Integer, Hash)>] GetOneStage
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/stages_api.rb, line 298 def stages_id_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StagesApi.stages_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 StagesApi.stages_id_get" end # resource path local_var_path = '/stages/{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] || 'GetOneStage' # 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: StagesApi#stages_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update stage details Updates the properties of a stage. @param id [Integer] ID of the stage @param [Hash] opts the optional parameters @return [GetAddUpdateStage]
# File lib/pipedrive-openapi-client/api/stages_api.rb, line 350 def stages_id_put(id, opts = {}) data, _status_code, _headers = stages_id_put_with_http_info(id, opts) data end
Update stage details Updates the properties of a stage. @param id [Integer] ID of the stage @param [Hash] opts the optional parameters @return [Array<(GetAddUpdateStage
, Integer, Hash)>] GetAddUpdateStage
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/stages_api.rb, line 360 def stages_id_put_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StagesApi.stages_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 StagesApi.stages_id_put" end # resource path local_var_path = '/stages/{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/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] || 'GetAddUpdateStage' # 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: StagesApi#stages_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Add a new stage Adds a new stage, returns the ID upon success. @param [Hash] opts the optional parameters @return [GetAddUpdateStage]
# File lib/pipedrive-openapi-client/api/stages_api.rb, line 413 def stages_post(opts = {}) data, _status_code, _headers = stages_post_with_http_info(opts) data end
Add a new stage Adds a new stage, returns the ID upon success. @param [Hash] opts the optional parameters @return [Array<(GetAddUpdateStage
, Integer, Hash)>] GetAddUpdateStage
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/stages_api.rb, line 422 def stages_post_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StagesApi.stages_post ...' end # resource path local_var_path = '/stages' # 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/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] || 'GetAddUpdateStage' # 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: StagesApi#stages_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end