Skip to main content

aws_sdk_glue/
client.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[derive(Debug)]
3pub(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 AWS Glue
10///
11/// Client for invoking operations on AWS Glue. Each operation on AWS Glue 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_glue::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_glue::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 [`AssociateGlossaryTerms`](crate::operation::associate_glossary_terms) operation has
63/// a [`Client::associate_glossary_terms`], 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.associate_glossary_terms()
69///     .asset_identifier("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#[derive(::std::clone::Clone, ::std::fmt::Debug)]
78pub struct Client {
79    handle: ::std::sync::Arc<Handle>,
80}
81
82impl Client {
83    /// Creates a new client from the service [`Config`](crate::Config).
84    ///
85    /// # Panics
86    ///
87    /// This method will panic in the following cases:
88    ///
89    /// - Retries or timeouts are enabled without a `sleep_impl` configured.
90    /// - Identity caching is enabled without a `sleep_impl` and `time_source` configured.
91    /// - No `behavior_version` is provided.
92    ///
93    /// The panic message for each of these will have instructions on how to resolve them.
94    #[track_caller]
95    pub fn from_conf(conf: crate::Config) -> Self {
96        let handle = Handle {
97            conf: conf.clone(),
98            runtime_plugins: crate::config::base_client_runtime_plugins(conf),
99        };
100        if let Err(err) = Self::validate_config(&handle) {
101            panic!("Invalid client configuration: {err}");
102        }
103        Self {
104            handle: ::std::sync::Arc::new(handle),
105        }
106    }
107
108    /// Returns the client's configuration.
109    pub fn config(&self) -> &crate::Config {
110        &self.handle.conf
111    }
112
113    fn validate_config(handle: &Handle) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
114        let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
115        handle
116            .runtime_plugins
117            .apply_client_configuration(&mut cfg)?
118            .validate_base_client_config(&cfg)?;
119        Ok(())
120    }
121}
122
123impl Client {
124    /// Creates a new client from an [SDK Config](::aws_types::sdk_config::SdkConfig).
125    ///
126    /// # Panics
127    ///
128    /// - This method will panic if the `sdk_config` is missing an async sleep implementation. If you experience this panic, set
129    ///   the `sleep_impl` on the Config passed into this function to fix it.
130    /// - This method will panic if the `sdk_config` is missing an HTTP connector. If you experience this panic, set the
131    ///   `http_connector` on the Config passed into this function to fix it.
132    /// - 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.
133    #[track_caller]
134    pub fn new(sdk_config: &::aws_types::sdk_config::SdkConfig) -> Self {
135        Self::from_conf(sdk_config.into())
136    }
137}
138
139impl Client {
140    /// Returns the type registry for this service.
141    ///
142    /// The registry contains an entry for every structure shape in the service
143    /// closure (excluding only synthetic operation input/output shapes),
144    /// keyed by [`ShapeId`](::aws_smithy_schema::ShapeId). It is primarily useful for deserializing
145    /// a [`Document`](::aws_smithy_types::Document) into a typed shape:
146    ///
147    /// ```ignore
148    /// let registry = MyClient::registry();
149    /// let typed = registry.deserialize_document(&doc)?;
150    /// // Downcast to the concrete type you expected.
151    /// ```
152    pub fn registry() -> &'static ::aws_smithy_schema::registry::TypeRegistry {
153        &crate::type_registry::REGISTRY
154    }
155}
156
157impl Client {
158    /// Returns the service-wide error registry.
159    ///
160    /// The registry contains an entry for every `@error`-trait structure shape
161    /// in the service closure, keyed by [`ShapeId`](::aws_smithy_schema::ShapeId). Use it to reify a
162    /// discriminated [`Document`](::aws_smithy_types::Document) into a typed error variant via
163    /// [`TypeRegistry::deserialize_document`](::aws_smithy_schema::registry::TypeRegistry::deserialize_document).
164    ///
165    /// This registry is provided for third-party `Document`-based error handling.
166    /// Internally it also serves as the widening fallback when the schema-serde
167    /// error path reifies an error code that an operation does not model directly
168    /// (the operation's own error registry is consulted first).
169    ///
170    /// ```ignore
171    /// let registry = MyClient::error_registry();
172    /// let typed = registry.deserialize_document(&doc)?;
173    /// // Downcast to the concrete error variant you expected.
174    /// ```
175    pub fn error_registry() -> &'static ::aws_smithy_schema::registry::TypeRegistry {
176        &crate::error_type_registry::REGISTRY
177    }
178}
179
180mod associate_glossary_terms;
181
182mod batch_create_partition;
183
184mod batch_delete_connection;
185
186mod batch_delete_partition;
187
188mod batch_delete_table;
189
190mod batch_delete_table_version;
191
192mod batch_get_blueprints;
193
194mod batch_get_crawlers;
195
196mod batch_get_custom_entity_types;
197
198mod batch_get_data_quality_result;
199
200mod batch_get_data_quality_result_v2;
201
202mod batch_get_data_quality_ruleset_evaluation_run;
203
204mod batch_get_dev_endpoints;
205
206mod batch_get_iterable_forms;
207
208mod batch_get_jobs;
209
210mod batch_get_partition;
211
212mod batch_get_table_optimizer;
213
214mod batch_get_triggers;
215
216mod batch_get_workflows;
217
218mod batch_put_data_quality_statistic_annotation;
219
220mod batch_stop_job_run;
221
222mod batch_update_partition;
223
224mod cancel_data_quality_rule_recommendation_run;
225
226mod cancel_data_quality_ruleset_evaluation_run;
227
228mod cancel_ml_task_run;
229
230mod cancel_statement;
231
232mod check_schema_version_validity;
233
234mod create_blueprint;
235
236mod create_catalog;
237
238mod create_classifier;
239
240mod create_column_statistics_task_settings;
241
242mod create_connection;
243
244mod create_crawler;
245
246mod create_custom_entity_type;
247
248mod create_data_quality_evaluation_config;
249
250mod create_data_quality_ruleset;
251
252mod create_database;
253
254mod create_dev_endpoint;
255
256mod create_glossary;
257
258mod create_glossary_term;
259
260mod create_glue_identity_center_configuration;
261
262mod create_integration;
263
264mod create_integration_resource_property;
265
266mod create_integration_table_properties;
267
268mod create_job;
269
270mod create_ml_transform;
271
272mod create_partition;
273
274mod create_partition_index;
275
276mod create_registry;
277
278mod create_schema;
279
280mod create_script;
281
282mod create_security_configuration;
283
284mod create_session;
285
286mod create_table;
287
288mod create_table_optimizer;
289
290mod create_trigger;
291
292mod create_usage_profile;
293
294mod create_user_defined_function;
295
296mod create_workflow;
297
298/// Operation customization and supporting types.
299///
300/// The underlying HTTP requests made during an operation can be customized
301/// by calling the `customize()` method on the builder returned from a client
302/// operation call. For example, this can be used to add an additional HTTP header:
303///
304/// ```ignore
305/// # async fn wrapper() -> ::std::result::Result<(), aws_sdk_glue::Error> {
306/// # let client: aws_sdk_glue::Client = unimplemented!();
307/// use ::http_1x::header::{HeaderName, HeaderValue};
308///
309/// let result = client.associate_glossary_terms()
310///     .customize()
311///     .mutate_request(|req| {
312///         // Add `x-example-header` with value
313///         req.headers_mut()
314///             .insert(
315///                 HeaderName::from_static("x-example-header"),
316///                 HeaderValue::from_static("1"),
317///             );
318///     })
319///     .send()
320///     .await;
321/// # }
322/// ```
323pub mod customize;
324
325mod delete_asset;
326
327mod delete_attachment;
328
329mod delete_blueprint;
330
331mod delete_catalog;
332
333mod delete_classifier;
334
335mod delete_column_statistics_for_partition;
336
337mod delete_column_statistics_for_table;
338
339mod delete_column_statistics_task_settings;
340
341mod delete_connection;
342
343mod delete_connection_type;
344
345mod delete_crawler;
346
347mod delete_custom_entity_type;
348
349mod delete_data_quality_evaluation_config;
350
351mod delete_data_quality_ruleset;
352
353mod delete_database;
354
355mod delete_dev_endpoint;
356
357mod delete_form_type;
358
359mod delete_glossary;
360
361mod delete_glossary_term;
362
363mod delete_glue_identity_center_configuration;
364
365mod delete_integration;
366
367mod delete_integration_resource_property;
368
369mod delete_integration_table_properties;
370
371mod delete_job;
372
373mod delete_ml_transform;
374
375mod delete_partition;
376
377mod delete_partition_index;
378
379mod delete_registry;
380
381mod delete_resource_policy;
382
383mod delete_schema;
384
385mod delete_schema_versions;
386
387mod delete_security_configuration;
388
389mod delete_session;
390
391mod delete_table;
392
393mod delete_table_optimizer;
394
395mod delete_table_version;
396
397mod delete_trigger;
398
399mod delete_usage_profile;
400
401mod delete_user_defined_function;
402
403mod delete_workflow;
404
405mod describe_connection_type;
406
407mod describe_entity;
408
409mod describe_inbound_integrations;
410
411mod describe_integrations;
412
413mod disassociate_glossary_terms;
414
415mod get_asset;
416
417mod get_asset_type;
418
419mod get_blueprint;
420
421mod get_blueprint_run;
422
423mod get_blueprint_runs;
424
425mod get_catalog;
426
427mod get_catalog_import_status;
428
429mod get_catalogs;
430
431mod get_classifier;
432
433mod get_classifiers;
434
435mod get_column_statistics_for_partition;
436
437mod get_column_statistics_for_table;
438
439mod get_column_statistics_task_run;
440
441mod get_column_statistics_task_runs;
442
443mod get_column_statistics_task_settings;
444
445mod get_connection;
446
447mod get_connections;
448
449mod get_crawler;
450
451mod get_crawler_metrics;
452
453mod get_crawlers;
454
455mod get_custom_entity_type;
456
457mod get_dashboard_url;
458
459mod get_data_catalog_encryption_settings;
460
461mod get_data_catalog_export_configuration;
462
463mod get_data_quality_evaluation_config;
464
465mod get_data_quality_model;
466
467mod get_data_quality_model_result;
468
469mod get_data_quality_result;
470
471mod get_data_quality_result_v2;
472
473mod get_data_quality_rule_recommendation_run;
474
475mod get_data_quality_ruleset;
476
477mod get_data_quality_ruleset_evaluation_run;
478
479mod get_database;
480
481mod get_databases;
482
483mod get_dataflow_graph;
484
485mod get_dev_endpoint;
486
487mod get_dev_endpoints;
488
489mod get_entity_records;
490
491mod get_form_type;
492
493mod get_glossary;
494
495mod get_glossary_term;
496
497mod get_glue_identity_center_configuration;
498
499mod get_integration_resource_property;
500
501mod get_integration_table_properties;
502
503mod get_job;
504
505mod get_job_bookmark;
506
507mod get_job_run;
508
509mod get_job_runs;
510
511mod get_job_upgrade_analysis;
512
513mod get_jobs;
514
515mod get_mapping;
516
517mod get_materialized_view_refresh_task_run;
518
519mod get_ml_task_run;
520
521mod get_ml_task_runs;
522
523mod get_ml_transform;
524
525mod get_ml_transforms;
526
527mod get_partition;
528
529mod get_partition_indexes;
530
531mod get_partitions;
532
533mod get_plan;
534
535mod get_registry;
536
537mod get_resource_policies;
538
539mod get_resource_policy;
540
541mod get_schema;
542
543mod get_schema_by_definition;
544
545mod get_schema_version;
546
547mod get_schema_versions_diff;
548
549mod get_security_configuration;
550
551mod get_security_configurations;
552
553mod get_session;
554
555mod get_session_endpoint;
556
557mod get_statement;
558
559mod get_system_logs_for_job_run;
560
561mod get_system_logs_for_session;
562
563mod get_table;
564
565mod get_table_optimizer;
566
567mod get_table_version;
568
569mod get_table_versions;
570
571mod get_tables;
572
573mod get_tags;
574
575mod get_trigger;
576
577mod get_triggers;
578
579mod get_unfiltered_partition_metadata;
580
581mod get_unfiltered_partitions_metadata;
582
583mod get_unfiltered_table_metadata;
584
585mod get_usage_profile;
586
587mod get_user_defined_function;
588
589mod get_user_defined_functions;
590
591mod get_workflow;
592
593mod get_workflow_run;
594
595mod get_workflow_run_properties;
596
597mod get_workflow_runs;
598
599mod import_catalog_to_glue;
600
601mod list_asset_types;
602
603mod list_blueprints;
604
605mod list_column_statistics_task_runs;
606
607mod list_connection_types;
608
609mod list_crawlers;
610
611mod list_crawls;
612
613mod list_custom_entity_types;
614
615mod list_data_quality_evaluation_configs;
616
617mod list_data_quality_results;
618
619mod list_data_quality_results_v2;
620
621mod list_data_quality_rule_recommendation_runs;
622
623mod list_data_quality_ruleset_evaluation_runs;
624
625mod list_data_quality_rulesets;
626
627mod list_data_quality_statistic_annotations;
628
629mod list_data_quality_statistics;
630
631mod list_dev_endpoints;
632
633mod list_entities;
634
635mod list_form_types;
636
637mod list_glossaries;
638
639mod list_glossary_terms;
640
641mod list_integration_resource_properties;
642
643mod list_integration_table_properties;
644
645mod list_iterable_forms;
646
647mod list_jobs;
648
649mod list_materialized_view_refresh_task_runs;
650
651mod list_ml_transforms;
652
653mod list_registries;
654
655mod list_schema_versions;
656
657mod list_schemas;
658
659mod list_sessions;
660
661mod list_statements;
662
663mod list_table_optimizer_runs;
664
665mod list_triggers;
666
667mod list_usage_profiles;
668
669mod list_workflows;
670
671mod modify_integration;
672
673mod publish_data_quality_result_v2;
674
675mod put_asset;
676
677mod put_attachment;
678
679mod put_data_catalog_encryption_settings;
680
681mod put_data_catalog_export_configuration;
682
683mod put_data_quality_profile_annotation;
684
685mod put_form_type;
686
687mod put_resource_policy;
688
689mod put_schema_version_metadata;
690
691mod put_workflow_run_properties;
692
693mod query_schema_version_metadata;
694
695mod register_connection_type;
696
697mod register_schema_version;
698
699mod remove_schema_version_metadata;
700
701mod reset_job_bookmark;
702
703mod resume_workflow_run;
704
705mod run_statement;
706
707mod search_assets;
708
709mod search_tables;
710
711mod start_blueprint_run;
712
713mod start_column_statistics_task_run;
714
715mod start_column_statistics_task_run_schedule;
716
717mod start_crawler;
718
719mod start_crawler_schedule;
720
721mod start_data_quality_rule_recommendation_run;
722
723mod start_data_quality_ruleset_evaluation_run;
724
725mod start_export_labels_task_run;
726
727mod start_import_labels_task_run;
728
729mod start_job_run;
730
731mod start_job_upgrade_analysis;
732
733mod start_materialized_view_refresh_task_run;
734
735mod start_ml_evaluation_task_run;
736
737mod start_ml_labeling_set_generation_task_run;
738
739mod start_trigger;
740
741mod start_workflow_run;
742
743mod stop_column_statistics_task_run;
744
745mod stop_column_statistics_task_run_schedule;
746
747mod stop_crawler;
748
749mod stop_crawler_schedule;
750
751mod stop_job_upgrade_analysis;
752
753mod stop_materialized_view_refresh_task_run;
754
755mod stop_session;
756
757mod stop_trigger;
758
759mod stop_workflow_run;
760
761mod tag_resource;
762
763mod test_connection;
764
765mod untag_resource;
766
767mod update_asset;
768
769mod update_blueprint;
770
771mod update_catalog;
772
773mod update_classifier;
774
775mod update_column_statistics_for_partition;
776
777mod update_column_statistics_for_table;
778
779mod update_column_statistics_task_settings;
780
781mod update_connection;
782
783mod update_crawler;
784
785mod update_crawler_schedule;
786
787mod update_data_quality_evaluation_config;
788
789mod update_data_quality_ruleset;
790
791mod update_database;
792
793mod update_dev_endpoint;
794
795mod update_glossary;
796
797mod update_glossary_term;
798
799mod update_glue_identity_center_configuration;
800
801mod update_integration_resource_property;
802
803mod update_integration_table_properties;
804
805mod update_job;
806
807mod update_job_from_source_control;
808
809mod update_ml_transform;
810
811mod update_partition;
812
813mod update_registry;
814
815mod update_schema;
816
817mod update_source_control_from_job;
818
819mod update_table;
820
821mod update_table_optimizer;
822
823mod update_trigger;
824
825mod update_usage_profile;
826
827mod update_user_defined_function;
828
829mod update_workflow;