translatortext

package
v64.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package translatortext implements the Azure ARM Translatortext service API version v1.0-preview.1.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UserAgent

func UserAgent() string

UserAgent returns the UserAgent string to use when sending http.Requests.

func Version

func Version() string

Version returns the semantic version (see http://semver.org) of the client.

Types

type BaseClient

type BaseClient struct {
	autorest.Client
}

BaseClient is the base client for Translatortext.

func New

func New() BaseClient

New creates an instance of the BaseClient client.

func NewWithoutDefaults

func NewWithoutDefaults() BaseClient

NewWithoutDefaults creates an instance of the BaseClient client.

type BatchRequest

type BatchRequest struct {
	Source *SourceInput `json:"source,omitempty"`
	// Targets - Location of the destination for the output
	Targets *[]TargetInput `json:"targets,omitempty"`
	// StorageType - Possible values include: 'Folder', 'File'
	StorageType StorageType `json:"storageType,omitempty"`
}

BatchRequest definition for the input batch translation request

type BatchStatusDetail

type BatchStatusDetail struct {
	autorest.Response `json:"-"`
	// ID - Id of the operation.
	ID *uuid.UUID `json:"id,omitempty"`
	// CreatedDateTimeUtc - Operation created date time
	CreatedDateTimeUtc *date.Time `json:"createdDateTimeUtc,omitempty"`
	// LastActionDateTimeUtc - Date time in which the operation's status has been updated
	LastActionDateTimeUtc *date.Time `json:"lastActionDateTimeUtc,omitempty"`
	// Status - Possible values include: 'NotStarted', 'Running', 'Succeeded', 'Failed', 'Cancelled', 'Cancelling'
	Status  Status         `json:"status,omitempty"`
	Summary *StatusSummary `json:"summary,omitempty"`
}

BatchStatusDetail job status response

type BatchStatusResponse

type BatchStatusResponse struct {
	autorest.Response `json:"-"`
	// Value - The summary status of individual operation
	Value *[]BatchStatusDetail `json:"value,omitempty"`
	// NextLink - Url for the next page.  Null if no more pages available
	NextLink *string `json:"@nextLink,omitempty"`
}

BatchStatusResponse document Status Response

type BatchSubmissionRequest

type BatchSubmissionRequest struct {
	// Inputs - The input list of documents or folders containing documents
	Inputs *[]BatchRequest `json:"inputs,omitempty"`
}

BatchSubmissionRequest job submission batch request

type Code

type Code string

Code enumerates the values for code.

const (
	// InternalServerError ...
	InternalServerError Code = "InternalServerError"
	// InvalidArgument ...
	InvalidArgument Code = "InvalidArgument"
	// InvalidRequest ...
	InvalidRequest Code = "InvalidRequest"
	// RequestRateTooHigh ...
	RequestRateTooHigh Code = "RequestRateTooHigh"
	// ResourceNotFound ...
	ResourceNotFound Code = "ResourceNotFound"
	// ServiceUnavailable ...
	ServiceUnavailable Code = "ServiceUnavailable"
	// Unauthorized ...
	Unauthorized Code = "Unauthorized"
)

func PossibleCodeValues

func PossibleCodeValues() []Code

PossibleCodeValues returns an array of possible values for the Code const type.

type DocumentFilter

type DocumentFilter struct {
	// Prefix - A case-sensitive prefix string to filter documents in the source path for translation.
	// For example, when using a Azure storage blob Uri, use the prefix to restrict sub folders for translation.
	Prefix *string `json:"prefix,omitempty"`
	// Suffix - A case-sensitive suffix string to filter documents in the source path for translation.
	// This is most often use for file extensions
	Suffix *string `json:"suffix,omitempty"`
}

DocumentFilter ...

type DocumentStatusDetail

type DocumentStatusDetail struct {
	autorest.Response `json:"-"`
	// Path - Location of the document or folder
	Path *string `json:"path,omitempty"`
	// CreatedDateTimeUtc - Operation created date time
	CreatedDateTimeUtc *date.Time `json:"createdDateTimeUtc,omitempty"`
	// LastActionDateTimeUtc - Date time in which the operation's status has been updated
	LastActionDateTimeUtc *date.Time `json:"lastActionDateTimeUtc,omitempty"`
	// Status - Possible values include: 'Status1NotStarted', 'Status1Running', 'Status1Succeeded', 'Status1Failed', 'Status1Cancelled', 'Status1Cancelling'
	Status Status1 `json:"status,omitempty"`
	// DetectedLanguage - Detected language of the original document (to be implemented)
	DetectedLanguage *string `json:"detectedLanguage,omitempty"`
	// To - To language
	To    *string  `json:"to,omitempty"`
	Error *ErrorV2 `json:"error,omitempty"`
	// Progress - Progress of the translation if available
	Progress *float64 `json:"progress,omitempty"`
	// ID - Document Id
	ID *uuid.UUID `json:"id,omitempty"`
}

DocumentStatusDetail ...

type DocumentStatusResponse

type DocumentStatusResponse struct {
	autorest.Response `json:"-"`
	// Value - The detail status of individual documents
	Value *[]DocumentStatusDetail `json:"value,omitempty"`
	// NextLink - Url for the next page.  Null if no more pages available
	NextLink *string `json:"@nextLink,omitempty"`
}

DocumentStatusResponse document Status Response

type ErrorResponseV2

type ErrorResponseV2 struct {
	Error *ErrorV2 `json:"error,omitempty"`
}

ErrorResponseV2 contains unified error information used for HTTP responses across any Cognitive Service. Instances can be created either through Microsoft.CloudAI.Containers.HttpStatusExceptionV2 or by returning it directly from a controller.

type ErrorV2

type ErrorV2 struct {
	// Code - Possible values include: 'InvalidRequest', 'InvalidArgument', 'InternalServerError', 'ServiceUnavailable', 'ResourceNotFound', 'Unauthorized', 'RequestRateTooHigh'
	Code Code `json:"code,omitempty"`
	// Message - READ-ONLY; Gets high level error message.
	Message *string `json:"message,omitempty"`
	// Target - READ-ONLY; Gets the source of the error.
	// For example it would be "documents" or "document id" in case of invalid document.
	Target     *string       `json:"target,omitempty"`
	InnerError *InnerErrorV2 `json:"innerError,omitempty"`
}

ErrorV2 this contains an outer error with error code, message, details, target and an inner error with more descriptive details.

func (ErrorV2) MarshalJSON

func (ev ErrorV2) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for ErrorV2.

type FileFormat

type FileFormat struct {
	// Format - Name of the format
	Format *string `json:"format,omitempty"`
	// FileExtensions - Supported file extension for this format
	FileExtensions *[]string `json:"fileExtensions,omitempty"`
	// ContentTypes - Supported Content-Types for this format
	ContentTypes *[]string `json:"contentTypes,omitempty"`
	// Versions - Supported Version
	Versions *[]string `json:"versions,omitempty"`
}

FileFormat ...

type FileFormatListResult

type FileFormatListResult struct {
	autorest.Response `json:"-"`
	// Value - list of objects
	Value *[]FileFormat `json:"value,omitempty"`
}

FileFormatListResult base type for List return in our api

type Glossary

type Glossary struct {
	// GlossaryURL - Location of the glossary.
	// We will use the file extension to extract the formating if the format parameter is not supplied.
	//
	// If the translation language pair is not present in the glossary, it will not be applied
	GlossaryURL *string `json:"glossaryUrl,omitempty"`
	// Format - Format
	Format *string `json:"format,omitempty"`
	// Version - Version
	Version *string `json:"version,omitempty"`
}

Glossary glossary / translation memory for the request

type InnerErrorV2

type InnerErrorV2 struct {
	// Code - READ-ONLY; Gets detailed error code.
	Code *int32 `json:"code,omitempty"`
	// Error - READ-ONLY; Gets detailed error string.
	Error *string `json:"error,omitempty"`
	// Message - READ-ONLY; Gets high level error message.
	Message *string `json:"message,omitempty"`
	// Target - READ-ONLY; Gets the source of the error.
	// For example it would be "documents" or "document id" in case of invalid document.
	Target     *string       `json:"target,omitempty"`
	InnerError *InnerErrorV2 `json:"innerError,omitempty"`
}

InnerErrorV2 new Inner Error format which conforms to Cognitive Services API Guidelines which is available at https://microsoft.sharepoint.com/%3Aw%3A/t/CognitiveServicesPMO/EUoytcrjuJdKpeOKIK_QRC8BPtUYQpKBi8JsWyeDMRsWlQ?e=CPq8ow. This contains required properties ErrorCode, message and optional properties target, details(key value pair), inner error(this can be nested).

func (InnerErrorV2) MarshalJSON

func (iev InnerErrorV2) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for InnerErrorV2.

type SourceInput

type SourceInput struct {
	// SourceURL - Location of the folder / container or single file with your documents
	SourceURL *string         `json:"sourceUrl,omitempty"`
	Filter    *DocumentFilter `json:"filter,omitempty"`
	// Language - Language code
	// If none is specified, we will perform auto detect on the document
	Language *string `json:"language,omitempty"`
	// StorageSource - Possible values include: 'AzureBlob'
	StorageSource StorageSource `json:"storageSource,omitempty"`
}

SourceInput source of the input documents

type Status

type Status string

Status enumerates the values for status.

const (
	// Cancelled ...
	Cancelled Status = "Cancelled"
	// Cancelling ...
	Cancelling Status = "Cancelling"
	// Failed ...
	Failed Status = "Failed"
	// NotStarted ...
	NotStarted Status = "NotStarted"
	// Running ...
	Running Status = "Running"
	// Succeeded ...
	Succeeded Status = "Succeeded"
)

func PossibleStatusValues

func PossibleStatusValues() []Status

PossibleStatusValues returns an array of possible values for the Status const type.

type Status1

type Status1 string

Status1 enumerates the values for status 1.

const (
	// Status1Cancelled ...
	Status1Cancelled Status1 = "Cancelled"
	// Status1Cancelling ...
	Status1Cancelling Status1 = "Cancelling"
	// Status1Failed ...
	Status1Failed Status1 = "Failed"
	// Status1NotStarted ...
	Status1NotStarted Status1 = "NotStarted"
	// Status1Running ...
	Status1Running Status1 = "Running"
	// Status1Succeeded ...
	Status1Succeeded Status1 = "Succeeded"
)

func PossibleStatus1Values

func PossibleStatus1Values() []Status1

PossibleStatus1Values returns an array of possible values for the Status1 const type.

type StatusSummary

type StatusSummary struct {
	// Total - Total count
	Total *int32 `json:"total,omitempty"`
	// Failed - Failed count
	Failed *int32 `json:"failed,omitempty"`
	// Success - Number of Success
	Success *int32 `json:"success,omitempty"`
	// InProgress - Number of in progress
	InProgress *int32 `json:"inProgress,omitempty"`
	// NotYetStarted - Count of not yet started
	NotYetStarted *int32 `json:"notYetStarted,omitempty"`
	// Cancelled - Number of cancelled
	Cancelled *int32 `json:"cancelled,omitempty"`
}

StatusSummary ...

type StorageSource

type StorageSource string

StorageSource enumerates the values for storage source.

const (
	// AzureBlob ...
	AzureBlob StorageSource = "AzureBlob"
)

func PossibleStorageSourceValues

func PossibleStorageSourceValues() []StorageSource

PossibleStorageSourceValues returns an array of possible values for the StorageSource const type.

type StorageSource1

type StorageSource1 string

StorageSource1 enumerates the values for storage source 1.

const (
	// StorageSource1AzureBlob ...
	StorageSource1AzureBlob StorageSource1 = "AzureBlob"
)

func PossibleStorageSource1Values

func PossibleStorageSource1Values() []StorageSource1

PossibleStorageSource1Values returns an array of possible values for the StorageSource1 const type.

type StorageSourceListResult

type StorageSourceListResult struct {
	autorest.Response `json:"-"`
	// Value - list of objects
	Value *[]string `json:"value,omitempty"`
}

StorageSourceListResult base type for List return in our api

type StorageType

type StorageType string

StorageType enumerates the values for storage type.

const (
	// File ...
	File StorageType = "File"
	// Folder ...
	Folder StorageType = "Folder"
)

func PossibleStorageTypeValues

func PossibleStorageTypeValues() []StorageType

PossibleStorageTypeValues returns an array of possible values for the StorageType const type.

type TargetInput

type TargetInput struct {
	// TargetURL - Location of the folder / container with your documents
	TargetURL *string `json:"targetUrl,omitempty"`
	// Category - Category / custom system for translation request
	Category *string `json:"category,omitempty"`
	// Language - Target Language
	Language *string `json:"language,omitempty"`
	// Glossaries - List of Glossary
	Glossaries *[]Glossary `json:"glossaries,omitempty"`
	// StorageSource - Possible values include: 'StorageSource1AzureBlob'
	StorageSource StorageSource1 `json:"storageSource,omitempty"`
}

TargetInput destination for the finished translated documents

type TranslationClient

type TranslationClient struct {
	BaseClient
}

TranslationClient is the client for the Translation methods of the Translatortext service.

func NewTranslationClient

func NewTranslationClient() TranslationClient

NewTranslationClient creates an instance of the TranslationClient client.

func (TranslationClient) CancelOperation

func (client TranslationClient) CancelOperation(ctx context.Context, endpoint string, ID uuid.UUID) (result BatchStatusDetail, err error)

CancelOperation cancel a currently processing or queued operation. An operation will not be cancelled if it is already completed or failed or cancelling. A bad request will be returned. All documents that have completed translation will not be cancelled and will be charged. All pending documents will be cancelled if possible. Parameters: endpoint - supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). ID - format - uuid. The operation-id

