aws_sdk_datapipeline/types/
_instance_identity.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p></p>
4/// <p>Identity information for the EC2 instance that is hosting the task runner. You can get this value by calling a metadata URI from the EC2 instance. For more information, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html">Instance Metadata</a> in the <i>Amazon Elastic Compute Cloud User Guide.</i> Passing in this value proves that your task runner is running on an EC2 instance, and ensures the proper AWS Data Pipeline service charges are applied to your pipeline.</p>
5/// <p></p>
6#[non_exhaustive]
7#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
8pub struct InstanceIdentity {
9    /// <p>A description of an EC2 instance that is generated when the instance is launched and exposed to the instance via the instance metadata service in the form of a JSON representation of an object.</p>
10    pub document: ::std::option::Option<::std::string::String>,
11    /// <p>A signature which can be used to verify the accuracy and authenticity of the information provided in the instance identity document.</p>
12    pub signature: ::std::option::Option<::std::string::String>,
13}
14impl InstanceIdentity {
15    /// <p>A description of an EC2 instance that is generated when the instance is launched and exposed to the instance via the instance metadata service in the form of a JSON representation of an object.</p>
16    pub fn document(&self) -> ::std::option::Option<&str> {
17        self.document.as_deref()
18    }
19    /// <p>A signature which can be used to verify the accuracy and authenticity of the information provided in the instance identity document.</p>
20    pub fn signature(&self) -> ::std::option::Option<&str> {
21        self.signature.as_deref()
22    }
23}
24impl InstanceIdentity {
25    /// Creates a new builder-style object to manufacture [`InstanceIdentity`](crate::types::InstanceIdentity).
26    pub fn builder() -> crate::types::builders::InstanceIdentityBuilder {
27        crate::types::builders::InstanceIdentityBuilder::default()
28    }
29}
30
31/// A builder for [`InstanceIdentity`](crate::types::InstanceIdentity).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct InstanceIdentityBuilder {
35    pub(crate) document: ::std::option::Option<::std::string::String>,
36    pub(crate) signature: ::std::option::Option<::std::string::String>,
37}
38impl InstanceIdentityBuilder {
39    /// <p>A description of an EC2 instance that is generated when the instance is launched and exposed to the instance via the instance metadata service in the form of a JSON representation of an object.</p>
40    pub fn document(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41        self.document = ::std::option::Option::Some(input.into());
42        self
43    }
44    /// <p>A description of an EC2 instance that is generated when the instance is launched and exposed to the instance via the instance metadata service in the form of a JSON representation of an object.</p>
45    pub fn set_document(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46        self.document = input;
47        self
48    }
49    /// <p>A description of an EC2 instance that is generated when the instance is launched and exposed to the instance via the instance metadata service in the form of a JSON representation of an object.</p>
50    pub fn get_document(&self) -> &::std::option::Option<::std::string::String> {
51        &self.document
52    }
53    /// <p>A signature which can be used to verify the accuracy and authenticity of the information provided in the instance identity document.</p>
54    pub fn signature(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.signature = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>A signature which can be used to verify the accuracy and authenticity of the information provided in the instance identity document.</p>
59    pub fn set_signature(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.signature = input;
61        self
62    }
63    /// <p>A signature which can be used to verify the accuracy and authenticity of the information provided in the instance identity document.</p>
64    pub fn get_signature(&self) -> &::std::option::Option<::std::string::String> {
65        &self.signature
66    }
67    /// Consumes the builder and constructs a [`InstanceIdentity`](crate::types::InstanceIdentity).
68    pub fn build(self) -> crate::types::InstanceIdentity {
69        crate::types::InstanceIdentity {
70            document: self.document,
71            signature: self.signature,
72        }
73    }
74}