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
139mod associate_glossary_terms;
140
141mod batch_create_partition;
142
143mod batch_delete_connection;
144
145mod batch_delete_partition;
146
147mod batch_delete_table;
148
149mod batch_delete_table_version;
150
151mod batch_get_blueprints;
152
153mod batch_get_crawlers;
154
155mod batch_get_custom_entity_types;
156
157mod batch_get_data_quality_result;
158
159mod batch_get_data_quality_ruleset_evaluation_run;
160
161mod batch_get_dev_endpoints;
162
163mod batch_get_iterable_forms;
164
165mod batch_get_jobs;
166
167mod batch_get_partition;
168
169mod batch_get_table_optimizer;
170
171mod batch_get_triggers;
172
173mod batch_get_workflows;
174
175mod batch_put_data_quality_statistic_annotation;
176
177mod batch_stop_job_run;
178
179mod batch_update_partition;
180
181mod cancel_data_quality_rule_recommendation_run;
182
183mod cancel_data_quality_ruleset_evaluation_run;
184
185mod cancel_ml_task_run;
186
187mod cancel_statement;
188
189mod check_schema_version_validity;
190
191mod create_blueprint;
192
193mod create_catalog;
194
195mod create_classifier;
196
197mod create_column_statistics_task_settings;
198
199mod create_connection;
200
201mod create_crawler;
202
203mod create_custom_entity_type;
204
205mod create_data_quality_ruleset;
206
207mod create_database;
208
209mod create_dev_endpoint;
210
211mod create_glossary;
212
213mod create_glossary_term;
214
215mod create_glue_identity_center_configuration;
216
217mod create_integration;
218
219mod create_integration_resource_property;
220
221mod create_integration_table_properties;
222
223mod create_job;
224
225mod create_ml_transform;
226
227mod create_partition;
228
229mod create_partition_index;
230
231mod create_registry;
232
233mod create_schema;
234
235mod create_script;
236
237mod create_security_configuration;
238
239mod create_session;
240
241mod create_table;
242
243mod create_table_optimizer;
244
245mod create_trigger;
246
247mod create_usage_profile;
248
249mod create_user_defined_function;
250
251mod create_workflow;
252
253/// Operation customization and supporting types.
254///
255/// The underlying HTTP requests made during an operation can be customized
256/// by calling the `customize()` method on the builder returned from a client
257/// operation call. For example, this can be used to add an additional HTTP header:
258///
259/// ```ignore
260/// # async fn wrapper() -> ::std::result::Result<(), aws_sdk_glue::Error> {
261/// # let client: aws_sdk_glue::Client = unimplemented!();
262/// use ::http_1x::header::{HeaderName, HeaderValue};
263///
264/// let result = client.associate_glossary_terms()
265///     .customize()
266///     .mutate_request(|req| {
267///         // Add `x-example-header` with value
268///         req.headers_mut()
269///             .insert(
270///                 HeaderName::from_static("x-example-header"),
271///                 HeaderValue::from_static("1"),
272///             );
273///     })
274///     .send()
275///     .await;
276/// # }
277/// ```
278pub mod customize;
279
280mod delete_asset;
281
282mod delete_asset_type;
283
284mod delete_attachment;
285
286mod delete_blueprint;
287
288mod delete_catalog;
289
290mod delete_classifier;
291
292mod delete_column_statistics_for_partition;
293
294mod delete_column_statistics_for_table;
295
296mod delete_column_statistics_task_settings;
297
298mod delete_connection;
299
300mod delete_connection_type;
301
302mod delete_crawler;
303
304mod delete_custom_entity_type;
305
306mod delete_data_quality_ruleset;
307
308mod delete_database;
309
310mod delete_dev_endpoint;
311
312mod delete_form_type;
313
314mod delete_glossary;
315
316mod delete_glossary_term;
317
318mod delete_glue_identity_center_configuration;
319
320mod delete_integration;
321
322mod delete_integration_resource_property;
323
324mod delete_integration_table_properties;
325
326mod delete_job;
327
328mod delete_ml_transform;
329
330mod delete_partition;
331
332mod delete_partition_index;
333
334mod delete_registry;
335
336mod delete_resource_policy;
337
338mod delete_schema;
339
340mod delete_schema_versions;
341
342mod delete_security_configuration;
343
344mod delete_session;
345
346mod delete_table;
347
348mod delete_table_optimizer;
349
350mod delete_table_version;
351
352mod delete_trigger;
353
354mod delete_usage_profile;
355
356mod delete_user_defined_function;
357
358mod delete_workflow;
359
360mod describe_connection_type;
361
362mod describe_entity;
363
364mod describe_inbound_integrations;
365
366mod describe_integrations;
367
368mod disassociate_glossary_terms;
369
370mod get_asset;
371
372mod get_asset_type;
373
374mod get_blueprint;
375
376mod get_blueprint_run;
377
378mod get_blueprint_runs;
379
380mod get_catalog;
381
382mod get_catalog_import_status;
383
384mod get_catalogs;
385
386mod get_classifier;
387
388mod get_classifiers;
389
390mod get_column_statistics_for_partition;
391
392mod get_column_statistics_for_table;
393
394mod get_column_statistics_task_run;
395
396mod get_column_statistics_task_runs;
397
398mod get_column_statistics_task_settings;
399
400mod get_connection;
401
402mod get_connections;
403
404mod get_crawler;
405
406mod get_crawler_metrics;
407
408mod get_crawlers;
409
410mod get_custom_entity_type;
411
412mod get_dashboard_url;
413
414mod get_data_catalog_encryption_settings;
415
416mod get_data_catalog_export_configuration;
417
418mod get_data_quality_model;
419
420mod get_data_quality_model_result;
421
422mod get_data_quality_result;
423
424mod get_data_quality_rule_recommendation_run;
425
426mod get_data_quality_ruleset;
427
428mod get_data_quality_ruleset_evaluation_run;
429
430mod get_database;
431
432mod get_databases;
433
434mod get_dataflow_graph;
435
436mod get_dev_endpoint;
437
438mod get_dev_endpoints;
439
440mod get_entity_records;
441
442mod get_form_type;
443
444mod get_glossary;
445
446mod get_glossary_term;
447
448mod get_glue_identity_center_configuration;
449
450mod get_integration_resource_property;
451
452mod get_integration_table_properties;
453
454mod get_job;
455
456mod get_job_bookmark;
457
458mod get_job_run;
459
460mod get_job_runs;
461
462mod get_jobs;
463
464mod get_mapping;
465
466mod get_materialized_view_refresh_task_run;
467
468mod get_ml_task_run;
469
470mod get_ml_task_runs;
471
472mod get_ml_transform;
473
474mod get_ml_transforms;
475
476mod get_partition;
477
478mod get_partition_indexes;
479
480mod get_partitions;
481
482mod get_plan;
483
484mod get_registry;
485
486mod get_resource_policies;
487
488mod get_resource_policy;
489
490mod get_schema;
491
492mod get_schema_by_definition;
493
494mod get_schema_version;
495
496mod get_schema_versions_diff;
497
498mod get_security_configuration;
499
500mod get_security_configurations;
501
502mod get_session;
503
504mod get_session_endpoint;
505
506mod get_statement;
507
508mod get_table;
509
510mod get_table_optimizer;
511
512mod get_table_version;
513
514mod get_table_versions;
515
516mod get_tables;
517
518mod get_tags;
519
520mod get_trigger;
521
522mod get_triggers;
523
524mod get_unfiltered_partition_metadata;
525
526mod get_unfiltered_partitions_metadata;
527
528mod get_unfiltered_table_metadata;
529
530mod get_usage_profile;
531
532mod get_user_defined_function;
533
534mod get_user_defined_functions;
535
536mod get_workflow;
537
538mod get_workflow_run;
539
540mod get_workflow_run_properties;
541
542mod get_workflow_runs;
543
544mod import_catalog_to_glue;
545
546mod list_asset_types;
547
548mod list_blueprints;
549
550mod list_column_statistics_task_runs;
551
552mod list_connection_types;
553
554mod list_crawlers;
555
556mod list_crawls;
557
558mod list_custom_entity_types;
559
560mod list_data_quality_results;
561
562mod list_data_quality_rule_recommendation_runs;
563
564mod list_data_quality_ruleset_evaluation_runs;
565
566mod list_data_quality_rulesets;
567
568mod list_data_quality_statistic_annotations;
569
570mod list_data_quality_statistics;
571
572mod list_dev_endpoints;
573
574mod list_entities;
575
576mod list_form_types;
577
578mod list_glossaries;
579
580mod list_glossary_terms;
581
582mod list_integration_resource_properties;
583
584mod list_integration_table_properties;
585
586mod list_iterable_forms;
587
588mod list_jobs;
589
590mod list_materialized_view_refresh_task_runs;
591
592mod list_ml_transforms;
593
594mod list_registries;
595
596mod list_schema_versions;
597
598mod list_schemas;
599
600mod list_sessions;
601
602mod list_statements;
603
604mod list_table_optimizer_runs;
605
606mod list_triggers;
607
608mod list_usage_profiles;
609
610mod list_workflows;
611
612mod modify_integration;
613
614mod put_asset;
615
616mod put_asset_type;
617
618mod put_attachment;
619
620mod put_data_catalog_encryption_settings;
621
622mod put_data_catalog_export_configuration;
623
624mod put_data_quality_profile_annotation;
625
626mod put_form_type;
627
628mod put_resource_policy;
629
630mod put_schema_version_metadata;
631
632mod put_workflow_run_properties;
633
634mod query_schema_version_metadata;
635
636mod register_connection_type;
637
638mod register_schema_version;
639
640mod remove_schema_version_metadata;
641
642mod reset_job_bookmark;
643
644mod resume_workflow_run;
645
646mod run_statement;
647
648mod search_assets;
649
650mod search_tables;
651
652mod start_blueprint_run;
653
654mod start_column_statistics_task_run;
655
656mod start_column_statistics_task_run_schedule;
657
658mod start_crawler;
659
660mod start_crawler_schedule;
661
662mod start_data_quality_rule_recommendation_run;
663
664mod start_data_quality_ruleset_evaluation_run;
665
666mod start_export_labels_task_run;
667
668mod start_import_labels_task_run;
669
670mod start_job_run;
671
672mod start_materialized_view_refresh_task_run;
673
674mod start_ml_evaluation_task_run;
675
676mod start_ml_labeling_set_generation_task_run;
677
678mod start_trigger;
679
680mod start_workflow_run;
681
682mod stop_column_statistics_task_run;
683
684mod stop_column_statistics_task_run_schedule;
685
686mod stop_crawler;
687
688mod stop_crawler_schedule;
689
690mod stop_materialized_view_refresh_task_run;
691
692mod stop_session;
693
694mod stop_trigger;
695
696mod stop_workflow_run;
697
698mod tag_resource;
699
700mod test_connection;
701
702mod untag_resource;
703
704mod update_asset;
705
706mod update_blueprint;
707
708mod update_catalog;
709
710mod update_classifier;
711
712mod update_column_statistics_for_partition;
713
714mod update_column_statistics_for_table;
715
716mod update_column_statistics_task_settings;
717
718mod update_connection;
719
720mod update_crawler;
721
722mod update_crawler_schedule;
723
724mod update_data_quality_ruleset;
725
726mod update_database;
727
728mod update_dev_endpoint;
729
730mod update_glossary;
731
732mod update_glossary_term;
733
734mod update_glue_identity_center_configuration;
735
736mod update_integration_resource_property;
737
738mod update_integration_table_properties;
739
740mod update_job;
741
742mod update_job_from_source_control;
743
744mod update_ml_transform;
745
746mod update_partition;
747
748mod update_registry;
749
750mod update_schema;
751
752mod update_source_control_from_job;
753
754mod update_table;
755
756mod update_table_optimizer;
757
758mod update_trigger;
759
760mod update_usage_profile;
761
762mod update_user_defined_function;
763
764mod update_workflow;