aws-sdk-appstream 1.111.0

AWS SDK for Amazon AppStream
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Describes a streaming session.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Session {
    /// <p>The identifier of the streaming session.</p>
    pub id: ::std::option::Option<::std::string::String>,
    /// <p>The identifier of the user for whom the session was created.</p>
    pub user_id: ::std::option::Option<::std::string::String>,
    /// <p>The name of the stack for the streaming session.</p>
    pub stack_name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the fleet for the streaming session.</p>
    pub fleet_name: ::std::option::Option<::std::string::String>,
    /// <p>The current state of the streaming session.</p>
    pub state: ::std::option::Option<crate::types::SessionState>,
    /// <p>Specifies whether a user is connected to the streaming session.</p>
    pub connection_state: ::std::option::Option<crate::types::SessionConnectionState>,
    /// <p>The time when a streaming instance is dedicated for the user.</p>
    pub start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The time when the streaming session is set to expire. This time is based on the <code>MaxUserDurationinSeconds</code> value, which determines the maximum length of time that a streaming session can run. A streaming session might end earlier than the time specified in <code>SessionMaxExpirationTime</code>, when the <code>DisconnectTimeOutInSeconds</code> elapses or the user chooses to end his or her session. If the <code>DisconnectTimeOutInSeconds</code> elapses, or the user chooses to end his or her session, the streaming instance is terminated and the streaming session ends.</p>
    pub max_expiration_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The authentication method. The user is authenticated using a streaming URL (<code>API</code>) or SAML 2.0 federation (<code>SAML</code>).</p>
    pub authentication_type: ::std::option::Option<crate::types::AuthenticationType>,
    /// <p>The network details for the streaming session.</p>
    pub network_access_configuration: ::std::option::Option<crate::types::NetworkAccessConfiguration>,
    /// <p>The identifier for the instance hosting the session.</p>
    pub instance_id: ::std::option::Option<::std::string::String>,
    /// <p>The drain status of the instance hosting the streaming session. This only applies to multi-session fleets.</p>
    pub instance_drain_status: ::std::option::Option<crate::types::InstanceDrainStatus>,
}
impl Session {
    /// <p>The identifier of the streaming session.</p>
    pub fn id(&self) -> ::std::option::Option<&str> {
        self.id.as_deref()
    }
    /// <p>The identifier of the user for whom the session was created.</p>
    pub fn user_id(&self) -> ::std::option::Option<&str> {
        self.user_id.as_deref()
    }
    /// <p>The name of the stack for the streaming session.</p>
    pub fn stack_name(&self) -> ::std::option::Option<&str> {
        self.stack_name.as_deref()
    }
    /// <p>The name of the fleet for the streaming session.</p>
    pub fn fleet_name(&self) -> ::std::option::Option<&str> {
        self.fleet_name.as_deref()
    }
    /// <p>The current state of the streaming session.</p>
    pub fn state(&self) -> ::std::option::Option<&crate::types::SessionState> {
        self.state.as_ref()
    }
    /// <p>Specifies whether a user is connected to the streaming session.</p>
    pub fn connection_state(&self) -> ::std::option::Option<&crate::types::SessionConnectionState> {
        self.connection_state.as_ref()
    }
    /// <p>The time when a streaming instance is dedicated for the user.</p>
    pub fn start_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.start_time.as_ref()
    }
    /// <p>The time when the streaming session is set to expire. This time is based on the <code>MaxUserDurationinSeconds</code> value, which determines the maximum length of time that a streaming session can run. A streaming session might end earlier than the time specified in <code>SessionMaxExpirationTime</code>, when the <code>DisconnectTimeOutInSeconds</code> elapses or the user chooses to end his or her session. If the <code>DisconnectTimeOutInSeconds</code> elapses, or the user chooses to end his or her session, the streaming instance is terminated and the streaming session ends.</p>
    pub fn max_expiration_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.max_expiration_time.as_ref()
    }
    /// <p>The authentication method. The user is authenticated using a streaming URL (<code>API</code>) or SAML 2.0 federation (<code>SAML</code>).</p>
    pub fn authentication_type(&self) -> ::std::option::Option<&crate::types::AuthenticationType> {
        self.authentication_type.as_ref()
    }
    /// <p>The network details for the streaming session.</p>
    pub fn network_access_configuration(&self) -> ::std::option::Option<&crate::types::NetworkAccessConfiguration> {
        self.network_access_configuration.as_ref()
    }
    /// <p>The identifier for the instance hosting the session.</p>
    pub fn instance_id(&self) -> ::std::option::Option<&str> {
        self.instance_id.as_deref()
    }
    /// <p>The drain status of the instance hosting the streaming session. This only applies to multi-session fleets.</p>
    pub fn instance_drain_status(&self) -> ::std::option::Option<&crate::types::InstanceDrainStatus> {
        self.instance_drain_status.as_ref()
    }
}
impl Session {
    /// Creates a new builder-style object to manufacture [`Session`](crate::types::Session).
    pub fn builder() -> crate::types::builders::SessionBuilder {
        crate::types::builders::SessionBuilder::default()
    }
}

