v22

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

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

Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT.

Index

Constants

View Source
const (
	TokenScopes = "token.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 Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

func NewAccountRequest

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

NewAccountRequest generates requests for Account

func NewCreateTokenRequestWithBody

func NewCreateTokenRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewCreateTokenRequestWithBody generates requests for CreateToken with any type of body

func NewCreateTokenRequestWithFormdataBody

func NewCreateTokenRequestWithFormdataBody(server string, body CreateTokenFormdataRequestBody) (*http.Request, error)

NewCreateTokenRequestWithFormdataBody calls the generic CreateToken builder with application/x-www-form-urlencoded body

func NewDeleteTokenRequest

func NewDeleteTokenRequest(server string, id string) (*http.Request, error)

NewDeleteTokenRequest generates requests for DeleteToken

func NewPingRequest

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

NewPingRequest generates requests for Ping

func NewProcessFileAsyncRequestWithBody

func NewProcessFileAsyncRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewProcessFileAsyncRequestWithBody generates requests for ProcessFileAsync with any type of body

func NewProcessFileFetchRequestWithBody

func NewProcessFileFetchRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewProcessFileFetchRequestWithBody generates requests for ProcessFileFetch with any type of body

func NewProcessFileFetchRequestWithFormdataBody

func NewProcessFileFetchRequestWithFormdataBody(server string, body ProcessFileFetchFormdataRequestBody) (*http.Request, error)

NewProcessFileFetchRequestWithFormdataBody calls the generic ProcessFileFetch builder with application/x-www-form-urlencoded body

func NewProcessFileRequestWithBody

func NewProcessFileRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewProcessFileRequestWithBody generates requests for ProcessFile with any type of body

func NewRetrieveFileRequest

func NewRetrieveFileRequest(server string, id string) (*http.Request, error)

NewRetrieveFileRequest generates requests for RetrieveFile

func NewRetrieveTokenRequest

func NewRetrieveTokenRequest(server string, id string) (*http.Request, error)

NewRetrieveTokenRequest generates requests for RetrieveToken

func PathToRawSpec

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

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

func Setup

func Setup(mux *flow.Mux, eng *engine.Engine, key, secret, data, baseURL string)

Types

type AccountInfo

type AccountInfo struct {
	Balance          *float32           `json:"balance,omitempty"`
	BillingEmail     *string            `json:"billing_email,omitempty"`
	CreationDate     *string            `json:"creation_date,omitempty"`
	Keys             *map[string]ApiKey `json:"keys,omitempty"`
	ModificationDate *string            `json:"modification_date,omitempty"`
	Name             *string            `json:"name,omitempty"`
	StartingBalance  *float32           `json:"starting_balance,omitempty"`
	Subscription     *string            `json:"subscription,omitempty"`
	Users            *map[string]User   `json:"users,omitempty"`
}

AccountInfo defines model for AccountInfo.

type AccountResponse

type AccountResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *AccountInfo
	JSON401      *N401
}

func ParseAccountResponse

func ParseAccountResponse(rsp *http.Response) (*AccountResponse, error)

ParseAccountResponse parses an HTTP response from a AccountWithResponse call

func (AccountResponse) Status

func (r AccountResponse) Status() string

Status returns HTTPResponse.Status

func (AccountResponse) StatusCode

func (r AccountResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ApiKey

type ApiKey struct {
	Active                     *bool     `json:"active,omitempty"`
	CreationDate               *string   `json:"creation_date,omitempty"`
	DetectionCategoriesEnabled *[]string `json:"detection_categories_enabled,omitempty"`
	LastSeenDate               *string   `json:"last_seen_date,omitempty"`
	Tags                       *[]string `json:"tags,omitempty"`
}

ApiKey defines model for ApiKey.

type AuthToken

type AuthToken struct {
	CreationDate   *string `json:"creation_date,omitempty"`
	ExpirationDate *string `json:"expiration_date,omitempty"`
	Id             *string `json:"id,omitempty"`
}

AuthToken defines model for AuthToken.

type ChiServerOptions

type ChiServerOptions struct {
	BaseURL          string
	BaseRouter       chi.Router
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

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) Account

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

func (*Client) CreateTokenWithBody

func (c *Client) CreateTokenWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreateTokenWithFormdataBody

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

func (*Client) DeleteToken

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

func (*Client) Ping

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

func (*Client) ProcessFileAsyncWithBody

func (c *Client) ProcessFileAsyncWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ProcessFileFetchWithBody

func (c *Client) ProcessFileFetchWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ProcessFileFetchWithFormdataBody

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

func (*Client) ProcessFileWithBody

func (c *Client) ProcessFileWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) RetrieveFile

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

