esg

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 esg 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 NewPostDetectEsgSentimentLanguageRequest

func NewPostDetectEsgSentimentLanguageRequest(server string, language string, body PostDetectEsgSentimentLanguageJSONRequestBody) (*http.Request, error)

NewPostDetectEsgSentimentLanguageRequest calls the generic PostDetectEsgSentimentLanguage builder with application/json body

func NewPostDetectEsgSentimentLanguageRequestWithBody

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

NewPostDetectEsgSentimentLanguageRequestWithBody generates requests for PostDetectEsgSentimentLanguage with any type of body

Types

type AnalysisRequest

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

Request

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

func (c *Client) PostDetectEsgSentimentLanguage(ctx context.Context, language string, body PostDetectEsgSentimentLanguageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostDetectEsgSentimentLanguageWithBody

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

type ClientInterface

type ClientInterface interface {
	// PostDetectEsgSentimentLanguage request with any body
	PostDetectEsgSentimentLanguageWithBody(ctx context.Context, language string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostDetectEsgSentimentLanguage(ctx context.Context, language string, body PostDetectEsgSentimentLanguageJSONRequestBody, 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) PostDetectEsgSentimentLanguageWithBodyWithResponse

func (c *ClientWithResponses) PostDetectEsgSentimentLanguageWithBodyWithResponse(ctx context.Context, language string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostDetectEsgSentimentLanguageResponse, error)

PostDetectEsgSentimentLanguageWithBodyWithResponse request with arbitrary body returning *PostDetectEsgSentimentLanguageResponse

func (*ClientWithResponses) PostDetectEsgSentimentLanguageWithResponse

func (c *ClientWithResponses) PostDetectEsgSentimentLanguageWithResponse(ctx context.Context, language string, body PostDetectEsgSentimentLanguageJSONRequestBody, reqEditors ...RequestEditorFn) (*PostDetectEsgSentimentLanguageResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// PostDetectEsgSentimentLanguage request with any body
	PostDetectEsgSentimentLanguageWithBodyWithResponse(ctx context.Context, language string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostDetectEsgSentimentLanguageResponse, error)

	PostDetectEsgSentimentLanguageWithResponse(ctx context.Context, language string, body PostDetectEsgSentimentLanguageJSONRequestBody, reqEditors ...RequestEditorFn) (*PostDetectEsgSentimentLanguageResponse, 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 ESGSentimentDetectDocument

type ESGSentimentDetectDocument struct {
	// ESG categories with sentiment connotation, for example: 'Environment/Positive/Waste and Emissions Management' or 'Governance/Negative/Legal Compliance'"
	Categories *[]Category `json:"categories,omitempty"`

	// Extractions of entities with ESG data and overall ESG sentiment scores. For example: 'entity=Acme Ltd., pollution_reduced=25%' or 'environment_performance_score=365'.
	Extractions *[]Extraction `json:"extractions,omitempty"`

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

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

Information detection data

type ESGSentimentDetectResponse

type ESGSentimentDetectResponse struct {
	// Information detection data
	Data *ESGSentimentDetectDocument `json:"data,omitempty"`

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

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

ESG Sentiment detection resource response

type Extraction

type Extraction struct {
	// Extraction record fields
	Fields *[]struct {
		// Field name
		Name *string `json:"name,omitempty"`

		// Positions of parts of the text corresponding to the field value
		Positions *[]DocumentPosition `json:"positions,omitempty"`

		// Field value
		Value *string `json:"value,omitempty"`
	} `json:"fields,omitempty"`

	// Software package name
	Namespace *string `json:"namespace,omitempty"`

	// Extraction record template
	Template *string `json:"template,omitempty"`
}

Extraction record

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type PostDetectEsgSentimentLanguageJSONBody

type PostDetectEsgSentimentLanguageJSONBody = AnalysisRequest

PostDetectEsgSentimentLanguageJSONBody defines parameters for PostDetectEsgSentimentLanguage.

type PostDetectEsgSentimentLanguageJSONRequestBody

type PostDetectEsgSentimentLanguageJSONRequestBody = PostDetectEsgSentimentLanguageJSONBody

PostDetectEsgSentimentLanguageJSONRequestBody defines body for PostDetectEsgSentimentLanguage for application/json ContentType.

type PostDetectEsgSentimentLanguageResponse

type PostDetectEsgSentimentLanguageResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ESGSentimentDetectResponse
}

func ParsePostDetectEsgSentimentLanguageResponse

func ParsePostDetectEsgSentimentLanguageResponse(rsp *http.Response) (*PostDetectEsgSentimentLanguageResponse, error)

ParsePostDetectEsgSentimentLanguageResponse parses an HTTP response from a PostDetectEsgSentimentLanguageWithResponse call

func (PostDetectEsgSentimentLanguageResponse) Status

Status returns HTTPResponse.Status

func (PostDetectEsgSentimentLanguageResponse) 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