pub struct ReconfigureBasinRequest {
pub basin: BasinName,
pub config: Option<BasinConfig>,
pub mask: Option<Vec<String>>,
}
Expand description
Reconfigure basin request.
Fields§
§basin: BasinName
Basin name.
config: Option<BasinConfig>
Basin configuration.
mask: Option<Vec<String>>
Specifies the pieces of configuration being updated. See https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask
Implementations§
Source§impl ReconfigureBasinRequest
impl ReconfigureBasinRequest
Sourcepub fn new(basin: BasinName) -> Self
pub fn new(basin: BasinName) -> Self
Create a new request with basin name.
Examples found in repository?
examples/reconfigure_basin.rs (line 21)
7async fn main() -> Result<(), Box<dyn std::error::Error>> {
8 let token = std::env::var("S2_ACCESS_TOKEN")?;
9 let config = ClientConfig::new(token);
10 let client = Client::new(config);
11
12 let basin: BasinName = "my-favorite-basin".parse()?;
13
14 let default_stream_config_updates =
15 StreamConfig::new().with_storage_class(StorageClass::Standard);
16 let basin_config_updates = BasinConfig::new()
17 .with_default_stream_config(default_stream_config_updates)
18 .with_create_stream_on_append(true)
19 .with_create_stream_on_read(true);
20
21 let reconfigure_basin_request = ReconfigureBasinRequest::new(basin)
22 .with_config(basin_config_updates)
23 // Field mask specifies which fields to update.
24 .with_mask(vec!["default_stream_config.retention_policy".to_string()]);
25
26 let updated_basin_config = client.reconfigure_basin(reconfigure_basin_request).await?;
27
28 println!("{updated_basin_config:#?}");
29
30 Ok(())
31}
Sourcepub fn with_config(self, config: BasinConfig) -> Self
pub fn with_config(self, config: BasinConfig) -> Self
Overwrite basin config.
Examples found in repository?
examples/reconfigure_basin.rs (line 22)
7async fn main() -> Result<(), Box<dyn std::error::Error>> {
8 let token = std::env::var("S2_ACCESS_TOKEN")?;
9 let config = ClientConfig::new(token);
10 let client = Client::new(config);
11
12 let basin: BasinName = "my-favorite-basin".parse()?;
13
14 let default_stream_config_updates =
15 StreamConfig::new().with_storage_class(StorageClass::Standard);
16 let basin_config_updates = BasinConfig::new()
17 .with_default_stream_config(default_stream_config_updates)
18 .with_create_stream_on_append(true)
19 .with_create_stream_on_read(true);
20
21 let reconfigure_basin_request = ReconfigureBasinRequest::new(basin)
22 .with_config(basin_config_updates)
23 // Field mask specifies which fields to update.
24 .with_mask(vec!["default_stream_config.retention_policy".to_string()]);
25
26 let updated_basin_config = client.reconfigure_basin(reconfigure_basin_request).await?;
27
28 println!("{updated_basin_config:#?}");
29
30 Ok(())
31}
Sourcepub fn with_mask(self, mask: impl Into<Vec<String>>) -> Self
pub fn with_mask(self, mask: impl Into<Vec<String>>) -> Self
Overwrite field mask.
Examples found in repository?
examples/reconfigure_basin.rs (line 24)
7async fn main() -> Result<(), Box<dyn std::error::Error>> {
8 let token = std::env::var("S2_ACCESS_TOKEN")?;
9 let config = ClientConfig::new(token);
10 let client = Client::new(config);
11
12 let basin: BasinName = "my-favorite-basin".parse()?;
13
14 let default_stream_config_updates =
15 StreamConfig::new().with_storage_class(StorageClass::Standard);
16 let basin_config_updates = BasinConfig::new()
17 .with_default_stream_config(default_stream_config_updates)
18 .with_create_stream_on_append(true)
19 .with_create_stream_on_read(true);
20
21 let reconfigure_basin_request = ReconfigureBasinRequest::new(basin)
22 .with_config(basin_config_updates)
23 // Field mask specifies which fields to update.
24 .with_mask(vec!["default_stream_config.retention_policy".to_string()]);
25
26 let updated_basin_config = client.reconfigure_basin(reconfigure_basin_request).await?;
27
28 println!("{updated_basin_config:#?}");
29
30 Ok(())
31}
Trait Implementations§
Source§impl Clone for ReconfigureBasinRequest
impl Clone for ReconfigureBasinRequest
Source§fn clone(&self) -> ReconfigureBasinRequest
fn clone(&self) -> ReconfigureBasinRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ReconfigureBasinRequest
impl RefUnwindSafe for ReconfigureBasinRequest
impl Send for ReconfigureBasinRequest
impl Sync for ReconfigureBasinRequest
impl Unpin for ReconfigureBasinRequest
impl UnwindSafe for ReconfigureBasinRequest
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
Mutably borrows from an owned value. Read more
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>
Wrap the input message
T
in a tonic::Request