aws_sdk_codeguruprofiler/operation/configure_agent/_configure_agent_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The structure representing the configureAgentRequest.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ConfigureAgentInput {
7 /// <p>The name of the profiling group for which the configured agent is collecting profiling data.</p>
8 pub profiling_group_name: ::std::option::Option<::std::string::String>,
9 /// <p>A universally unique identifier (UUID) for a profiling instance. For example, if the profiling instance is an Amazon EC2 instance, it is the instance ID. If it is an AWS Fargate container, it is the container's task ID.</p>
10 pub fleet_instance_id: ::std::option::Option<::std::string::String>,
11 /// <p>Metadata captured about the compute platform the agent is running on. It includes information about sampling and reporting. The valid fields are:</p>
12 /// <ul>
13 /// <li>
14 /// <p><code>COMPUTE_PLATFORM</code> - The compute platform on which the agent is running</p></li>
15 /// <li>
16 /// <p><code>AGENT_ID</code> - The ID for an agent instance.</p></li>
17 /// <li>
18 /// <p><code>AWS_REQUEST_ID</code> - The AWS request ID of a Lambda invocation.</p></li>
19 /// <li>
20 /// <p><code>EXECUTION_ENVIRONMENT</code> - The execution environment a Lambda function is running on.</p></li>
21 /// <li>
22 /// <p><code>LAMBDA_FUNCTION_ARN</code> - The Amazon Resource Name (ARN) that is used to invoke a Lambda function.</p></li>
23 /// <li>
24 /// <p><code>LAMBDA_MEMORY_LIMIT_IN_MB</code> - The memory allocated to a Lambda function.</p></li>
25 /// <li>
26 /// <p><code>LAMBDA_REMAINING_TIME_IN_MILLISECONDS</code> - The time in milliseconds before execution of a Lambda function times out.</p></li>
27 /// <li>
28 /// <p><code>LAMBDA_TIME_GAP_BETWEEN_INVOKES_IN_MILLISECONDS</code> - The time in milliseconds between two invocations of a Lambda function.</p></li>
29 /// <li>
30 /// <p><code>LAMBDA_PREVIOUS_EXECUTION_TIME_IN_MILLISECONDS</code> - The time in milliseconds for the previous Lambda invocation.</p></li>
31 /// </ul>
32 pub metadata: ::std::option::Option<::std::collections::HashMap<crate::types::MetadataField, ::std::string::String>>,
33}
34impl ConfigureAgentInput {
35 /// <p>The name of the profiling group for which the configured agent is collecting profiling data.</p>
36 pub fn profiling_group_name(&self) -> ::std::option::Option<&str> {
37 self.profiling_group_name.as_deref()
38 }
39 /// <p>A universally unique identifier (UUID) for a profiling instance. For example, if the profiling instance is an Amazon EC2 instance, it is the instance ID. If it is an AWS Fargate container, it is the container's task ID.</p>
40 pub fn fleet_instance_id(&self) -> ::std::option::Option<&str> {
41 self.fleet_instance_id.as_deref()
42 }
43 /// <p>Metadata captured about the compute platform the agent is running on. It includes information about sampling and reporting. The valid fields are:</p>
44 /// <ul>
45 /// <li>
46 /// <p><code>COMPUTE_PLATFORM</code> - The compute platform on which the agent is running</p></li>
47 /// <li>
48 /// <p><code>AGENT_ID</code> - The ID for an agent instance.</p></li>
49 /// <li>
50 /// <p><code>AWS_REQUEST_ID</code> - The AWS request ID of a Lambda invocation.</p></li>
51 /// <li>
52 /// <p><code>EXECUTION_ENVIRONMENT</code> - The execution environment a Lambda function is running on.</p></li>
53 /// <li>
54 /// <p><code>LAMBDA_FUNCTION_ARN</code> - The Amazon Resource Name (ARN) that is used to invoke a Lambda function.</p></li>
55 /// <li>
56 /// <p><code>LAMBDA_MEMORY_LIMIT_IN_MB</code> - The memory allocated to a Lambda function.</p></li>
57 /// <li>
58 /// <p><code>LAMBDA_REMAINING_TIME_IN_MILLISECONDS</code> - The time in milliseconds before execution of a Lambda function times out.</p></li>
59 /// <li>
60 /// <p><code>LAMBDA_TIME_GAP_BETWEEN_INVOKES_IN_MILLISECONDS</code> - The time in milliseconds between two invocations of a Lambda function.</p></li>
61 /// <li>
62 /// <p><code>LAMBDA_PREVIOUS_EXECUTION_TIME_IN_MILLISECONDS</code> - The time in milliseconds for the previous Lambda invocation.</p></li>
63 /// </ul>
64 pub fn metadata(&self) -> ::std::option::Option<&::std::collections::HashMap<crate::types::MetadataField, ::std::string::String>> {
65 self.metadata.as_ref()
66 }
67}
68impl ConfigureAgentInput {
69 /// Creates a new builder-style object to manufacture [`ConfigureAgentInput`](crate::operation::configure_agent::ConfigureAgentInput).
70 pub fn builder() -> crate::operation::configure_agent::builders::ConfigureAgentInputBuilder {
71 crate::operation::configure_agent::builders::ConfigureAgentInputBuilder::default()
72 }
73}
74
75/// A builder for [`ConfigureAgentInput`](crate::operation::configure_agent::ConfigureAgentInput).
76#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
77#[non_exhaustive]
78pub struct ConfigureAgentInputBuilder {
79 pub(crate) profiling_group_name: ::std::option::Option<::std::string::String>,
80 pub(crate) fleet_instance_id: ::std::option::Option<::std::string::String>,
81 pub(crate) metadata: ::std::option::Option<::std::collections::HashMap<crate::types::MetadataField, ::std::string::String>>,
82}
83impl ConfigureAgentInputBuilder {
84 /// <p>The name of the profiling group for which the configured agent is collecting profiling data.</p>
85 /// This field is required.
86 pub fn profiling_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87 self.profiling_group_name = ::std::option::Option::Some(input.into());
88 self
89 }
90 /// <p>The name of the profiling group for which the configured agent is collecting profiling data.</p>
91 pub fn set_profiling_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92 self.profiling_group_name = input;
93 self
94 }
95 /// <p>The name of the profiling group for which the configured agent is collecting profiling data.</p>
96 pub fn get_profiling_group_name(&self) -> &::std::option::Option<::std::string::String> {
97 &self.profiling_group_name
98 }
99 /// <p>A universally unique identifier (UUID) for a profiling instance. For example, if the profiling instance is an Amazon EC2 instance, it is the instance ID. If it is an AWS Fargate container, it is the container's task ID.</p>
100 pub fn fleet_instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101 self.fleet_instance_id = ::std::option::Option::Some(input.into());
102 self
103 }
104 /// <p>A universally unique identifier (UUID) for a profiling instance. For example, if the profiling instance is an Amazon EC2 instance, it is the instance ID. If it is an AWS Fargate container, it is the container's task ID.</p>
105 pub fn set_fleet_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106 self.fleet_instance_id = input;
107 self
108 }
109 /// <p>A universally unique identifier (UUID) for a profiling instance. For example, if the profiling instance is an Amazon EC2 instance, it is the instance ID. If it is an AWS Fargate container, it is the container's task ID.</p>
110 pub fn get_fleet_instance_id(&self) -> &::std::option::Option<::std::string::String> {
111 &self.fleet_instance_id
112 }
113 /// Adds a key-value pair to `metadata`.
114 ///
115 /// To override the contents of this collection use [`set_metadata`](Self::set_metadata).
116 ///
117 /// <p>Metadata captured about the compute platform the agent is running on. It includes information about sampling and reporting. The valid fields are:</p>
118 /// <ul>
119 /// <li>
120 /// <p><code>COMPUTE_PLATFORM</code> - The compute platform on which the agent is running</p></li>
121 /// <li>
122 /// <p><code>AGENT_ID</code> - The ID for an agent instance.</p></li>
123 /// <li>
124 /// <p><code>AWS_REQUEST_ID</code> - The AWS request ID of a Lambda invocation.</p></li>
125 /// <li>
126 /// <p><code>EXECUTION_ENVIRONMENT</code> - The execution environment a Lambda function is running on.</p></li>
127 /// <li>
128 /// <p><code>LAMBDA_FUNCTION_ARN</code> - The Amazon Resource Name (ARN) that is used to invoke a Lambda function.</p></li>
129 /// <li>
130 /// <p><code>LAMBDA_MEMORY_LIMIT_IN_MB</code> - The memory allocated to a Lambda function.</p></li>
131 /// <li>
132 /// <p><code>LAMBDA_REMAINING_TIME_IN_MILLISECONDS</code> - The time in milliseconds before execution of a Lambda function times out.</p></li>
133 /// <li>
134 /// <p><code>LAMBDA_TIME_GAP_BETWEEN_INVOKES_IN_MILLISECONDS</code> - The time in milliseconds between two invocations of a Lambda function.</p></li>
135 /// <li>
136 /// <p><code>LAMBDA_PREVIOUS_EXECUTION_TIME_IN_MILLISECONDS</code> - The time in milliseconds for the previous Lambda invocation.</p></li>
137 /// </ul>
138 pub fn metadata(mut self, k: crate::types::MetadataField, v: impl ::std::convert::Into<::std::string::String>) -> Self {
139 let mut hash_map = self.metadata.unwrap_or_default();
140 hash_map.insert(k, v.into());
141 self.metadata = ::std::option::Option::Some(hash_map);
142 self
143 }
144 /// <p>Metadata captured about the compute platform the agent is running on. It includes information about sampling and reporting. The valid fields are:</p>
145 /// <ul>
146 /// <li>
147 /// <p><code>COMPUTE_PLATFORM</code> - The compute platform on which the agent is running</p></li>
148 /// <li>
149 /// <p><code>AGENT_ID</code> - The ID for an agent instance.</p></li>
150 /// <li>
151 /// <p><code>AWS_REQUEST_ID</code> - The AWS request ID of a Lambda invocation.</p></li>
152 /// <li>
153 /// <p><code>EXECUTION_ENVIRONMENT</code> - The execution environment a Lambda function is running on.</p></li>
154 /// <li>
155 /// <p><code>LAMBDA_FUNCTION_ARN</code> - The Amazon Resource Name (ARN) that is used to invoke a Lambda function.</p></li>
156 /// <li>
157 /// <p><code>LAMBDA_MEMORY_LIMIT_IN_MB</code> - The memory allocated to a Lambda function.</p></li>
158 /// <li>
159 /// <p><code>LAMBDA_REMAINING_TIME_IN_MILLISECONDS</code> - The time in milliseconds before execution of a Lambda function times out.</p></li>
160 /// <li>
161 /// <p><code>LAMBDA_TIME_GAP_BETWEEN_INVOKES_IN_MILLISECONDS</code> - The time in milliseconds between two invocations of a Lambda function.</p></li>
162 /// <li>
163 /// <p><code>LAMBDA_PREVIOUS_EXECUTION_TIME_IN_MILLISECONDS</code> - The time in milliseconds for the previous Lambda invocation.</p></li>
164 /// </ul>
165 pub fn set_metadata(
166 mut self,
167 input: ::std::option::Option<::std::collections::HashMap<crate::types::MetadataField, ::std::string::String>>,
168 ) -> Self {
169 self.metadata = input;
170 self
171 }
172 /// <p>Metadata captured about the compute platform the agent is running on. It includes information about sampling and reporting. The valid fields are:</p>
173 /// <ul>
174 /// <li>
175 /// <p><code>COMPUTE_PLATFORM</code> - The compute platform on which the agent is running</p></li>
176 /// <li>
177 /// <p><code>AGENT_ID</code> - The ID for an agent instance.</p></li>
178 /// <li>
179 /// <p><code>AWS_REQUEST_ID</code> - The AWS request ID of a Lambda invocation.</p></li>
180 /// <li>
181 /// <p><code>EXECUTION_ENVIRONMENT</code> - The execution environment a Lambda function is running on.</p></li>
182 /// <li>
183 /// <p><code>LAMBDA_FUNCTION_ARN</code> - The Amazon Resource Name (ARN) that is used to invoke a Lambda function.</p></li>
184 /// <li>
185 /// <p><code>LAMBDA_MEMORY_LIMIT_IN_MB</code> - The memory allocated to a Lambda function.</p></li>
186 /// <li>
187 /// <p><code>LAMBDA_REMAINING_TIME_IN_MILLISECONDS</code> - The time in milliseconds before execution of a Lambda function times out.</p></li>
188 /// <li>
189 /// <p><code>LAMBDA_TIME_GAP_BETWEEN_INVOKES_IN_MILLISECONDS</code> - The time in milliseconds between two invocations of a Lambda function.</p></li>
190 /// <li>
191 /// <p><code>LAMBDA_PREVIOUS_EXECUTION_TIME_IN_MILLISECONDS</code> - The time in milliseconds for the previous Lambda invocation.</p></li>
192 /// </ul>
193 pub fn get_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<crate::types::MetadataField, ::std::string::String>> {
194 &self.metadata
195 }
196 /// Consumes the builder and constructs a [`ConfigureAgentInput`](crate::operation::configure_agent::ConfigureAgentInput).
197 pub fn build(
198 self,
199 ) -> ::std::result::Result<crate::operation::configure_agent::ConfigureAgentInput, ::aws_smithy_types::error::operation::BuildError> {
200 ::std::result::Result::Ok(crate::operation::configure_agent::ConfigureAgentInput {
201 profiling_group_name: self.profiling_group_name,
202 fleet_instance_id: self.fleet_instance_id,
203 metadata: self.metadata,
204 })
205 }
206}