// 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 {
	AuthorityOptions(params *AuthorityOptionsParams) (*AuthorityOptionsOK, error)

	BackendOptions(params *BackendOptionsParams) (*BackendOptionsOK, error)

	FilingOptions(params *FilingOptionsParams) (*FilingOptionsOK, error)

	FilingTypeOptions(params *FilingTypeOptionsParams) (*FilingTypeOptionsOK, error)

	LicenseOptions(params *LicenseOptionsParams) (*LicenseOptionsOK, error)

	LicenseTypeOptions(params *LicenseTypeOptionsParams) (*LicenseTypeOptionsOK, error)

	NotebookOptions(params *NotebookOptionsParams) (*NotebookOptionsOK, error)

	RatingEngineOptions(params *RatingEngineOptionsParams) (*RatingEngineOptionsOK, error)

	SubmissionOptions(params *SubmissionOptionsParams) (*SubmissionOptionsOK, error)

	TaxTypeAccountOptions(params *TaxTypeAccountOptionsParams) (*TaxTypeAccountOptionsOK, error)

	TransactionOptions(params *TransactionOptionsParams) (*TransactionOptionsOK, error)

	SetTransport(transport runtime.ClientTransport)
}

/*
  AuthorityOptions CORS support
*/
func (a *Client) AuthorityOptions(params *AuthorityOptionsParams) (*AuthorityOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAuthorityOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "authorityOptions",
		Method:             "OPTIONS",
		PathPattern:        "/authorities",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &AuthorityOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*AuthorityOptionsOK)
	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 authorityOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  BackendOptions CORS support
*/
func (a *Client) BackendOptions(params *BackendOptionsParams) (*BackendOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewBackendOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "backendOptions",
		Method:             "OPTIONS",
		PathPattern:        "/backends",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &BackendOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*BackendOptionsOK)
	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 backendOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  FilingOptions CORS support
*/
func (a *Client) FilingOptions(params *FilingOptionsParams) (*FilingOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewFilingOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "filingOptions",
		Method:             "OPTIONS",
		PathPattern:        "/filings",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &FilingOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*FilingOptionsOK)
	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 filingOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  FilingTypeOptions CORS support
*/
func (a *Client) FilingTypeOptions(params *FilingTypeOptionsParams) (*FilingTypeOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewFilingTypeOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "filingTypeOptions",
		Method:             "OPTIONS",
		PathPattern:        "/filingtypes",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &FilingTypeOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*FilingTypeOptionsOK)
	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 filingTypeOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  LicenseOptions CORS support
*/
func (a *Client) LicenseOptions(params *LicenseOptionsParams) (*LicenseOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewLicenseOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "licenseOptions",
		Method:             "OPTIONS",
		PathPattern:        "/licenses",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &LicenseOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*LicenseOptionsOK)
	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 licenseOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  LicenseTypeOptions CORS support
*/
func (a *Client) LicenseTypeOptions(params *LicenseTypeOptionsParams) (*LicenseTypeOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewLicenseTypeOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "licenseTypeOptions",
		Method:             "OPTIONS",
		PathPattern:        "/licensetypes",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &LicenseTypeOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*LicenseTypeOptionsOK)
	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 licenseTypeOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  NotebookOptions CORS support
*/
func (a *Client) NotebookOptions(params *NotebookOptionsParams) (*NotebookOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewNotebookOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "notebookOptions",
		Method:             "OPTIONS",
		PathPattern:        "/notebooks",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &NotebookOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*NotebookOptionsOK)
	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 notebookOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  RatingEngineOptions CORS support
*/
func (a *Client) RatingEngineOptions(params *RatingEngineOptionsParams) (*RatingEngineOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewRatingEngineOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "ratingEngineOptions",
		Method:             "OPTIONS",
		PathPattern:        "/ratingengines",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &RatingEngineOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*RatingEngineOptionsOK)
	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 ratingEngineOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  SubmissionOptions CORS support
*/
func (a *Client) SubmissionOptions(params *SubmissionOptionsParams) (*SubmissionOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewSubmissionOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "submissionOptions",
		Method:             "OPTIONS",
		PathPattern:        "/submissions",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &SubmissionOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*SubmissionOptionsOK)
	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 submissionOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  TaxTypeAccountOptions CORS support
*/
func (a *Client) TaxTypeAccountOptions(params *TaxTypeAccountOptionsParams) (*TaxTypeAccountOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewTaxTypeAccountOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "taxTypeAccountOptions",
		Method:             "OPTIONS",
		PathPattern:        "/taxtypeaccounts",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &TaxTypeAccountOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*TaxTypeAccountOptionsOK)
	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 taxTypeAccountOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
  TransactionOptions CORS support
*/
func (a *Client) TransactionOptions(params *TransactionOptionsParams) (*TransactionOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewTransactionOptionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "transactionOptions",
		Method:             "OPTIONS",
		PathPattern:        "/transactions",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &TransactionOptionsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*TransactionOptionsOK)
	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 transactionOptions: 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
}
