// 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 {
	AccountOptions(params *AccountOptionsParams) (*AccountOptionsOK, error)

	AccountOptionsObservable(params *AccountOptionsObservableParams) (*AccountOptionsObservableOK, error)

	CompanyObservableOptions(params *CompanyObservableOptionsParams) (*CompanyObservableOptionsOK, error)

	CompanyOptions(params *CompanyOptionsParams) (*CompanyOptionsOK, error)

	ContactOptions(params *ContactOptionsParams) (*ContactOptionsOK, error)

	ContactOptionsObservable(params *ContactOptionsObservableParams) (*ContactOptionsObservableOK, error)

	LeadOptions(params *LeadOptionsParams) (*LeadOptionsOK, error)

	LeadOptionsObservable(params *LeadOptionsObservableParams) (*LeadOptionsObservableOK, error)

	SetTransport(transport runtime.ClientTransport)
}

/*
  AccountOptions CORS support
*/
func (a *Client) AccountOptions(params *AccountOptionsParams) (*AccountOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAccountOptionsParams()
	}

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

/*
  AccountOptionsObservable CORS support
*/
func (a *Client) AccountOptionsObservable(params *AccountOptionsObservableParams) (*AccountOptionsObservableOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewAccountOptionsObservableParams()
	}

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

/*
  CompanyObservableOptions CORS support
*/
func (a *Client) CompanyObservableOptions(params *CompanyObservableOptionsParams) (*CompanyObservableOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewCompanyObservableOptionsParams()
	}

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

/*
  CompanyOptions CORS support
*/
func (a *Client) CompanyOptions(params *CompanyOptionsParams) (*CompanyOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewCompanyOptionsParams()
	}

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

/*
  ContactOptions CORS support
*/
func (a *Client) ContactOptions(params *ContactOptionsParams) (*ContactOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewContactOptionsParams()
	}

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

/*
  ContactOptionsObservable CORS support
*/
func (a *Client) ContactOptionsObservable(params *ContactOptionsObservableParams) (*ContactOptionsObservableOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewContactOptionsObservableParams()
	}

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

/*
  LeadOptions CORS support
*/
func (a *Client) LeadOptions(params *LeadOptionsParams) (*LeadOptionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewLeadOptionsParams()
	}

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

/*
  LeadOptionsObservable CORS support
*/
func (a *Client) LeadOptionsObservable(params *LeadOptionsObservableParams) (*LeadOptionsObservableOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewLeadOptionsObservableParams()
	}

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