dofusportals

package
v0.0.0-...-4b18402 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package dofusportals provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.

Index

Constants

View Source
const (
	ApiKeyAuthScopes = "ApiKeyAuth.Scopes"
)

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func NewGetExternalV1DimensionsRequest

func NewGetExternalV1DimensionsRequest(server string) (*http.Request, error)

NewGetExternalV1DimensionsRequest generates requests for GetExternalV1Dimensions

func NewGetExternalV1ServersRequest

func NewGetExternalV1ServersRequest(server string) (*http.Request, error)

NewGetExternalV1ServersRequest generates requests for GetExternalV1Servers

func NewGetExternalV1ServersServerIdPortalsDimensionIdHistoryRequest

func NewGetExternalV1ServersServerIdPortalsDimensionIdHistoryRequest(server string, serverId string, dimensionId string) (*http.Request, error)

NewGetExternalV1ServersServerIdPortalsDimensionIdHistoryRequest generates requests for GetExternalV1ServersServerIdPortalsDimensionIdHistory

func NewGetExternalV1ServersServerIdPortalsDimensionIdRequest

func NewGetExternalV1ServersServerIdPortalsDimensionIdRequest(server string, serverId string, dimensionId string) (*http.Request, error)

NewGetExternalV1ServersServerIdPortalsDimensionIdRequest generates requests for GetExternalV1ServersServerIdPortalsDimensionId

func NewGetExternalV1ServersServerIdPortalsRequest

func NewGetExternalV1ServersServerIdPortalsRequest(server string, serverId string) (*http.Request, error)

NewGetExternalV1ServersServerIdPortalsRequest generates requests for GetExternalV1ServersServerIdPortals

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

Types

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) GetExternalV1Dimensions

