=begin
#Hatchet API

#The Hatchet API

The version of the OpenAPI document: 1.0.0

Generated by: https://openapi-generator.tech
Generator version: 7.14.0

=end

require 'cgi'

module HatchetSdkRest
  class MetadataApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # Get cloud metadata
    # Gets metadata for the Hatchet cloud instance
    # @param [Hash] opts the optional parameters
    # @return [APIErrors]
    def cloud_metadata_get(opts = {})
      data, _status_code, _headers = cloud_metadata_get_with_http_info(opts)
      data
    end

    # Get cloud metadata
    # Gets metadata for the Hatchet cloud instance
    # @param [Hash] opts the optional parameters
    # @return [Array<(APIErrors, Integer, Hash)>] APIErrors data, response status code and response headers
    def cloud_metadata_get_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MetadataApi.cloud_metadata_get ...'
      end
      # resource path
      local_var_path = '/api/v1/cloud/metadata'

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

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

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

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

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

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

    # Get metadata
    # Gets metadata for the Hatchet instance
    # @param [Hash] opts the optional parameters
    # @return [APIMeta]
    def metadata_get(opts = {})
      data, _status_code, _headers = metadata_get_with_http_info(opts)
      data
    end

    # Get metadata
    # Gets metadata for the Hatchet instance
    # @param [Hash] opts the optional parameters
    # @return [Array<(APIMeta, Integer, Hash)>] APIMeta data, response status code and response headers
    def metadata_get_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MetadataApi.metadata_get ...'
      end
      # resource path
      local_var_path = '/api/v1/meta'

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

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

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

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

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

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

    # List integrations
    # List all integrations
    # @param [Hash] opts the optional parameters
    # @return [Array<APIMetaIntegration>]
    def metadata_list_integrations(opts = {})
      data, _status_code, _headers = metadata_list_integrations_with_http_info(opts)
      data
    end

    # List integrations
    # List all integrations
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<APIMetaIntegration>, Integer, Hash)>] Array<APIMetaIntegration> data, response status code and response headers
    def metadata_list_integrations_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MetadataApi.metadata_list_integrations ...'
      end
      # resource path
      local_var_path = '/api/v1/meta/integrations'

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

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

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

      # return_type
      return_type = opts[:debug_return_type] || 'Array<APIMetaIntegration>'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

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