=begin
#Kubernetes

#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.8.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.2.3

=end

require "uri"

module Kubernetes
  class CustomObjectsApi
    attr_accessor :api_client

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

    # 
    # Creates a cluster scoped Custom object
    # @param group The custom resource&#39;s group name
    # @param version The custom resource&#39;s version
    # @param plural The custom resource&#39;s plural name. For TPRs this would be lowercase plural kind.
    # @param body The JSON schema of the Resource to create.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :pretty If &#39;true&#39;, then the output is pretty printed.
    # @return [Object]
    def create_cluster_custom_object(group, version, plural, body, opts = {})
      data, _status_code, _headers = create_cluster_custom_object_with_http_info(group, version, plural, body, opts)
      return data
    end

    # 
    # Creates a cluster scoped Custom object
    # @param group The custom resource&#39;s group name
    # @param version The custom resource&#39;s version
    # @param plural The custom resource&#39;s plural name. For TPRs this would be lowercase plural kind.
    # @param body The JSON schema of the Resource to create.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :pretty If &#39;true&#39;, then the output is pretty printed.
    # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
    def create_cluster_custom_object_with_http_info(group, version, plural, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: CustomObjectsApi.create_cluster_custom_object ..."
      end
      # verify the required parameter 'group' is set
      if @api_client.config.client_side_validation && group.nil?
        fail ArgumentError, "Missing the required parameter 'group' when calling CustomObjectsApi.create_cluster_custom_object"
      end
      # verify the required parameter 'version' is set
      if @api_client.config.client_side_validation && version.nil?
        fail ArgumentError, "Missing the required parameter 'version' when calling CustomObjectsApi.create_cluster_custom_object"
      end
      # verify the required parameter 'plural' is set
      if @api_client.config.client_side_validation && plural.nil?
        fail ArgumentError, "Missing the required parameter 'plural' when calling CustomObjectsApi.create_cluster_custom_object"
      end
      # verify the required parameter 'body' is set
      if @api_client.config.client_side_validation && body.nil?
        fail ArgumentError, "Missing the required parameter 'body' when calling CustomObjectsApi.create_cluster_custom_object"
      end
      # resource path
      local_var_path = "/apis/{group}/{version}/{plural}".sub('{' + 'group' + '}', group.to_s).sub('{' + 'version' + '}', version.to_s).sub('{' + 'plural' + '}', plural.to_s)

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

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

    # 
    # Creates a namespace scoped Custom object
    # @param group The custom resource&#39;s group name
    # @param version The custom resource&#39;s version
    # @param namespace The custom resource&#39;s namespace
    # @param plural The custom resource&#39;s plural name. For TPRs this would be lowercase plural kind.
    # @param body The JSON schema of the Resource to create.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :pretty If &#39;true&#39;, then the output is pretty printed.
    # @return [Object]
    def create_namespaced_custom_object(group, version, namespace, plural, body, opts = {})
      data, _status_code, _headers = create_namespaced_custom_object_with_http_info(group, version, namespace, plural, body, opts)
      return data
    end

    # 
    # Creates a namespace scoped Custom object
    # @param group The custom resource&#39;s group name
    # @param version The custom resource&#39;s version
    # @param namespace The custom resource&#39;s namespace
    # @param plural The custom resource&#39;s plural name. For TPRs this would be lowercase plural kind.
    # @param body The JSON schema of the Resource to create.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :pretty If &#39;true&#39;, then the output is pretty printed.
    # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
    def create_namespaced_custom_object_with_http_info(group, version, namespace, plural, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: CustomObjectsApi.create_namespaced_custom_object ..."
      end
      # verify the required parameter 'group' is set
      if @api_client.config.client_side_validation && group.nil?
        fail ArgumentError, "Missing the required parameter 'group' when calling CustomObjectsApi.create_namespaced_custom_object"
      end
      # verify the required parameter 'version' is set
      if @api_client.config.client_side_validation && version.nil?
        fail ArgumentError, "Missing the required parameter 'version' when calling CustomObjectsApi.create_namespaced_custom_object"
      end
      # verify the required parameter 'namespace' is set
      if @api_client.config.client_side_validation && namespace.nil?
        fail ArgumentError, "Missing the required parameter 'namespace' when calling CustomObjectsApi.create_namespaced_custom_object"
      end
      # verify the required parameter 'plural' is set
      if @api_client.config.client_side_validation && plural.nil?
        fail ArgumentError, "Missing the required parameter 'plural' when calling CustomObjectsApi.create_namespaced_custom_object"
      end
      # verify the required parameter 'body' is set
      if @api_client.config.client_side_validation && body.nil?
        fail ArgumentError, "Missing the required parameter 'body' when calling CustomObjectsApi.create_namespaced_custom_object"
      end
      # resource path
      local_var_path = "/apis/{group}/{version}/namespaces/{namespace}/{plural}".sub('{' + 'group' + '}', group.to_s).sub('{' + 'version' + '}', version.to_s).sub('{' + 'namespace' + '}', namespace.to_s).sub('{' + 'plural' + '}', plural.to_s)

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

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

    # 
    # Deletes the specified cluster scoped custom object
    # @param group the custom resource&#39;s group
    # @param version the custom resource&#39;s version
    # @param plural the custom object&#39;s plural name. For TPRs this would be lowercase plural kind.
    # @param name the custom object&#39;s name
    # @param body 
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :grace_period_seconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
    # @option opts [BOOLEAN] :orphan_dependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \&quot;orphan\&quot; finalizer will be added to/removed from the object&#39;s finalizers list. Either this field or PropagationPolicy may be set, but not both.
    # @option opts [String] :propagation_policy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.
    # @return [Object]
    def delete_cluster_custom_object(group, version, plural, name, body, opts = {})
      data, _status_code, _headers = delete_cluster_custom_object_with_http_info(group, version, plural, name, body, opts)
      return data
    end

    # 
    # Deletes the specified cluster scoped custom object
    # @param group the custom resource&#39;s group
    # @param version the custom resource&#39;s version
    # @param plural the custom object&#39;s plural name. For TPRs this would be lowercase plural kind.
    # @param name the custom object&#39;s name
    # @param body 
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :grace_period_seconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
    # @option opts [BOOLEAN] :orphan_dependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \&quot;orphan\&quot; finalizer will be added to/removed from the object&#39;s finalizers list. Either this field or PropagationPolicy may be set, but not both.
    # @option opts [String] :propagation_policy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.
    # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
    def delete_cluster_custom_object_with_http_info(group, version, plural, name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: CustomObjectsApi.delete_cluster_custom_object ..."
      end
      # verify the required parameter 'group' is set
      if @api_client.config.client_side_validation && group.nil?
        fail ArgumentError, "Missing the required parameter 'group' when calling CustomObjectsApi.delete_cluster_custom_object"
      end
      # verify the required parameter 'version' is set
      if @api_client.config.client_side_validation && version.nil?
        fail ArgumentError, "Missing the required parameter 'version' when calling CustomObjectsApi.delete_cluster_custom_object"
      end
      # verify the required parameter 'plural' is set
      if @api_client.config.client_side_validation && plural.nil?
        fail ArgumentError, "Missing the required parameter 'plural' when calling CustomObjectsApi.delete_cluster_custom_object"
      end
      # verify the required parameter 'name' is set
      if @api_client.config.client_side_validation && name.nil?
        fail ArgumentError, "Missing the required parameter 'name' when calling CustomObjectsApi.delete_cluster_custom_object"
      end
      # verify the required parameter 'body' is set
      if @api_client.config.client_side_validation && body.nil?
        fail ArgumentError, "Missing the required parameter 'body' when calling CustomObjectsApi.delete_cluster_custom_object"
      end
      # resource path
      local_var_path = "/apis/{group}/{version}/{plural}/{name}".sub('{' + 'group' + '}', group.to_s).sub('{' + 'version' + '}', version.to_s).sub('{' + 'plural' + '}', plural.to_s).sub('{' + 'name' + '}', name.to_s)

      # query parameters
      query_params = {}
      query_params[:'gracePeriodSeconds'] = opts[:'grace_period_seconds'] if !opts[:'grace_period_seconds'].nil?
      query_params[:'orphanDependents'] = opts[:'orphan_dependents'] if !opts[:'orphan_dependents'].nil?
      query_params[:'propagationPolicy'] = opts[:'propagation_policy'] if !opts[:'propagation_policy'].nil?

      # 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(['*/*'])

      # form parameters
      form_params = {}

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

    # 
    # Deletes the specified namespace scoped custom object
    # @param group the custom resource&#39;s group
    # @param version the custom resource&#39;s version
    # @param namespace The custom resource&#39;s namespace
    # @param plural the custom resource&#39;s plural name. For TPRs this would be lowercase plural kind.
    # @param name the custom object&#39;s name
    # @param body 
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :grace_period_seconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
    # @option opts [BOOLEAN] :orphan_dependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \&quot;orphan\&quot; finalizer will be added to/removed from the object&#39;s finalizers list. Either this field or PropagationPolicy may be set, but not both.
    # @option opts [String] :propagation_policy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.
    # @return [Object]
    def delete_namespaced_custom_object(group, version, namespace, plural, name, body, opts = {})
      data, _status_code, _headers = delete_namespaced_custom_object_with_http_info(group, version, namespace, plural, name, body, opts)
      return data
    end

    # 
    # Deletes the specified namespace scoped custom object
    # @param group the custom resource&#39;s group
    # @param version the custom resource&#39;s version
    # @param namespace The custom resource&#39;s namespace
    # @param plural the custom resource&#39;s plural name. For TPRs this would be lowercase plural kind.
    # @param name the custom object&#39;s name
    # @param body 
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :grace_period_seconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
    # @option opts [BOOLEAN] :orphan_dependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \&quot;orphan\&quot; finalizer will be added to/removed from the object&#39;s finalizers list. Either this field or PropagationPolicy may be set, but not both.
    # @option opts [String] :propagation_policy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.
    # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
    def delete_namespaced_custom_object_with_http_info(group, version, namespace, plural, name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: CustomObjectsApi.delete_namespaced_custom_object ..."
      end
      # verify the required parameter 'group' is set
      if @api_client.config.client_side_validation && group.nil?
        fail ArgumentError, "Missing the required parameter 'group' when calling CustomObjectsApi.delete_namespaced_custom_object"
      end
      # verify the required parameter 'version' is set
      if @api_client.config.client_side_validation && version.nil?
        fail ArgumentError, "Missing the required parameter 'version' when calling CustomObjectsApi.delete_namespaced_custom_object"
      end
      # verify the required parameter 'namespace' is set
      if @api_client.config.client_side_validation && namespace.nil?
        fail ArgumentError, "Missing the required parameter 'namespace' when calling CustomObjectsApi.delete_namespaced_custom_object"
      end
      # verify the required parameter 'plural' is set
      if @api_client.config.client_side_validation && plural.nil?
        fail ArgumentError, "Missing the required parameter 'plural' when calling CustomObjectsApi.delete_namespaced_custom_object"
      end
      # verify the required parameter 'name' is set
      if @api_client.config.client_side_validation && name.nil?
        fail ArgumentError, "Missing the required parameter 'name' when calling CustomObjectsApi.delete_namespaced_custom_object"
      end
      # verify the required parameter 'body' is set
      if @api_client.config.client_side_validation && body.nil?
        fail ArgumentError, "Missing the required parameter 'body' when calling CustomObjectsApi.delete_namespaced_custom_object"
      end
      # resource path
      local_var_path = "/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}".sub('{' + 'group' + '}', group.to_s).sub('{' + 'version' + '}', version.to_s).sub('{' + 'namespace' + '}', namespace.to_s).sub('{' + 'plural' + '}', plural.to_s).sub('{' + 'name' + '}', name.to_s)

      # query parameters
      query_params = {}
      query_params[:'gracePeriodSeconds'] = opts[:'grace_period_seconds'] if !opts[:'grace_period_seconds'].nil?
      query_params[:'orphanDependents'] = opts[:'orphan_dependents'] if !opts[:'orphan_dependents'].nil?
      query_params[:'propagationPolicy'] = opts[:'propagation_policy'] if !opts[:'propagation_policy'].nil?

      # 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(['*/*'])

      # form parameters
      form_params = {}

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

    # 
    # Returns a cluster scoped custom object
    # @param group the custom resource&#39;s group
    # @param version the custom resource&#39;s version
    # @param plural the custom object&#39;s plural name. For TPRs this would be lowercase plural kind.
    # @param name the custom object&#39;s name
    # @param [Hash] opts the optional parameters
    # @return [Object]
    def get_cluster_custom_object(group, version, plural, name, opts = {})
      data, _status_code, _headers = get_cluster_custom_object_with_http_info(group, version, plural, name, opts)
      return data
    end

    # 
    # Returns a cluster scoped custom object
    # @param group the custom resource&#39;s group
    # @param version the custom resource&#39;s version
    # @param plural the custom object&#39;s plural name. For TPRs this would be lowercase plural kind.
    # @param name the custom object&#39;s name
    # @param [Hash] opts the optional parameters
    # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
    def get_cluster_custom_object_with_http_info(group, version, plural, name, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: CustomObjectsApi.get_cluster_custom_object ..."
      end
      # verify the required parameter 'group' is set
      if @api_client.config.client_side_validation && group.nil?
        fail ArgumentError, "Missing the required parameter 'group' when calling CustomObjectsApi.get_cluster_custom_object"
      end
      # verify the required parameter 'version' is set
      if @api_client.config.client_side_validation && version.nil?
        fail ArgumentError, "Missing the required parameter 'version' when calling CustomObjectsApi.get_cluster_custom_object"
      end
      # verify the required parameter 'plural' is set
      if @api_client.config.client_side_validation && plural.nil?
        fail ArgumentError, "Missing the required parameter 'plural' when calling CustomObjectsApi.get_cluster_custom_object"
      end
      # verify the required parameter 'name' is set
      if @api_client.config.client_side_validation && name.nil?
        fail ArgumentError, "Missing the required parameter 'name' when calling CustomObjectsApi.get_cluster_custom_object"
      end
      # resource path
      local_var_path = "/apis/{group}/{version}/{plural}/{name}".sub('{' + 'group' + '}', group.to_s).sub('{' + 'version' + '}', version.to_s).sub('{' + 'plural' + '}', plural.to_s).sub('{' + 'name' + '}', name.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(['*/*'])

      # form parameters
      form_params = {}

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

    # 
    # Returns a namespace scoped custom object
    # @param group the custom resource&#39;s group
    # @param version the custom resource&#39;s version
    # @param namespace The custom resource&#39;s namespace
    # @param plural the custom resource&#39;s plural name. For TPRs this would be lowercase plural kind.
    # @param name the custom object&#39;s name
    # @param [Hash] opts the optional parameters
    # @return [Object]
    def get_namespaced_custom_object(group, version, namespace, plural, name, opts = {})
      data, _status_code, _headers = get_namespaced_custom_object_with_http_info(group, version, namespace, plural, name, opts)
      return data
    end

    # 
    # Returns a namespace scoped custom object
    # @param group the custom resource&#39;s group
    # @param version the custom resource&#39;s version
    # @param namespace The custom resource&#39;s namespace
    # @param plural the custom resource&#39;s plural name. For TPRs this would be lowercase plural kind.
    # @param name the custom object&#39;s name
    # @param [Hash] opts the optional parameters
    # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
    def get_namespaced_custom_object_with_http_info(group, version, namespace, plural, name, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: CustomObjectsApi.get_namespaced_custom_object ..."
      end
      # verify the required parameter 'group' is set
      if @api_client.config.client_side_validation && group.nil?
        fail ArgumentError, "Missing the required parameter 'group' when calling CustomObjectsApi.get_namespaced_custom_object"
      end
      # verify the required parameter 'version' is set
      if @api_client.config.client_side_validation && version.nil?
        fail ArgumentError, "Missing the required parameter 'version' when calling CustomObjectsApi.get_namespaced_custom_object"
      end
      # verify the required parameter 'namespace' is set
      if @api_client.config.client_side_validation && namespace.nil?
        fail ArgumentError, "Missing the required parameter 'namespace' when calling CustomObjectsApi.get_namespaced_custom_object"
      end
      # verify the required parameter 'plural' is set
      if @api_client.config.client_side_validation && plural.nil?
        fail ArgumentError, "Missing the required parameter 'plural' when calling CustomObjectsApi.get_namespaced_custom_object"
      end
      # verify the required parameter 'name' is set
      if @api_client.config.client_side_validation && name.nil?
        fail ArgumentError, "Missing the required parameter 'name' when calling CustomObjectsApi.get_namespaced_custom_object"
      end
      # resource path
      local_var_path = "/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}".sub('{' + 'group' + '}', group.to_s).sub('{' + 'version' + '}', version.to_s).sub('{' + 'namespace' + '}', namespace.to_s).sub('{' + 'plural' + '}', plural.to_s).sub('{' + 'name' + '}', name.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(['*/*'])

      # form parameters
      form_params = {}

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

    # 
    # list or watch cluster scoped custom objects
    # @param group The custom resource&#39;s group name
    # @param version The custom resource&#39;s version
    # @param plural The custom resource&#39;s plural name. For TPRs this would be lowercase plural kind.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :pretty If &#39;true&#39;, then the output is pretty printed.
    # @option opts [String] :label_selector A selector to restrict the list of returned objects by their labels. Defaults to everything.
    # @option opts [String] :resource_version When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it&#39;s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
    # @option opts [BOOLEAN] :watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications.
    # @return [Object]
    def list_cluster_custom_object(group, version, plural, opts = {})
      data, _status_code, _headers = list_cluster_custom_object_with_http_info(group, version, plural, opts)
      return data
    end

    # 
    # list or watch cluster scoped custom objects
    # @param group The custom resource&#39;s group name
    # @param version The custom resource&#39;s version
    # @param plural The custom resource&#39;s plural name. For TPRs this would be lowercase plural kind.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :pretty If &#39;true&#39;, then the output is pretty printed.
    # @option opts [String] :label_selector A selector to restrict the list of returned objects by their labels. Defaults to everything.
    # @option opts [String] :resource_version When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it&#39;s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
    # @option opts [BOOLEAN] :watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications.
    # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
    def list_cluster_custom_object_with_http_info(group, version, plural, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: CustomObjectsApi.list_cluster_custom_object ..."
      end
      # verify the required parameter 'group' is set
      if @api_client.config.client_side_validation && group.nil?
        fail ArgumentError, "Missing the required parameter 'group' when calling CustomObjectsApi.list_cluster_custom_object"
      end
      # verify the required parameter 'version' is set
      if @api_client.config.client_side_validation && version.nil?
        fail ArgumentError, "Missing the required parameter 'version' when calling CustomObjectsApi.list_cluster_custom_object"
      end
      # verify the required parameter 'plural' is set
      if @api_client.config.client_side_validation && plural.nil?
        fail ArgumentError, "Missing the required parameter 'plural' when calling CustomObjectsApi.list_cluster_custom_object"
      end
      # resource path
      local_var_path = "/apis/{group}/{version}/{plural}".sub('{' + 'group' + '}', group.to_s).sub('{' + 'version' + '}', version.to_s).sub('{' + 'plural' + '}', plural.to_s)

      # query parameters
      query_params = {}
      query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
      query_params[:'labelSelector'] = opts[:'label_selector'] if !opts[:'label_selector'].nil?
      query_params[:'resourceVersion'] = opts[:'resource_version'] if !opts[:'resource_version'].nil?
      query_params[:'watch'] = opts[:'watch'] if !opts[:'watch'].nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/json;stream=watch'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['*/*'])

      # form parameters
      form_params = {}

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

    # 
    # list or watch namespace scoped custom objects
    # @param group The custom resource&#39;s group name
    # @param version The custom resource&#39;s version
    # @param namespace The custom resource&#39;s namespace
    # @param plural The custom resource&#39;s plural name. For TPRs this would be lowercase plural kind.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :pretty If &#39;true&#39;, then the output is pretty printed.
    # @option opts [String] :label_selector A selector to restrict the list of returned objects by their labels. Defaults to everything.
    # @option opts [String] :resource_version When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it&#39;s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
    # @option opts [BOOLEAN] :watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications.
    # @return [Object]
    def list_namespaced_custom_object(group, version, namespace, plural, opts = {})
      data, _status_code, _headers = list_namespaced_custom_object_with_http_info(group, version, namespace, plural, opts)
      return data
    end

    # 
    # list or watch namespace scoped custom objects
    # @param group The custom resource&#39;s group name
    # @param version The custom resource&#39;s version
    # @param namespace The custom resource&#39;s namespace
    # @param plural The custom resource&#39;s plural name. For TPRs this would be lowercase plural kind.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :pretty If &#39;true&#39;, then the output is pretty printed.
    # @option opts [String] :label_selector A selector to restrict the list of returned objects by their labels. Defaults to everything.
    # @option opts [String] :resource_version When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it&#39;s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
    # @option opts [BOOLEAN] :watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications.
    # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
    def list_namespaced_custom_object_with_http_info(group, version, namespace, plural, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: CustomObjectsApi.list_namespaced_custom_object ..."
      end
      # verify the required parameter 'group' is set
      if @api_client.config.client_side_validation && group.nil?
        fail ArgumentError, "Missing the required parameter 'group' when calling CustomObjectsApi.list_namespaced_custom_object"
      end
      # verify the required parameter 'version' is set
      if @api_client.config.client_side_validation && version.nil?
        fail ArgumentError, "Missing the required parameter 'version' when calling CustomObjectsApi.list_namespaced_custom_object"
      end
      # verify the required parameter 'namespace' is set
      if @api_client.config.client_side_validation && namespace.nil?
        fail ArgumentError, "Missing the required parameter 'namespace' when calling CustomObjectsApi.list_namespaced_custom_object"
      end
      # verify the required parameter 'plural' is set
      if @api_client.config.client_side_validation && plural.nil?
        fail ArgumentError, "Missing the required parameter 'plural' when calling CustomObjectsApi.list_namespaced_custom_object"
      end
      # resource path
      local_var_path = "/apis/{group}/{version}/namespaces/{namespace}/{plural}".sub('{' + 'group' + '}', group.to_s).sub('{' + 'version' + '}', version.to_s).sub('{' + 'namespace' + '}', namespace.to_s).sub('{' + 'plural' + '}', plural.to_s)

      # query parameters
      query_params = {}
      query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
      query_params[:'labelSelector'] = opts[:'label_selector'] if !opts[:'label_selector'].nil?
      query_params[:'resourceVersion'] = opts[:'resource_version'] if !opts[:'resource_version'].nil?
      query_params[:'watch'] = opts[:'watch'] if !opts[:'watch'].nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/json;stream=watch'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['*/*'])

      # form parameters
      form_params = {}

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

    # 
    # replace the specified cluster scoped custom object
    # @param group the custom resource&#39;s group
    # @param version the custom resource&#39;s version
    # @param plural the custom object&#39;s plural name. For TPRs this would be lowercase plural kind.
    # @param name the custom object&#39;s name
    # @param body The JSON schema of the Resource to replace.
    # @param [Hash] opts the optional parameters
    # @return [Object]
    def replace_cluster_custom_object(group, version, plural, name, body, opts = {})
      data, _status_code, _headers = replace_cluster_custom_object_with_http_info(group, version, plural, name, body, opts)
      return data
    end

    # 
    # replace the specified cluster scoped custom object
    # @param group the custom resource&#39;s group
    # @param version the custom resource&#39;s version
    # @param plural the custom object&#39;s plural name. For TPRs this would be lowercase plural kind.
    # @param name the custom object&#39;s name
    # @param body The JSON schema of the Resource to replace.
    # @param [Hash] opts the optional parameters
    # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
    def replace_cluster_custom_object_with_http_info(group, version, plural, name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: CustomObjectsApi.replace_cluster_custom_object ..."
      end
      # verify the required parameter 'group' is set
      if @api_client.config.client_side_validation && group.nil?
        fail ArgumentError, "Missing the required parameter 'group' when calling CustomObjectsApi.replace_cluster_custom_object"
      end
      # verify the required parameter 'version' is set
      if @api_client.config.client_side_validation && version.nil?
        fail ArgumentError, "Missing the required parameter 'version' when calling CustomObjectsApi.replace_cluster_custom_object"
      end
      # verify the required parameter 'plural' is set
      if @api_client.config.client_side_validation && plural.nil?
        fail ArgumentError, "Missing the required parameter 'plural' when calling CustomObjectsApi.replace_cluster_custom_object"
      end
      # verify the required parameter 'name' is set
      if @api_client.config.client_side_validation && name.nil?
        fail ArgumentError, "Missing the required parameter 'name' when calling CustomObjectsApi.replace_cluster_custom_object"
      end
      # verify the required parameter 'body' is set
      if @api_client.config.client_side_validation && body.nil?
        fail ArgumentError, "Missing the required parameter 'body' when calling CustomObjectsApi.replace_cluster_custom_object"
      end
      # resource path
      local_var_path = "/apis/{group}/{version}/{plural}/{name}".sub('{' + 'group' + '}', group.to_s).sub('{' + 'version' + '}', version.to_s).sub('{' + 'plural' + '}', plural.to_s).sub('{' + 'name' + '}', name.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(['*/*'])

      # form parameters
      form_params = {}

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

    # 
    # replace the specified namespace scoped custom object
    # @param group the custom resource&#39;s group
    # @param version the custom resource&#39;s version
    # @param namespace The custom resource&#39;s namespace
    # @param plural the custom resource&#39;s plural name. For TPRs this would be lowercase plural kind.
    # @param name the custom object&#39;s name
    # @param body The JSON schema of the Resource to replace.
    # @param [Hash] opts the optional parameters
    # @return [Object]
    def replace_namespaced_custom_object(group, version, namespace, plural, name, body, opts = {})
      data, _status_code, _headers = replace_namespaced_custom_object_with_http_info(group, version, namespace, plural, name, body, opts)
      return data
    end

    # 
    # replace the specified namespace scoped custom object
    # @param group the custom resource&#39;s group
    # @param version the custom resource&#39;s version
    # @param namespace The custom resource&#39;s namespace
    # @param plural the custom resource&#39;s plural name. For TPRs this would be lowercase plural kind.
    # @param name the custom object&#39;s name
    # @param body The JSON schema of the Resource to replace.
    # @param [Hash] opts the optional parameters
    # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
    def replace_namespaced_custom_object_with_http_info(group, version, namespace, plural, name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: CustomObjectsApi.replace_namespaced_custom_object ..."
      end
      # verify the required parameter 'group' is set
      if @api_client.config.client_side_validation && group.nil?
        fail ArgumentError, "Missing the required parameter 'group' when calling CustomObjectsApi.replace_namespaced_custom_object"
      end
      # verify the required parameter 'version' is set
      if @api_client.config.client_side_validation && version.nil?
        fail ArgumentError, "Missing the required parameter 'version' when calling CustomObjectsApi.replace_namespaced_custom_object"
      end
      # verify the required parameter 'namespace' is set
      if @api_client.config.client_side_validation && namespace.nil?
        fail ArgumentError, "Missing the required parameter 'namespace' when calling CustomObjectsApi.replace_namespaced_custom_object"
      end
      # verify the required parameter 'plural' is set
      if @api_client.config.client_side_validation && plural.nil?
        fail ArgumentError, "Missing the required parameter 'plural' when calling CustomObjectsApi.replace_namespaced_custom_object"
      end
      # verify the required parameter 'name' is set
      if @api_client.config.client_side_validation && name.nil?
        fail ArgumentError, "Missing the required parameter 'name' when calling CustomObjectsApi.replace_namespaced_custom_object"
      end
      # verify the required parameter 'body' is set
      if @api_client.config.client_side_validation && body.nil?
        fail ArgumentError, "Missing the required parameter 'body' when calling CustomObjectsApi.replace_namespaced_custom_object"
      end
      # resource path
      local_var_path = "/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}".sub('{' + 'group' + '}', group.to_s).sub('{' + 'version' + '}', version.to_s).sub('{' + 'namespace' + '}', namespace.to_s).sub('{' + 'plural' + '}', plural.to_s).sub('{' + 'name' + '}', name.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(['*/*'])

      # form parameters
      form_params = {}

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