#[non_exhaustive]pub struct CloudStorageConfig {
pub bucket: String,
pub filename_prefix: String,
pub filename_suffix: String,
pub filename_datetime_format: String,
pub max_duration: Option<Duration>,
pub max_bytes: i64,
pub max_messages: i64,
pub state: State,
pub service_account_email: String,
pub output_format: Option<OutputFormat>,
/* private fields */
}Expand description
Configuration for a Cloud Storage subscription.
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.bucket: StringRequired. User-provided name for the Cloud Storage bucket. The bucket must be created by the user. The bucket name must be without any prefix like “gs://”. See the [bucket naming requirements] (https://cloud.google.com/storage/docs/buckets#naming).
filename_prefix: StringOptional. User-provided prefix for Cloud Storage filename. See the object naming requirements.
filename_suffix: StringOptional. User-provided suffix for Cloud Storage filename. See the object naming requirements. Must not end in “/”.
filename_datetime_format: StringOptional. User-provided format string specifying how to represent datetimes in Cloud Storage filenames. See the datetime format guidance.
max_duration: Option<Duration>Optional. The maximum duration that can elapse before a new Cloud Storage file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed the subscription’s acknowledgment deadline.
max_bytes: i64Optional. The maximum bytes that can be written to a Cloud Storage file before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may be exceeded in cases where messages are larger than the limit.
max_messages: i64Optional. The maximum number of messages that can be written to a Cloud Storage file before a new file is created. Min 1000 messages.
state: StateOutput only. An output-only field that indicates whether or not the subscription can receive messages.
service_account_email: StringOptional. The service account to use to write to Cloud Storage. The
subscription creator or updater that specifies this field must have
iam.serviceAccounts.actAs permission on the service account. If not
specified, the Pub/Sub
service agent,
service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
output_format: Option<OutputFormat>Defaults to text format.
Implementations§
Source§impl CloudStorageConfig
impl CloudStorageConfig
pub fn new() -> Self
Sourcepub fn set_bucket<T: Into<String>>(self, v: T) -> Self
pub fn set_bucket<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_filename_prefix<T: Into<String>>(self, v: T) -> Self
pub fn set_filename_prefix<T: Into<String>>(self, v: T) -> Self
Sets the value of filename_prefix.
§Example
let x = CloudStorageConfig::new().set_filename_prefix("example");Sourcepub fn set_filename_suffix<T: Into<String>>(self, v: T) -> Self
pub fn set_filename_suffix<T: Into<String>>(self, v: T) -> Self
Sets the value of filename_suffix.
§Example
let x = CloudStorageConfig::new().set_filename_suffix("example");Sourcepub fn set_filename_datetime_format<T: Into<String>>(self, v: T) -> Self
pub fn set_filename_datetime_format<T: Into<String>>(self, v: T) -> Self
Sets the value of filename_datetime_format.
§Example
let x = CloudStorageConfig::new().set_filename_datetime_format("example");Sourcepub fn set_max_duration<T>(self, v: T) -> Self
pub fn set_max_duration<T>(self, v: T) -> Self
Sets the value of max_duration.
§Example
use wkt::Duration;
let x = CloudStorageConfig::new().set_max_duration(Duration::default()/* use setters */);Sourcepub fn set_or_clear_max_duration<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_max_duration<T>(self, v: Option<T>) -> Self
Sets or clears the value of max_duration.
§Example
use wkt::Duration;
let x = CloudStorageConfig::new().set_or_clear_max_duration(Some(Duration::default()/* use setters */));
let x = CloudStorageConfig::new().set_or_clear_max_duration(None::<Duration>);Sourcepub fn set_max_bytes<T: Into<i64>>(self, v: T) -> Self
pub fn set_max_bytes<T: Into<i64>>(self, v: T) -> Self
Sourcepub fn set_max_messages<T: Into<i64>>(self, v: T) -> Self
pub fn set_max_messages<T: Into<i64>>(self, v: T) -> Self
Sourcepub fn set_service_account_email<T: Into<String>>(self, v: T) -> Self
pub fn set_service_account_email<T: Into<String>>(self, v: T) -> Self
Sets the value of service_account_email.
§Example
let x = CloudStorageConfig::new().set_service_account_email("example");Sourcepub fn set_output_format<T: Into<Option<OutputFormat>>>(self, v: T) -> Self
pub fn set_output_format<T: Into<Option<OutputFormat>>>(self, v: T) -> Self
Sets the value of output_format.
Note that all the setters affecting output_format are mutually
exclusive.
§Example
use google_cloud_pubsub::model::cloud_storage_config::TextConfig;
let x = CloudStorageConfig::new().set_output_format(Some(
google_cloud_pubsub::model::cloud_storage_config::OutputFormat::TextConfig(TextConfig::default().into())));Sourcepub fn text_config(&self) -> Option<&Box<TextConfig>>
pub fn text_config(&self) -> Option<&Box<TextConfig>>
The value of output_format
if it holds a TextConfig, None if the field is not set or
holds a different branch.
Sourcepub fn set_text_config<T: Into<Box<TextConfig>>>(self, v: T) -> Self
pub fn set_text_config<T: Into<Box<TextConfig>>>(self, v: T) -> Self
Sets the value of output_format
to hold a TextConfig.
Note that all the setters affecting output_format are
mutually exclusive.
§Example
use google_cloud_pubsub::model::cloud_storage_config::TextConfig;
let x = CloudStorageConfig::new().set_text_config(TextConfig::default()/* use setters */);
assert!(x.text_config().is_some());
assert!(x.avro_config().is_none());Sourcepub fn avro_config(&self) -> Option<&Box<AvroConfig>>
pub fn avro_config(&self) -> Option<&Box<AvroConfig>>
The value of output_format
if it holds a AvroConfig, None if the field is not set or
holds a different branch.
Sourcepub fn set_avro_config<T: Into<Box<AvroConfig>>>(self, v: T) -> Self
pub fn set_avro_config<T: Into<Box<AvroConfig>>>(self, v: T) -> Self
Sets the value of output_format
to hold a AvroConfig.
Note that all the setters affecting output_format are
mutually exclusive.
§Example
use google_cloud_pubsub::model::cloud_storage_config::AvroConfig;
let x = CloudStorageConfig::new().set_avro_config(AvroConfig::default()/* use setters */);
assert!(x.avro_config().is_some());
assert!(x.text_config().is_none());Trait Implementations§
Source§impl Clone for CloudStorageConfig
impl Clone for CloudStorageConfig
Source§fn clone(&self) -> CloudStorageConfig
fn clone(&self) -> CloudStorageConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CloudStorageConfig
impl Debug for CloudStorageConfig
Source§impl Default for CloudStorageConfig
impl Default for CloudStorageConfig
Source§fn default() -> CloudStorageConfig
fn default() -> CloudStorageConfig
Source§impl Message for CloudStorageConfig
impl Message for CloudStorageConfig
Source§impl PartialEq for CloudStorageConfig
impl PartialEq for CloudStorageConfig
impl StructuralPartialEq for CloudStorageConfig
Auto Trait Implementations§
impl Freeze for CloudStorageConfig
impl RefUnwindSafe for CloudStorageConfig
impl Send for CloudStorageConfig
impl Sync for CloudStorageConfig
impl Unpin for CloudStorageConfig
impl UnwindSafe for CloudStorageConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request