// Code generated by go-swagger; DO NOT EDIT.

// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package cors

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"fmt"

	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"
)

// New creates a new cors API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
	return &Client{transport: transport, formats: formats}
}

/*
Client for cors API
*/
type Client struct {
	transport runtime.ClientTransport
	formats   strfmt.Registry
}

// ClientService is the interface for Client methods
type ClientService interface {
	ClusterOptions(params *ClusterOptionsParams) (*ClusterOptionsOK, error)

	ClustersOptions(params *ClustersOptionsParams) (*ClustersOptionsOK, error)

	DatabaseOptions(params *DatabaseOptionsParams) (*DatabaseOptionsOK, error)

	DatabasesOptions(params *DatabasesOptionsParams) (*DatabasesOptionsOK, error)

	IngestOptions(params *IngestOptionsParams) (*IngestOptionsOK, error)

	IngestsOptions(params *IngestsOptionsParams) (*IngestsOptionsOK, error)

	JobOptions(params *JobOptionsParams) (*JobOptionsOK, error)

	JobsOptions(params *JobsOptionsParams) (*JobsOptionsOK, error)

	ServiceOptions(params *ServiceOptionsParams) (*ServiceOptionsOK, error)

	ServicesOptions(params *ServicesOptionsParams) (*ServicesOptionsOK, error)

	TemplateOptions(params *TemplateOptionsParams) (*TemplateOptionsOK, error)

	TemplatesOptions(params *TemplatesOptionsParams) (*TemplatesOptionsOK, error)

	TenantOptions(params *TenantOptionsParams) (*TenantOptionsOK, error)

	TenantsOptions(params *TenantsOptionsParams) (*TenantsOptionsOK, error)

	UserOptions(params *UserOptionsParams) (*UserOptionsOK, error)

	UsersOptions(params *UsersOptionsParams) (*UsersOptionsOK, error)

	SetTransport(transport runtime.ClientTransport)
}

/*
  ClusterOptions CORS support
*/
func (a *Client) ClusterOptions(params *ClusterOptionsParams) (*ClusterOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewClusterOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "clusterOptions",
		Method:             "OPTIONS",
		PathPattern:        "/clusters/observable",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &ClusterOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*ClusterOptionsOK)
	if ok {
		return success, nil
	}
	// unexpected success response
	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for clusterOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  ClustersOptions CORS support
*/
func (a *Client) ClustersOptions(params *ClustersOptionsParams) (*ClustersOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewClustersOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "clustersOptions",
		Method:             "OPTIONS",
		PathPattern:        "/clusters",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &ClustersOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*ClustersOptionsOK)
	if ok {
		return success, nil
	}
	// unexpected success response
	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for clustersOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  DatabaseOptions CORS support
*/
func (a *Client) DatabaseOptions(params *DatabaseOptionsParams) (*DatabaseOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewDatabaseOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "databaseOptions",
		Method:             "OPTIONS",
		PathPattern:        "/databases/observable",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &DatabaseOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*DatabaseOptionsOK)
	if ok {
		return success, nil
	}
	// unexpected success response
	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for databaseOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  DatabasesOptions CORS support
*/
func (a *Client) DatabasesOptions(params *DatabasesOptionsParams) (*DatabasesOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewDatabasesOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "databasesOptions",
		Method:             "OPTIONS",
		PathPattern:        "/databases",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &DatabasesOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*DatabasesOptionsOK)
	if ok {
		return success, nil
	}
	// unexpected success response
	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for databasesOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  IngestOptions CORS support
*/
func (a *Client) IngestOptions(params *IngestOptionsParams) (*IngestOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewIngestOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "ingestOptions",
		Method:             "OPTIONS",
		PathPattern:        "/ingests/observable",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &IngestOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*IngestOptionsOK)
	if ok {
		return success, nil
	}
	// unexpected success response
	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for ingestOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  IngestsOptions CORS support