func (TranslationClient) CancelOperationPreparer

func (client TranslationClient) CancelOperationPreparer(ctx context.Context, endpoint string, ID uuid.UUID) (*http.Request, error)

CancelOperationPreparer prepares the CancelOperation request.

func (TranslationClient) CancelOperationResponder

func (client TranslationClient) CancelOperationResponder(resp *http.Response) (result BatchStatusDetail, err error)

CancelOperationResponder handles the response to the CancelOperation request. The method always closes the http.Response Body.

func (TranslationClient) CancelOperationSender

func (client TranslationClient) CancelOperationSender(req *http.Request) (*http.Response, error)

CancelOperationSender sends the CancelOperation request. The method will close the http.Response Body if it receives an error.

func (TranslationClient) GetDocumentFormats

func (client TranslationClient) GetDocumentFormats(ctx context.Context, endpoint string) (result FileFormatListResult, err error)

GetDocumentFormats the list of supported document formats supported by our service. The list will include the common file extension used and supported as well as the content-type if using the upload API. Parameters: endpoint - supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).

func (TranslationClient) GetDocumentFormatsPreparer

func (client TranslationClient) GetDocumentFormatsPreparer(ctx context.Context, endpoint string) (*http.Request, error)

GetDocumentFormatsPreparer prepares the GetDocumentFormats request.

func (TranslationClient) GetDocumentFormatsResponder

func (client TranslationClient) GetDocumentFormatsResponder(resp *http.Response) (result FileFormatListResult, err error)

GetDocumentFormatsResponder handles the response to the GetDocumentFormats request. The method always closes the http.Response Body.

func (TranslationClient) GetDocumentFormatsSender

func (client TranslationClient) GetDocumentFormatsSender(req *http.Request) (*http.Response, error)

GetDocumentFormatsSender sends the GetDocumentFormats request. The method will close the http.Response Body if it receives an error.

func (TranslationClient) GetDocumentStatus

func (client TranslationClient) GetDocumentStatus(ctx context.Context, endpoint string, ID uuid.UUID, documentID uuid.UUID) (result DocumentStatusDetail, err error)

GetDocumentStatus returns the status of the translation of the document. Parameters: endpoint - supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). ID - format - uuid. The batch id documentID - format - uuid. The document id

func (TranslationClient) GetDocumentStatusPreparer

func (client TranslationClient) GetDocumentStatusPreparer(ctx context.Context, endpoint string, ID uuid.UUID, documentID uuid.UUID) (*http.Request, error)

GetDocumentStatusPreparer prepares the GetDocumentStatus request.

func (TranslationClient) GetDocumentStatusResponder

func (client TranslationClient) GetDocumentStatusResponder(resp *http.Response) (result DocumentStatusDetail, err error)

GetDocumentStatusResponder handles the response to the GetDocumentStatus request. The method always closes the http.Response Body.

func (TranslationClient) GetDocumentStatusSender

func (client TranslationClient) GetDocumentStatusSender(req *http.Request) (*http.Response, error)

GetDocumentStatusSender sends the GetDocumentStatus request. The method will close the http.Response Body if it receives an error.

func (TranslationClient) GetDocumentStorageSource

func (client TranslationClient) GetDocumentStorageSource(ctx context.Context, endpoint string) (result StorageSourceListResult, err error)

GetDocumentStorageSource the list of storage sources supported by our service. Parameters: endpoint - supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).

func (TranslationClient) GetDocumentStorageSourcePreparer

func (client TranslationClient) GetDocumentStorageSourcePreparer(ctx context.Context, endpoint string) (*http.Request, error)

GetDocumentStorageSourcePreparer prepares the GetDocumentStorageSource request.

func (TranslationClient) GetDocumentStorageSourceResponder

func (client TranslationClient) GetDocumentStorageSourceResponder(resp *http.Response) (result StorageSourceListResult, err error)

GetDocumentStorageSourceResponder handles the response to the GetDocumentStorageSource request. The method always closes the http.Response Body.

func (TranslationClient) GetDocumentStorageSourceSender

func (client TranslationClient) GetDocumentStorageSourceSender(req *http.Request) (*http.Response, error)

GetDocumentStorageSourceSender sends the GetDocumentStorageSource request. The method will close the http.Response Body if it receives an error.

func (TranslationClient) GetGlossaryFormats

func (client TranslationClient) GetGlossaryFormats(ctx context.Context, endpoint string) (result FileFormatListResult, err error)

GetGlossaryFormats the list of supported glossary formats supported by our service. The list will include the common file extension used. Parameters: endpoint - supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).

func (TranslationClient) GetGlossaryFormatsPreparer

func (client TranslationClient) GetGlossaryFormatsPreparer(ctx context.Context, endpoint string) (*http.Request, error)

GetGlossaryFormatsPreparer prepares the GetGlossaryFormats request.

func (TranslationClient) GetGlossaryFormatsResponder

func (client TranslationClient) GetGlossaryFormatsResponder(resp *http.Response) (result FileFormatListResult, err error)

GetGlossaryFormatsResponder handles the response to the GetGlossaryFormats request. The method always closes the http.Response Body.

func (TranslationClient) GetGlossaryFormatsSender

func (client TranslationClient) GetGlossaryFormatsSender(req *http.Request) (*http.Response, error)

GetGlossaryFormatsSender sends the GetGlossaryFormats request. The method will close the http.Response Body if it receives an error.

func (TranslationClient) GetOperationDocumentsStatus

func (client TranslationClient) GetOperationDocumentsStatus(ctx context.Context, endpoint string, ID uuid.UUID, top *int32, skip *int32) (result DocumentStatusResponse, err error)

GetOperationDocumentsStatus returns the status of the list of documents translation operation by a given operation id.

The documents are sorted by the document Id

If the number of documents exceed our paging limit, server side paging will be used. Paginated responses will indicate a partial result by including a continuation token in the response. The absence of a continuation token means that no additional pages are available.

Clients MAY use $top and $skip query parameters to specify a number of results to return and an offset into the collection. The server will honor the values specified by the client; however, clients MUST be prepared to handle responses that contain a different page size or contain a continuation token. When both $top and $skip are given by a client, the server SHOULD first apply $skip and then $top on the collection. Note: If the server can't honor $top and/or $skip, the server MUST return an error to the client informing about it instead of just ignoring the query options. This will avoid the risk of the client making assumptions about the data returned. Parameters: endpoint - supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). ID - format - uuid. The operation id top - take the $top entries in the collection When both $top and $skip are supplied, $skip is applied first skip - skip the $skip entries in the collection When both $top and $skip are supplied, $skip is applied first

func (TranslationClient) GetOperationDocumentsStatusPreparer

func (client TranslationClient) GetOperationDocumentsStatusPreparer(ctx context.Context, endpoint string, ID uuid.UUID, top *int32, skip *int32) (*http.Request, error)

GetOperationDocumentsStatusPreparer prepares the GetOperationDocumentsStatus request.

func (TranslationClient) GetOperationDocumentsStatusResponder

func (client TranslationClient) GetOperationDocumentsStatusResponder(resp *http.Response) (result DocumentStatusResponse, err error)

GetOperationDocumentsStatusResponder handles the response to the GetOperationDocumentsStatus request. The method always closes the http.Response Body.

func (TranslationClient) GetOperationDocumentsStatusSender

func (client TranslationClient) GetOperationDocumentsStatusSender(req *http.Request) (*http.Response, error)

GetOperationDocumentsStatusSender sends the GetOperationDocumentsStatus request. The method will close the http.Response Body if it receives an error.

func (TranslationClient) GetOperationStatus

func (client TranslationClient) GetOperationStatus(ctx context.Context, endpoint string, ID uuid.UUID) (result BatchStatusDetail, err error)

GetOperationStatus returns the status of the translation batch operation. The status will include the overall job status as well as a summary of the current progress of all the documents being translated. Parameters: endpoint - supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). ID - format - uuid. The operation id

