=begin
#Scubawhere API Documentation

#This is the documentation for scubawhere's RMS API. This API is only to be used by authorized parties with valid auth tokens.  [Learn about scubawhere](http://www.scubawhere.com) to become an authorized consumer of our API 

OpenAPI spec version: 1.0.0
Contact: bryan@scubawhere.com
Generated by: https://github.com/swagger-api/swagger-codegen.git

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=end

require "uri"

module SwaggerClient
  class AddonApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end

    # Create a new addon
    # 
    # @param name Name of the type of addon
    # @param base_prices Prices for addon
    # @param [Hash] opts the optional parameters
    # @option opts [String] :description Description of the addon
    # @return [InlineResponse2002]
    def add_addon(name, base_prices, opts = {})
      data, _status_code, _headers = add_addon_with_http_info(name, base_prices, opts)
      return data
    end

    # Create a new addon
    # 
    # @param name Name of the type of addon
    # @param base_prices Prices for addon
    # @param [Hash] opts the optional parameters
    # @option opts [String] :description Description of the addon
    # @return [Array<(InlineResponse2002, Fixnum, Hash)>] InlineResponse2002 data, response status code and response headers
    def add_addon_with_http_info(name, base_prices, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: AddonApi.add_addon ..."
      end
      # verify the required parameter 'name' is set
      fail ArgumentError, "Missing the required parameter 'name' when calling AddonApi.add_addon" if name.nil?
      # verify the required parameter 'base_prices' is set
      fail ArgumentError, "Missing the required parameter 'base_prices' when calling AddonApi.add_addon" if base_prices.nil?
      # resource path
      local_var_path = "/addon/add".sub('{format}','json')

      # query parameters
      query_params = {}
      query_params[:'name'] = name
      query_params[:'base_prices'] = base_prices
      query_params[:'description'] = opts[:'description'] if !opts[:'description'].nil?

      # header parameters
      header_params = {}

      # HTTP header 'Accept' (if needed)
      local_header_accept = ['application/json']
      local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

      # HTTP header 'Content-Type'
      local_header_content_type = ['application/json']
      header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

      # form parameters
      form_params = {}

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

    # Delete an addon by ID
    # 
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :body ID of the Addon
    # @return [InlineResponse2003]
    def delete_addon(opts = {})
      data, _status_code, _headers = delete_addon_with_http_info(opts)
      return data
    end

    # Delete an addon by ID
    # 
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :body ID of the Addon
    # @return [Array<(InlineResponse2003, Fixnum, Hash)>] InlineResponse2003 data, response status code and response headers
    def delete_addon_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: AddonApi.delete_addon ..."
      end
      # resource path
      local_var_path = "/addon/delete".sub('{format}','json')

      # query parameters
      query_params = {}
      query_params[:'body'] = opts[:'body'] if !opts[:'body'].nil?

      # header parameters
      header_params = {}

      # HTTP header 'Accept' (if needed)
      local_header_accept = ['application/json']
      local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

      # HTTP header 'Content-Type'
      local_header_content_type = ['application/json']
      header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'InlineResponse2003')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AddonApi#delete_addon\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Retrieve an addon by ID
    # 
    # @param id ID of the addon to be retrieved
    # @param [Hash] opts the optional parameters
    # @return [InlineResponse2001]
    def get_addon(id, opts = {})
      data, _status_code, _headers = get_addon_with_http_info(id, opts)
      return data
    end

    # Retrieve an addon by ID
    # 
    # @param id ID of the addon to be retrieved
    # @param [Hash] opts the optional parameters
    # @return [Array<(InlineResponse2001, Fixnum, Hash)>] InlineResponse2001 data, response status code and response headers
    def get_addon_with_http_info(id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: AddonApi.get_addon ..."
      end
      # verify the required parameter 'id' is set
      fail ArgumentError, "Missing the required parameter 'id' when calling AddonApi.get_addon" if id.nil?
      # resource path
      local_var_path = "/addon".sub('{format}','json')

      # query parameters
      query_params = {}
      query_params[:'id'] = id

      # header parameters
      header_params = {}

      # HTTP header 'Accept' (if needed)
      local_header_accept = ['application/json']
      local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

      # HTTP header 'Content-Type'
      local_header_content_type = ['application/json']
      header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

      # form parameters
      form_params = {}

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

    # Retrieve all addons
    # 
    # @param [Hash] opts the optional parameters
    # @return [Array<Addon>]
    def get_all_addons(opts = {})
      data, _status_code, _headers = get_all_addons_with_http_info(opts)
      return data
    end

    # Retrieve all addons
    # 
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<Addon>, Fixnum, Hash)>] Array<Addon> data, response status code and response headers
    def get_all_addons_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: AddonApi.get_all_addons ..."
      end
      # resource path
      local_var_path = "/addon/all".sub('{format}','json')

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}

      # HTTP header 'Accept' (if needed)
      local_header_accept = ['application/json']
      local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

      # HTTP header 'Content-Type'
      local_header_content_type = ['application/json']
      header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

      # form parameters
      form_params = {}

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

    # Retrieve all addons including any deleted models
    # 
    # @param [Hash] opts the optional parameters
    # @return [Array<Addon>]
    def get_all_with_trashed_addons(opts = {})
      data, _status_code, _headers = get_all_with_trashed_addons_with_http_info(opts)
      return data
    end

    # Retrieve all addons including any deleted models
    # 
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<Addon>, Fixnum, Hash)>] Array<Addon> data, response status code and response headers
    def get_all_with_trashed_addons_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: AddonApi.get_all_with_trashed_addons ..."
      end
      # resource path
      local_var_path = "/addon/all-with-trashed".sub('{format}','json')

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}

      # HTTP header 'Accept' (if needed)
      local_header_accept = ['application/json']
      local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

      # HTTP header 'Content-Type'
      local_header_content_type = ['application/json']
      header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

      # form parameters
      form_params = {}

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

    # Update an Addon
    # Updates the addon by id using the specified fields
    # @param id ID of the Addon to be updated
    # @param [Hash] opts the optional parameters
    # @option opts [String] :name Name of the Addon
    # @option opts [String] :description Description of the Addon
    # @return [InlineResponse2002]
    def update_addon(id, opts = {})
      data, _status_code, _headers = update_addon_with_http_info(id, opts)
      return data
    end

    # Update an Addon
    # Updates the addon by id using the specified fields
    # @param id ID of the Addon to be updated
    # @param [Hash] opts the optional parameters
    # @option opts [String] :name Name of the Addon
    # @option opts [String] :description Description of the Addon
    # @return [Array<(InlineResponse2002, Fixnum, Hash)>] InlineResponse2002 data, response status code and response headers
    def update_addon_with_http_info(id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: AddonApi.update_addon ..."
      end
      # verify the required parameter 'id' is set
      fail ArgumentError, "Missing the required parameter 'id' when calling AddonApi.update_addon" if id.nil?
      # resource path
      local_var_path = "/addon/edit".sub('{format}','json')

      # query parameters
      query_params = {}
      query_params[:'id'] = id
      query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
      query_params[:'description'] = opts[:'description'] if !opts[:'description'].nil?

      # header parameters
      header_params = {}

      # HTTP header 'Accept' (if needed)
      local_header_accept = ['application/json']
      local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

      # HTTP header 'Content-Type'
      local_header_content_type = ['application/json']
      header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

      # form parameters
      form_params = {}

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