/// A builder for [`Session`](crate::types::Session).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SessionBuilder {
    pub(crate) id: ::std::option::Option<::std::string::String>,
    pub(crate) user_id: ::std::option::Option<::std::string::String>,
    pub(crate) stack_name: ::std::option::Option<::std::string::String>,
    pub(crate) fleet_name: ::std::option::Option<::std::string::String>,
    pub(crate) state: ::std::option::Option<crate::types::SessionState>,
    pub(crate) connection_state: ::std::option::Option<crate::types::SessionConnectionState>,
    pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) max_expiration_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) authentication_type: ::std::option::Option<crate::types::AuthenticationType>,
    pub(crate) network_access_configuration: ::std::option::Option<crate::types::NetworkAccessConfiguration>,
    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
    pub(crate) instance_drain_status: ::std::option::Option<crate::types::InstanceDrainStatus>,
}
impl SessionBuilder {
    /// <p>The identifier of the streaming session.</p>
    /// This field is required.
    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the streaming session.</p>
    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.id = input;
        self
    }
    /// <p>The identifier of the streaming session.</p>
    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.id
    }
    /// <p>The identifier of the user for whom the session was created.</p>
    /// This field is required.
    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.user_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the user for whom the session was created.</p>
    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.user_id = input;
        self
    }
    /// <p>The identifier of the user for whom the session was created.</p>
    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.user_id
    }
    /// <p>The name of the stack for the streaming session.</p>
    /// This field is required.
    pub fn stack_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.stack_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the stack for the streaming session.</p>
    pub fn set_stack_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.stack_name = input;
        self
    }
    /// <p>The name of the stack for the streaming session.</p>
    pub fn get_stack_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.stack_name
    }
    /// <p>The name of the fleet for the streaming session.</p>
    /// This field is required.
    pub fn fleet_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.fleet_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the fleet for the streaming session.</p>
    pub fn set_fleet_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.fleet_name = input;
        self
    }
    /// <p>The name of the fleet for the streaming session.</p>
    pub fn get_fleet_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.fleet_name
    }
    /// <p>The current state of the streaming session.</p>
    /// This field is required.
    pub fn state(mut self, input: crate::types::SessionState) -> Self {
        self.state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current state of the streaming session.</p>
    pub fn set_state(mut self, input: ::std::option::Option<crate::types::SessionState>) -> Self {
        self.state = input;
        self
    }
    /// <p>The current state of the streaming session.</p>
    pub fn get_state(&self) -> &::std::option::Option<crate::types::SessionState> {
        &self.state
    }
    /// <p>Specifies whether a user is connected to the streaming session.</p>
    pub fn connection_state(mut self, input: crate::types::SessionConnectionState) -> Self {
        self.connection_state = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies whether a user is connected to the streaming session.</p>
    pub fn set_connection_state(mut self, input: ::std::option::Option<crate::types::SessionConnectionState>) -> Self {
        self.connection_state = input;
        self
    }
    /// <p>Specifies whether a user is connected to the streaming session.</p>
    pub fn get_connection_state(&self) -> &::std::option::Option<crate::types::SessionConnectionState> {
        &self.connection_state
    }
    /// <p>The time when a streaming instance is dedicated for the user.</p>
    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.start_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time when a streaming instance is dedicated for the user.</p>
    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.start_time = input;
        self
    }
    /// <p>The time when a streaming instance is dedicated for the user.</p>
    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.start_time
    }
    /// <p>The time when the streaming session is set to expire. This time is based on the <code>MaxUserDurationinSeconds</code> value, which determines the maximum length of time that a streaming session can run. A streaming session might end earlier than the time specified in <code>SessionMaxExpirationTime</code>, when the <code>DisconnectTimeOutInSeconds</code> elapses or the user chooses to end his or her session. If the <code>DisconnectTimeOutInSeconds</code> elapses, or the user chooses to end his or her session, the streaming instance is terminated and the streaming session ends.</p>
    pub fn max_expiration_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.max_expiration_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time when the streaming session is set to expire. This time is based on the <code>MaxUserDurationinSeconds</code> value, which determines the maximum length of time that a streaming session can run. A streaming session might end earlier than the time specified in <code>SessionMaxExpirationTime</code>, when the <code>DisconnectTimeOutInSeconds</code> elapses or the user chooses to end his or her session. If the <code>DisconnectTimeOutInSeconds</code> elapses, or the user chooses to end his or her session, the streaming instance is terminated and the streaming session ends.</p>
    pub fn set_max_expiration_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.max_expiration_time = input;
        self
    }
    /// <p>The time when the streaming session is set to expire. This time is based on the <code>MaxUserDurationinSeconds</code> value, which determines the maximum length of time that a streaming session can run. A streaming session might end earlier than the time specified in <code>SessionMaxExpirationTime</code>, when the <code>DisconnectTimeOutInSeconds</code> elapses or the user chooses to end his or her session. If the <code>DisconnectTimeOutInSeconds</code> elapses, or the user chooses to end his or her session, the streaming instance is terminated and the streaming session ends.</p>
    pub fn get_max_expiration_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.max_expiration_time
    }
    /// <p>The authentication method. The user is authenticated using a streaming URL (<code>API</code>) or SAML 2.0 federation (<code>SAML</code>).</p>
    pub fn authentication_type(mut self, input: crate::types::AuthenticationType) -> Self {
        self.authentication_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The authentication method. The user is authenticated using a streaming URL (<code>API</code>) or SAML 2.0 federation (<code>SAML</code>).</p>
    pub fn set_authentication_type(mut self, input: ::std::option::Option<crate::types::AuthenticationType>) -> Self {
        self.authentication_type = input;
        self
    }
    /// <p>The authentication method. The user is authenticated using a streaming URL (<code>API</code>) or SAML 2.0 federation (<code>SAML</code>).</p>
    pub fn get_authentication_type(&self) -> &::std::option::Option<crate::types::AuthenticationType> {
        &self.authentication_type
    }
    /// <p>The network details for the streaming session.</p>
    pub fn network_access_configuration(mut self, input: crate::types::NetworkAccessConfiguration) -> Self {
        self.network_access_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>The network details for the streaming session.</p>
    pub fn set_network_access_configuration(mut self, input: ::std::option::Option<crate::types::NetworkAccessConfiguration>) -> Self {
        self.network_access_configuration = input;
        self
    }
    /// <p>The network details for the streaming session.</p>
    pub fn get_network_access_configuration(&self) -> &::std::option::Option<crate::types::NetworkAccessConfiguration> {
        &self.network_access_configuration
    }
    /// <p>The identifier for the instance hosting the session.</p>
    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier for the instance hosting the session.</p>
    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_id = input;
        self
    }
    /// <p>The identifier for the instance hosting the session.</p>
    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_id
    }
    /// <p>The drain status of the instance hosting the streaming session. This only applies to multi-session fleets.</p>
    pub fn instance_drain_status(mut self, input: crate::types::InstanceDrainStatus) -> Self {
        self.instance_drain_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The drain status of the instance hosting the streaming session. This only applies to multi-session fleets.</p>
    pub fn set_instance_drain_status(mut self, input: ::std::option::Option<crate::types::InstanceDrainStatus>) -> Self {
        self.instance_drain_status = input;
        self
    }
    /// <p>The drain status of the instance hosting the streaming session. This only applies to multi-session fleets.</p>
    pub fn get_instance_drain_status(&self) -> &::std::option::Option<crate::types::InstanceDrainStatus> {
        &self.instance_drain_status
    }
    /// Consumes the builder and constructs a [`Session`](crate::types::Session).
    pub fn build(self) -> crate::types::Session {
        crate::types::Session {
            id: self.id,
            user_id: self.user_id,
            stack_name: self.stack_name,
            fleet_name: self.fleet_name,
            state: self.state,
            connection_state: self.connection_state,
            start_time: self.start_time,
            max_expiration_time: self.max_expiration_time,
            authentication_type: self.authentication_type,
            network_access_configuration: self.network_access_configuration,
            instance_id: self.instance_id,
            instance_drain_status: self.instance_drain_status,
        }
    }
}