func (c *Client) GetExternalV1Dimensions(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetExternalV1Servers

func (c *Client) GetExternalV1Servers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetExternalV1ServersServerIdPortals

func (c *Client) GetExternalV1ServersServerIdPortals(ctx context.Context, serverId string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetExternalV1ServersServerIdPortalsDimensionId

func (c *Client) GetExternalV1ServersServerIdPortalsDimensionId(ctx context.Context, serverId string, dimensionId string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetExternalV1ServersServerIdPortalsDimensionIdHistory

func (c *Client) GetExternalV1ServersServerIdPortalsDimensionIdHistory(ctx context.Context, serverId string, dimensionId string, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// GetExternalV1Dimensions request
	GetExternalV1Dimensions(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetExternalV1Servers request
	GetExternalV1Servers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetExternalV1ServersServerIdPortals request
	GetExternalV1ServersServerIdPortals(ctx context.Context, serverId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetExternalV1ServersServerIdPortalsDimensionId request
	GetExternalV1ServersServerIdPortalsDimensionId(ctx context.Context, serverId string, dimensionId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetExternalV1ServersServerIdPortalsDimensionIdHistory request
	GetExternalV1ServersServerIdPortalsDimensionIdHistory(ctx context.Context, serverId string, dimensionId string, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) GetExternalV1DimensionsWithResponse

func (c *ClientWithResponses) GetExternalV1DimensionsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetExternalV1DimensionsResponse, error)

GetExternalV1DimensionsWithResponse request returning *GetExternalV1DimensionsResponse

func (*ClientWithResponses) GetExternalV1ServersServerIdPortalsDimensionIdHistoryWithResponse

func (c *ClientWithResponses) GetExternalV1ServersServerIdPortalsDimensionIdHistoryWithResponse(ctx context.Context, serverId string, dimensionId string, reqEditors ...RequestEditorFn) (*GetExternalV1ServersServerIdPortalsDimensionIdHistoryResponse, error)

GetExternalV1ServersServerIdPortalsDimensionIdHistoryWithResponse request returning *GetExternalV1ServersServerIdPortalsDimensionIdHistoryResponse

func (*ClientWithResponses) GetExternalV1ServersServerIdPortalsDimensionIdWithResponse

func (c *ClientWithResponses) GetExternalV1ServersServerIdPortalsDimensionIdWithResponse(ctx context.Context, serverId string, dimensionId string, reqEditors ...RequestEditorFn) (*GetExternalV1ServersServerIdPortalsDimensionIdResponse, error)

GetExternalV1ServersServerIdPortalsDimensionIdWithResponse request returning *GetExternalV1ServersServerIdPortalsDimensionIdResponse

func (*ClientWithResponses) GetExternalV1ServersServerIdPortalsWithResponse

func (c *ClientWithResponses) GetExternalV1ServersServerIdPortalsWithResponse(ctx context.Context, serverId string, reqEditors ...RequestEditorFn) (*GetExternalV1ServersServerIdPortalsResponse, error)

GetExternalV1ServersServerIdPortalsWithResponse request returning *GetExternalV1ServersServerIdPortalsResponse

func (*ClientWithResponses) GetExternalV1ServersWithResponse

func (c *ClientWithResponses) GetExternalV1ServersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetExternalV1ServersResponse, error)

GetExternalV1ServersWithResponse request returning *GetExternalV1ServersResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetExternalV1Dimensions request
	GetExternalV1DimensionsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetExternalV1DimensionsResponse, error)

	// GetExternalV1Servers request
	GetExternalV1ServersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetExternalV1ServersResponse, error)

	// GetExternalV1ServersServerIdPortals request
	GetExternalV1ServersServerIdPortalsWithResponse(ctx context.Context, serverId string, reqEditors ...RequestEditorFn) (*GetExternalV1ServersServerIdPortalsResponse, error)

	// GetExternalV1ServersServerIdPortalsDimensionId request
	GetExternalV1ServersServerIdPortalsDimensionIdWithResponse(ctx context.Context, serverId string, dimensionId string, reqEditors ...RequestEditorFn) (*GetExternalV1ServersServerIdPortalsDimensionIdResponse, error)

	// GetExternalV1ServersServerIdPortalsDimensionIdHistory request
	GetExternalV1ServersServerIdPortalsDimensionIdHistoryWithResponse(ctx context.Context, serverId string, dimensionId string, reqEditors ...RequestEditorFn) (*GetExternalV1ServersServerIdPortalsDimensionIdHistoryResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type Dimension

type Dimension struct {
	// Id Name of the dimension, used as an id.
	Id string `json:"id"`
}

Dimension Dofus game dimension

type GetExternalV1DimensionsResponse

type GetExternalV1DimensionsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]Dimension
	JSON400      *IntendedError
}

func ParseGetExternalV1DimensionsResponse

func ParseGetExternalV1DimensionsResponse(rsp *http.Response) (*GetExternalV1DimensionsResponse, error)

ParseGetExternalV1DimensionsResponse parses an HTTP response from a GetExternalV1DimensionsWithResponse call

func (GetExternalV1DimensionsResponse) Status

Status returns HTTPResponse.Status

func (GetExternalV1DimensionsResponse) StatusCode

func (r GetExternalV1DimensionsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetExternalV1ServersResponse

type GetExternalV1ServersResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]Server
	JSON400      *IntendedError
}

func ParseGetExternalV1ServersResponse

func ParseGetExternalV1ServersResponse(rsp *http.Response) (*GetExternalV1ServersResponse, error)

ParseGetExternalV1ServersResponse parses an HTTP response from a GetExternalV1ServersWithResponse call

func (GetExternalV1ServersResponse) Status

Status returns HTTPResponse.Status

func (GetExternalV1ServersResponse) StatusCode

func (r GetExternalV1ServersResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetExternalV1ServersServerIdPortalsDimensionIdHistoryResponse

type GetExternalV1ServersServerIdPortalsDimensionIdHistoryResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]PortalHistory
	JSON400      *IntendedError
}

