// 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 blaze_client

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

import (
	"github.com/go-openapi/runtime"
	httptransport "github.com/go-openapi/runtime/client"
	"github.com/go-openapi/strfmt"

	"github.com/taxnexus/go/lib/api/blaze/blaze_client/members"
	"github.com/taxnexus/go/lib/api/blaze/blaze_client/products"
	"github.com/taxnexus/go/lib/api/blaze/blaze_client/purchase_orders"
	"github.com/taxnexus/go/lib/api/blaze/blaze_client/shop"
	"github.com/taxnexus/go/lib/api/blaze/blaze_client/transactions"
	"github.com/taxnexus/go/lib/api/blaze/blaze_client/vendors"
)

// Default blaze HTTP client.
var Default = NewHTTPClient(nil)

const (
	// DefaultHost is the default Host
	// found in Meta (info) section of spec file
	DefaultHost string = "api.blaze.me"
	// DefaultBasePath is the default BasePath
	// found in Meta (info) section of spec file
	DefaultBasePath string = "/api/v1"
)

// DefaultSchemes are the default schemes found in Meta (info) section of spec file
var DefaultSchemes = []string{"https"}

// NewHTTPClient creates a new blaze HTTP client.
func NewHTTPClient(formats strfmt.Registry) *Blaze {
	return NewHTTPClientWithConfig(formats, nil)
}

// NewHTTPClientWithConfig creates a new blaze HTTP client,
// using a customizable transport config.
func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Blaze {
	// ensure nullable parameters have default
	if cfg == nil {
		cfg = DefaultTransportConfig()
	}

	// create transport and client
	transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes)
	return New(transport, formats)
}

// New creates a new blaze client
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Blaze {
	// ensure nullable parameters have default
	if formats == nil {
		formats = strfmt.Default
	}

	cli := new(Blaze)
	cli.Transport = transport
	cli.Members = members.New(transport, formats)
	cli.Products = products.New(transport, formats)
	cli.PurchaseOrders = purchase_orders.New(transport, formats)
	cli.Shop = shop.New(transport, formats)
	cli.Transactions = transactions.New(transport, formats)
	cli.Vendors = vendors.New(transport, formats)
	return cli
}

// DefaultTransportConfig creates a TransportConfig with the
// default settings taken from the meta section of the spec file.
func DefaultTransportConfig() *TransportConfig {
	return &TransportConfig{
		Host:     DefaultHost,
		BasePath: DefaultBasePath,
		Schemes:  DefaultSchemes,
	}
}

// TransportConfig contains the transport related info,
// found in the meta section of the spec file.
type TransportConfig struct {
	Host     string
	BasePath string
	Schemes  []string
}

// WithHost overrides the default host,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithHost(host string) *TransportConfig {
	cfg.Host = host
	return cfg
}

// WithBasePath overrides the default basePath,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig {
	cfg.BasePath = basePath
	return cfg
}

// WithSchemes overrides the default schemes,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig {
	cfg.Schemes = schemes
	return cfg
}

// Blaze is a client for blaze
type Blaze struct {
	Members members.ClientService

	Products products.ClientService

	PurchaseOrders purchase_orders.ClientService

	Shop shop.ClientService

	Transactions transactions.ClientService

	Vendors vendors.ClientService

	Transport runtime.ClientTransport
}

// SetTransport changes the transport on the client and all its subresources
func (c *Blaze) SetTransport(transport runtime.ClientTransport) {
	c.Transport = transport
	c.Members.SetTransport(transport)
	c.Products.SetTransport(transport)
	c.PurchaseOrders.SetTransport(transport)
	c.Shop.SetTransport(transport)
	c.Transactions.SetTransport(transport)
	c.Vendors.SetTransport(transport)
}
