1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | #[derive(Debug)]
|
3 + | pub(crate) struct Handle {
|
4 + | pub(crate) conf: crate::Config,
|
5 + | #[allow(dead_code)] // unused when a service does not provide any operations
|
6 + | pub(crate) runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
|
7 + | }
|
8 + |
|
9 + | /// Client for Amazon Simple Systems Manager (SSM)
|
10 + | ///
|
11 + | /// Client for invoking operations on Amazon Simple Systems Manager (SSM). Each operation on Amazon Simple Systems Manager (SSM) is a method on this
|
12 + | /// this struct. `.send()` MUST be invoked on the generated operations to dispatch the request to the service.
|
13 + | /// ## Constructing a `Client`
|
14 + | ///
|
15 + | /// A [`Config`] is required to construct a client. For most use cases, the [`aws-config`]
|
16 + | /// crate should be used to automatically resolve this config using
|
17 + | /// [`aws_config::load_from_env()`], since this will resolve an [`SdkConfig`] which can be shared
|
18 + | /// across multiple different AWS SDK clients. This config resolution process can be customized
|
19 + | /// by calling [`aws_config::from_env()`] instead, which returns a [`ConfigLoader`] that uses
|
20 + | /// the [builder pattern] to customize the default config.
|
21 + | ///
|
22 + | /// In the simplest case, creating a client looks as follows:
|
23 + | /// ```rust,no_run
|
24 + | /// # async fn wrapper() {
|
25 + | /// let config = aws_config::load_from_env().await;
|
26 + | /// let client = aws_sdk_ssm::Client::new(&config);
|
27 + | /// # }
|
28 + | /// ```
|
29 + | ///
|
30 + | /// Occasionally, SDKs may have additional service-specific values that can be set on the [`Config`] that
|
31 + | /// is absent from [`SdkConfig`], or slightly different settings for a specific client may be desired.
|
32 + | /// The [`Builder`](crate::config::Builder) struct implements `From<&SdkConfig>`, so setting these specific settings can be
|
33 + | /// done as follows:
|
34 + | ///
|
35 + | /// ```rust,no_run
|
36 + | /// # async fn wrapper() {
|
37 + | /// let sdk_config = ::aws_config::load_from_env().await;
|
38 + | /// let config = aws_sdk_ssm::config::Builder::from(&sdk_config)
|
39 + | /// # /*
|
40 + | /// .some_service_specific_setting("value")
|
41 + | /// # */
|
42 + | /// .build();
|
43 + | /// # }
|
44 + | /// ```
|
45 + | ///
|
46 + | /// See the [`aws-config` docs] and [`Config`] for more information on customizing configuration.
|
47 + | ///
|
48 + | /// _Note:_ Client construction is expensive due to connection thread pool initialization, and should
|
49 + | /// be done once at application start-up.
|
50 + | ///
|
51 + | /// [`Config`]: crate::Config
|
52 + | /// [`ConfigLoader`]: https://docs.rs/aws-config/*/aws_config/struct.ConfigLoader.html
|
53 + | /// [`SdkConfig`]: https://docs.rs/aws-config/*/aws_config/struct.SdkConfig.html
|
54 + | /// [`aws-config` docs]: https://docs.rs/aws-config/*
|
55 + | /// [`aws-config`]: https://crates.io/crates/aws-config
|
56 + | /// [`aws_config::from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.from_env.html
|
57 + | /// [`aws_config::load_from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.load_from_env.html
|
58 + | /// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#builders-enable-construction-of-complex-values-c-builder
|
59 + | /// # Using the `Client`
|
60 + | ///
|
61 + | /// A client has a function for every operation that can be performed by the service.
|
62 + | /// For example, the [`AddTagsToResource`](crate::operation::add_tags_to_resource) operation has
|
63 + | /// a [`Client::add_tags_to_resource`], function which returns a builder for that operation.
|
64 + | /// The fluent builder ultimately has a `send()` function that returns an async future that
|
65 + | /// returns a result, as illustrated below:
|
66 + | ///
|
67 + | /// ```rust,ignore
|
68 + | /// let result = client.add_tags_to_resource()
|
69 + | /// .resource_type("example")
|
70 + | /// .send()
|
71 + | /// .await;
|
72 + | /// ```
|
73 + | ///
|
74 + | /// The underlying HTTP requests that get made by this can be modified with the `customize_operation`
|
75 + | /// function on the fluent builder. See the [`customize`](crate::client::customize) module for more
|
76 + | /// information.
|
77 + | /// # Waiters
|
78 + | ///
|
79 + | /// This client provides `wait_until` methods behind the [`Waiters`](crate::client::Waiters) trait.
|
80 + | /// To use them, simply import the trait, and then call one of the `wait_until` methods. This will
|
81 + | /// return a waiter fluent builder that takes various parameters, which are documented on the builder
|
82 + | /// type. Once parameters have been provided, the `wait` method can be called to initiate waiting.
|
83 + | ///
|
84 + | /// For example, if there was a `wait_until_thing` method, it could look like:
|
85 + | /// ```rust,ignore
|
86 + | /// let result = client.wait_until_thing()
|
87 + | /// .thing_id("someId")
|
88 + | /// .wait(Duration::from_secs(120))
|
89 + | /// .await;
|
90 + | /// ```
|
91 + | #[derive(::std::clone::Clone, ::std::fmt::Debug)]
|
92 + | pub struct Client {
|
93 + | handle: ::std::sync::Arc<Handle>,
|
94 + | }
|
95 + |
|
96 + | impl Client {
|
97 + | /// Creates a new client from the service [`Config`](crate::Config).
|
98 + | ///
|
99 + | /// # Panics
|
100 + | ///
|
101 + | /// This method will panic in the following cases:
|
102 + | ///
|
103 + | /// - Retries or timeouts are enabled without a `sleep_impl` configured.
|
104 + | /// - Identity caching is enabled without a `sleep_impl` and `time_source` configured.
|
105 + | /// - No `behavior_version` is provided.
|
106 + | ///
|
107 + | /// The panic message for each of these will have instructions on how to resolve them.
|
108 + | #[track_caller]
|
109 + | pub fn from_conf(conf: crate::Config) -> Self {
|
110 + | let handle = Handle {
|
111 + | conf: conf.clone(),
|
112 + | runtime_plugins: crate::config::base_client_runtime_plugins(conf),
|
113 + | };
|
114 + | if let Err(err) = Self::validate_config(&handle) {
|
115 + | panic!("Invalid client configuration: {err}");
|
116 + | }
|
117 + | Self {
|
118 + | handle: ::std::sync::Arc::new(handle),
|
119 + | }
|
120 + | }
|
121 + |
|
122 + | /// Returns the client's configuration.
|
123 + | pub fn config(&self) -> &crate::Config {
|
124 + | &self.handle.conf
|
125 + | }
|
126 + |
|
127 + | fn validate_config(handle: &Handle) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
128 + | let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
|
129 + | handle
|
130 + | .runtime_plugins
|
131 + | .apply_client_configuration(&mut cfg)?
|
132 + | .validate_base_client_config(&cfg)?;
|
133 + | Ok(())
|
134 + | }
|
135 + | }
|
136 + |
|
137 + | ///
|
138 + | /// Waiter functions for the client.
|
139 + | ///
|
140 + | /// Import this trait to get `wait_until` methods on the client.
|
141 + | ///
|
142 + | pub trait Waiters {
|
143 + | /// Wait for `command_executed`
|
144 + | fn wait_until_command_executed(&self) -> crate::waiters::command_executed::CommandExecutedFluentBuilder;
|
145 + | }
|
146 + | impl Waiters for Client {
|
147 + | fn wait_until_command_executed(&self) -> crate::waiters::command_executed::CommandExecutedFluentBuilder {
|
148 + | crate::waiters::command_executed::CommandExecutedFluentBuilder::new(self.handle.clone())
|
149 + | }
|
150 + | }
|
151 + |
|
152 + | impl Client {
|
153 + | /// Creates a new client from an [SDK Config](::aws_types::sdk_config::SdkConfig).
|
154 + | ///
|
155 + | /// # Panics
|
156 + | ///
|
157 + | /// - This method will panic if the `sdk_config` is missing an async sleep implementation. If you experience this panic, set
|
158 + | /// the `sleep_impl` on the Config passed into this function to fix it.
|
159 + | /// - This method will panic if the `sdk_config` is missing an HTTP connector. If you experience this panic, set the
|
160 + | /// `http_connector` on the Config passed into this function to fix it.
|
161 + | /// - This method will panic if no `BehaviorVersion` is provided. If you experience this panic, set `behavior_version` on the Config or enable the `behavior-version-latest` Cargo feature.
|
162 + | #[track_caller]
|
163 + | pub fn new(sdk_config: &::aws_types::sdk_config::SdkConfig) -> Self {
|
164 + | Self::from_conf(sdk_config.into())
|
165 + | }
|
166 + | }
|
167 + |
|
168 + | impl Client {
|
169 + | /// Returns the type registry for this service.
|
170 + | ///
|
171 + | /// The registry contains an entry for every structure shape in the service
|
172 + | /// closure (excluding only synthetic operation input/output shapes),
|
173 + | /// keyed by [`ShapeId`](::aws_smithy_schema::ShapeId). It is primarily useful for deserializing
|
174 + | /// a [`Document`](::aws_smithy_types::Document) into a typed shape:
|
175 + | ///
|
176 + | /// ```ignore
|
177 + | /// let registry = MyClient::registry();
|
178 + | /// let typed = registry.deserialize_document(&doc)?;
|
179 + | /// // Downcast to the concrete type you expected.
|
180 + | /// ```
|
181 + | pub fn registry() -> &'static ::aws_smithy_schema::registry::TypeRegistry {
|
182 + | &crate::type_registry::REGISTRY
|
183 + | }
|
184 + | }
|
185 + |
|
186 + | impl Client {
|
187 + | /// Returns the service-wide error registry.
|
188 + | ///
|
189 + | /// The registry contains an entry for every `@error`-trait structure shape
|
190 + | /// in the service closure, keyed by [`ShapeId`](::aws_smithy_schema::ShapeId). Use it to reify a
|
191 + | /// discriminated [`Document`](::aws_smithy_types::Document) into a typed error variant via
|
192 + | /// [`TypeRegistry::deserialize_document`](::aws_smithy_schema::registry::TypeRegistry::deserialize_document).
|
193 + | ///
|
194 + | /// This registry is provided for third-party `Document`-based error handling.
|
195 + | /// Internally it also serves as the widening fallback when the schema-serde
|
196 + | /// error path reifies an error code that an operation does not model directly
|
197 + | /// (the operation's own error registry is consulted first).
|
198 + | ///
|
199 + | /// ```ignore
|
200 + | /// let registry = MyClient::error_registry();
|
201 + | /// let typed = registry.deserialize_document(&doc)?;
|
202 + | /// // Downcast to the concrete error variant you expected.
|
203 + | /// ```
|
204 + | pub fn error_registry() -> &'static ::aws_smithy_schema::registry::TypeRegistry {
|
205 + | &crate::error_type_registry::REGISTRY
|
206 + | }
|
207 + | }
|
208 + |
|
209 + | mod add_tags_to_resource;
|
210 + |
|
211 + | mod associate_ops_item_related_item;
|
212 + |
|
213 + | mod cancel_command;
|
214 + |
|
215 + | mod cancel_maintenance_window_execution;
|
216 + |
|
217 + | mod create_activation;
|
218 + |
|
219 + | mod create_association;
|
220 + |
|
221 + | mod create_association_batch;
|
222 + |
|
223 + | mod create_cloud_connector;
|
224 + |
|
225 + | mod create_document;
|
226 + |
|
227 + | mod create_maintenance_window;
|
228 + |
|
229 + | mod create_ops_item;
|
230 + |
|
231 + | mod create_ops_metadata;
|
232 + |
|
233 + | mod create_patch_baseline;
|
234 + |
|
235 + | mod create_resource_data_sync;
|
236 + |
|
237 + | /// Operation customization and supporting types.
|
238 + | ///
|
239 + | /// The underlying HTTP requests made during an operation can be customized
|
240 + | /// by calling the `customize()` method on the builder returned from a client
|
241 + | /// operation call. For example, this can be used to add an additional HTTP header:
|
242 + | ///
|
243 + | /// ```ignore
|
244 + | /// # async fn wrapper() -> ::std::result::Result<(), aws_sdk_ssm::Error> {
|
245 + | /// # let client: aws_sdk_ssm::Client = unimplemented!();
|
246 + | /// use ::http_1x::header::{HeaderName, HeaderValue};
|
247 + | ///
|
248 + | /// let result = client.add_tags_to_resource()
|
249 + | /// .customize()
|
250 + | /// .mutate_request(|req| {
|
251 + | /// // Add `x-example-header` with value
|
252 + | /// req.headers_mut()
|
253 + | /// .insert(
|
254 + | /// HeaderName::from_static("x-example-header"),
|
255 + | /// HeaderValue::from_static("1"),
|
256 + | /// );
|
257 + | /// })
|
258 + | /// .send()
|
259 + | /// .await;
|
260 + | /// # }
|
261 + | /// ```
|
262 + | pub mod customize;
|
263 + |
|
264 + | mod delete_activation;
|
265 + |
|
266 + | mod delete_association;
|
267 + |
|
268 + | mod delete_cloud_connector;
|
269 + |
|
270 + | mod delete_document;
|
271 + |
|
272 + | mod delete_inventory;
|
273 + |
|
274 + | mod delete_maintenance_window;
|
275 + |
|
276 + | mod delete_ops_item;
|
277 + |
|
278 + | mod delete_ops_metadata;
|
279 + |
|
280 + | mod delete_parameter;
|
281 + |
|
282 + | mod delete_parameters;
|
283 + |
|
284 + | mod delete_patch_baseline;
|
285 + |
|
286 + | mod delete_resource_data_sync;
|
287 + |
|
288 + | mod delete_resource_policy;
|
289 + |
|
290 + | mod deregister_managed_instance;
|
291 + |
|
292 + | mod deregister_patch_baseline_for_patch_group;
|
293 + |
|
294 + | mod deregister_target_from_maintenance_window;
|
295 + |
|
296 + | mod deregister_task_from_maintenance_window;
|
297 + |
|
298 + | mod describe_activations;
|
299 + |
|
300 + | mod describe_association;
|
301 + |
|
302 + | mod describe_association_execution_targets;
|
303 + |
|
304 + | mod describe_association_executions;
|
305 + |
|
306 + | mod describe_automation_executions;
|
307 + |
|
308 + | mod describe_automation_step_executions;
|
309 + |
|
310 + | mod describe_available_patches;
|
311 + |
|
312 + | mod describe_document;
|
313 + |
|
314 + | mod describe_document_permission;
|
315 + |
|
316 + | mod describe_effective_instance_associations;
|
317 + |
|
318 + | mod describe_effective_patches_for_patch_baseline;
|
319 + |
|
320 + | mod describe_instance_associations_status;
|
321 + |
|
322 + | mod describe_instance_information;
|
323 + |
|
324 + | mod describe_instance_patch_states;
|
325 + |
|
326 + | mod describe_instance_patch_states_for_patch_group;
|
327 + |
|
328 + | mod describe_instance_patches;
|
329 + |
|
330 + | mod describe_instance_properties;
|
331 + |
|
332 + | mod describe_inventory_deletions;
|
333 + |
|
334 + | mod describe_maintenance_window_execution_task_invocations;
|
335 + |
|
336 + | mod describe_maintenance_window_execution_tasks;
|
337 + |
|
338 + | mod describe_maintenance_window_executions;
|
339 + |
|
340 + | mod describe_maintenance_window_schedule;
|
341 + |
|
342 + | mod describe_maintenance_window_targets;
|
343 + |
|
344 + | mod describe_maintenance_window_tasks;
|
345 + |
|
346 + | mod describe_maintenance_windows;
|
347 + |
|
348 + | mod describe_maintenance_windows_for_target;
|
349 + |
|
350 + | mod describe_ops_items;
|
351 + |
|
352 + | mod describe_parameters;
|
353 + |
|
354 + | mod describe_patch_baselines;
|
355 + |
|
356 + | mod describe_patch_group_state;
|
357 + |
|
358 + | mod describe_patch_groups;
|
359 + |
|
360 + | mod describe_patch_properties;
|
361 + |
|
362 + | mod describe_sessions;
|
363 + |
|
364 + | mod disassociate_ops_item_related_item;
|
365 + |
|
366 + | mod get_access_token;
|
367 + |
|
368 + | mod get_automation_execution;
|
369 + |
|
370 + | mod get_calendar_state;
|
371 + |
|
372 + | mod get_cloud_connector;
|
373 + |
|
374 + | mod get_command_invocation;
|
375 + |
|
376 + | mod get_connection_status;
|
377 + |
|
378 + | mod get_default_patch_baseline;
|
379 + |
|
380 + | mod get_deployable_patch_snapshot_for_instance;
|
381 + |
|
382 + | mod get_document;
|
383 + |
|
384 + | mod get_execution_preview;
|
385 + |
|
386 + | mod get_inventory;
|
387 + |
|
388 + | mod get_inventory_schema;
|
389 + |
|
390 + | mod get_maintenance_window;
|
391 + |
|
392 + | mod get_maintenance_window_execution;
|
393 + |
|
394 + | mod get_maintenance_window_execution_task;
|
395 + |
|
396 + | mod get_maintenance_window_execution_task_invocation;
|
397 + |
|
398 + | mod get_maintenance_window_task;
|
399 + |
|
400 + | mod get_ops_item;
|
401 + |
|
402 + | mod get_ops_metadata;
|
403 + |
|
404 + | mod get_ops_summary;
|
405 + |
|
406 + | mod get_parameter;
|
407 + |
|
408 + | mod get_parameter_history;
|
409 + |
|
410 + | mod get_parameters;
|
411 + |
|
412 + | mod get_parameters_by_path;
|
413 + |
|
414 + | mod get_patch_baseline;
|
415 + |
|
416 + | mod get_patch_baseline_for_patch_group;
|
417 + |
|
418 + | mod get_resource_policies;
|
419 + |
|
420 + | mod get_service_setting;
|
421 + |
|
422 + | mod label_parameter_version;
|
423 + |
|
424 + | mod list_association_versions;
|
425 + |
|
426 + | mod list_associations;
|
427 + |
|
428 + | mod list_cloud_connectors;
|
429 + |
|
430 + | mod list_command_invocations;
|
431 + |
|
432 + | mod list_commands;
|
433 + |
|
434 + | mod list_compliance_items;
|
435 + |
|
436 + | mod list_compliance_summaries;
|
437 + |
|
438 + | mod list_document_metadata_history;
|
439 + |
|
440 + | mod list_document_versions;
|
441 + |
|
442 + | mod list_documents;
|
443 + |
|
444 + | mod list_inventory_entries;
|
445 + |
|
446 + | mod list_nodes;
|
447 + |
|
448 + | mod list_nodes_summary;
|
449 + |
|
450 + | mod list_ops_item_events;
|
451 + |
|
452 + | mod list_ops_item_related_items;
|
453 + |
|
454 + | mod list_ops_metadata;
|
455 + |
|
456 + | mod list_resource_compliance_summaries;
|
457 + |
|
458 + | mod list_resource_data_sync;
|
459 + |
|
460 + | mod list_tags_for_resource;
|
461 + |
|
462 + | mod modify_document_permission;
|
463 + |
|
464 + | mod put_compliance_items;
|
465 + |
|
466 + | mod put_inventory;
|
467 + |
|
468 + | mod put_parameter;
|
469 + |
|
470 + | mod put_resource_policy;
|
471 + |
|
472 + | mod register_default_patch_baseline;
|
473 + |
|
474 + | mod register_patch_baseline_for_patch_group;
|
475 + |
|
476 + | mod register_target_with_maintenance_window;
|
477 + |
|
478 + | mod register_task_with_maintenance_window;
|
479 + |
|
480 + | mod remove_tags_from_resource;
|
481 + |
|
482 + | mod reset_service_setting;
|
483 + |
|
484 + | mod resume_session;
|
485 + |
|
486 + | mod send_automation_signal;
|
487 + |
|
488 + | mod send_command;
|
489 + |
|
490 + | mod start_access_request;
|
491 + |
|
492 + | mod start_associations_once;
|
493 + |
|
494 + | mod start_automation_execution;
|
495 + |
|
496 + | mod start_change_request_execution;
|
497 + |
|
498 + | mod start_execution_preview;
|
499 + |
|
500 + | mod start_session;
|
501 + |
|
502 + | mod stop_automation_execution;
|
503 + |
|
504 + | mod terminate_session;
|
505 + |
|
506 + | mod unlabel_parameter_version;
|
507 + |
|
508 + | mod update_association;
|
509 + |
|
510 + | mod update_association_status;
|
511 + |
|
512 + | mod update_cloud_connector;
|
513 + |
|
514 + | mod update_document;
|
515 + |
|
516 + | mod update_document_default_version;
|
517 + |
|
518 + | mod update_document_metadata;
|
519 + |
|
520 + | mod update_maintenance_window;
|
521 + |
|
522 + | mod update_maintenance_window_target;
|
523 + |
|
524 + | mod update_maintenance_window_task;
|
525 + |
|
526 + | mod update_managed_instance_role;
|
527 + |
|
528 + | mod update_ops_item;
|
529 + |
|
530 + | mod update_ops_metadata;
|
531 + |
|
532 + | mod update_patch_baseline;
|
533 + |
|
534 + | mod update_resource_data_sync;
|
535 + |
|
536 + | mod update_service_setting;
|
537 + |
|
538 + | mod validate_cloud_connector;
|