emotions

package
v0.0.0-...-5d5b006 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

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

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

Index

Constants

View Source
const (
	BearerAuthScopes = "bearerAuth.Scopes"
)

Variables

This section is empty.

Functions

func NewPostCategorizeEmotionalTraitsLanguageRequest

NewPostCategorizeEmotionalTraitsLanguageRequest calls the generic PostCategorizeEmotionalTraitsLanguage builder with application/json body

func NewPostCategorizeEmotionalTraitsLanguageRequestWithBody

func NewPostCategorizeEmotionalTraitsLanguageRequestWithBody(server string, language PostCategorizeEmotionalTraitsLanguageParamsLanguage, params *PostCategorizeEmotionalTraitsLanguageParams, contentType string, body io.Reader) (*http.Request, error)

NewPostCategorizeEmotionalTraitsLanguageRequestWithBody generates requests for PostCategorizeEmotionalTraitsLanguage with any type of body

Types

type AnalysisRequest

type AnalysisRequest struct {
	// Document
	Document *Document `json:"document,omitempty"`
}

Request

type CategorizeDocument

type CategorizeDocument struct {
	// Categories
	Categories *[]Category `json:"categories,omitempty"`

	// Extra-data containing main groups
	ExtraData *struct {
		// Main groups
		Groups *[]Group `json:"groups,omitempty"`
	} `json:"extraData,omitempty"`

	// Text language
	Language *string `json:"language,omitempty"`

	// Service version
	Version *string `json:"version,omitempty"`
}

Categorization data

type CategorizeResponse

type CategorizeResponse struct {
	// Categorization data
	Data *CategorizeDocument `json:"data,omitempty"`

	// Service errors
	Errors *[]ServiceError `json:"errors,omitempty"`

	// Operation completed successfully (true/false)
	Success *bool `json:"success,omitempty"`
}

Classification resource response

type Category

type Category struct {
	// Score expressed as a percentage of the sum of the scores of all the candidate categories, winners and not (see the **score** property)
	Frequency *float32 `json:"frequency,omitempty"`

	// Hierarchical path
	Hierarchy *[]string `json:"hierarchy,omitempty"`

	// Category ID
	Id *string `json:"id,omitempty"`

	// Category label
	Label *string `json:"label,omitempty"`

	// Name of the software package containing the reference taxonomy
	Namespace *string `json:"namespace,omitempty"`

	// Positions of the portions of text that contributed to the selection of the category
	Positions *[]DocumentPosition `json:"positions,omitempty"`

	// Score assigned to the category to represent its relevance
	Score *int32 `json:"score,omitempty"`

	// True if the category is deemed particularly relevant
	Winner *bool `json:"winner,omitempty"`
}

Category

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

