aws-sdk-gamelift 1.119.0

AWS SDK for Amazon GameLift
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::describe_container_group_port_mappings::_describe_container_group_port_mappings_input::DescribeContainerGroupPortMappingsInputBuilder;

pub use crate::operation::describe_container_group_port_mappings::_describe_container_group_port_mappings_output::DescribeContainerGroupPortMappingsOutputBuilder;

impl crate::operation::describe_container_group_port_mappings::builders::DescribeContainerGroupPortMappingsInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::describe_container_group_port_mappings::DescribeContainerGroupPortMappingsOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::describe_container_group_port_mappings::DescribeContainerGroupPortMappingsError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.describe_container_group_port_mappings();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `DescribeContainerGroupPortMappings`.
///
/// <p><b>This API works with the following fleet types:</b> Container</p>
/// <p>Retrieves the port mappings for a container group running on a container fleet. Port mappings show how container ports are mapped to connection ports on the fleet instance. Use this operation to find the connection port for a specific container on a fleet instance.</p>
/// <p><b>Request options</b></p>
/// <ul>
/// <li>
/// <p>Get port mappings for a game server container group. Provide the fleet ID, set <code>ContainerGroupType</code> to <code>GAME_SERVER</code>, and specify the <code>ComputeName</code> for the game server container group.</p></li>
/// <li>
/// <p>Get port mappings for a per-instance container group. Provide the fleet ID, set <code>ContainerGroupType</code> to <code>PER_INSTANCE</code>, and specify the <code>InstanceId</code> for the instance.</p></li>
/// <li>
/// <p>Optionally filter results to a single container by providing a <code>ContainerName</code>.</p></li>
/// </ul>
/// <p><b>Results</b></p>
/// <p>This operation returns the fleet ID, fleet ARN, location, container group definition ARN, container group type, compute name (for game server container groups), instance ID, and a list of <code>ContainerGroupPortMapping</code> objects. Each object contains the container name, runtime ID, and a list of port mappings that show how container ports map to connection ports on the instance.</p>
/// <p><b>Learn more</b></p>
/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/containers-remote-access.html">Connect to containers</a></p>
/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/containers-create-groups.html">Create a container group definition</a></p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct DescribeContainerGroupPortMappingsFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::describe_container_group_port_mappings::builders::DescribeContainerGroupPortMappingsInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::describe_container_group_port_mappings::DescribeContainerGroupPortMappingsOutput,
        crate::operation::describe_container_group_port_mappings::DescribeContainerGroupPortMappingsError,
    > for DescribeContainerGroupPortMappingsFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::describe_container_group_port_mappings::DescribeContainerGroupPortMappingsOutput,
            crate::operation::describe_container_group_port_mappings::DescribeContainerGroupPortMappingsError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl DescribeContainerGroupPortMappingsFluentBuilder {
    /// Creates a new `DescribeContainerGroupPortMappingsFluentBuilder`.
    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 DescribeContainerGroupPortMappings as a reference.
    pub fn as_input(&self) -> &crate::operation::describe_container_group_port_mappings::builders::DescribeContainerGroupPortMappingsInputBuilder {
        &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::describe_container_group_port_mappings::DescribeContainerGroupPortMappingsOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::describe_container_group_port_mappings::DescribeContainerGroupPortMappingsError,
            ::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::describe_container_group_port_mappings::DescribeContainerGroupPortMappings::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::describe_container_group_port_mappings::DescribeContainerGroupPortMappings::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::describe_container_group_port_mappings::DescribeContainerGroupPortMappingsOutput,
        crate::operation::describe_container_group_port_mappings::DescribeContainerGroupPortMappingsError,
        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>A unique identifier for the container fleet. You can use either the fleet ID or ARN value.</p>
    pub fn fleet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.fleet_id(input.into());
        self
    }
    /// <p>A unique identifier for the container fleet. You can use either the fleet ID or ARN value.</p>
    pub fn set_fleet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_fleet_id(input);
        self
    }
    /// <p>A unique identifier for the container fleet. You can use either the fleet ID or ARN value.</p>
    pub fn get_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_fleet_id()
    }
    /// <p>The type of container group to retrieve port mappings for.</p>
    /// <ul>
    /// <li>
    /// <p><code>GAME_SERVER</code> -- Get port mappings for a game server container group.</p></li>
    /// <li>
    /// <p><code>PER_INSTANCE</code> -- Get port mappings for a per-instance container group.</p></li>
    /// </ul>
    pub fn container_group_type(mut self, input: crate::types::ContainerGroupType) -> Self {
        self.inner = self.inner.container_group_type(input);
        self
    }
    /// <p>The type of container group to retrieve port mappings for.</p>
    /// <ul>
    /// <li>
    /// <p><code>GAME_SERVER</code> -- Get port mappings for a game server container group.</p></li>
    /// <li>
    /// <p><code>PER_INSTANCE</code> -- Get port mappings for a per-instance container group.</p></li>
    /// </ul>
    pub fn set_container_group_type(mut self, input: ::std::option::Option<crate::types::ContainerGroupType>) -> Self {
        self.inner = self.inner.set_container_group_type(input);
        self
    }
    /// <p>The type of container group to retrieve port mappings for.</p>
    /// <ul>
    /// <li>
    /// <p><code>GAME_SERVER</code> -- Get port mappings for a game server container group.</p></li>
    /// <li>
    /// <p><code>PER_INSTANCE</code> -- Get port mappings for a per-instance container group.</p></li>
    /// </ul>
    pub fn get_container_group_type(&self) -> &::std::option::Option<crate::types::ContainerGroupType> {
        self.inner.get_container_group_type()
    }
    /// <p>A unique identifier for the compute resource for which to retrieve port mappings. For a container fleet, a compute represents a game server container group running on a fleet instance. You can use either the compute name or ARN value.</p>
    /// <p>When <code>ContainerGroupType</code> is <code>GAME_SERVER</code>, this parameter is required.</p>
    /// <p>When <code>ContainerGroupType</code> is <code>PER_INSTANCE</code>, do not provide this parameter. If you provide a compute name with <code>PER_INSTANCE</code>, the request fails with an <code>InvalidRequestException</code>.</p>
    pub fn compute_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.compute_name(input.into());
        self
    }
    /// <p>A unique identifier for the compute resource for which to retrieve port mappings. For a container fleet, a compute represents a game server container group running on a fleet instance. You can use either the compute name or ARN value.</p>
    /// <p>When <code>ContainerGroupType</code> is <code>GAME_SERVER</code>, this parameter is required.</p>
    /// <p>When <code>ContainerGroupType</code> is <code>PER_INSTANCE</code>, do not provide this parameter. If you provide a compute name with <code>PER_INSTANCE</code>, the request fails with an <code>InvalidRequestException</code>.</p>
    pub fn set_compute_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_compute_name(input);
        self
    }
    /// <p>A unique identifier for the compute resource for which to retrieve port mappings. For a container fleet, a compute represents a game server container group running on a fleet instance. You can use either the compute name or ARN value.</p>
    /// <p>When <code>ContainerGroupType</code> is <code>GAME_SERVER</code>, this parameter is required.</p>
    /// <p>When <code>ContainerGroupType</code> is <code>PER_INSTANCE</code>, do not provide this parameter. If you provide a compute name with <code>PER_INSTANCE</code>, the request fails with an <code>InvalidRequestException</code>.</p>
    pub fn get_compute_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_compute_name()
    }
    /// <p>A unique identifier for the fleet instance to retrieve port mappings for.</p>
    /// <p>When <code>ContainerGroupType</code> is <code>PER_INSTANCE</code>, this parameter is required.</p>
    /// <p>When <code>ContainerGroupType</code> is <code>GAME_SERVER</code>, this parameter is optional. If you provide an instance ID, it must match the instance that's running the specified compute. If the instance ID doesn't match, the request fails with an <code>InvalidRequestException</code>.</p>
    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.instance_id(input.into());
        self
    }
    /// <p>A unique identifier for the fleet instance to retrieve port mappings for.</p>
    /// <p>When <code>ContainerGroupType</code> is <code>PER_INSTANCE</code>, this parameter is required.</p>
    /// <p>When <code>ContainerGroupType</code> is <code>GAME_SERVER</code>, this parameter is optional. If you provide an instance ID, it must match the instance that's running the specified compute. If the instance ID doesn't match, the request fails with an <code>InvalidRequestException</code>.</p>
    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_instance_id(input);
        self
    }
    /// <p>A unique identifier for the fleet instance to retrieve port mappings for.</p>
    /// <p>When <code>ContainerGroupType</code> is <code>PER_INSTANCE</code>, this parameter is required.</p>
    /// <p>When <code>ContainerGroupType</code> is <code>GAME_SERVER</code>, this parameter is optional. If you provide an instance ID, it must match the instance that's running the specified compute. If the instance ID doesn't match, the request fails with an <code>InvalidRequestException</code>.</p>
    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_instance_id()
    }
    /// <p>A container name to filter the results. When provided, the operation returns port mappings for the specified container only. If no container with the specified name exists in the container group, the request fails with a <code>NotFoundException</code>.</p>
    /// <p>If not provided, the operation returns port mappings for all containers in the container group.</p>
    pub fn container_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.container_name(input.into());
        self
    }
    /// <p>A container name to filter the results. When provided, the operation returns port mappings for the specified container only. If no container with the specified name exists in the container group, the request fails with a <code>NotFoundException</code>.</p>
    /// <p>If not provided, the operation returns port mappings for all containers in the container group.</p>
    pub fn set_container_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_container_name(input);
        self
    }
    /// <p>A container name to filter the results. When provided, the operation returns port mappings for the specified container only. If no container with the specified name exists in the container group, the request fails with a <code>NotFoundException</code>.</p>
    /// <p>If not provided, the operation returns port mappings for all containers in the container group.</p>
    pub fn get_container_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_container_name()
    }
}