=begin #Subskribe API #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 1.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.41 =end require 'uri' module SubskribeDevClient class OpportunityApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Creates a standalone opportunity # Returns the details of a specified opportunity # @param [Hash] opts the optional parameters # @option opts [OpportunityRestJson] :body # @return [OpportunityJson] def create_opportunity(opts = {}) data, _status_code, _headers = create_opportunity_with_http_info(opts) data end # Creates a standalone opportunity # Returns the details of a specified opportunity # @param [Hash] opts the optional parameters # @option opts [OpportunityRestJson] :body # @return [Array<(OpportunityJson, Fixnum, Hash)>] OpportunityJson data, response status code and response headers def create_opportunity_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OpportunityApi.create_opportunity ...' end # resource path local_var_path = '/opportunity' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'OpportunityJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: OpportunityApi#create_opportunity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Opens an opportunity # Returns the details of the updated opportunity # @param id crm id or native id of the opportunity # @param [Hash] opts the optional parameters # @return [OpportunityJson] def reset_opportunity_closed_state(id, opts = {}) data, _status_code, _headers = reset_opportunity_closed_state_with_http_info(id, opts) data end # Opens an opportunity # Returns the details of the updated opportunity # @param id crm id or native id of the opportunity # @param [Hash] opts the optional parameters # @return [Array<(OpportunityJson, Fixnum, Hash)>] OpportunityJson data, response status code and response headers def reset_opportunity_closed_state_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OpportunityApi.reset_opportunity_closed_state ...' 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 OpportunityApi.reset_opportunity_closed_state" end # resource path local_var_path = '/opportunity/{id}/open'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'OpportunityJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: OpportunityApi#reset_opportunity_closed_state\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Updates a standalone opportunity # Returns the details of the updated opportunity # @param id id of the opportunity # @param [Hash] opts the optional parameters # @option opts [OpportunityRestJson] :body # @return [OpportunityJson] def update_opportunity(id, opts = {}) data, _status_code, _headers = update_opportunity_with_http_info(id, opts) data end # Updates a standalone opportunity # Returns the details of the updated opportunity # @param id id of the opportunity # @param [Hash] opts the optional parameters # @option opts [OpportunityRestJson] :body # @return [Array<(OpportunityJson, Fixnum, Hash)>] OpportunityJson data, response status code and response headers def update_opportunity_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OpportunityApi.update_opportunity ...' 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 OpportunityApi.update_opportunity" end # resource path local_var_path = '/opportunity/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'OpportunityJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: OpportunityApi#update_opportunity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end