#[non_exhaustive]pub struct Document {
pub type: Type,
pub language_code: String,
pub source: Option<Source>,
}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
Sourcepub fn set_language_code<T: Into<String>>(self, v: T) -> Self
pub fn set_language_code<T: Into<String>>(self, v: T) -> Self
Sets the value of language_code.
Sourcepub fn set_source<T: Into<Option<Source>>>(self, v: T) -> Self
pub fn set_source<T: Into<Option<Source>>>(self, v: T) -> Self
Sets the value of source.
Sourcepub fn get_content(&self) -> Option<&String>
pub fn get_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 get_gcs_content_uri(&self) -> Option<&String>
pub fn get_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.
Sourcepub fn set_content<T: Into<String>>(self, v: T) -> Self
pub fn set_content<T: Into<String>>(self, v: T) -> Self
Sets the value of source
to hold a Content.
Note that all the setters affecting source are
mutually exclusive.
Sourcepub fn set_gcs_content_uri<T: Into<String>>(self, v: T) -> Self
pub fn set_gcs_content_uri<T: Into<String>>(self, v: T) -> Self
Sets the value of source
to hold a GcsContentUri.
Note that all the setters affecting source are
mutually exclusive.