func ParseGetExternalV1ServersServerIdPortalsDimensionIdHistoryResponse

func ParseGetExternalV1ServersServerIdPortalsDimensionIdHistoryResponse(rsp *http.Response) (*GetExternalV1ServersServerIdPortalsDimensionIdHistoryResponse, error)

ParseGetExternalV1ServersServerIdPortalsDimensionIdHistoryResponse parses an HTTP response from a GetExternalV1ServersServerIdPortalsDimensionIdHistoryWithResponse call

func (GetExternalV1ServersServerIdPortalsDimensionIdHistoryResponse) Status

Status returns HTTPResponse.Status

func (GetExternalV1ServersServerIdPortalsDimensionIdHistoryResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type GetExternalV1ServersServerIdPortalsDimensionIdResponse

type GetExternalV1ServersServerIdPortalsDimensionIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Portal
	JSON400      *IntendedError
}

func ParseGetExternalV1ServersServerIdPortalsDimensionIdResponse

func ParseGetExternalV1ServersServerIdPortalsDimensionIdResponse(rsp *http.Response) (*GetExternalV1ServersServerIdPortalsDimensionIdResponse, error)

ParseGetExternalV1ServersServerIdPortalsDimensionIdResponse parses an HTTP response from a GetExternalV1ServersServerIdPortalsDimensionIdWithResponse call

func (GetExternalV1ServersServerIdPortalsDimensionIdResponse) Status

Status returns HTTPResponse.Status

func (GetExternalV1ServersServerIdPortalsDimensionIdResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type GetExternalV1ServersServerIdPortalsResponse

type GetExternalV1ServersServerIdPortalsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]Portal
	JSON400      *IntendedError
}

func ParseGetExternalV1ServersServerIdPortalsResponse

func ParseGetExternalV1ServersServerIdPortalsResponse(rsp *http.Response) (*GetExternalV1ServersServerIdPortalsResponse, error)

ParseGetExternalV1ServersServerIdPortalsResponse parses an HTTP response from a GetExternalV1ServersServerIdPortalsWithResponse call

func (GetExternalV1ServersServerIdPortalsResponse) Status

Status returns HTTPResponse.Status