func (*Client) RetrieveToken

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

type ClientInterface

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

	// CreateTokenWithBody request with any body
	CreateTokenWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CreateTokenWithFormdataBody(ctx context.Context, body CreateTokenFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

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

	// ProcessFileWithBody request with any body
	ProcessFileWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ProcessFileAsyncWithBody request with any body
	ProcessFileAsyncWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ProcessFileFetchWithBody request with any body
	ProcessFileFetchWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	ProcessFileFetchWithFormdataBody(ctx context.Context, body ProcessFileFetchFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	// Ping request
	Ping(ctx context.Context, 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) AccountWithResponse

func (c *ClientWithResponses) AccountWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*AccountResponse, error)

AccountWithResponse request returning *AccountResponse

func (*ClientWithResponses) CreateTokenWithBodyWithResponse

func (c *ClientWithResponses) CreateTokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTokenResponse, error)

CreateTokenWithBodyWithResponse request with arbitrary body returning *CreateTokenResponse

func (*ClientWithResponses) CreateTokenWithFormdataBodyWithResponse

func (c *ClientWithResponses) CreateTokenWithFormdataBodyWithResponse(ctx context.Context, body CreateTokenFormdataRequestBody, reqEditors ...RequestEditorFn) (*CreateTokenResponse, error)

func (*ClientWithResponses) DeleteTokenWithResponse

func (c *ClientWithResponses) DeleteTokenWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteTokenResponse, error)

DeleteTokenWithResponse request returning *DeleteTokenResponse

func (*ClientWithResponses) PingWithResponse

func (c *ClientWithResponses) PingWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PingResponse, error)

PingWithResponse request returning *PingResponse

func (*ClientWithResponses) ProcessFileAsyncWithBodyWithResponse

func (c *ClientWithResponses) ProcessFileAsyncWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ProcessFileAsyncResponse, error)

ProcessFileAsyncWithBodyWithResponse request with arbitrary body returning *ProcessFileAsyncResponse

func (*ClientWithResponses) ProcessFileFetchWithBodyWithResponse

func (c *ClientWithResponses) ProcessFileFetchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ProcessFileFetchResponse, error)

ProcessFileFetchWithBodyWithResponse request with arbitrary body returning *ProcessFileFetchResponse

func (*ClientWithResponses) ProcessFileFetchWithFormdataBodyWithResponse

func (c *ClientWithResponses) ProcessFileFetchWithFormdataBodyWithResponse(ctx context.Context, body ProcessFileFetchFormdataRequestBody, reqEditors ...RequestEditorFn) (*ProcessFileFetchResponse, error)

func (*ClientWithResponses) ProcessFileWithBodyWithResponse

func (c *ClientWithResponses) ProcessFileWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ProcessFileResponse, error)

ProcessFileWithBodyWithResponse request with arbitrary body returning *ProcessFileResponse

func (*ClientWithResponses) RetrieveFileWithResponse

func (c *ClientWithResponses) RetrieveFileWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RetrieveFileResponse, error)

RetrieveFileWithResponse request returning *RetrieveFileResponse

func (*ClientWithResponses) RetrieveTokenWithResponse

func (c *ClientWithResponses) RetrieveTokenWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RetrieveTokenResponse, error)

