aws_sdk_ecs/operation/delete_service/
_delete_service_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DeleteServiceInput {
6    /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to delete. If you do not specify a cluster, the default cluster is assumed.</p>
7    pub cluster: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the service to delete.</p>
9    pub service: ::std::option::Option<::std::string::String>,
10    /// <p>If <code>true</code>, allows you to delete a service even if it wasn't scaled down to zero tasks. It's only necessary to use this if the service uses the <code>REPLICA</code> scheduling strategy.</p>
11    pub force: ::std::option::Option<bool>,
12}
13impl DeleteServiceInput {
14    /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to delete. If you do not specify a cluster, the default cluster is assumed.</p>
15    pub fn cluster(&self) -> ::std::option::Option<&str> {
16        self.cluster.as_deref()
17    }
18    /// <p>The name of the service to delete.</p>
19    pub fn service(&self) -> ::std::option::Option<&str> {
20        self.service.as_deref()
21    }
22    /// <p>If <code>true</code>, allows you to delete a service even if it wasn't scaled down to zero tasks. It's only necessary to use this if the service uses the <code>REPLICA</code> scheduling strategy.</p>
23    pub fn force(&self) -> ::std::option::Option<bool> {
24        self.force
25    }
26}
27impl DeleteServiceInput {
28    /// Creates a new builder-style object to manufacture [`DeleteServiceInput`](crate::operation::delete_service::DeleteServiceInput).
29    pub fn builder() -> crate::operation::delete_service::builders::DeleteServiceInputBuilder {
30        crate::operation::delete_service::builders::DeleteServiceInputBuilder::default()
31    }
32}
33
34/// A builder for [`DeleteServiceInput`](crate::operation::delete_service::DeleteServiceInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct DeleteServiceInputBuilder {
38    pub(crate) cluster: ::std::option::Option<::std::string::String>,
39    pub(crate) service: ::std::option::Option<::std::string::String>,
40    pub(crate) force: ::std::option::Option<bool>,
41}
42impl DeleteServiceInputBuilder {
43    /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to delete. If you do not specify a cluster, the default cluster is assumed.</p>
44    pub fn cluster(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
45        self.cluster = ::std::option::Option::Some(input.into());
46        self
47    }
48    /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to delete. If you do not specify a cluster, the default cluster is assumed.</p>
49    pub fn set_cluster(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
50        self.cluster = input;
51        self
52    }
53    /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to delete. If you do not specify a cluster, the default cluster is assumed.</p>
54    pub fn get_cluster(&self) -> &::std::option::Option<::std::string::String> {
55        &self.cluster
56    }
57    /// <p>The name of the service to delete.</p>
58    /// This field is required.
59    pub fn service(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.service = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>The name of the service to delete.</p>
64    pub fn set_service(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.service = input;
66        self
67    }
68    /// <p>The name of the service to delete.</p>
69    pub fn get_service(&self) -> &::std::option::Option<::std::string::String> {
70        &self.service
71    }
72    /// <p>If <code>true</code>, allows you to delete a service even if it wasn't scaled down to zero tasks. It's only necessary to use this if the service uses the <code>REPLICA</code> scheduling strategy.</p>
73    pub fn force(mut self, input: bool) -> Self {
74        self.force = ::std::option::Option::Some(input);
75        self
76    }
77    /// <p>If <code>true</code>, allows you to delete a service even if it wasn't scaled down to zero tasks. It's only necessary to use this if the service uses the <code>REPLICA</code> scheduling strategy.</p>
78    pub fn set_force(mut self, input: ::std::option::Option<bool>) -> Self {
79        self.force = input;
80        self
81    }
82    /// <p>If <code>true</code>, allows you to delete a service even if it wasn't scaled down to zero tasks. It's only necessary to use this if the service uses the <code>REPLICA</code> scheduling strategy.</p>
83    pub fn get_force(&self) -> &::std::option::Option<bool> {
84        &self.force
85    }
86    /// Consumes the builder and constructs a [`DeleteServiceInput`](crate::operation::delete_service::DeleteServiceInput).
87    pub fn build(
88        self,
89    ) -> ::std::result::Result<crate::operation::delete_service::DeleteServiceInput, ::aws_smithy_types::error::operation::BuildError> {
90        ::std::result::Result::Ok(crate::operation::delete_service::DeleteServiceInput {
91            cluster: self.cluster,
92            service: self.service,
93            force: self.force,
94        })
95    }
96}