=begin
#Hydrogen Electron API

#The Hydrogen Electron API

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

=end

require 'uri'

module ElectronApi
  class CardApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # close a card
    # @param close_request closeRequest
    # @param [Hash] opts the optional parameters
    # @return [BaseResponseVO]
    def create_card_close_using_post(close_request, opts = {})
      data, _status_code, _headers = create_card_close_using_post_with_http_info(close_request, opts)
      data
    end

    # close a card
    # @param close_request closeRequest
    # @param [Hash] opts the optional parameters
    # @return [Array<(BaseResponseVO, Fixnum, Hash)>] BaseResponseVO data, response status code and response headers
    def create_card_close_using_post_with_http_info(close_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: CardApi.create_card_close_using_post ...'
      end
      # verify the required parameter 'close_request' is set
      if @api_client.config.client_side_validation && close_request.nil?
        fail ArgumentError, "Missing the required parameter 'close_request' when calling CardApi.create_card_close_using_post"
      end
      # resource path
      local_var_path = '/card/close'

      # query parameters
      query_params = {}

      # header parameters
      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/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(close_request)
      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 => 'BaseResponseVO')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: CardApi#create_card_close_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # issue a card
    # @param issue_request issueRequest
    # @param [Hash] opts the optional parameters
    # @return [BaseResponseVO]
    def create_card_issue_using_post(issue_request, opts = {})
      data, _status_code, _headers = create_card_issue_using_post_with_http_info(issue_request, opts)
      data
    end

    # issue a card
    # @param issue_request issueRequest
    # @param [Hash] opts the optional parameters
    # @return [Array<(BaseResponseVO, Fixnum, Hash)>] BaseResponseVO data, response status code and response headers
    def create_card_issue_using_post_with_http_info(issue_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: CardApi.create_card_issue_using_post ...'
      end
      # verify the required parameter 'issue_request' is set
      if @api_client.config.client_side_validation && issue_request.nil?
        fail ArgumentError, "Missing the required parameter 'issue_request' when calling CardApi.create_card_issue_using_post"
      end
      # resource path
      local_var_path = '/card/issue'

      # query parameters
      query_params = {}

      # header parameters
      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/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(issue_request)
      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 => 'BaseResponseVO')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: CardApi#create_card_issue_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Create a card load
    # @param load_request loadRequest
    # @param [Hash] opts the optional parameters
    # @return [CardLoadUnloadResponseVO]
    def create_card_load_using_post(load_request, opts = {})
      data, _status_code, _headers = create_card_load_using_post_with_http_info(load_request, opts)
      data
    end

    # Create a card load
    # @param load_request loadRequest
    # @param [Hash] opts the optional parameters
    # @return [Array<(CardLoadUnloadResponseVO, Fixnum, Hash)>] CardLoadUnloadResponseVO data, response status code and response headers
    def create_card_load_using_post_with_http_info(load_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: CardApi.create_card_load_using_post ...'
      end
      # verify the required parameter 'load_request' is set
      if @api_client.config.client_side_validation && load_request.nil?
        fail ArgumentError, "Missing the required parameter 'load_request' when calling CardApi.create_card_load_using_post"
      end
      # resource path
      local_var_path = '/card/load'

      # query parameters
      query_params = {}

      # header parameters
      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/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(load_request)
      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 => 'CardLoadUnloadResponseVO')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: CardApi#create_card_load_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # reactivate card
    # @param reactivate_request reactivateRequest
    # @param [Hash] opts the optional parameters
    # @return [BaseResponseVO]
    def create_card_reactivate_using_post(reactivate_request, opts = {})
      data, _status_code, _headers = create_card_reactivate_using_post_with_http_info(reactivate_request, opts)
      data
    end

    # reactivate card
    # @param reactivate_request reactivateRequest
    # @param [Hash] opts the optional parameters
    # @return [Array<(BaseResponseVO, Fixnum, Hash)>] BaseResponseVO data, response status code and response headers
    def create_card_reactivate_using_post_with_http_info(reactivate_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: CardApi.create_card_reactivate_using_post ...'
      end
      # verify the required parameter 'reactivate_request' is set
      if @api_client.config.client_side_validation && reactivate_request.nil?
        fail ArgumentError, "Missing the required parameter 'reactivate_request' when calling CardApi.create_card_reactivate_using_post"
      end
      # resource path
      local_var_path = '/card/reactivate'

      # query parameters
      query_params = {}

      # header parameters
      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/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(reactivate_request)
      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 => 'BaseResponseVO')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: CardApi#create_card_reactivate_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Create card replace
    # @param request request
    # @param [Hash] opts the optional parameters
    # @return [CardReplaceResponseVO]
    def create_card_replace_using_post(request, opts = {})
      data, _status_code, _headers = create_card_replace_using_post_with_http_info(request, opts)
      data
    end

    # Create card replace
    # @param request request
    # @param [Hash] opts the optional parameters
    # @return [Array<(CardReplaceResponseVO, Fixnum, Hash)>] CardReplaceResponseVO data, response status code and response headers
    def create_card_replace_using_post_with_http_info(request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: CardApi.create_card_replace_using_post ...'
      end
      # verify the required parameter 'request' is set
      if @api_client.config.client_side_validation && request.nil?
        fail ArgumentError, "Missing the required parameter 'request' when calling CardApi.create_card_replace_using_post"
      end
      # resource path
      local_var_path = '/card/replace'

      # query parameters
      query_params = {}

      # header parameters
      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/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(request)
      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 => 'CardReplaceResponseVO')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: CardApi#create_card_replace_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Create card spending control
    # @param request request
    # @param [Hash] opts the optional parameters
    # @return [CardSpendingControlResponseVO]
    def create_card_spending_control_using_post(request, opts = {})
      data, _status_code, _headers = create_card_spending_control_using_post_with_http_info(request, opts)
      data
    end

    # Create card spending control
    # @param request request
    # @param [Hash] opts the optional parameters
    # @return [Array<(CardSpendingControlResponseVO, Fixnum, Hash)>] CardSpendingControlResponseVO data, response status code and response headers
    def create_card_spending_control_using_post_with_http_info(request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: CardApi.create_card_spending_control_using_post ...'
      end
      # verify the required parameter 'request' is set
      if @api_client.config.client_side_validation && request.nil?
        fail ArgumentError, "Missing the required parameter 'request' when calling CardApi.create_card_spending_control_using_post"
      end
      # resource path
      local_var_path = '/card/spending_control'

      # query parameters
      query_params = {}

      # header parameters
      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/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(request)
      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 => 'CardSpendingControlResponseVO')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: CardApi#create_card_spending_control_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # suspend card
    # @param suspend_request suspendRequest
    # @param [Hash] opts the optional parameters
    # @return [BaseResponseVO]
    def create_card_suspend_using_post(suspend_request, opts = {})
      data, _status_code, _headers = create_card_suspend_using_post_with_http_info(suspend_request, opts)
      data
    end

    # suspend card
    # @param suspend_request suspendRequest
    # @param [Hash] opts the optional parameters
    # @return [Array<(BaseResponseVO, Fixnum, Hash)>] BaseResponseVO data, response status code and response headers
    def create_card_suspend_using_post_with_http_info(suspend_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: CardApi.create_card_suspend_using_post ...'
      end
      # verify the required parameter 'suspend_request' is set
      if @api_client.config.client_side_validation && suspend_request.nil?
        fail ArgumentError, "Missing the required parameter 'suspend_request' when calling CardApi.create_card_suspend_using_post"
      end
      # resource path
      local_var_path = '/card/suspend'

      # query parameters
      query_params = {}

      # header parameters
      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/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(suspend_request)
      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 => 'BaseResponseVO')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: CardApi#create_card_suspend_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Create a card upload
    # @param reload_request reloadRequest
    # @param [Hash] opts the optional parameters
    # @return [CardLoadUnloadResponseVO]
    def create_card_unload_using_post(reload_request, opts = {})
      data, _status_code, _headers = create_card_unload_using_post_with_http_info(reload_request, opts)
      data
    end

    # Create a card upload
    # @param reload_request reloadRequest
    # @param [Hash] opts the optional parameters
    # @return [Array<(CardLoadUnloadResponseVO, Fixnum, Hash)>] CardLoadUnloadResponseVO data, response status code and response headers
    def create_card_unload_using_post_with_http_info(reload_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: CardApi.create_card_unload_using_post ...'
      end
      # verify the required parameter 'reload_request' is set
      if @api_client.config.client_side_validation && reload_request.nil?
        fail ArgumentError, "Missing the required parameter 'reload_request' when calling CardApi.create_card_unload_using_post"
      end
      # resource path
      local_var_path = '/card/unload'

      # query parameters
      query_params = {}

      # header parameters
      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/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(reload_request)
      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 => 'CardLoadUnloadResponseVO')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: CardApi#create_card_unload_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Create a card client
    # @param card_client_request_co cardClientRequestCO
    # @param [Hash] opts the optional parameters
    # @return [CreateCardClientResponseVO]
    def create_client_card_using_post(card_client_request_co, opts = {})
      data, _status_code, _headers = create_client_card_using_post_with_http_info(card_client_request_co, opts)
      data
    end

    # Create a card client
    # @param card_client_request_co cardClientRequestCO
    # @param [Hash] opts the optional parameters
    # @return [Array<(CreateCardClientResponseVO, Fixnum, Hash)>] CreateCardClientResponseVO data, response status code and response headers
    def create_client_card_using_post_with_http_info(card_client_request_co, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: CardApi.create_client_card_using_post ...'
      end
      # verify the required parameter 'card_client_request_co' is set
      if @api_client.config.client_side_validation && card_client_request_co.nil?
        fail ArgumentError, "Missing the required parameter 'card_client_request_co' when calling CardApi.create_client_card_using_post"
      end
      # resource path
      local_var_path = '/card/client'

      # query parameters
      query_params = {}

      # header parameters
      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/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(card_client_request_co)
      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 => 'CreateCardClientResponseVO')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: CardApi#create_client_card_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Card reserve account
    # @param [Hash] opts the optional parameters
    # @return [CardReserveAccountResponseVO]
    def get_card_reserve_account_details_using_get(opts = {})
      data, _status_code, _headers = get_card_reserve_account_details_using_get_with_http_info(opts)
      data
    end

    # Card reserve account
    # @param [Hash] opts the optional parameters
    # @return [Array<(CardReserveAccountResponseVO, Fixnum, Hash)>] CardReserveAccountResponseVO data, response status code and response headers
    def get_card_reserve_account_details_using_get_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: CardApi.get_card_reserve_account_details_using_get ...'
      end
      # resource path
      local_var_path = '/card/reserve'

      # 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 = ['oauth2']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'CardReserveAccountResponseVO')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: CardApi#get_card_reserve_account_details_using_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Update a card spending control
    # @param nucleus_spending_control_id nucleus_spending_control_id
    # @param [Hash] opts the optional parameters
    # @return [CardSpendingControlResponseVO]
    def update_card_spending_control_using_put(nucleus_spending_control_id, opts = {})
      data, _status_code, _headers = update_card_spending_control_using_put_with_http_info(nucleus_spending_control_id, opts)
      data
    end

    # Update a card spending control
    # @param nucleus_spending_control_id nucleus_spending_control_id
    # @param [Hash] opts the optional parameters
    # @return [Array<(CardSpendingControlResponseVO, Fixnum, Hash)>] CardSpendingControlResponseVO data, response status code and response headers
    def update_card_spending_control_using_put_with_http_info(nucleus_spending_control_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: CardApi.update_card_spending_control_using_put ...'
      end
      # verify the required parameter 'nucleus_spending_control_id' is set
      if @api_client.config.client_side_validation && nucleus_spending_control_id.nil?
        fail ArgumentError, "Missing the required parameter 'nucleus_spending_control_id' when calling CardApi.update_card_spending_control_using_put"
      end
      # resource path
      local_var_path = '/card/spending_control/{nucleus_spending_control_id}'.sub('{' + 'nucleus_spending_control_id' + '}', nucleus_spending_control_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'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['oauth2']
      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 => 'CardSpendingControlResponseVO')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: CardApi#update_card_spending_control_using_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Update a card client
    # @param nucleus_client_id nucleus_client_id
    # @param [Hash] opts the optional parameters
    # @return [UpdateCardClientResponseVO]
    def update_client_card_using_put(nucleus_client_id, opts = {})
      data, _status_code, _headers = update_client_card_using_put_with_http_info(nucleus_client_id, opts)
      data
    end

    # Update a card client
    # @param nucleus_client_id nucleus_client_id
    # @param [Hash] opts the optional parameters
    # @return [Array<(UpdateCardClientResponseVO, Fixnum, Hash)>] UpdateCardClientResponseVO data, response status code and response headers
    def update_client_card_using_put_with_http_info(nucleus_client_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: CardApi.update_client_card_using_put ...'
      end
      # verify the required parameter 'nucleus_client_id' is set
      if @api_client.config.client_side_validation && nucleus_client_id.nil?
        fail ArgumentError, "Missing the required parameter 'nucleus_client_id' when calling CardApi.update_client_card_using_put"
      end
      # resource path
      local_var_path = '/card/client/{nucleus_client_id}'.sub('{' + 'nucleus_client_id' + '}', nucleus_client_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'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['oauth2']
      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 => 'UpdateCardClientResponseVO')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: CardApi#update_client_card_using_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
  end
end
