aws_sdk_apprunner/operation/delete_service/
_delete_service_output.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 DeleteServiceOutput {
6    /// <p>A description of the App Runner service that this request just deleted.</p>
7    pub service: ::std::option::Option<crate::types::Service>,
8    /// <p>The unique ID of the asynchronous operation that this request started. You can use it combined with the <code>ListOperations</code> call to track the operation's progress.</p>
9    pub operation_id: ::std::string::String,
10    _request_id: Option<String>,
11}
12impl DeleteServiceOutput {
13    /// <p>A description of the App Runner service that this request just deleted.</p>
14    pub fn service(&self) -> ::std::option::Option<&crate::types::Service> {
15        self.service.as_ref()
16    }
17    /// <p>The unique ID of the asynchronous operation that this request started. You can use it combined with the <code>ListOperations</code> call to track the operation's progress.</p>
18    pub fn operation_id(&self) -> &str {
19        use std::ops::Deref;
20        self.operation_id.deref()
21    }
22}
23impl ::aws_types::request_id::RequestId for DeleteServiceOutput {
24    fn request_id(&self) -> Option<&str> {
25        self._request_id.as_deref()
26    }
27}
28impl DeleteServiceOutput {
29    /// Creates a new builder-style object to manufacture [`DeleteServiceOutput`](crate::operation::delete_service::DeleteServiceOutput).
30    pub fn builder() -> crate::operation::delete_service::builders::DeleteServiceOutputBuilder {
31        crate::operation::delete_service::builders::DeleteServiceOutputBuilder::default()
32    }
33}
34
35/// A builder for [`DeleteServiceOutput`](crate::operation::delete_service::DeleteServiceOutput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct DeleteServiceOutputBuilder {
39    pub(crate) service: ::std::option::Option<crate::types::Service>,
40    pub(crate) operation_id: ::std::option::Option<::std::string::String>,
41    _request_id: Option<String>,
42}
43impl DeleteServiceOutputBuilder {
44    /// <p>A description of the App Runner service that this request just deleted.</p>
45    /// This field is required.
46    pub fn service(mut self, input: crate::types::Service) -> Self {
47        self.service = ::std::option::Option::Some(input);
48        self
49    }
50    /// <p>A description of the App Runner service that this request just deleted.</p>
51    pub fn set_service(mut self, input: ::std::option::Option<crate::types::Service>) -> Self {
52        self.service = input;
53        self
54    }
55    /// <p>A description of the App Runner service that this request just deleted.</p>
56    pub fn get_service(&self) -> &::std::option::Option<crate::types::Service> {
57        &self.service
58    }
59    /// <p>The unique ID of the asynchronous operation that this request started. You can use it combined with the <code>ListOperations</code> call to track the operation's progress.</p>
60    /// This field is required.
61    pub fn operation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.operation_id = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The unique ID of the asynchronous operation that this request started. You can use it combined with the <code>ListOperations</code> call to track the operation's progress.</p>
66    pub fn set_operation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.operation_id = input;
68        self
69    }
70    /// <p>The unique ID of the asynchronous operation that this request started. You can use it combined with the <code>ListOperations</code> call to track the operation's progress.</p>
71    pub fn get_operation_id(&self) -> &::std::option::Option<::std::string::String> {
72        &self.operation_id
73    }
74    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
75        self._request_id = Some(request_id.into());
76        self
77    }
78
79    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
80        self._request_id = request_id;
81        self
82    }
83    /// Consumes the builder and constructs a [`DeleteServiceOutput`](crate::operation::delete_service::DeleteServiceOutput).
84    /// This method will fail if any of the following fields are not set:
85    /// - [`operation_id`](crate::operation::delete_service::builders::DeleteServiceOutputBuilder::operation_id)
86    pub fn build(
87        self,
88    ) -> ::std::result::Result<crate::operation::delete_service::DeleteServiceOutput, ::aws_smithy_types::error::operation::BuildError> {
89        ::std::result::Result::Ok(crate::operation::delete_service::DeleteServiceOutput {
90            service: self.service,
91            operation_id: self.operation_id.ok_or_else(|| {
92                ::aws_smithy_types::error::operation::BuildError::missing_field(
93                    "operation_id",
94                    "operation_id was not specified but it is required when building DeleteServiceOutput",
95                )
96            })?,
97            _request_id: self._request_id,
98        })
99    }
100}