RetrieveTokenWithResponse request returning *RetrieveTokenResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// AccountWithResponse request
	AccountWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*AccountResponse, error)

	// CreateTokenWithBodyWithResponse request with any body
	CreateTokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTokenResponse, error)

	CreateTokenWithFormdataBodyWithResponse(ctx context.Context, body CreateTokenFormdataRequestBody, reqEditors ...RequestEditorFn) (*CreateTokenResponse, error)

	// DeleteTokenWithResponse request
	DeleteTokenWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteTokenResponse, error)

	// RetrieveTokenWithResponse request
	RetrieveTokenWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RetrieveTokenResponse, error)

	// ProcessFileWithBodyWithResponse request with any body
	ProcessFileWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ProcessFileResponse, error)

	// ProcessFileAsyncWithBodyWithResponse request with any body
	ProcessFileAsyncWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ProcessFileAsyncResponse, error)

	// ProcessFileFetchWithBodyWithResponse request with any body
	ProcessFileFetchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ProcessFileFetchResponse, error)

	ProcessFileFetchWithFormdataBodyWithResponse(ctx context.Context, body ProcessFileFetchFormdataRequestBody, reqEditors ...RequestEditorFn) (*ProcessFileFetchResponse, error)

	// RetrieveFileWithResponse request
	RetrieveFileWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RetrieveFileResponse, error)

	// PingWithResponse request
	PingWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PingResponse, error)
}

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

type CreateTokenFormdataBody

type CreateTokenFormdataBody struct {
	// Timeout Number of seconds this token should be valid for
	Timeout *int64 `form:"timeout,omitempty" json:"timeout,omitempty"`
}

CreateTokenFormdataBody defines parameters for CreateToken.

type CreateTokenFormdataRequestBody

type CreateTokenFormdataRequestBody CreateTokenFormdataBody

CreateTokenFormdataRequestBody defines body for CreateToken for application/x-www-form-urlencoded ContentType.

type CreateTokenResponse

type CreateTokenResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *AuthToken
	JSON401      *N401
}

func ParseCreateTokenResponse

func ParseCreateTokenResponse(rsp *http.Response) (*CreateTokenResponse, error)

ParseCreateTokenResponse parses an HTTP response from a CreateTokenWithResponse call

func (CreateTokenResponse) Status

func (r CreateTokenResponse) Status() string

Status returns HTTPResponse.Status

func (CreateTokenResponse) StatusCode

func (r CreateTokenResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteTokenResponse

type DeleteTokenResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON401      *N401
}

func ParseDeleteTokenResponse

func ParseDeleteTokenResponse(rsp *http.Response) (*DeleteTokenResponse, error)

ParseDeleteTokenResponse parses an HTTP response from a DeleteTokenWithResponse call

func (DeleteTokenResponse) Status

func (r DeleteTokenResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteTokenResponse) StatusCode

func (r DeleteTokenResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ErrorResponse

type ErrorResponse struct {
	Error    *string            `json:"error"`
	Id       *string            `json:"id"`
	Metadata *map[string]string `json:"metadata,omitempty"`
}

ErrorResponse defines model for ErrorResponse.

type FakeHandler

type FakeHandler struct {
	// contains filtered or unexported fields
}

func (FakeHandler) Account

func (h FakeHandler) Account(w http.ResponseWriter, r *http.Request)

func (FakeHandler) CreateToken

func (h FakeHandler) CreateToken(w http.ResponseWriter, r *http.Request)

func (FakeHandler) DeleteToken

func (h FakeHandler) DeleteToken(w http.ResponseWriter, _ *http.Request, id string)

func (FakeHandler) Ping

func (h FakeHandler) Ping(w http.ResponseWriter, r *http.Request)

func (FakeHandler) ProcessFile

func (h FakeHandler) ProcessFile(w http.ResponseWriter, r *http.Request)

func (FakeHandler) ProcessFileAsync

func (h FakeHandler) ProcessFileAsync(w http.ResponseWriter, r *http.Request)

func (FakeHandler) ProcessFileFetch

func (h FakeHandler) ProcessFileFetch(w http.ResponseWriter, r *http.Request)

func (FakeHandler) RetrieveFile

func (h FakeHandler) RetrieveFile(w http.ResponseWriter, _ *http.Request, id string)

func (FakeHandler) RetrieveToken

func (h FakeHandler) RetrieveToken(w http.ResponseWriter, _ *http.Request, id string)

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type N401

type N401 = ErrorResponse

N401 defines model for 401.

type PingResponse

type PingResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		// Key Returns the public key used
		Key     *string `json:"key,omitempty"`
		Message *string `json:"message,omitempty"`
	}
	JSON401 *N401
}

func ParsePingResponse

func ParsePingResponse(rsp *http.Response) (*PingResponse, error)

ParsePingResponse parses an HTTP response from a PingWithResponse call

func (PingResponse) Status

