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

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

package members_client

import (
	"maps"

	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/attendees"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/clusters"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/courses"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/credentials"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/databases"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/documents"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/emails"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/enrollments"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/events"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/favorites"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/invoices"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/issued_certificates"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/lesson_progress"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/orders"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/payment_methods"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/portal_access"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/portal_catalog"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/portal_clients"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/portal_memberships"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/portal_plans"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/prompts"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/research_projects"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/sessions"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/templates"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/tenants"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/track_events"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/tracks"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/transactions"
	"code.tnxs.net/vernonkeenan/lib/api/members/members_client/users"
	"github.com/go-openapi/runtime"
	httptransport "github.com/go-openapi/runtime/client"
	"github.com/go-openapi/strfmt"
)

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

const (
	// DefaultHost is the default Host found in Meta (info) section of spec file.
	DefaultHost string = "members.vernonkeenan.com:8080"
	// DefaultBasePath is the default BasePath found in Meta (info) section of spec file.
	DefaultBasePath string = "/v1"
)

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

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

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

	// create transport and client.
	transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes)
	maps.Copy(transport.Producers, cfg.Producers)
	maps.Copy(transport.Consumers, cfg.Consumers)

	return New(transport, formats)
}

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

	cli := new(Members)
	cli.Transport = transport
	cli.Attendees = attendees.New(transport, formats)
	cli.Clusters = clusters.New(transport, formats)
	cli.Courses = courses.New(transport, formats)
	cli.Credentials = credentials.New(transport, formats)
	cli.Databases = databases.New(transport, formats)
	cli.Documents = documents.New(transport, formats)
	cli.Emails = emails.New(transport, formats)
	cli.Enrollments = enrollments.New(transport, formats)
	cli.Events = events.New(transport, formats)
	cli.Favorites = favorites.New(transport, formats)
	cli.Invoices = invoices.New(transport, formats)
	cli.IssuedCertificates = issued_certificates.New(transport, formats)
	cli.LessonProgress = lesson_progress.New(transport, formats)
	cli.Orders = orders.New(transport, formats)
	cli.PaymentMethods = payment_methods.New(transport, formats)
	cli.PortalAccess = portal_access.New(transport, formats)
	cli.PortalCatalog = portal_catalog.New(transport, formats)
	cli.PortalClients = portal_clients.New(transport, formats)
	cli.PortalMemberships = portal_memberships.New(transport, formats)
	cli.PortalPlans = portal_plans.New(transport, formats)
	cli.Prompts = prompts.New(transport, formats)
	cli.ResearchProjects = research_projects.New(transport, formats)
	cli.Sessions = sessions.New(transport, formats)
	cli.Templates = templates.New(transport, formats)
	cli.Tenants = tenants.New(transport, formats)
	cli.TrackEvents = track_events.New(transport, formats)
	cli.Tracks = tracks.New(transport, formats)
	cli.Transactions = transactions.New(transport, formats)
	cli.Users = users.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
	Producers map[string]runtime.Producer
	Consumers map[string]runtime.Consumer
}

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

// WithProducers overrides the default producers registered by [httptransport.Runtime].
func (cfg *TransportConfig) WithProducers(producers map[string]runtime.Producer) *TransportConfig {
	cfg.Producers = producers
	return cfg
}

// WithConsumers overrides the default consumers registered by [httptransport.Runtime].
func (cfg *TransportConfig) WithConsumers(consumers map[string]runtime.Consumer) *TransportConfig {
	cfg.Consumers = consumers
	return cfg
}

// Members is a client for members.
type Members struct {
	Attendees attendees.ClientService

	Clusters clusters.ClientService

	Courses courses.ClientService

	Credentials credentials.ClientService

	Databases databases.ClientService

	Documents documents.ClientService

	Emails emails.ClientService

	Enrollments enrollments.ClientService

	Events events.ClientService

	Favorites favorites.ClientService

	Invoices invoices.ClientService

	IssuedCertificates issued_certificates.ClientService

	LessonProgress lesson_progress.ClientService

	Orders orders.ClientService

	PaymentMethods payment_methods.ClientService

	PortalAccess portal_access.ClientService

	PortalCatalog portal_catalog.ClientService

	PortalClients portal_clients.ClientService

	PortalMemberships portal_memberships.ClientService

	PortalPlans portal_plans.ClientService

	Prompts prompts.ClientService

	ResearchProjects research_projects.ClientService

	Sessions sessions.ClientService

	Templates templates.ClientService

	Tenants tenants.ClientService

	TrackEvents track_events.ClientService

	Tracks tracks.ClientService

	Transactions transactions.ClientService

	Users users.ClientService

	Transport runtime.ContextualTransport
}

// SetTransport changes the transport on the client and all its subresources.
func (c *Members) SetTransport(transport runtime.ContextualTransport) {
	c.Transport = transport
	c.Attendees.SetTransport(transport)
	c.Clusters.SetTransport(transport)
	c.Courses.SetTransport(transport)
	c.Credentials.SetTransport(transport)
	c.Databases.SetTransport(transport)
	c.Documents.SetTransport(transport)
	c.Emails.SetTransport(transport)
	c.Enrollments.SetTransport(transport)
	c.Events.SetTransport(transport)
	c.Favorites.SetTransport(transport)
	c.Invoices.SetTransport(transport)
	c.IssuedCertificates.SetTransport(transport)
	c.LessonProgress.SetTransport(transport)
	c.Orders.SetTransport(transport)
	c.PaymentMethods.SetTransport(transport)
	c.PortalAccess.SetTransport(transport)
	c.PortalCatalog.SetTransport(transport)
	c.PortalClients.SetTransport(transport)
	c.PortalMemberships.SetTransport(transport)
	c.PortalPlans.SetTransport(transport)
	c.Prompts.SetTransport(transport)
	c.ResearchProjects.SetTransport(transport)
	c.Sessions.SetTransport(transport)
	c.Templates.SetTransport(transport)
	c.Tenants.SetTransport(transport)
	c.TrackEvents.SetTransport(transport)
	c.Tracks.SetTransport(transport)
	c.Transactions.SetTransport(transport)
	c.Users.SetTransport(transport)
}
