#[non_exhaustive]pub struct DetectLanguageRequest {
pub parent: String,
pub model: String,
pub mime_type: String,
pub labels: HashMap<String, String>,
pub source: Option<Source>,
/* private fields */
}Expand description
The request message for language detection.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.parent: StringRequired. Project or location to make a call. Must refer to a caller’s project.
Format: projects/{project-number-or-id}/locations/{location-id} or
projects/{project-number-or-id}.
For global calls, use projects/{project-number-or-id}/locations/global or
projects/{project-number-or-id}.
Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned.
model: StringOptional. The language detection model to be used.
Format:
projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}
Only one language detection model is currently supported:
projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default.
If not specified, the default model is used.
mime_type: StringOptional. The format of the source text, for example, “text/html”, “text/plain”. If left blank, the MIME type defaults to “text/html”.
labels: HashMap<String, String>Optional. The labels with user-defined metadata for the request.
Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.
See https://cloud.google.com/translate/docs/advanced/labels for more information.
source: Option<Source>Required. The source of the document from which to detect the language.
Implementations§
Source§impl DetectLanguageRequest
impl DetectLanguageRequest
pub fn new() -> Self
Sourcepub fn set_parent<T: Into<String>>(self, v: T) -> Self
pub fn set_parent<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_mime_type<T: Into<String>>(self, v: T) -> Self
pub fn set_mime_type<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_labels<T, K, V>(self, v: T) -> Self
pub fn set_labels<T, K, V>(self, v: T) -> Self
Sourcepub fn set_source<T: Into<Option<Source>>>(self, v: T) -> Self
pub fn set_source<T: Into<Option<Source>>>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for DetectLanguageRequest
impl Clone for DetectLanguageRequest
Source§fn clone(&self) -> DetectLanguageRequest
fn clone(&self) -> DetectLanguageRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more