func (r PingResponse) Status() string

Status returns HTTPResponse.Status

func (PingResponse) StatusCode

func (r PingResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ProcessFileAsyncMultipartBody

type ProcessFileAsyncMultipartBody struct {
	// Callback Callback URL to notify once processing is completed
	Callback *string `json:"callback,omitempty"`

	// File File to analyze
	File     *openapi_types.File `json:"file,omitempty"`
	Metadata *map[string]string  `json:"metadata,omitempty"`
}

ProcessFileAsyncMultipartBody defines parameters for ProcessFileAsync.

type ProcessFileAsyncMultipartRequestBody

type ProcessFileAsyncMultipartRequestBody ProcessFileAsyncMultipartBody

ProcessFileAsyncMultipartRequestBody defines body for ProcessFileAsync for multipart/form-data ContentType.

type ProcessFileAsyncResponse

type ProcessFileAsyncResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON202      *ProcessingPendingResponse
	JSON400      *ErrorResponse
	JSON401      *N401
}

func ParseProcessFileAsyncResponse

func ParseProcessFileAsyncResponse(rsp *http.Response) (*ProcessFileAsyncResponse, error)

ParseProcessFileAsyncResponse parses an HTTP response from a ProcessFileAsyncWithResponse call

func (ProcessFileAsyncResponse) Status

func (r ProcessFileAsyncResponse) Status() string

Status returns HTTPResponse.Status

func (ProcessFileAsyncResponse) StatusCode

func (r ProcessFileAsyncResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ProcessFileFetchFormdataBody

type ProcessFileFetchFormdataBody struct {
	// Callback Callback URL to notify once processing is completed
	Callback *string `form:"callback,omitempty" json:"callback,omitempty"`

	// Location URL to fetch and analyze
	Location             *string           `form:"location,omitempty" json:"location,omitempty"`
	AdditionalProperties map[string]string `json:"-"`
}

ProcessFileFetchFormdataBody defines parameters for ProcessFileFetch.

func (ProcessFileFetchFormdataBody) Get

func (a ProcessFileFetchFormdataBody) Get(fieldName string) (value string, found bool)

Getter for additional properties for ProcessFileFetchFormdataBody. Returns the specified element and whether it was found

func (ProcessFileFetchFormdataBody) MarshalJSON

func (a ProcessFileFetchFormdataBody) MarshalJSON() ([]byte, error)

Override default JSON handling for ProcessFileFetchFormdataBody to handle AdditionalProperties

func (*ProcessFileFetchFormdataBody) Set

func (a *ProcessFileFetchFormdataBody) Set(fieldName string, value string)

Setter for additional properties for ProcessFileFetchFormdataBody

func (*ProcessFileFetchFormdataBody) UnmarshalJSON

func (a *ProcessFileFetchFormdataBody) UnmarshalJSON(b []byte) error

Override default JSON handling for ProcessFileFetchFormdataBody to handle AdditionalProperties

type ProcessFileFetchFormdataRequestBody

type ProcessFileFetchFormdataRequestBody ProcessFileFetchFormdataBody

ProcessFileFetchFormdataRequestBody defines body for ProcessFileFetch for application/x-www-form-urlencoded ContentType.

type ProcessFileFetchResponse

type ProcessFileFetchResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON202      *ProcessingPendingResponse
	JSON400      *ErrorResponse
	JSON401      *N401
}

func ParseProcessFileFetchResponse

func ParseProcessFileFetchResponse(rsp *http.Response) (*ProcessFileFetchResponse, error)

ParseProcessFileFetchResponse parses an HTTP response from a ProcessFileFetchWithResponse call

func (ProcessFileFetchResponse) Status

func (r ProcessFileFetchResponse) Status() string

Status returns HTTPResponse.Status

func (ProcessFileFetchResponse) StatusCode

func (r ProcessFileFetchResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ProcessFileMultipartBody

type ProcessFileMultipartBody struct {
	// File File to analyze
	File openapi_types.File `json:"file"`

	// Location URL to fetch and analyze
	Location string             `json:"location"`
	Metadata *map[string]string `json:"metadata,omitempty"`
}

ProcessFileMultipartBody defines parameters for ProcessFile.

type ProcessFileMultipartRequestBody

type ProcessFileMultipartRequestBody ProcessFileMultipartBody

ProcessFileMultipartRequestBody defines body for ProcessFile for multipart/form-data ContentType.

type ProcessFileResponse

type ProcessFileResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *ProcessingResponse
	JSON400      *ErrorResponse
	JSON401      *N401
	JSON403      *ErrorResponse
	JSON413      *ErrorResponse
}

