#[non_exhaustive]pub struct Document {
pub type: Type,
pub language_code: String,
pub source: Option<Source>,
/* private fields */
}Expand description
Represents the input to API methods.
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.type: TypeRequired. If the type is not set or is TYPE_UNSPECIFIED,
returns an INVALID_ARGUMENT error.
language_code: StringOptional. The language of the document (if not specified, the language is
automatically detected). Both ISO and BCP-47 language codes are
accepted.<br>
Language
Support lists
currently supported languages for each API method. If the language (either
specified by the caller or automatically detected) is not supported by the
called API method, an INVALID_ARGUMENT error is returned.
source: Option<Source>The source of the document: a string containing the content or a Google Cloud Storage URI.
Implementations§
Source§impl Document
impl Document
pub fn new() -> Self
Sourcepub fn set_language_code<T: Into<String>>(self, v: T) -> Self
pub fn set_language_code<T: Into<String>>(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
Sourcepub fn content(&self) -> Option<&String>
pub fn content(&self) -> Option<&String>
The value of source
if it holds a Content, None if the field is not set or
holds a different branch.
Sourcepub fn set_content<T: Into<String>>(self, v: T) -> Self
pub fn set_content<T: Into<String>>(self, v: T) -> Self
Sourcepub fn gcs_content_uri(&self) -> Option<&String>
pub fn gcs_content_uri(&self) -> Option<&String>
The value of source
if it holds a GcsContentUri, None if the field is not set or
holds a different branch.