=begin
#Microsoft Security Updates API

#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

The version of the OpenAPI document: 1.0.0

Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.2.0-SNAPSHOT

=end

require 'cgi'

module OpenapiClient
  class DefaultApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # Gets a CVRF document by ID (ie: 2016-Aug)  Note: to view the correct XML response, please change *$ref: '#/definitions/cvrfReturnTypes200'* to *$ref: '#/definitions/cvrfReturnTypes200_xml'* in the swagger.json or swagger.yaml file 
    # @param api_version [String] 
    # @param api_key [String] 
    # @param id [String] 
    # @param [Hash] opts the optional parameters
    # @return [CvrfReturnTypes200]
    def cvrf_id_get(api_version, api_key, id, opts = {})
      data, _status_code, _headers = cvrf_id_get_with_http_info(api_version, api_key, id, opts)
      data
    end

    # Gets a CVRF document by ID (ie: 2016-Aug)  Note: to view the correct XML response, please change *$ref: &#39;#/definitions/cvrfReturnTypes200&#39;* to *$ref: &#39;#/definitions/cvrfReturnTypes200_xml&#39;* in the swagger.json or swagger.yaml file 
    # @param api_version [String] 
    # @param api_key [String] 
    # @param id [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(CvrfReturnTypes200, Integer, Hash)>] CvrfReturnTypes200 data, response status code and response headers
    def cvrf_id_get_with_http_info(api_version, api_key, id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.cvrf_id_get ...'
      end
      # verify the required parameter 'api_version' is set
      if @api_client.config.client_side_validation && api_version.nil?
        fail ArgumentError, "Missing the required parameter 'api_version' when calling DefaultApi.cvrf_id_get"
      end
      # verify the required parameter 'api_key' is set
      if @api_client.config.client_side_validation && api_key.nil?
        fail ArgumentError, "Missing the required parameter 'api_key' when calling DefaultApi.cvrf_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 DefaultApi.cvrf_id_get"
      end
      # resource path
      local_var_path = '/cvrf/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'api-version'] = api_version

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
      header_params[:'api-key'] = api_key

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'CvrfReturnTypes200'

      # auth_names
      auth_names = opts[:debug_auth_names] || []

      new_options = opts.merge(
        :operation => :"DefaultApi.cvrf_id_get",
        :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: DefaultApi#cvrf_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get all updates with a link to the CVRF document 
    # @param api_version [String] 
    # @param api_key [String] 
    # @param [Hash] opts the optional parameters
    # @return [UpdatesReturnTypes200]
    def updates_get(api_version, api_key, opts = {})
      data, _status_code, _headers = updates_get_with_http_info(api_version, api_key, opts)
      data
    end

    # Get all updates with a link to the CVRF document 
    # @param api_version [String] 
    # @param api_key [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(UpdatesReturnTypes200, Integer, Hash)>] UpdatesReturnTypes200 data, response status code and response headers
    def updates_get_with_http_info(api_version, api_key, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.updates_get ...'
      end
      # verify the required parameter 'api_version' is set
      if @api_client.config.client_side_validation && api_version.nil?
        fail ArgumentError, "Missing the required parameter 'api_version' when calling DefaultApi.updates_get"
      end
      # verify the required parameter 'api_key' is set
      if @api_client.config.client_side_validation && api_key.nil?
        fail ArgumentError, "Missing the required parameter 'api_key' when calling DefaultApi.updates_get"
      end
      # resource path
      local_var_path = '/Updates'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'api-version'] = api_version

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
      header_params[:'api-key'] = api_key

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'UpdatesReturnTypes200'

      # auth_names
      auth_names = opts[:debug_auth_names] || []

      new_options = opts.merge(
        :operation => :"DefaultApi.updates_get",
        :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: DefaultApi#updates_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get updates with a link to the CVRF document for a particular ID.  ID can be:    * Update ID (ie: 2016-Aug)   * Vulnerability ID (ie: CVE-2016-0128)   * Year (ie: 2016) 
    # @param api_version [String] 
    # @param api_key [String] 
    # @param id [String] 
    # @param [Hash] opts the optional parameters
    # @return [UpdatesReturnTypes200]
    def updates_id_get(api_version, api_key, id, opts = {})
      data, _status_code, _headers = updates_id_get_with_http_info(api_version, api_key, id, opts)
      data
    end

    # Get updates with a link to the CVRF document for a particular ID.  ID can be:    * Update ID (ie: 2016-Aug)   * Vulnerability ID (ie: CVE-2016-0128)   * Year (ie: 2016) 
    # @param api_version [String] 
    # @param api_key [String] 
    # @param id [String] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(UpdatesReturnTypes200, Integer, Hash)>] UpdatesReturnTypes200 data, response status code and response headers
    def updates_id_get_with_http_info(api_version, api_key, id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.updates_id_get ...'
      end
      # verify the required parameter 'api_version' is set
      if @api_client.config.client_side_validation && api_version.nil?
        fail ArgumentError, "Missing the required parameter 'api_version' when calling DefaultApi.updates_id_get"
      end
      # verify the required parameter 'api_key' is set
      if @api_client.config.client_side_validation && api_key.nil?
        fail ArgumentError, "Missing the required parameter 'api_key' when calling DefaultApi.updates_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 DefaultApi.updates_id_get"
      end
      # resource path
      local_var_path = '/Updates('{id}')'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'api-version'] = api_version

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
      header_params[:'api-key'] = api_key

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'UpdatesReturnTypes200'

      # auth_names
      auth_names = opts[:debug_auth_names] || []

      new_options = opts.merge(
        :operation => :"DefaultApi.updates_id_get",
        :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: DefaultApi#updates_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
  end
end
