This repository has been archived on 2025-02-01. You can view files and clone it, but cannot push or open issues or pull requests.
eve-goclient/client/app_client.go

281 lines
6 KiB
Go

package 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"
strfmt "github.com/go-openapi/strfmt"
"./alliance"
"./assets"
"./bookmarks"
"./calendar"
"./character"
"./clones"
"./contacts"
"./dogma"
"./fleets"
"./incursions"
"./industry"
"./insurance"
"./killmails"
"./location"
"./loyalty"
"./mail"
"./market"
"./planetary_interaction"
"./search"
"./skills"
"./sovereignty"
"./universe"
"./user_interface"
"./wallet"
"./wars"
)
// Default app HTTP client.
var Default = NewHTTPClient(nil)
const (
// DefaultHost is the default Host
// found in Meta (info) section of spec file
DefaultHost string = "esi.tech.ccp.is"
// DefaultBasePath is the default BasePath
// found in Meta (info) section of spec file
DefaultBasePath string = "/latest"
)
// DefaultSchemes are the default schemes found in Meta (info) section of spec file
var DefaultSchemes = []string{"https"}
// NewHTTPClient creates a new app HTTP client.
func NewHTTPClient(formats strfmt.Registry) *App {
return NewHTTPClientWithConfig(formats, nil)
}
// NewHTTPClientWithConfig creates a new app HTTP client,
// using a customizable transport config.
func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *App {
// ensure nullable parameters have default
if formats == nil {
formats = strfmt.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 app client
func New(transport runtime.ClientTransport, formats strfmt.Registry) *App {
cli := new(App)
cli.Transport = transport
cli.Alliance = alliance.New(transport, formats)
cli.Assets = assets.New(transport, formats)
cli.Bookmarks = bookmarks.New(transport, formats)
cli.Calendar = calendar.New(transport, formats)
cli.Character = character.New(transport, formats)
cli.Clones = clones.New(transport, formats)
cli.Contacts = contacts.New(transport, formats)
cli.Dogma = dogma.New(transport, formats)
cli.Fleets = fleets.New(transport, formats)
cli.Incursions = incursions.New(transport, formats)
cli.Industry = industry.New(transport, formats)
cli.Insurance = insurance.New(transport, formats)
cli.Killmails = killmails.New(transport, formats)
cli.Location = location.New(transport, formats)
cli.Loyalty = loyalty.New(transport, formats)
cli.Mail = mail.New(transport, formats)
cli.Market = market.New(transport, formats)
cli.PlanetaryInteraction = planetary_interaction.New(transport, formats)
cli.Search = search.New(transport, formats)
cli.Skills = skills.New(transport, formats)
cli.Sovereignty = sovereignty.New(transport, formats)
cli.Universe = universe.New(transport, formats)
cli.UserInterface = user_interface.New(transport, formats)
cli.Wallet = wallet.New(transport, formats)
cli.Wars = wars.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
}
// App is a client for app
type App struct {
Alliance *alliance.Client
Assets *assets.Client
Bookmarks *bookmarks.Client
Calendar *calendar.Client
Character *character.Client
Clones *clones.Client
Contacts *contacts.Client
Dogma *dogma.Client
Fleets *fleets.Client
Incursions *incursions.Client
Industry *industry.Client
Insurance *insurance.Client
Killmails *killmails.Client
Location *location.Client
Loyalty *loyalty.Client
Mail *mail.Client
Market *market.Client
PlanetaryInteraction *planetary_interaction.Client
Search *search.Client
Skills *skills.Client
Sovereignty *sovereignty.Client
Universe *universe.Client
UserInterface *user_interface.Client
Wallet *wallet.Client
Wars *wars.Client
Transport runtime.ClientTransport
}
// SetTransport changes the transport on the client and all its subresources
func (c *App) SetTransport(transport runtime.ClientTransport) {
c.Transport = transport
c.Alliance.SetTransport(transport)
c.Assets.SetTransport(transport)
c.Bookmarks.SetTransport(transport)
c.Calendar.SetTransport(transport)
c.Character.SetTransport(transport)
c.Clones.SetTransport(transport)
c.Contacts.SetTransport(transport)
c.Dogma.SetTransport(transport)
c.Fleets.SetTransport(transport)
c.Incursions.SetTransport(transport)
c.Industry.SetTransport(transport)
c.Insurance.SetTransport(transport)
c.Killmails.SetTransport(transport)
c.Location.SetTransport(transport)
c.Loyalty.SetTransport(transport)
c.Mail.SetTransport(transport)
c.Market.SetTransport(transport)
c.PlanetaryInteraction.SetTransport(transport)
c.Search.SetTransport(transport)
c.Skills.SetTransport(transport)
c.Sovereignty.SetTransport(transport)
c.Universe.SetTransport(transport)
c.UserInterface.SetTransport(transport)
c.Wallet.SetTransport(transport)
c.Wars.SetTransport(transport)
}