func (c *Client) PostCategorizeEmotionalTraitsLanguageWithBody(ctx context.Context, language PostCategorizeEmotionalTraitsLanguageParamsLanguage, params *PostCategorizeEmotionalTraitsLanguageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// PostCategorizeEmotionalTraitsLanguage request with any body
	PostCategorizeEmotionalTraitsLanguageWithBody(ctx context.Context, language PostCategorizeEmotionalTraitsLanguageParamsLanguage, params *PostCategorizeEmotionalTraitsLanguageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostCategorizeEmotionalTraitsLanguage(ctx context.Context, language PostCategorizeEmotionalTraitsLanguageParamsLanguage, params *PostCategorizeEmotionalTraitsLanguageParams, body PostCategorizeEmotionalTraitsLanguageJSONRequestBody, 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) PostCategorizeEmotionalTraitsLanguageWithBodyWithResponse

func (c *ClientWithResponses) PostCategorizeEmotionalTraitsLanguageWithBodyWithResponse(ctx context.Context, language PostCategorizeEmotionalTraitsLanguageParamsLanguage, params *PostCategorizeEmotionalTraitsLanguageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostCategorizeEmotionalTraitsLanguageResponse, error)

PostCategorizeEmotionalTraitsLanguageWithBodyWithResponse request with arbitrary body returning *PostCategorizeEmotionalTraitsLanguageResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// PostCategorizeEmotionalTraitsLanguage request with any body
	PostCategorizeEmotionalTraitsLanguageWithBodyWithResponse(ctx context.Context, language PostCategorizeEmotionalTraitsLanguageParamsLanguage, params *PostCategorizeEmotionalTraitsLanguageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostCategorizeEmotionalTraitsLanguageResponse, error)

	PostCategorizeEmotionalTraitsLanguageWithResponse(ctx context.Context, language PostCategorizeEmotionalTraitsLanguageParamsLanguage, params *PostCategorizeEmotionalTraitsLanguageParams, body PostCategorizeEmotionalTraitsLanguageJSONRequestBody, reqEditors ...RequestEditorFn) (*PostCategorizeEmotionalTraitsLanguageResponse, error)
}

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

type Document

type Document struct {
	// The document's text
	Text *string `json:"text,omitempty"`
}

Document

type DocumentPosition

type DocumentPosition struct {
	// Zero-based position of the character after the last
	End *int64 `json:"end,omitempty"`

	// Zero-based position of the first character
	Start *int64 `json:"start,omitempty"`
}

Position

type Group

type Group struct {
	// ID of the category corresponding to the group inside the taxonomy
	Id *string `json:"id,omitempty"`

	// Label of the category corresponding to the group inside the taxonomy
	Label *string `json:"label,omitempty"`

	// Group rank
	Position *int32 `json:"position,omitempty"`
}

Group of emotional traits

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type PostCategorizeEmotionalTraitsLanguageJSONBody

type PostCategorizeEmotionalTraitsLanguageJSONBody = AnalysisRequest

PostCategorizeEmotionalTraitsLanguageJSONBody defines parameters for PostCategorizeEmotionalTraitsLanguage.

type PostCategorizeEmotionalTraitsLanguageJSONRequestBody

type PostCategorizeEmotionalTraitsLanguageJSONRequestBody = PostCategorizeEmotionalTraitsLanguageJSONBody

PostCategorizeEmotionalTraitsLanguageJSONRequestBody defines body for PostCategorizeEmotionalTraitsLanguage for application/json ContentType.

type PostCategorizeEmotionalTraitsLanguageParams

type PostCategorizeEmotionalTraitsLanguageParams struct {
	// Classification features, specify `extradata` to obtain main groups
	Features PostCategorizeEmotionalTraitsLanguageParamsFeatures `form:"features" json:"features"`
}

PostCategorizeEmotionalTraitsLanguageParams defines parameters for PostCategorizeEmotionalTraitsLanguage.

type PostCategorizeEmotionalTraitsLanguageParamsFeatures

type PostCategorizeEmotionalTraitsLanguageParamsFeatures string

PostCategorizeEmotionalTraitsLanguageParamsFeatures defines parameters for PostCategorizeEmotionalTraitsLanguage.

type PostCategorizeEmotionalTraitsLanguageParamsLanguage

type PostCategorizeEmotionalTraitsLanguageParamsLanguage string

PostCategorizeEmotionalTraitsLanguageParamsLanguage defines parameters for PostCategorizeEmotionalTraitsLanguage.

type PostCategorizeEmotionalTraitsLanguageResponse

type PostCategorizeEmotionalTraitsLanguageResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *CategorizeResponse
}

func ParsePostCategorizeEmotionalTraitsLanguageResponse

func ParsePostCategorizeEmotionalTraitsLanguageResponse(rsp *http.Response) (*PostCategorizeEmotionalTraitsLanguageResponse, error)

ParsePostCategorizeEmotionalTraitsLanguageResponse parses an HTTP response from a PostCategorizeEmotionalTraitsLanguageWithResponse call

func (PostCategorizeEmotionalTraitsLanguageResponse) Status

Status returns HTTPResponse.Status

func (PostCategorizeEmotionalTraitsLanguageResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type ServiceError

type ServiceError struct {
	// Error code
	Code *string `json:"code,omitempty"`

	// Error message
	Message *string `json:"message,omitempty"`
}

Error information

Jump to

Keyboard shortcuts

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