aws-sdk-redshiftserverless 1.101.0

AWS SDK for Redshift Serverless
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::update_workgroup::_update_workgroup_output::UpdateWorkgroupOutputBuilder;

pub use crate::operation::update_workgroup::_update_workgroup_input::UpdateWorkgroupInputBuilder;

impl crate::operation::update_workgroup::builders::UpdateWorkgroupInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::update_workgroup::UpdateWorkgroupOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_workgroup::UpdateWorkgroupError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.update_workgroup();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `UpdateWorkgroup`.
///
/// <p>Updates a workgroup with the specified configuration settings. You can't update multiple parameters in one request. For example, you can update <code>baseCapacity</code> or <code>port</code> in a single request, but you can't update both in the same request.</p>
/// <p>VPC Block Public Access (BPA) enables you to block resources in VPCs and subnets that you own in a Region from reaching or being reached from the internet through internet gateways and egress-only internet gateways. If a workgroup is in an account with VPC BPA turned on, the following capabilities are blocked:</p>
/// <ul>
/// <li>
/// <p>Creating a public access workgroup</p></li>
/// <li>
/// <p>Modifying a private workgroup to public</p></li>
/// <li>
/// <p>Adding a subnet with VPC BPA turned on to the workgroup when the workgroup is public</p></li>
/// </ul>
/// <p>For more information about VPC BPA, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/security-vpc-bpa.html">Block public access to VPCs and subnets</a> in the <i>Amazon VPC User Guide</i>.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct UpdateWorkgroupFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::update_workgroup::builders::UpdateWorkgroupInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::update_workgroup::UpdateWorkgroupOutput,
        crate::operation::update_workgroup::UpdateWorkgroupError,
    > for UpdateWorkgroupFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::update_workgroup::UpdateWorkgroupOutput,
            crate::operation::update_workgroup::UpdateWorkgroupError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl UpdateWorkgroupFluentBuilder {
    /// Creates a new `UpdateWorkgroupFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the UpdateWorkgroup as a reference.
    pub fn as_input(&self) -> &crate::operation::update_workgroup::builders::UpdateWorkgroupInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::update_workgroup::UpdateWorkgroupOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_workgroup::UpdateWorkgroupError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::update_workgroup::UpdateWorkgroup::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::update_workgroup::UpdateWorkgroup::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::update_workgroup::UpdateWorkgroupOutput,
        crate::operation::update_workgroup::UpdateWorkgroupError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>The name of the workgroup to update. You can't update the name of a workgroup once it is created.</p>
    pub fn workgroup_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.workgroup_name(input.into());
        self
    }
    /// <p>The name of the workgroup to update. You can't update the name of a workgroup once it is created.</p>
    pub fn set_workgroup_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_workgroup_name(input);
        self
    }
    /// <p>The name of the workgroup to update. You can't update the name of a workgroup once it is created.</p>
    pub fn get_workgroup_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_workgroup_name()
    }
    /// <p>The new base data warehouse capacity in Redshift Processing Units (RPUs).</p>
    pub fn base_capacity(mut self, input: i32) -> Self {
        self.inner = self.inner.base_capacity(input);
        self
    }
    /// <p>The new base data warehouse capacity in Redshift Processing Units (RPUs).</p>
    pub fn set_base_capacity(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_base_capacity(input);
        self
    }
    /// <p>The new base data warehouse capacity in Redshift Processing Units (RPUs).</p>
    pub fn get_base_capacity(&self) -> &::std::option::Option<i32> {
        self.inner.get_base_capacity()
    }
    /// <p>The value that specifies whether to turn on enhanced virtual private cloud (VPC) routing, which forces Amazon Redshift Serverless to route traffic through your VPC.</p>
    pub fn enhanced_vpc_routing(mut self, input: bool) -> Self {
        self.inner = self.inner.enhanced_vpc_routing(input);
        self
    }
    /// <p>The value that specifies whether to turn on enhanced virtual private cloud (VPC) routing, which forces Amazon Redshift Serverless to route traffic through your VPC.</p>
    pub fn set_enhanced_vpc_routing(mut self, input: ::std::option::Option<bool>) -> Self {
        self.inner = self.inner.set_enhanced_vpc_routing(input);
        self
    }
    /// <p>The value that specifies whether to turn on enhanced virtual private cloud (VPC) routing, which forces Amazon Redshift Serverless to route traffic through your VPC.</p>
    pub fn get_enhanced_vpc_routing(&self) -> &::std::option::Option<bool> {
        self.inner.get_enhanced_vpc_routing()
    }
    ///
    /// Appends an item to `configParameters`.
    ///
    /// To override the contents of this collection use [`set_config_parameters`](Self::set_config_parameters).
    ///
    /// <p>An array of parameters to set for advanced control over a database. The options are <code>auto_mv</code>, <code>datestyle</code>, <code>enable_case_sensitive_identifier</code>, <code>enable_user_activity_logging</code>, <code>query_group</code>, <code>search_path</code>, <code>require_ssl</code>, <code>use_fips_ssl</code>, and either <code>wlm_json_configuration</code> or query monitoring metrics that let you define performance boundaries. You can either specify individual query monitoring metrics (such as <code>max_scan_row_count</code>, <code>max_query_execution_time</code>) or use <code>wlm_json_configuration</code> to define query queues with rules, but not both. If you're using <code>wlm_json_configuration</code>, the maximum size of <code>parameterValue</code> is 8000 characters. For more information about query monitoring rules and available metrics, see <a href="https://docs.aws.amazon.com/redshift/latest/dg/cm-c-wlm-query-monitoring-rules.html#cm-c-wlm-query-monitoring-metrics-serverless"> Query monitoring metrics for Amazon Redshift Serverless</a>.</p>
    pub fn config_parameters(mut self, input: crate::types::ConfigParameter) -> Self {
        self.inner = self.inner.config_parameters(input);
        self
    }
    /// <p>An array of parameters to set for advanced control over a database. The options are <code>auto_mv</code>, <code>datestyle</code>, <code>enable_case_sensitive_identifier</code>, <code>enable_user_activity_logging</code>, <code>query_group</code>, <code>search_path</code>, <code>require_ssl</code>, <code>use_fips_ssl</code>, and either <code>wlm_json_configuration</code> or query monitoring metrics that let you define performance boundaries. You can either specify individual query monitoring metrics (such as <code>max_scan_row_count</code>, <code>max_query_execution_time</code>) or use <code>wlm_json_configuration</code> to define query queues with rules, but not both. If you're using <code>wlm_json_configuration</code>, the maximum size of <code>parameterValue</code> is 8000 characters. For more information about query monitoring rules and available metrics, see <a href="https://docs.aws.amazon.com/redshift/latest/dg/cm-c-wlm-query-monitoring-rules.html#cm-c-wlm-query-monitoring-metrics-serverless"> Query monitoring metrics for Amazon Redshift Serverless</a>.</p>
    pub fn set_config_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ConfigParameter>>) -> Self {
        self.inner = self.inner.set_config_parameters(input);
        self
    }
    /// <p>An array of parameters to set for advanced control over a database. The options are <code>auto_mv</code>, <code>datestyle</code>, <code>enable_case_sensitive_identifier</code>, <code>enable_user_activity_logging</code>, <code>query_group</code>, <code>search_path</code>, <code>require_ssl</code>, <code>use_fips_ssl</code>, and either <code>wlm_json_configuration</code> or query monitoring metrics that let you define performance boundaries. You can either specify individual query monitoring metrics (such as <code>max_scan_row_count</code>, <code>max_query_execution_time</code>) or use <code>wlm_json_configuration</code> to define query queues with rules, but not both. If you're using <code>wlm_json_configuration</code>, the maximum size of <code>parameterValue</code> is 8000 characters. For more information about query monitoring rules and available metrics, see <a href="https://docs.aws.amazon.com/redshift/latest/dg/cm-c-wlm-query-monitoring-rules.html#cm-c-wlm-query-monitoring-metrics-serverless"> Query monitoring metrics for Amazon Redshift Serverless</a>.</p>
    pub fn get_config_parameters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ConfigParameter>> {
        self.inner.get_config_parameters()
    }
    /// <p>A value that specifies whether the workgroup can be accessible from a public network.</p>
    pub fn publicly_accessible(mut self, input: bool) -> Self {
        self.inner = self.inner.publicly_accessible(input);
        self
    }
    /// <p>A value that specifies whether the workgroup can be accessible from a public network.</p>
    pub fn set_publicly_accessible(mut self, input: ::std::option::Option<bool>) -> Self {
        self.inner = self.inner.set_publicly_accessible(input);
        self
    }
    /// <p>A value that specifies whether the workgroup can be accessible from a public network.</p>
    pub fn get_publicly_accessible(&self) -> &::std::option::Option<bool> {
        self.inner.get_publicly_accessible()
    }
    ///
    /// Appends an item to `subnetIds`.
    ///
    /// To override the contents of this collection use [`set_subnet_ids`](Self::set_subnet_ids).
    ///
    /// <p>An array of VPC subnet IDs to associate with the workgroup.</p>
    pub fn subnet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.subnet_ids(input.into());
        self
    }
    /// <p>An array of VPC subnet IDs to associate with the workgroup.</p>
    pub fn set_subnet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inner = self.inner.set_subnet_ids(input);
        self
    }
    /// <p>An array of VPC subnet IDs to associate with the workgroup.</p>
    pub fn get_subnet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        self.inner.get_subnet_ids()
    }
    ///
    /// Appends an item to `securityGroupIds`.
    ///
    /// To override the contents of this collection use [`set_security_group_ids`](Self::set_security_group_ids).
    ///
    /// <p>An array of security group IDs to associate with the workgroup.</p>
    pub fn security_group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.security_group_ids(input.into());
        self
    }
    /// <p>An array of security group IDs to associate with the workgroup.</p>
    pub fn set_security_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inner = self.inner.set_security_group_ids(input);
        self
    }
    /// <p>An array of security group IDs to associate with the workgroup.</p>
    pub fn get_security_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        self.inner.get_security_group_ids()
    }
    /// <p>The custom port to use when connecting to a workgroup. Valid port ranges are 5431-5455 and 8191-8215. The default is 5439.</p>
    pub fn port(mut self, input: i32) -> Self {
        self.inner = self.inner.port(input);
        self
    }
    /// <p>The custom port to use when connecting to a workgroup. Valid port ranges are 5431-5455 and 8191-8215. The default is 5439.</p>
    pub fn set_port(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_port(input);
        self
    }
    /// <p>The custom port to use when connecting to a workgroup. Valid port ranges are 5431-5455 and 8191-8215. The default is 5439.</p>
    pub fn get_port(&self) -> &::std::option::Option<i32> {
        self.inner.get_port()
    }
    /// <p>The maximum data-warehouse capacity Amazon Redshift Serverless uses to serve queries. The max capacity is specified in RPUs.</p>
    pub fn max_capacity(mut self, input: i32) -> Self {
        self.inner = self.inner.max_capacity(input);
        self
    }
    /// <p>The maximum data-warehouse capacity Amazon Redshift Serverless uses to serve queries. The max capacity is specified in RPUs.</p>
    pub fn set_max_capacity(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_max_capacity(input);
        self
    }
    /// <p>The maximum data-warehouse capacity Amazon Redshift Serverless uses to serve queries. The max capacity is specified in RPUs.</p>
    pub fn get_max_capacity(&self) -> &::std::option::Option<i32> {
        self.inner.get_max_capacity()
    }
    /// <p>The IP address type that the workgroup supports. Possible values are <code>ipv4</code> and <code>dualstack</code>.</p>
    pub fn ip_address_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.ip_address_type(input.into());
        self
    }
    /// <p>The IP address type that the workgroup supports. Possible values are <code>ipv4</code> and <code>dualstack</code>.</p>
    pub fn set_ip_address_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_ip_address_type(input);
        self
    }
    /// <p>The IP address type that the workgroup supports. Possible values are <code>ipv4</code> and <code>dualstack</code>.</p>
    pub fn get_ip_address_type(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_ip_address_type()
    }
    /// <p>An object that represents the price performance target settings for the workgroup.</p>
    pub fn price_performance_target(mut self, input: crate::types::PerformanceTarget) -> Self {
        self.inner = self.inner.price_performance_target(input);
        self
    }
    /// <p>An object that represents the price performance target settings for the workgroup.</p>
    pub fn set_price_performance_target(mut self, input: ::std::option::Option<crate::types::PerformanceTarget>) -> Self {
        self.inner = self.inner.set_price_performance_target(input);
        self
    }
    /// <p>An object that represents the price performance target settings for the workgroup.</p>
    pub fn get_price_performance_target(&self) -> &::std::option::Option<crate::types::PerformanceTarget> {
        self.inner.get_price_performance_target()
    }
    /// <p>An optional parameter for the name of the track for the workgroup. If you don't provide a track name, the workgroup is assigned to the <code>current</code> track.</p>
    pub fn track_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.track_name(input.into());
        self
    }
    /// <p>An optional parameter for the name of the track for the workgroup. If you don't provide a track name, the workgroup is assigned to the <code>current</code> track.</p>
    pub fn set_track_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_track_name(input);
        self
    }
    /// <p>An optional parameter for the name of the track for the workgroup. If you don't provide a track name, the workgroup is assigned to the <code>current</code> track.</p>
    pub fn get_track_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_track_name()
    }
    /// <p>If <code>true</code>, allocates additional compute resources for running automatic optimization operations.</p>
    /// <p>Default: false</p>
    pub fn extra_compute_for_automatic_optimization(mut self, input: bool) -> Self {
        self.inner = self.inner.extra_compute_for_automatic_optimization(input);
        self
    }
    /// <p>If <code>true</code>, allocates additional compute resources for running automatic optimization operations.</p>
    /// <p>Default: false</p>
    pub fn set_extra_compute_for_automatic_optimization(mut self, input: ::std::option::Option<bool>) -> Self {
        self.inner = self.inner.set_extra_compute_for_automatic_optimization(input);
        self
    }
    /// <p>If <code>true</code>, allocates additional compute resources for running automatic optimization operations.</p>
    /// <p>Default: false</p>
    pub fn get_extra_compute_for_automatic_optimization(&self) -> &::std::option::Option<bool> {
        self.inner.get_extra_compute_for_automatic_optimization()
    }
}