func (GetExternalV1ServersServerIdPortalsResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type IntendedError

type IntendedError struct {
	// Error Code of the functional error
	Error IntendedErrorError `json:"error"`
}

IntendedError Error that comes when trying to validate and sanitize inputs

type IntendedErrorError

type IntendedErrorError string

IntendedErrorError Code of the functional error

const (
	AcceptLanguageIsBad    IntendedErrorError = "accept_language.is_bad"
	AcceptLanguageNotFound IntendedErrorError = "accept_language.not_found"
	DimensionNotFound      IntendedErrorError = "dimension.not_found"
	IdIsBad                IntendedErrorError = "id.is_bad"
	LoginNotFound          IntendedErrorError = "login.not_found"
	MailIsBad              IntendedErrorError = "mail.is_bad"
	MailNotFound           IntendedErrorError = "mail.not_found"
	NameIsBad              IntendedErrorError = "name.is_bad"
	NameNotFound           IntendedErrorError = "name.not_found"
	PasswordIsBad          IntendedErrorError = "password.is_bad"
	PasswordNotFound       IntendedErrorError = "password.not_found"
	PortalIsBad            IntendedErrorError = "portal.is_bad"
	PortalPositionIsBad    IntendedErrorError = "portal.position.is_bad"
	ServerNotFound         IntendedErrorError = "server.not_found"
	TokenNotFound          IntendedErrorError = "token.not_found"
)

Defines values for IntendedErrorError.

type IntendedErrorResponse

type IntendedErrorResponse = IntendedError

IntendedErrorResponse Error that comes when trying to validate and sanitize inputs

type Portal

type Portal struct {
	// CreatedAt Date of the last updated position.
	CreatedAt *time.Time `json:"createdAt,omitempty"`

	// CreatedBy User that has added or updated the last position
	CreatedBy *User `json:"createdBy,omitempty"`

	// Dimension Name of the dimension
	Dimension string `json:"dimension"`

	// Position Position [x, y] in Dofus map
	Position *Position `json:"position,omitempty"`

	// RemainingUses Remaining number of uses.
	RemainingUses *float32 `json:"remainingUses,omitempty"`

	// Server Name of the server
	Server string `json:"server"`

	// UpdatedAt Date of the last updated portal.
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`

	// UpdatedBy User that has added or updated the last position
	UpdatedBy *User `json:"updatedBy,omitempty"`
}

Portal Portal position at a specific moment. If the position is not filled, then the portal position is considered as unknown and some fields will not be present.

type PortalHistory

type PortalHistory struct {
	// IsInCanopy Is the portal position in the canopy or not.
	IsInCanopy *bool `json:"isInCanopy,omitempty"`

	// Position Position [x, y] in Dofus map
	Position *Position `json:"position,omitempty"`

	// RemainingUses Remaining number of uses.
	RemainingUses *float32 `json:"remainingUses,omitempty"`
}

PortalHistory Portal position value at a specific period.

type Position

type Position struct {
	// ConditionalTransport Transport used to access to a position easily
	ConditionalTransport *Transport `json:"conditionalTransport,omitempty"`

	// IsInCanopy Is the position in the canopy or not.
	IsInCanopy *bool `json:"isInCanopy,omitempty"`

	// Transport Transport used to access to a position easily
	Transport *Transport `json:"transport,omitempty"`

	// X x value in [x, y].
	X float32 `json:"x"`

	// Y y value in [x, y].
	Y float32 `json:"y"`
}

Position Position [x, y] in Dofus map

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type Server

type Server struct {
	// Active Define if the server is accessible for players or not
	Active bool `json:"active"`

	// Community Community of the server. Most of the time, it is a specific region in Europe.
	Community ServerCommunity `json:"community"`

	// Id Name of the server, used as an id.
	Id string `json:"id"`

	// Type Type of the server. Most of the servers are multi-account.
	Type ServerType `json:"type"`
}

Server Dofus game server

type ServerCommunity

type ServerCommunity string

ServerCommunity Community of the server. Most of the time, it is a specific region in Europe.

const (
	All ServerCommunity = "all"
	Es  ServerCommunity = "es"
	Fr  ServerCommunity = "fr"
	Pt  ServerCommunity = "pt"
)

Defines values for ServerCommunity.

type ServerType

type ServerType string

ServerType Type of the server. Most of the servers are multi-account.

const (
	Epic   ServerType = "epic"
	Event  ServerType = "event"
	Heroic ServerType = "heroic"
	Mono   ServerType = "mono"
	Multi  ServerType = "multi"
)

Defines values for ServerType.

type Transport

type Transport struct {
	// Area Area where the transport is localized.
	Area string `json:"area"`

	// SubArea Sub area where the transport is localized.
	SubArea string `json:"subArea"`

	// Type Type of the transport. Most of the transport are zaaps.
	Type TransportType `json:"type"`

	// X x value in [x, y].
	X float32 `json:"x"`

	// Y y value in [x, y].
	Y float32 `json:"y"`
}

Transport Transport used to access to a position easily

type TransportType

type TransportType string

TransportType Type of the transport. Most of the transport are zaaps.

const (
	Brigandin   TransportType = "brigandin"
	CharAVoile  TransportType = "char_a_voile"
	Diligence   TransportType = "diligence"
	Foreuse     TransportType = "foreuse"
	Frigostien  TransportType = "frigostien"
	Scaeroplane TransportType = "scaeroplane"
	Skis        TransportType = "skis"
	Zaap        TransportType = "zaap"
)

Defines values for TransportType.

type User

type User struct {
	// Name Name of the user
	Name string `json:"name"`
}

User User that has added or updated the last position

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL