Variables
BatchTranslateMetadata_State_name, BatchTranslateMetadata_State_value
var (
BatchTranslateMetadata_State_name = map[int32]string{
0: "STATE_UNSPECIFIED",
1: "RUNNING",
2: "SUCCEEDED",
3: "FAILED",
4: "CANCELLING",
5: "CANCELLED",
}
BatchTranslateMetadata_State_value = map[string]int32{
"STATE_UNSPECIFIED": 0,
"RUNNING": 1,
"SUCCEEDED": 2,
"FAILED": 3,
"CANCELLING": 4,
"CANCELLED": 5,
}
)
Enum value maps for BatchTranslateMetadata_State.
CreateGlossaryMetadata_State_name, CreateGlossaryMetadata_State_value
var (
CreateGlossaryMetadata_State_name = map[int32]string{
0: "STATE_UNSPECIFIED",
1: "RUNNING",
2: "SUCCEEDED",
3: "FAILED",
4: "CANCELLING",
5: "CANCELLED",
}
CreateGlossaryMetadata_State_value = map[string]int32{
"STATE_UNSPECIFIED": 0,
"RUNNING": 1,
"SUCCEEDED": 2,
"FAILED": 3,
"CANCELLING": 4,
"CANCELLED": 5,
}
)
Enum value maps for CreateGlossaryMetadata_State.
DeleteGlossaryMetadata_State_name, DeleteGlossaryMetadata_State_value
var (
DeleteGlossaryMetadata_State_name = map[int32]string{
0: "STATE_UNSPECIFIED",
1: "RUNNING",
2: "SUCCEEDED",
3: "FAILED",
4: "CANCELLING",
5: "CANCELLED",
}
DeleteGlossaryMetadata_State_value = map[string]int32{
"STATE_UNSPECIFIED": 0,
"RUNNING": 1,
"SUCCEEDED": 2,
"FAILED": 3,
"CANCELLING": 4,
"CANCELLED": 5,
}
)
Enum value maps for DeleteGlossaryMetadata_State.
BatchTranslateDocumentMetadata_State_name, BatchTranslateDocumentMetadata_State_value
var (
BatchTranslateDocumentMetadata_State_name = map[int32]string{
0: "STATE_UNSPECIFIED",
1: "RUNNING",
2: "SUCCEEDED",
3: "FAILED",
4: "CANCELLING",
5: "CANCELLED",
}
BatchTranslateDocumentMetadata_State_value = map[string]int32{
"STATE_UNSPECIFIED": 0,
"RUNNING": 1,
"SUCCEEDED": 2,
"FAILED": 3,
"CANCELLING": 4,
"CANCELLED": 5,
}
)
Enum value maps for BatchTranslateDocumentMetadata_State.
File_google_cloud_translate_v3_translation_service_proto
var File_google_cloud_translate_v3_translation_service_proto protoreflect.FileDescriptor
Functions
func RegisterTranslationServiceServer
func RegisterTranslationServiceServer(s *grpc.Server, srv TranslationServiceServer)
BatchDocumentInputConfig
type BatchDocumentInputConfig struct {
// Specify the input.
//
// Types that are assignable to Source:
//
// *BatchDocumentInputConfig_GcsSource
Source isBatchDocumentInputConfig_Source `protobuf_oneof:"source"`
// contains filtered or unexported fields
}
Input configuration for BatchTranslateDocument request.
func (*BatchDocumentInputConfig) Descriptor
func (*BatchDocumentInputConfig) Descriptor() ([]byte, []int)
Deprecated: Use BatchDocumentInputConfig.ProtoReflect.Descriptor instead.
func (*BatchDocumentInputConfig) GetGcsSource
func (x *BatchDocumentInputConfig) GetGcsSource() *GcsSource
func (*BatchDocumentInputConfig) GetSource
func (m *BatchDocumentInputConfig) GetSource() isBatchDocumentInputConfig_Source
func (*BatchDocumentInputConfig) ProtoMessage
func (*BatchDocumentInputConfig) ProtoMessage()
func (*BatchDocumentInputConfig) ProtoReflect
func (x *BatchDocumentInputConfig) ProtoReflect() protoreflect.Message
func (*BatchDocumentInputConfig) Reset
func (x *BatchDocumentInputConfig) Reset()
func (*BatchDocumentInputConfig) String
func (x *BatchDocumentInputConfig) String() string
BatchDocumentInputConfig_GcsSource
type BatchDocumentInputConfig_GcsSource struct {
// Google Cloud Storage location for the source input.
// This can be a single file (for example,
// `gs://translation-test/input.docx`) or a wildcard (for example,
// `gs://translation-test/*`).
//
// File mime type is determined based on extension. Supported mime type
// includes:
// - `pdf`, application/pdf
// - `docx`,
// application/vnd.openxmlformats-officedocument.wordprocessingml.document
// - `pptx`,
// application/vnd.openxmlformats-officedocument.presentationml.presentation
// - `xlsx`,
// application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
//
// The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB.
// The max file size to support for `.pdf` is 1GB and the max page limit is
// 1000 pages.
// The max file size to support for all input documents is 1GB.
GcsSource *GcsSource `protobuf:"bytes,1,opt,name=gcs_source,json=gcsSource,proto3,oneof"`
}
BatchDocumentOutputConfig
type BatchDocumentOutputConfig struct {
// The destination of output. The destination directory provided must exist
// and be empty.
//
// Types that are assignable to Destination:
//
// *BatchDocumentOutputConfig_GcsDestination
Destination isBatchDocumentOutputConfig_Destination `protobuf_oneof:"destination"`
// contains filtered or unexported fields
}
Output configuration for BatchTranslateDocument request.
func (*BatchDocumentOutputConfig) Descriptor
func (*BatchDocumentOutputConfig) Descriptor() ([]byte, []int)
Deprecated: Use BatchDocumentOutputConfig.ProtoReflect.Descriptor instead.
func (*BatchDocumentOutputConfig) GetDestination
func (m *BatchDocumentOutputConfig) GetDestination() isBatchDocumentOutputConfig_Destination
func (*BatchDocumentOutputConfig) GetGcsDestination
func (x *BatchDocumentOutputConfig) GetGcsDestination() *GcsDestination
func (*BatchDocumentOutputConfig) ProtoMessage
func (*BatchDocumentOutputConfig) ProtoMessage()
func (*BatchDocumentOutputConfig) ProtoReflect
func (x *BatchDocumentOutputConfig) ProtoReflect() protoreflect.Message
func (*BatchDocumentOutputConfig) Reset
func (x *BatchDocumentOutputConfig) Reset()
func (*BatchDocumentOutputConfig) String
func (x *BatchDocumentOutputConfig) String() string
BatchDocumentOutputConfig_GcsDestination
type BatchDocumentOutputConfig_GcsDestination struct {
// Google Cloud Storage destination for output content.
// For every single input document (for example, gs://a/b/c.[extension]), we
// generate at most 2 * n output files. (n is the # of target_language_codes
// in the BatchTranslateDocumentRequest).
//
// While the input documents are being processed, we write/update an index
// file `index.csv` under `gcs_destination.output_uri_prefix` (for example,
// gs://translation_output/index.csv) The index file is generated/updated as
// new files are being translated. The format is:
//
// input_document,target_language_code,translation_output,error_output,
// glossary_translation_output,glossary_error_output
//
// `input_document` is one file we matched using gcs_source.input_uri.
// `target_language_code` is provided in the request.
// `translation_output` contains the translations. (details provided below)
// `error_output` contains the error message during processing of the file.
// Both translations_file and errors_file could be empty strings if we have
// no content to output.
// `glossary_translation_output` and `glossary_error_output` are the
// translated output/error when we apply glossaries. They could also be
// empty if we have no content to output.
//
// Once a row is present in index.csv, the input/output matching never
// changes. Callers should also expect all the content in input_file are
// processed and ready to be consumed (that is, no partial output file is
// written).
//
// Since index.csv will be keeping updated during the process, please make
// sure there is no custom retention policy applied on the output bucket
// that may avoid file updating.
// (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy)
//
// The naming format of translation output files follows (for target
// language code [trg]): `translation_output`:
// gs://translation_output/a_b_c_[trg]_translation.[extension]
// `glossary_translation_output`:
// gs://translation_test/a_b_c_[trg]_glossary_translation.[extension] The
// output document will maintain the same file format as the input document.
//
// The naming format of error output files follows (for target language code
// [trg]): `error_output`: gs://translation_test/a_b_c_[trg]_errors.txt
// `glossary_error_output`:
// gs://translation_test/a_b_c_[trg]_glossary_translation.txt The error
// output is a txt file containing error details.
GcsDestination *GcsDestination `protobuf:"bytes,1,opt,name=gcs_destination,json=gcsDestination,proto3,oneof"`
}
BatchTranslateDocumentMetadata
type BatchTranslateDocumentMetadata struct {
State BatchTranslateDocumentMetadata_State "" /* 134 byte string literal not displayed */
TotalPages int64 `protobuf:"varint,2,opt,name=total_pages,json=totalPages,proto3" json:"total_pages,omitempty"`
TranslatedPages int64 `protobuf:"varint,3,opt,name=translated_pages,json=translatedPages,proto3" json:"translated_pages,omitempty"`
FailedPages int64 `protobuf:"varint,4,opt,name=failed_pages,json=failedPages,proto3" json:"failed_pages,omitempty"`
TotalBillablePages int64 `protobuf:"varint,5,opt,name=total_billable_pages,json=totalBillablePages,proto3" json:"total_billable_pages,omitempty"`
TotalCharacters int64 `protobuf:"varint,6,opt,name=total_characters,json=totalCharacters,proto3" json:"total_characters,omitempty"`
TranslatedCharacters int64 `protobuf:"varint,7,opt,name=translated_characters,json=translatedCharacters,proto3" json:"translated_characters,omitempty"`
FailedCharacters int64 `protobuf:"varint,8,opt,name=failed_characters,json=failedCharacters,proto3" json:"failed_characters,omitempty"`
TotalBillableCharacters int64 "" /* 133 byte string literal not displayed */
SubmitTime *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=submit_time,json=submitTime,proto3" json:"submit_time,omitempty"`
}
State metadata for the batch translation operation.
func (*BatchTranslateDocumentMetadata) Descriptor
func (*BatchTranslateDocumentMetadata) Descriptor() ([]byte, []int)
Deprecated: Use BatchTranslateDocumentMetadata.ProtoReflect.Descriptor instead.
func (*BatchTranslateDocumentMetadata) GetFailedCharacters
func (x *BatchTranslateDocumentMetadata) GetFailedCharacters() int64
func (*BatchTranslateDocumentMetadata) GetFailedPages
func (x *BatchTranslateDocumentMetadata) GetFailedPages() int64
func (*BatchTranslateDocumentMetadata) GetState
func (x *BatchTranslateDocumentMetadata) GetState() BatchTranslateDocumentMetadata_State
func (*BatchTranslateDocumentMetadata) GetSubmitTime
func (x *BatchTranslateDocumentMetadata) GetSubmitTime() *timestamppb.Timestamp
func (*BatchTranslateDocumentMetadata) GetTotalBillableCharacters
func (x *BatchTranslateDocumentMetadata) GetTotalBillableCharacters() int64
func (*BatchTranslateDocumentMetadata) GetTotalBillablePages
func (x *BatchTranslateDocumentMetadata) GetTotalBillablePages() int64
func (*BatchTranslateDocumentMetadata) GetTotalCharacters
func (x *BatchTranslateDocumentMetadata) GetTotalCharacters() int64
func (*BatchTranslateDocumentMetadata) GetTotalPages
func (x *BatchTranslateDocumentMetadata) GetTotalPages() int64
func (*BatchTranslateDocumentMetadata) GetTranslatedCharacters
func (x *BatchTranslateDocumentMetadata) GetTranslatedCharacters() int64
func (*BatchTranslateDocumentMetadata) GetTranslatedPages
func (x *BatchTranslateDocumentMetadata) GetTranslatedPages() int64
func (*BatchTranslateDocumentMetadata) ProtoMessage
func (*BatchTranslateDocumentMetadata) ProtoMessage()
func (*BatchTranslateDocumentMetadata) ProtoReflect
func (x *BatchTranslateDocumentMetadata) ProtoReflect() protoreflect.Message
func (*BatchTranslateDocumentMetadata) Reset
func (x *BatchTranslateDocumentMetadata) Reset()
func (*BatchTranslateDocumentMetadata) String
func (x *BatchTranslateDocumentMetadata) String() string
BatchTranslateDocumentMetadata_State
type BatchTranslateDocumentMetadata_State int32
State of the job.
BatchTranslateDocumentMetadata_STATE_UNSPECIFIED, BatchTranslateDocumentMetadata_RUNNING, BatchTranslateDocumentMetadata_SUCCEEDED, BatchTranslateDocumentMetadata_FAILED, BatchTranslateDocumentMetadata_CANCELLING, BatchTranslateDocumentMetadata_CANCELLED
const (
// Invalid.
BatchTranslateDocumentMetadata_STATE_UNSPECIFIED BatchTranslateDocumentMetadata_State = 0
// Request is being processed.
BatchTranslateDocumentMetadata_RUNNING BatchTranslateDocumentMetadata_State = 1
// The batch is processed, and at least one item was successfully processed.
BatchTranslateDocumentMetadata_SUCCEEDED BatchTranslateDocumentMetadata_State = 2
// The batch is done and no item was successfully processed.
BatchTranslateDocumentMetadata_FAILED BatchTranslateDocumentMetadata_State = 3
// Request is in the process of being canceled after caller invoked
// longrunning.Operations.CancelOperation on the request id.
BatchTranslateDocumentMetadata_CANCELLING BatchTranslateDocumentMetadata_State = 4
// The batch is done after the user has called the
// longrunning.Operations.CancelOperation. Any records processed before the
// cancel command are output as specified in the request.
BatchTranslateDocumentMetadata_CANCELLED BatchTranslateDocumentMetadata_State = 5
)
func (BatchTranslateDocumentMetadata_State) Descriptor
func (BatchTranslateDocumentMetadata_State) Descriptor() protoreflect.EnumDescriptor
func (BatchTranslateDocumentMetadata_State) Enum
func (x BatchTranslateDocumentMetadata_State) Enum() *BatchTranslateDocumentMetadata_State
func (BatchTranslateDocumentMetadata_State) EnumDescriptor
func (BatchTranslateDocumentMetadata_State) EnumDescriptor() ([]byte, []int)
Deprecated: Use BatchTranslateDocumentMetadata_State.Descriptor instead.
func (BatchTranslateDocumentMetadata_State) Number
func (x BatchTranslateDocumentMetadata_State) Number() protoreflect.EnumNumber
func (BatchTranslateDocumentMetadata_State) String
func (x BatchTranslateDocumentMetadata_State) String() string
func (BatchTranslateDocumentMetadata_State) Type
func (BatchTranslateDocumentMetadata_State) Type() protoreflect.EnumType
BatchTranslateDocumentRequest
type BatchTranslateDocumentRequest struct {
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
SourceLanguageCode string `protobuf:"bytes,2,opt,name=source_language_code,json=sourceLanguageCode,proto3" json:"source_language_code,omitempty"`
TargetLanguageCodes []string `protobuf:"bytes,3,rep,name=target_language_codes,json=targetLanguageCodes,proto3" json:"target_language_codes,omitempty"`
InputConfigs []*BatchDocumentInputConfig `protobuf:"bytes,4,rep,name=input_configs,json=inputConfigs,proto3" json:"input_configs,omitempty"`
OutputConfig *BatchDocumentOutputConfig `protobuf:"bytes,5,opt,name=output_config,json=outputConfig,proto3" json:"output_config,omitempty"`
Models map[string]string "" /* 153 byte string literal not displayed */
Glossaries map[string]*TranslateTextGlossaryConfig "" /* 161 byte string literal not displayed */
FormatConversions map[string]string "" /* 200 byte string literal not displayed */
}
The BatchTranslateDocument request.
func (*BatchTranslateDocumentRequest) Descriptor
func (*BatchTranslateDocumentRequest) Descriptor() ([]byte, []int)
Deprecated: Use BatchTranslateDocumentRequest.ProtoReflect.Descriptor instead.
func (*BatchTranslateDocumentRequest) GetFormatConversions
func (x *BatchTranslateDocumentRequest) GetFormatConversions() map[string]string
func (*BatchTranslateDocumentRequest) GetGlossaries
func (x *BatchTranslateDocumentRequest) GetGlossaries() map[string]*TranslateTextGlossaryConfig
func (*BatchTranslateDocumentRequest) GetInputConfigs
func (x *BatchTranslateDocumentRequest) GetInputConfigs() []*BatchDocumentInputConfig
func (*BatchTranslateDocumentRequest) GetModels
func (x *BatchTranslateDocumentRequest) GetModels() map[string]string
func (*BatchTranslateDocumentRequest) GetOutputConfig
func (x *BatchTranslateDocumentRequest) GetOutputConfig() *BatchDocumentOutputConfig
func (*BatchTranslateDocumentRequest) GetParent
func (x *BatchTranslateDocumentRequest) GetParent() string
func (*BatchTranslateDocumentRequest) GetSourceLanguageCode
func (x *BatchTranslateDocumentRequest) GetSourceLanguageCode() string
func (*BatchTranslateDocumentRequest) GetTargetLanguageCodes
func (x *BatchTranslateDocumentRequest) GetTargetLanguageCodes() []string
func (*BatchTranslateDocumentRequest) ProtoMessage
func (*BatchTranslateDocumentRequest) ProtoMessage()
func (*BatchTranslateDocumentRequest) ProtoReflect
func (x *BatchTranslateDocumentRequest) ProtoReflect() protoreflect.Message
func (*BatchTranslateDocumentRequest) Reset
func (x *BatchTranslateDocumentRequest) Reset()
func (*BatchTranslateDocumentRequest) String
func (x *BatchTranslateDocumentRequest) String() string
BatchTranslateDocumentResponse
type BatchTranslateDocumentResponse struct {
TotalPages int64 `protobuf:"varint,1,opt,name=total_pages,json=totalPages,proto3" json:"total_pages,omitempty"`
TranslatedPages int64 `protobuf:"varint,2,opt,name=translated_pages,json=translatedPages,proto3" json:"translated_pages,omitempty"`
FailedPages int64 `protobuf:"varint,3,opt,name=failed_pages,json=failedPages,proto3" json:"failed_pages,omitempty"`
TotalBillablePages int64 `protobuf:"varint,4,opt,name=total_billable_pages,json=totalBillablePages,proto3" json:"total_billable_pages,omitempty"`
TotalCharacters int64 `protobuf:"varint,5,opt,name=total_characters,json=totalCharacters,proto3" json:"total_characters,omitempty"`
TranslatedCharacters int64 `protobuf:"varint,6,opt,name=translated_characters,json=translatedCharacters,proto3" json:"translated_characters,omitempty"`
FailedCharacters int64 `protobuf:"varint,7,opt,name=failed_characters,json=failedCharacters,proto3" json:"failed_characters,omitempty"`
TotalBillableCharacters int64 "" /* 133 byte string literal not displayed */
SubmitTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=submit_time,json=submitTime,proto3" json:"submit_time,omitempty"`
EndTime *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
}
Stored in the [google.longrunning.Operation.response][google.longrunning.Operation.response] field returned by BatchTranslateDocument if at least one document is translated successfully.
func (*BatchTranslateDocumentResponse) Descriptor
func (*BatchTranslateDocumentResponse) Descriptor() ([]byte, []int)
Deprecated: Use BatchTranslateDocumentResponse.ProtoReflect.Descriptor instead.
func (*BatchTranslateDocumentResponse) GetEndTime
func (x *BatchTranslateDocumentResponse) GetEndTime() *timestamppb.Timestamp
func (*BatchTranslateDocumentResponse) GetFailedCharacters
func (x *BatchTranslateDocumentResponse) GetFailedCharacters() int64
func (*BatchTranslateDocumentResponse) GetFailedPages
func (x *BatchTranslateDocumentResponse) GetFailedPages() int64
func (*BatchTranslateDocumentResponse) GetSubmitTime
func (x *BatchTranslateDocumentResponse) GetSubmitTime() *timestamppb.Timestamp
func (*BatchTranslateDocumentResponse) GetTotalBillableCharacters
func (x *BatchTranslateDocumentResponse) GetTotalBillableCharacters() int64
func (*BatchTranslateDocumentResponse) GetTotalBillablePages
func (x *BatchTranslateDocumentResponse) GetTotalBillablePages() int64
func (*BatchTranslateDocumentResponse) GetTotalCharacters
func (x *BatchTranslateDocumentResponse) GetTotalCharacters() int64
func (*BatchTranslateDocumentResponse) GetTotalPages
func (x *BatchTranslateDocumentResponse) GetTotalPages() int64
func (*BatchTranslateDocumentResponse) GetTranslatedCharacters
func (x *BatchTranslateDocumentResponse) GetTranslatedCharacters() int64
func (*BatchTranslateDocumentResponse) GetTranslatedPages
func (x *BatchTranslateDocumentResponse) GetTranslatedPages() int64
func (*BatchTranslateDocumentResponse) ProtoMessage
func (*BatchTranslateDocumentResponse) ProtoMessage()
func (*BatchTranslateDocumentResponse) ProtoReflect
func (x *BatchTranslateDocumentResponse) ProtoReflect() protoreflect.Message
func (*BatchTranslateDocumentResponse) Reset
func (x *BatchTranslateDocumentResponse) Reset()
func (*BatchTranslateDocumentResponse) String
func (x *BatchTranslateDocumentResponse) String() string
BatchTranslateMetadata
type BatchTranslateMetadata struct {
// The state of the operation.
State BatchTranslateMetadata_State `protobuf:"varint,1,opt,name=state,proto3,enum=google.cloud.translation.v3.BatchTranslateMetadata_State" json:"state,omitempty"`
// Number of successfully translated characters so far (Unicode codepoints).
TranslatedCharacters int64 `protobuf:"varint,2,opt,name=translated_characters,json=translatedCharacters,proto3" json:"translated_characters,omitempty"`
// Number of characters that have failed to process so far (Unicode
// codepoints).
FailedCharacters int64 `protobuf:"varint,3,opt,name=failed_characters,json=failedCharacters,proto3" json:"failed_characters,omitempty"`
// Total number of characters (Unicode codepoints).
// This is the total number of codepoints from input files times the number of
// target languages and appears here shortly after the call is submitted.
TotalCharacters int64 `protobuf:"varint,4,opt,name=total_characters,json=totalCharacters,proto3" json:"total_characters,omitempty"`
// Time when the operation was submitted.
SubmitTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=submit_time,json=submitTime,proto3" json:"submit_time,omitempty"`
// contains filtered or unexported fields
}
State metadata for the batch translation operation.
func (*BatchTranslateMetadata) Descriptor
func (*BatchTranslateMetadata) Descriptor() ([]byte, []int)
Deprecated: Use BatchTranslateMetadata.ProtoReflect.Descriptor instead.
func (*BatchTranslateMetadata) GetFailedCharacters
func (x *BatchTranslateMetadata) GetFailedCharacters() int64
func (*BatchTranslateMetadata) GetState
func (x *BatchTranslateMetadata) GetState() BatchTranslateMetadata_State
func (*BatchTranslateMetadata) GetSubmitTime
func (x *BatchTranslateMetadata) GetSubmitTime() *timestamppb.Timestamp
func (*BatchTranslateMetadata) GetTotalCharacters
func (x *BatchTranslateMetadata) GetTotalCharacters() int64
func (*BatchTranslateMetadata) GetTranslatedCharacters
func (x *BatchTranslateMetadata) GetTranslatedCharacters() int64
func (*BatchTranslateMetadata) ProtoMessage
func (*BatchTranslateMetadata) ProtoMessage()
func (*BatchTranslateMetadata) ProtoReflect
func (x *BatchTranslateMetadata) ProtoReflect() protoreflect.Message
func (*BatchTranslateMetadata) Reset
func (x *BatchTranslateMetadata) Reset()
func (*BatchTranslateMetadata) String
func (x *BatchTranslateMetadata) String() string
BatchTranslateMetadata_State
type BatchTranslateMetadata_State