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