func (TranslationClient) GetOperationStatusPreparer

func (client TranslationClient) GetOperationStatusPreparer(ctx context.Context, endpoint string, ID uuid.UUID) (*http.Request, error)

GetOperationStatusPreparer prepares the GetOperationStatus request.

func (TranslationClient) GetOperationStatusResponder

func (client TranslationClient) GetOperationStatusResponder(resp *http.Response) (result BatchStatusDetail, err error)

GetOperationStatusResponder handles the response to the GetOperationStatus request. The method always closes the http.Response Body.

func (TranslationClient) GetOperationStatusSender

func (client TranslationClient) GetOperationStatusSender(req *http.Request) (*http.Response, error)

GetOperationStatusSender sends the GetOperationStatus request. The method will close the http.Response Body if it receives an error.

func (TranslationClient) GetOperations

func (client TranslationClient) GetOperations(ctx context.Context, endpoint string, top *int32, skip *int32) (result BatchStatusResponse, err error)

GetOperations returns the list of status of the translation batch operation. The list will consist only of the batch request submitted by the user (based on their subscription)

The operation status are sorted by the operation Id

If the number of operations exceed our paging limit, server side paging will be used. Paginated responses will indicate a partial result by including a continuation token in the response. The absence of a continuation token means that no additional pages are available.

Clients MAY use $top and $skip query parameters to specify a number of results to return and an offset into the collection. The server will honor the values specified by the client; however, clients MUST be prepared to handle responses that contain a different page size or contain a continuation token. When both $top and $skip are given by a client, the server SHOULD first apply $skip and then $top on the collection. Note: If the server can't honor $top and/or $skip, the server MUST return an error to the client informing about it instead of just ignoring the query options. This will avoid the risk of the client making assumptions about the data returned. Parameters: endpoint - supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). top - take the $top entries in the collection When both $top and $skip are supplied, $skip is applied first skip - skip the $skip entries in the collection When both $top and $skip are supplied, $skip is applied first

func (TranslationClient) GetOperationsPreparer

func (client TranslationClient) GetOperationsPreparer(ctx context.Context, endpoint string, top *int32, skip *int32) (*http.Request, error)

GetOperationsPreparer prepares the GetOperations request.

func (TranslationClient) GetOperationsResponder

func (client TranslationClient) GetOperationsResponder(resp *http.Response) (result BatchStatusResponse, err error)

GetOperationsResponder handles the response to the GetOperations request. The method always closes the http.Response Body.

func (TranslationClient) GetOperationsSender

func (client TranslationClient) GetOperationsSender(req *http.Request) (*http.Response, error)

GetOperationsSender sends the GetOperations request. The method will close the http.Response Body if it receives an error.

func (TranslationClient) SubmitBatchRequest

func (client TranslationClient) SubmitBatchRequest(ctx context.Context, endpoint string, body *BatchSubmissionRequest) (result autorest.Response, err error)

SubmitBatchRequest submit a batch request to the document translation service.

Each request can consists of multiple inputs. Each input will contains both a source and destination container for source and target language pair.

The prefix and suffix filter (if supplied) will be used to filter the folders. The prefix will be applied to the subpath after the container name

Glossaries / Translation memory can be supplied and will be applied when the document is being translated. If the glossary is invalid or unreachable during translation time. An error will be indicated in the document status.

If the file with the same name already exists in the destination, it will be overwritten. TargetUrl for each target language needs to be unique. Parameters: endpoint - supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). body - request details

func (TranslationClient) SubmitBatchRequestPreparer

func (client TranslationClient) SubmitBatchRequestPreparer(ctx context.Context, endpoint string, body *BatchSubmissionRequest) (*http.Request, error)

SubmitBatchRequestPreparer prepares the SubmitBatchRequest request.

func (TranslationClient) SubmitBatchRequestResponder

func (client TranslationClient) SubmitBatchRequestResponder(resp *http.Response) (result autorest.Response, err error)

SubmitBatchRequestResponder handles the response to the SubmitBatchRequest request. The method always closes the http.Response Body.

func (TranslationClient) SubmitBatchRequestSender

func (client TranslationClient) SubmitBatchRequestSender(req *http.Request) (*http.Response, error)

SubmitBatchRequestSender sends the SubmitBatchRequest request. The method will close the http.Response Body if it receives an error.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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