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

package stratoscale_client

import (
	"net/http"
	"net/url"

	"github.com/go-openapi/runtime"
	rtclient "github.com/go-openapi/runtime/client"
	"github.com/go-openapi/strfmt"

	"github.com/go-swagger/go-swagger/examples/tutorials/client/stratoscale_client/experimental"
	"github.com/go-swagger/go-swagger/examples/tutorials/client/stratoscale_client/todos"
)

const (
	// DefaultHost is the default Host
	// found in Meta (info) section of spec file
	DefaultHost string = "localhost"
	// DefaultBasePath is the default BasePath
	// found in Meta (info) section of spec file
	DefaultBasePath string = "/"
)

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

type Config struct {
	// URL is the base URL of the upstream server
	URL *url.URL
	// Transport is an inner transport for the client
	Transport http.RoundTripper
	// AuthInfo is for authentication
	AuthInfo runtime.ClientAuthInfoWriter
}

// New creates a new todo list HTTP client.
func New(c Config) *TodoList {
	var (
		host     = DefaultHost
		basePath = DefaultBasePath
		schemes  = DefaultSchemes
	)

	if c.URL != nil {
		host = c.URL.Host
		basePath = c.URL.Path
		schemes = []string{c.URL.Scheme}
	}

	transport := rtclient.New(host, basePath, schemes)
	if c.Transport != nil {
		transport.Transport = c.Transport
	}

	cli := new(TodoList)
	cli.Transport = transport
	cli.Experimental = experimental.New(transport, strfmt.Default, c.AuthInfo)
	cli.Todos = todos.New(transport, strfmt.Default, c.AuthInfo)
	return cli
}

// TodoList is a client for todo list
type TodoList struct {
	Experimental experimental.API
	Todos        todos.API
	Transport    runtime.ClientTransport
}