*/
func (a *Client) IngestsOptions(params *IngestsOptionsParams) (*IngestsOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewIngestsOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "ingestsOptions",
		Method:             "OPTIONS",
		PathPattern:        "/ingests",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &IngestsOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*IngestsOptionsOK)
	if ok {
		return success, nil
	}
	// unexpected success response
	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for ingestsOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  JobOptions CORS support
*/
func (a *Client) JobOptions(params *JobOptionsParams) (*JobOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewJobOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "jobOptions",
		Method:             "OPTIONS",
		PathPattern:        "/jobs/observable",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &JobOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*JobOptionsOK)
	if ok {
		return success, nil
	}
	// unexpected success response
	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for jobOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  JobsOptions CORS support
*/
func (a *Client) JobsOptions(params *JobsOptionsParams) (*JobsOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewJobsOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "jobsOptions",
		Method:             "OPTIONS",
		PathPattern:        "/jobs",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &JobsOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*JobsOptionsOK)
	if ok {
		return success, nil
	}
	// unexpected success response
	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for jobsOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  ServiceOptions CORS support
*/
func (a *Client) ServiceOptions(params *ServiceOptionsParams) (*ServiceOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewServiceOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "serviceOptions",
		Method:             "OPTIONS",
		PathPattern:        "/services/observable",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &ServiceOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*ServiceOptionsOK)
	if ok {
		return success, nil
	}
	// unexpected success response
	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for serviceOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  ServicesOptions CORS support
*/
func (a *Client) ServicesOptions(params *ServicesOptionsParams) (*ServicesOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewServicesOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "servicesOptions",
		Method:             "OPTIONS",
		PathPattern:        "/services",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &ServicesOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*ServicesOptionsOK)
	if ok {
		return success, nil
	}
	// unexpected success response
	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for servicesOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  TemplateOptions CORS support
*/
func (a *Client) TemplateOptions(params *TemplateOptionsParams) (*TemplateOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewTemplateOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "templateOptions",
		Method:             "OPTIONS",
		PathPattern:        "/templates/observable",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &TemplateOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*TemplateOptionsOK)
	if ok {
		return success, nil
	}
	// unexpected success response
	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for templateOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  TemplatesOptions CORS support
*/
func (a *Client) TemplatesOptions(params *TemplatesOptionsParams) (*TemplatesOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewTemplatesOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "templatesOptions",
		Method:             "OPTIONS",
		PathPattern:        "/templates",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &TemplatesOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*TemplatesOptionsOK)
	if ok {
		return success, nil
	}
	// unexpected success response
	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for templatesOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  TenantOptions CORS support
*/
func (a *Client) TenantOptions(params *TenantOptionsParams) (*TenantOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewTenantOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "tenantOptions",
		Method:             "OPTIONS",
		PathPattern:        "/tenants/observable",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &TenantOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*TenantOptionsOK)
	if ok {
		return success, nil
	}
	// unexpected success response
	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for tenantOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  TenantsOptions CORS support
*/
func (a *Client) TenantsOptions(params *TenantsOptionsParams) (*TenantsOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewTenantsOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "tenantsOptions",
		Method:             "OPTIONS",
		PathPattern:        "/tenants",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &TenantsOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*TenantsOptionsOK)
	if ok {
		return success, nil
	}
	// unexpected success response
	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for tenantsOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  UserOptions CORS support
*/
func (a *Client) UserOptions(params *UserOptionsParams) (*UserOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewUserOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "userOptions",
		Method:             "OPTIONS",
		PathPattern:        "/users/observable",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &UserOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*UserOptionsOK)
	if ok {
		return success, nil
	}
	// unexpected success response
	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for userOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  UsersOptions CORS support
*/
func (a *Client) UsersOptions(params *UsersOptionsParams) (*UsersOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewUsersOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "usersOptions",
		Method:             "OPTIONS",
		PathPattern:        "/users",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &UsersOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*UsersOptionsOK)
	if ok {
		return success, nil
	}
	// unexpected success response
	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for usersOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
	a.transport = transport
}
