=begin
#Molecule API Documentation

#The Hydrogen Molecule API

OpenAPI spec version: 1.3.0
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.14

=end

require 'uri'

module MoleculeApi
  class TokenCrowdsaleApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # Deploy token for Crowdsale
    # @param crowdsale_deploy_params Deploy token for Crowdsale
    # @param [Hash] opts the optional parameters
    # @return [TransactionSuccessResponse]
    def deploy_crowdsale_using_post(crowdsale_deploy_params, opts = {})
      data, _status_code, _headers = deploy_crowdsale_using_post_with_http_info(crowdsale_deploy_params, opts)
      data
    end

    # Deploy token for Crowdsale
    # @param crowdsale_deploy_params Deploy token for Crowdsale
    # @param [Hash] opts the optional parameters
    # @return [Array<(TransactionSuccessResponse, Fixnum, Hash)>] TransactionSuccessResponse data, response status code and response headers
    def deploy_crowdsale_using_post_with_http_info(crowdsale_deploy_params, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TokenCrowdsaleApi.deploy_crowdsale_using_post ...'
      end
      # verify the required parameter 'crowdsale_deploy_params' is set
      if @api_client.config.client_side_validation && crowdsale_deploy_params.nil?
        fail ArgumentError, "Missing the required parameter 'crowdsale_deploy_params' when calling TokenCrowdsaleApi.deploy_crowdsale_using_post"
      end
      # resource path
      local_var_path = '/crowdsale/deploy'

      # 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(crowdsale_deploy_params)
      auth_names = ['oauth2']
      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 => 'TransactionSuccessResponse')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TokenCrowdsaleApi#deploy_crowdsale_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Fund/add Tokens supply to Crowdsale
    # @param crowdsale_fund_params Fund provided Token&#39;s supply to Crowdsale
    # @param [Hash] opts the optional parameters
    # @return [TransactionSuccessResponse]
    def fund_crowdsale_using_post(crowdsale_fund_params, opts = {})
      data, _status_code, _headers = fund_crowdsale_using_post_with_http_info(crowdsale_fund_params, opts)
      data
    end

    # Fund/add Tokens supply to Crowdsale
    # @param crowdsale_fund_params Fund provided Token&#39;s supply to Crowdsale
    # @param [Hash] opts the optional parameters
    # @return [Array<(TransactionSuccessResponse, Fixnum, Hash)>] TransactionSuccessResponse data, response status code and response headers
    def fund_crowdsale_using_post_with_http_info(crowdsale_fund_params, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TokenCrowdsaleApi.fund_crowdsale_using_post ...'
      end
      # verify the required parameter 'crowdsale_fund_params' is set
      if @api_client.config.client_side_validation && crowdsale_fund_params.nil?
        fail ArgumentError, "Missing the required parameter 'crowdsale_fund_params' when calling TokenCrowdsaleApi.fund_crowdsale_using_post"
      end
      # resource path
      local_var_path = '/crowdsale/fund'

      # 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(crowdsale_fund_params)
      auth_names = ['oauth2']
      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 => 'TransactionSuccessResponse')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TokenCrowdsaleApi#fund_crowdsale_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Purchase Tokens from Crowdsale
    # @param crowdsale_purchase_params Purchase Tokens
    # @param [Hash] opts the optional parameters
    # @return [TransactionSuccessResponse]
    def purchase_crowdsale_using_post(crowdsale_purchase_params, opts = {})
      data, _status_code, _headers = purchase_crowdsale_using_post_with_http_info(crowdsale_purchase_params, opts)
      data
    end

    # Purchase Tokens from Crowdsale
    # @param crowdsale_purchase_params Purchase Tokens
    # @param [Hash] opts the optional parameters
    # @return [Array<(TransactionSuccessResponse, Fixnum, Hash)>] TransactionSuccessResponse data, response status code and response headers
    def purchase_crowdsale_using_post_with_http_info(crowdsale_purchase_params, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TokenCrowdsaleApi.purchase_crowdsale_using_post ...'
      end
      # verify the required parameter 'crowdsale_purchase_params' is set
      if @api_client.config.client_side_validation && crowdsale_purchase_params.nil?
        fail ArgumentError, "Missing the required parameter 'crowdsale_purchase_params' when calling TokenCrowdsaleApi.purchase_crowdsale_using_post"
      end
      # resource path
      local_var_path = '/crowdsale/purchase'

      # 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(crowdsale_purchase_params)
      auth_names = ['oauth2']
      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 => 'TransactionSuccessResponse')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TokenCrowdsaleApi#purchase_crowdsale_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
  end
end
