// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Describes an App Runner service. It can describe a service in any state, including deleted services.</p>
/// <p>This type contains the full information about a service, including configuration details. It's returned by the <a href="https://docs.aws.amazon.com/apprunner/latest/api/API_CreateService.html">CreateService</a>, <a href="https://docs.aws.amazon.com/apprunner/latest/api/API_DescribeService.html">DescribeService</a>, and <a href="https://docs.aws.amazon.com/apprunner/latest/api/API_DeleteService.html">DeleteService</a> actions. A subset of this information is returned by the <a href="https://docs.aws.amazon.com/apprunner/latest/api/API_ListServices.html">ListServices</a> action using the <a href="https://docs.aws.amazon.com/apprunner/latest/api/API_ServiceSummary.html">ServiceSummary</a> type.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Service {
/// <p>The customer-provided service name.</p>
pub service_name: ::std::string::String,
/// <p>An ID that App Runner generated for this service. It's unique within the Amazon Web Services Region.</p>
pub service_id: ::std::string::String,
/// <p>The Amazon Resource Name (ARN) of this service.</p>
pub service_arn: ::std::string::String,
/// <p>A subdomain URL that App Runner generated for this service. You can use this URL to access your service web application.</p>
pub service_url: ::std::option::Option<::std::string::String>,
/// <p>The time when the App Runner service was created. It's in the Unix time stamp format.</p>
pub created_at: ::aws_smithy_types::DateTime,
/// <p>The time when the App Runner service was last updated at. It's in the Unix time stamp format.</p>
pub updated_at: ::aws_smithy_types::DateTime,
/// <p>The time when the App Runner service was deleted. It's in the Unix time stamp format.</p>
pub deleted_at: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The current state of the App Runner service. These particular values mean the following.</p>
/// <ul>
/// <li>
/// <p><code>CREATE_FAILED</code> – The service failed to create. The failed service isn't usable, and still counts towards your service quota. To troubleshoot this failure, read the failure events and logs, change any parameters that need to be fixed, and rebuild your service using <code>UpdateService</code>.</p></li>
/// <li>
/// <p><code>DELETE_FAILED</code> – The service failed to delete and can't be successfully recovered. Retry the service deletion call to ensure that all related resources are removed.</p></li>
/// </ul>
pub status: crate::types::ServiceStatus,
/// <p>The source deployed to the App Runner service. It can be a code or an image repository.</p>
pub source_configuration: ::std::option::Option<crate::types::SourceConfiguration>,
/// <p>The runtime configuration of instances (scaling units) of this service.</p>
pub instance_configuration: ::std::option::Option<crate::types::InstanceConfiguration>,
/// <p>The encryption key that App Runner uses to encrypt the service logs and the copy of the source repository that App Runner maintains for the service. It can be either a customer-provided encryption key or an Amazon Web Services managed key.</p>
pub encryption_configuration: ::std::option::Option<crate::types::EncryptionConfiguration>,
/// <p>The settings for the health check that App Runner performs to monitor the health of this service.</p>
pub health_check_configuration: ::std::option::Option<crate::types::HealthCheckConfiguration>,
/// <p>Summary information for the App Runner automatic scaling configuration resource that's associated with this service.</p>
pub auto_scaling_configuration_summary: ::std::option::Option<crate::types::AutoScalingConfigurationSummary>,
/// <p>Configuration settings related to network traffic of the web application that this service runs.</p>
pub network_configuration: ::std::option::Option<crate::types::NetworkConfiguration>,
/// <p>The observability configuration of this service.</p>
pub observability_configuration: ::std::option::Option<crate::types::ServiceObservabilityConfiguration>,
}
impl Service {
/// <p>The customer-provided service name.</p>
pub fn service_name(&self) -> &str {
use std::ops::Deref;
self.service_name.deref()
}
/// <p>An ID that App Runner generated for this service. It's unique within the Amazon Web Services Region.</p>
pub fn service_id(&self) -> &str {
use std::ops::Deref;
self.service_id.deref()
}
/// <p>The Amazon Resource Name (ARN) of this service.</p>
pub fn service_arn(&self) -> &str {
use std::ops::Deref;
self.service_arn.deref()
}
/// <p>A subdomain URL that App Runner generated for this service. You can use this URL to access your service web application.</p>
pub fn service_url(&self) -> ::std::option::Option<&str> {
self.service_url.as_deref()
}
/// <p>The time when the App Runner service was created. It's in the Unix time stamp format.</p>
pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
&self.created_at
}
/// <p>The time when the App Runner service was last updated at. It's in the Unix time stamp format.</p>
pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
&self.updated_at
}
/// <p>The time when the App Runner service was deleted. It's in the Unix time stamp format.</p>
pub fn deleted_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.deleted_at.as_ref()
}
/// <p>The current state of the App Runner service. These particular values mean the following.</p>
/// <ul>
/// <li>
/// <p><code>CREATE_FAILED</code> – The service failed to create. The failed service isn't usable, and still counts towards your service quota. To troubleshoot this failure, read the failure events and logs, change any parameters that need to be fixed, and rebuild your service using <code>UpdateService</code>.</p></li>
/// <li>
/// <p><code>DELETE_FAILED</code> – The service failed to delete and can't be successfully recovered. Retry the service deletion call to ensure that all related resources are removed.</p></li>
/// </ul>
pub fn status(&self) -> &crate::types::ServiceStatus {
&self.status
}
/// <p>The source deployed to the App Runner service. It can be a code or an image repository.</p>
pub fn source_configuration(&self) -> ::std::option::Option<&crate::types::SourceConfiguration> {
self.source_configuration.as_ref()
}
/// <p>The runtime configuration of instances (scaling units) of this service.</p>
pub fn instance_configuration(&self) -> ::std::option::Option<&crate::types::InstanceConfiguration> {
self.instance_configuration.as_ref()
}
/// <p>The encryption key that App Runner uses to encrypt the service logs and the copy of the source repository that App Runner maintains for the service. It can be either a customer-provided encryption key or an Amazon Web Services managed key.</p>
pub fn encryption_configuration(&self) -> ::std::option::Option<&crate::types::EncryptionConfiguration> {
self.encryption_configuration.as_ref()
}
/// <p>The settings for the health check that App Runner performs to monitor the health of this service.</p>
pub fn health_check_configuration(&self) -> ::std::option::Option<&crate::types::HealthCheckConfiguration> {
self.health_check_configuration.as_ref()
}
/// <p>Summary information for the App Runner automatic scaling configuration resource that's associated with this service.</p>
pub fn auto_scaling_configuration_summary(&self) -> ::std::option::Option<&crate::types::AutoScalingConfigurationSummary> {
self.auto_scaling_configuration_summary.as_ref()
}
/// <p>Configuration settings related to network traffic of the web application that this service runs.</p>
pub fn network_configuration(&self) -> ::std::option::Option<&crate::types::NetworkConfiguration> {
self.network_configuration.as_ref()
}
/// <p>The observability configuration of this service.</p>
pub fn observability_configuration(&self) -> ::std::option::Option<&crate::types::ServiceObservabilityConfiguration> {
self.observability_configuration.as_ref()
}
}
impl Service {
/// Creates a new builder-style object to manufacture [`Service`](crate::types::Service).
pub fn builder() -> crate::types::builders::ServiceBuilder {
crate::types::builders::ServiceBuilder::default()
}
}
/// A builder for [`Service`](crate::types::Service).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ServiceBuilder {
pub(crate) service_name: ::std::option::Option<::std::string::String>,
pub(crate) service_id: ::std::option::Option<::std::string::String>,
pub(crate) service_arn: ::std::option::Option<::std::string::String>,
pub(crate) service_url: ::std::option::Option<::std::string::String>,
pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) deleted_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) status: ::std::option::Option<crate::types::ServiceStatus>,
pub(crate) source_configuration: ::std::option::Option<crate::types::SourceConfiguration>,
pub(crate) instance_configuration: ::std::option::Option<crate::types::InstanceConfiguration>,
pub(crate) encryption_configuration: ::std::option::Option<crate::types::EncryptionConfiguration>,
pub(crate) health_check_configuration: ::std::option::Option<crate::types::HealthCheckConfiguration>,
pub(crate) auto_scaling_configuration_summary: ::std::option::Option<crate::types::AutoScalingConfigurationSummary>,
pub(crate) network_configuration: ::std::option::Option<crate::types::NetworkConfiguration>,
pub(crate) observability_configuration: ::std::option::Option<crate::types::ServiceObservabilityConfiguration>,
}
impl ServiceBuilder {
/// <p>The customer-provided service name.</p>
/// This field is required.
pub fn service_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.service_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The customer-provided service name.</p>
pub fn set_service_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.service_name = input;
self
}
/// <p>The customer-provided service name.</p>
pub fn get_service_name(&self) -> &::std::option::Option<::std::string::String> {
&self.service_name
}
/// <p>An ID that App Runner generated for this service. It's unique within the Amazon Web Services Region.</p>
/// This field is required.
pub fn service_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.service_id = ::std::option::Option::Some(input.into());
self
}
/// <p>An ID that App Runner generated for this service. It's unique within the Amazon Web Services Region.</p>
pub fn set_service_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.service_id = input;
self
}
/// <p>An ID that App Runner generated for this service. It's unique within the Amazon Web Services Region.</p>
pub fn get_service_id(&self) -> &::std::option::Option<::std::string::String> {
&self.service_id
}
/// <p>The Amazon Resource Name (ARN) of this service.</p>
/// This field is required.
pub fn service_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.service_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of this service.</p>
pub fn set_service_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.service_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) of this service.</p>
pub fn get_service_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.service_arn
}
/// <p>A subdomain URL that App Runner generated for this service. You can use this URL to access your service web application.</p>
pub fn service_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.service_url = ::std::option::Option::Some(input.into());
self
}
/// <p>A subdomain URL that App Runner generated for this service. You can use this URL to access your service web application.</p>
pub fn set_service_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.service_url = input;
self
}
/// <p>A subdomain URL that App Runner generated for this service. You can use this URL to access your service web application.</p>
pub fn get_service_url(&self) -> &::std::option::Option<::std::string::String> {
&self.service_url
}
/// <p>The time when the App Runner service was created. It's in the Unix time stamp format.</p>
/// This field is required.
pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_at = ::std::option::Option::Some(input);
self
}
/// <p>The time when the App Runner service was created. It's in the Unix time stamp format.</p>
pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_at = input;
self
}
/// <p>The time when the App Runner service was created. It's in the Unix time stamp format.</p>
pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_at
}
/// <p>The time when the App Runner service was last updated at. It's in the Unix time stamp format.</p>
/// This field is required.
pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.updated_at = ::std::option::Option::Some(input);
self
}
/// <p>The time when the App Runner service was last updated at. It's in the Unix time stamp format.</p>
pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.updated_at = input;
self
}
/// <p>The time when the App Runner service was last updated at. It's in the Unix time stamp format.</p>
pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.updated_at
}
/// <p>The time when the App Runner service was deleted. It's in the Unix time stamp format.</p>
pub fn deleted_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.deleted_at = ::std::option::Option::Some(input);
self
}
/// <p>The time when the App Runner service was deleted. It's in the Unix time stamp format.</p>
pub fn set_deleted_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.deleted_at = input;
self
}
/// <p>The time when the App Runner service was deleted. It's in the Unix time stamp format.</p>
pub fn get_deleted_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.deleted_at
}
/// <p>The current state of the App Runner service. These particular values mean the following.</p>
/// <ul>
/// <li>
/// <p><code>CREATE_FAILED</code> – The service failed to create. The failed service isn't usable, and still counts towards your service quota. To troubleshoot this failure, read the failure events and logs, change any parameters that need to be fixed, and rebuild your service using <code>UpdateService</code>.</p></li>
/// <li>
/// <p><code>DELETE_FAILED</code> – The service failed to delete and can't be successfully recovered. Retry the service deletion call to ensure that all related resources are removed.</p></li>
/// </ul>
/// This field is required.
pub fn status(mut self, input: crate::types::ServiceStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
/// <p>The current state of the App Runner service. These particular values mean the following.</p>
/// <ul>
/// <li>
/// <p><code>CREATE_FAILED</code> – The service failed to create. The failed service isn't usable, and still counts towards your service quota. To troubleshoot this failure, read the failure events and logs, change any parameters that need to be fixed, and rebuild your service using <code>UpdateService</code>.</p></li>
/// <li>
/// <p><code>DELETE_FAILED</code> – The service failed to delete and can't be successfully recovered. Retry the service deletion call to ensure that all related resources are removed.</p></li>
/// </ul>
pub fn set_status(mut self, input: ::std::option::Option<crate::types::ServiceStatus>) -> Self {
self.status = input;
self
}
/// <p>The current state of the App Runner service. These particular values mean the following.</p>
/// <ul>
/// <li>
/// <p><code>CREATE_FAILED</code> – The service failed to create. The failed service isn't usable, and still counts towards your service quota. To troubleshoot this failure, read the failure events and logs, change any parameters that need to be fixed, and rebuild your service using <code>UpdateService</code>.</p></li>
/// <li>
/// <p><code>DELETE_FAILED</code> – The service failed to delete and can't be successfully recovered. Retry the service deletion call to ensure that all related resources are removed.</p></li>
/// </ul>
pub fn get_status(&self) -> &::std::option::Option<crate::types::ServiceStatus> {
&self.status
}
/// <p>The source deployed to the App Runner service. It can be a code or an image repository.</p>
/// This field is required.
pub fn source_configuration(mut self, input: crate::types::SourceConfiguration) -> Self {
self.source_configuration = ::std::option::Option::Some(input);
self
}
/// <p>The source deployed to the App Runner service. It can be a code or an image repository.</p>
pub fn set_source_configuration(mut self, input: ::std::option::Option<crate::types::SourceConfiguration>) -> Self {
self.source_configuration = input;
self
}
/// <p>The source deployed to the App Runner service. It can be a code or an image repository.</p>
pub fn get_source_configuration(&self) -> &::std::option::Option<crate::types::SourceConfiguration> {
&self.source_configuration
}
/// <p>The runtime configuration of instances (scaling units) of this service.</p>
/// This field is required.
pub fn instance_configuration(mut self, input: crate::types::InstanceConfiguration) -> Self {
self.instance_configuration = ::std::option::Option::Some(input);
self
}
/// <p>The runtime configuration of instances (scaling units) of this service.</p>
pub fn set_instance_configuration(mut self, input: ::std::option::Option<crate::types::InstanceConfiguration>) -> Self {
self.instance_configuration = input;
self
}
/// <p>The runtime configuration of instances (scaling units) of this service.</p>
pub fn get_instance_configuration(&self) -> &::std::option::Option<crate::types::InstanceConfiguration> {
&self.instance_configuration
}
/// <p>The encryption key that App Runner uses to encrypt the service logs and the copy of the source repository that App Runner maintains for the service. It can be either a customer-provided encryption key or an Amazon Web Services managed key.</p>
pub fn encryption_configuration(mut self, input: crate::types::EncryptionConfiguration) -> Self {
self.encryption_configuration = ::std::option::Option::Some(input);
self
}
/// <p>The encryption key that App Runner uses to encrypt the service logs and the copy of the source repository that App Runner maintains for the service. It can be either a customer-provided encryption key or an Amazon Web Services managed key.</p>
pub fn set_encryption_configuration(mut self, input: ::std::option::Option<crate::types::EncryptionConfiguration>) -> Self {
self.encryption_configuration = input;
self
}
/// <p>The encryption key that App Runner uses to encrypt the service logs and the copy of the source repository that App Runner maintains for the service. It can be either a customer-provided encryption key or an Amazon Web Services managed key.</p>
pub fn get_encryption_configuration(&self) -> &::std::option::Option<crate::types::EncryptionConfiguration> {
&self.encryption_configuration
}
/// <p>The settings for the health check that App Runner performs to monitor the health of this service.</p>
pub fn health_check_configuration(mut self, input: crate::types::HealthCheckConfiguration) -> Self {
self.health_check_configuration = ::std::option::Option::Some(input);
self
}
/// <p>The settings for the health check that App Runner performs to monitor the health of this service.</p>
pub fn set_health_check_configuration(mut self, input: ::std::option::Option<crate::types::HealthCheckConfiguration>) -> Self {
self.health_check_configuration = input;
self
}
/// <p>The settings for the health check that App Runner performs to monitor the health of this service.</p>
pub fn get_health_check_configuration(&self) -> &::std::option::Option<crate::types::HealthCheckConfiguration> {
&self.health_check_configuration
}
/// <p>Summary information for the App Runner automatic scaling configuration resource that's associated with this service.</p>
/// This field is required.
pub fn auto_scaling_configuration_summary(mut self, input: crate::types::AutoScalingConfigurationSummary) -> Self {
self.auto_scaling_configuration_summary = ::std::option::Option::Some(input);
self
}
/// <p>Summary information for the App Runner automatic scaling configuration resource that's associated with this service.</p>
pub fn set_auto_scaling_configuration_summary(mut self, input: ::std::option::Option<crate::types::AutoScalingConfigurationSummary>) -> Self {
self.auto_scaling_configuration_summary = input;
self
}
/// <p>Summary information for the App Runner automatic scaling configuration resource that's associated with this service.</p>
pub fn get_auto_scaling_configuration_summary(&self) -> &::std::option::Option<crate::types::AutoScalingConfigurationSummary> {
&self.auto_scaling_configuration_summary
}
/// <p>Configuration settings related to network traffic of the web application that this service runs.</p>
/// This field is required.
pub fn network_configuration(mut self, input: crate::types::NetworkConfiguration) -> Self {
self.network_configuration = ::std::option::Option::Some(input);
self
}
/// <p>Configuration settings related to network traffic of the web application that this service runs.</p>
pub fn set_network_configuration(mut self, input: ::std::option::Option<crate::types::NetworkConfiguration>) -> Self {
self.network_configuration = input;
self
}
/// <p>Configuration settings related to network traffic of the web application that this service runs.</p>
pub fn get_network_configuration(&self) -> &::std::option::Option<crate::types::NetworkConfiguration> {
&self.network_configuration
}
/// <p>The observability configuration of this service.</p>
pub fn observability_configuration(mut self, input: crate::types::ServiceObservabilityConfiguration) -> Self {
self.observability_configuration = ::std::option::Option::Some(input);
self
}
/// <p>The observability configuration of this service.</p>
pub fn set_observability_configuration(mut self, input: ::std::option::Option<crate::types::ServiceObservabilityConfiguration>) -> Self {
self.observability_configuration = input;
self
}
/// <p>The observability configuration of this service.</p>
pub fn get_observability_configuration(&self) -> &::std::option::Option<crate::types::ServiceObservabilityConfiguration> {
&self.observability_configuration
}
/// Consumes the builder and constructs a [`Service`](crate::types::Service).
/// This method will fail if any of the following fields are not set:
/// - [`service_name`](crate::types::builders::ServiceBuilder::service_name)
/// - [`service_id`](crate::types::builders::ServiceBuilder::service_id)
/// - [`service_arn`](crate::types::builders::ServiceBuilder::service_arn)
/// - [`created_at`](crate::types::builders::ServiceBuilder::created_at)
/// - [`updated_at`](crate::types::builders::ServiceBuilder::updated_at)
/// - [`status`](crate::types::builders::ServiceBuilder::status)
pub fn build(self) -> ::std::result::Result<crate::types::Service, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Service {
service_name: self.service_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"service_name",
"service_name was not specified but it is required when building Service",
)
})?,
service_id: self.service_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"service_id",
"service_id was not specified but it is required when building Service",
)
})?,
service_arn: self.service_arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"service_arn",
"service_arn was not specified but it is required when building Service",
)
})?,
service_url: self.service_url,
created_at: self.created_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"created_at",
"created_at was not specified but it is required when building Service",
)
})?,
updated_at: self.updated_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"updated_at",
"updated_at was not specified but it is required when building Service",
)
})?,
deleted_at: self.deleted_at,
status: self.status.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"status",
"status was not specified but it is required when building Service",
)
})?,
source_configuration: self.source_configuration,
instance_configuration: self.instance_configuration,
encryption_configuration: self.encryption_configuration,
health_check_configuration: self.health_check_configuration,
auto_scaling_configuration_summary: self.auto_scaling_configuration_summary,
network_configuration: self.network_configuration,
observability_configuration: self.observability_configuration,
})
}
}