func ParseProcessFileResponse

func ParseProcessFileResponse(rsp *http.Response) (*ProcessFileResponse, error)

ParseProcessFileResponse parses an HTTP response from a ProcessFileWithResponse call

func (ProcessFileResponse) Status

func (r ProcessFileResponse) Status() string

Status returns HTTPResponse.Status

func (ProcessFileResponse) StatusCode

func (r ProcessFileResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ProcessingPendingResponse

type ProcessingPendingResponse struct {
	// Id This result unique identifier, should be used to retried the result of the analysis
	Id *string `json:"id,omitempty"`
}

ProcessingPendingResponse Entity representation of a pending content analysis

type ProcessingResponse

type ProcessingResponse struct {
	// Checksum The SHA1 digest of the content processed
	Checksum *string `json:"checksum"`

	// ContentLength The length in bytes of the content processed
	ContentLength *float32 `json:"content_length"`

	// ContentType The media type of the content processed
	ContentType *string `json:"content_type"`

	// CreationDate ISO8601 time stamp of when the content was processed
	CreationDate *string `json:"creation_date"`

	// Error If an error occurred during processing this field will contain the error message. Please note that this field is only
	// present if an error occurred during processing.
	Error *string `json:"error"`

	// Findings These are the labels/findings identified by our detection engines using a dot notation for hierarchies, for
	// example: content.malicious.foo or content.malicious.bar. Please note that the actual findings will vary based
	// on the content type and the detection engines enabled for your API key.
	// As of this API version common content hierarchies include:
	//
	// * content.malicious.{{name}} - malicious content like malware and spam
	// * content.images.nsfw.{{name}} - unsafe image
	// * content.{{ISO_3166-1_alpha-2 country code}}.language.nsfw - unsafe language
	//
	// A empty findings array means that no findings were identified for the content processed and it should be considered *safe*.
	Findings *[]string `json:"findings"`

	// Id This result unique identifier, should be used to retried the result of the analysis
	Id       *string            `json:"id,omitempty"`
	Metadata *map[string]string `json:"metadata"`
}

ProcessingResponse Entity representation the result of a file analysis. Please note that this entity is only returned for synchronous requests. For asynchronous requests please refer to the [Files](#tag/Files) resource.

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error

func (e *RequiredParamError) Error() string

type RetrieveFileResponse

type RetrieveFileResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ProcessingResponse
	JSON401      *N401
}

func ParseRetrieveFileResponse

func ParseRetrieveFileResponse(rsp *http.Response) (*RetrieveFileResponse, error)

ParseRetrieveFileResponse parses an HTTP response from a RetrieveFileWithResponse call

func (RetrieveFileResponse) Status

func (r RetrieveFileResponse) Status() string

Status returns HTTPResponse.Status

func (RetrieveFileResponse) StatusCode

func (r RetrieveFileResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RetrieveTokenResponse

type RetrieveTokenResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *AuthToken
	JSON401      *N401
}

func ParseRetrieveTokenResponse

func ParseRetrieveTokenResponse(rsp *http.Response) (*RetrieveTokenResponse, error)

ParseRetrieveTokenResponse parses an HTTP response from a RetrieveTokenWithResponse call

func (RetrieveTokenResponse) Status

func (r RetrieveTokenResponse) Status() string

Status returns HTTPResponse.Status

func (RetrieveTokenResponse) StatusCode

func (r RetrieveTokenResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ServerInterface

type ServerInterface interface {
	// Retrieves account related information
	// (GET /account.json)
	Account(w http.ResponseWriter, r *http.Request)
	// Creates a temporary authentication token
	// (POST /auth/tokens)
	CreateToken(w http.ResponseWriter, r *http.Request)
	// Deletes a previously created temporary authentication token
	// (DELETE /auth/tokens/{id})
	DeleteToken(w http.ResponseWriter, r *http.Request, id string)
	// Retrieves a previously created temporary authentication token
	// (GET /auth/tokens/{id})
	RetrieveToken(w http.ResponseWriter, r *http.Request, id string)
	// Submits content for processing
	// (POST /files)
	ProcessFile(w http.ResponseWriter, r *http.Request)
	// Submits content for processing asynchronously
	// (POST /files/async)
	ProcessFileAsync(w http.ResponseWriter, r *http.Request)
	// Submits a URL for processing asynchronously
	// (POST /files/fetch)
	ProcessFileFetch(w http.ResponseWriter, r *http.Request)
	// Retrieves a previously created processing result
	// (GET /files/{id})
	RetrieveFile(w http.ResponseWriter, r *http.Request, id string)
	// Test endpoint
	// (GET /ping)
	Ping(w http.ResponseWriter, r *http.Request)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) Account

Account operation middleware

func (*ServerInterfaceWrapper) CreateToken

func (siw *ServerInterfaceWrapper) CreateToken(w http.ResponseWriter, r *http.Request)

CreateToken operation middleware

func (*ServerInterfaceWrapper) DeleteToken

func (siw *ServerInterfaceWrapper) DeleteToken(w http.ResponseWriter, r *http.Request)

DeleteToken operation middleware

func (*ServerInterfaceWrapper) Ping

Ping operation middleware

func (*ServerInterfaceWrapper) ProcessFile

func (siw *ServerInterfaceWrapper) ProcessFile(w http.ResponseWriter, r *http.Request)

ProcessFile operation middleware

func (*ServerInterfaceWrapper) ProcessFileAsync

func (siw *ServerInterfaceWrapper) ProcessFileAsync(w http.ResponseWriter, r *http.Request)

ProcessFileAsync operation middleware

func (*ServerInterfaceWrapper) ProcessFileFetch

func (siw *ServerInterfaceWrapper) ProcessFileFetch(w http.ResponseWriter, r *http.Request)

ProcessFileFetch operation middleware

func (*ServerInterfaceWrapper) RetrieveFile

func (siw *ServerInterfaceWrapper) RetrieveFile(w http.ResponseWriter, r *http.Request)

RetrieveFile operation middleware

func (*ServerInterfaceWrapper) RetrieveToken

func (siw *ServerInterfaceWrapper) RetrieveToken(w http.ResponseWriter, r *http.Request)

RetrieveToken operation middleware

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type Unimplemented

type Unimplemented struct{}

func (Unimplemented) Account

func (_ Unimplemented) Account(w http.ResponseWriter, r *http.Request)

Retrieves account related information (GET /account.json)

func (Unimplemented) CreateToken

func (_ Unimplemented) CreateToken(w http.ResponseWriter, r *http.Request)

Creates a temporary authentication token (POST /auth/tokens)

func (Unimplemented) DeleteToken

func (_ Unimplemented) DeleteToken(w http.ResponseWriter, r *http.Request, id string)

Deletes a previously created temporary authentication token (DELETE /auth/tokens/{id})

func (Unimplemented) Ping

Test endpoint (GET /ping)

func (Unimplemented) ProcessFile

func (_ Unimplemented) ProcessFile(w http.ResponseWriter, r *http.Request)

Submits content for processing (POST /files)

func (Unimplemented) ProcessFileAsync

func (_ Unimplemented) ProcessFileAsync(w http.ResponseWriter, r *http.Request)

Submits content for processing asynchronously (POST /files/async)

func (Unimplemented) ProcessFileFetch

func (_ Unimplemented) ProcessFileFetch(w http.ResponseWriter, r *http.Request)

Submits a URL for processing asynchronously (POST /files/fetch)

func (Unimplemented) RetrieveFile

func (_ Unimplemented) RetrieveFile(w http.ResponseWriter, r *http.Request, id string)

Retrieves a previously created processing result (GET /files/{id})

func (Unimplemented) RetrieveToken

func (_ Unimplemented) RetrieveToken(w http.ResponseWriter, r *http.Request, id string)

Retrieves a previously created temporary authentication token (GET /auth/tokens/{id})

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

type User

type User struct {
	CreationDate *string `json:"creation_date,omitempty"`
	LastLogin    *string `json:"last_login,omitempty"`
}

User defines model for User.

Jump to

Keyboard shortcuts

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