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_table_properties;
299
300mod delete_job;
301
302mod delete_ml_transform;
303
304mod delete_partition;
305
306mod delete_partition_index;
307
308mod delete_registry;
309
310mod delete_resource_policy;
311
312mod delete_schema;
313
314mod delete_schema_versions;
315
316mod delete_security_configuration;
317
318mod delete_session;
319
320mod delete_table;
321
322mod delete_table_optimizer;
323
324mod delete_table_version;
325
326mod delete_trigger;
327
328mod delete_usage_profile;
329
330mod delete_user_defined_function;
331
332mod delete_workflow;
333
334mod describe_connection_type;
335
336mod describe_entity;
337
338mod describe_inbound_integrations;
339
340mod describe_integrations;
341
342mod get_blueprint;
343
344mod get_blueprint_run;
345
346mod get_blueprint_runs;
347
348mod get_catalog;
349
350mod get_catalog_import_status;
351
352mod get_catalogs;
353
354mod get_classifier;
355
356mod get_classifiers;
357
358mod get_column_statistics_for_partition;
359
360mod get_column_statistics_for_table;
361
362mod get_column_statistics_task_run;
363
364mod get_column_statistics_task_runs;
365
366mod get_column_statistics_task_settings;
367
368mod get_connection;
369
370mod get_connections;
371
372mod get_crawler;
373
374mod get_crawler_metrics;
375
376mod get_crawlers;
377
378mod get_custom_entity_type;
379
380mod get_data_catalog_encryption_settings;
381
382mod get_data_quality_model;
383
384mod get_data_quality_model_result;
385
386mod get_data_quality_result;
387
388mod get_data_quality_rule_recommendation_run;
389
390mod get_data_quality_ruleset;
391
392mod get_data_quality_ruleset_evaluation_run;
393
394mod get_database;
395
396mod get_databases;
397
398mod get_dataflow_graph;
399
400mod get_dev_endpoint;
401
402mod get_dev_endpoints;
403
404mod get_entity_records;
405
406mod get_glue_identity_center_configuration;
407
408mod get_integration_resource_property;
409
410mod get_integration_table_properties;
411
412mod get_job;
413
414mod get_job_bookmark;
415
416mod get_job_run;
417
418mod get_job_runs;
419
420mod get_jobs;
421
422mod get_mapping;
423
424mod get_ml_task_run;
425
426mod get_ml_task_runs;
427
428mod get_ml_transform;
429
430mod get_ml_transforms;
431
432mod get_partition;
433
434mod get_partition_indexes;
435
436mod get_partitions;
437
438mod get_plan;
439
440mod get_registry;
441
442mod get_resource_policies;
443
444mod get_resource_policy;
445
446mod get_schema;
447
448mod get_schema_by_definition;
449
450mod get_schema_version;
451
452mod get_schema_versions_diff;
453
454mod get_security_configuration;
455
456mod get_security_configurations;
457
458mod get_session;
459
460mod get_statement;
461
462mod get_table;
463
464mod get_table_optimizer;
465
466mod get_table_version;
467
468mod get_table_versions;
469
470mod get_tables;
471
472mod get_tags;
473
474mod get_trigger;
475
476mod get_triggers;
477
478mod get_unfiltered_partition_metadata;
479
480mod get_unfiltered_partitions_metadata;
481
482mod get_unfiltered_table_metadata;
483
484mod get_usage_profile;
485
486mod get_user_defined_function;
487
488mod get_user_defined_functions;
489
490mod get_workflow;
491
492mod get_workflow_run;
493
494mod get_workflow_run_properties;
495
496mod get_workflow_runs;
497
498mod import_catalog_to_glue;
499
500mod list_blueprints;
501
502mod list_column_statistics_task_runs;
503
504mod list_connection_types;
505
506mod list_crawlers;
507
508mod list_crawls;
509
510mod list_custom_entity_types;
511
512mod list_data_quality_results;
513
514mod list_data_quality_rule_recommendation_runs;
515
516mod list_data_quality_ruleset_evaluation_runs;
517
518mod list_data_quality_rulesets;
519
520mod list_data_quality_statistic_annotations;
521
522mod list_data_quality_statistics;
523
524mod list_dev_endpoints;
525
526mod list_entities;
527
528mod list_jobs;
529
530mod list_ml_transforms;
531
532mod list_registries;
533
534mod list_schema_versions;
535
536mod list_schemas;
537
538mod list_sessions;
539
540mod list_statements;
541
542mod list_table_optimizer_runs;
543
544mod list_triggers;
545
546mod list_usage_profiles;
547
548mod list_workflows;
549
550mod modify_integration;
551
552mod put_data_catalog_encryption_settings;
553
554mod put_data_quality_profile_annotation;
555
556mod put_resource_policy;
557
558mod put_schema_version_metadata;
559
560mod put_workflow_run_properties;
561
562mod query_schema_version_metadata;
563
564mod register_schema_version;
565
566mod remove_schema_version_metadata;
567
568mod reset_job_bookmark;
569
570mod resume_workflow_run;
571
572mod run_statement;
573
574mod search_tables;
575
576mod start_blueprint_run;
577
578mod start_column_statistics_task_run;
579
580mod start_column_statistics_task_run_schedule;
581
582mod start_crawler;
583
584mod start_crawler_schedule;
585
586mod start_data_quality_rule_recommendation_run;
587
588mod start_data_quality_ruleset_evaluation_run;
589
590mod start_export_labels_task_run;
591
592mod start_import_labels_task_run;
593
594mod start_job_run;
595
596mod start_ml_evaluation_task_run;
597
598mod start_ml_labeling_set_generation_task_run;
599
600mod start_trigger;
601
602mod start_workflow_run;
603
604mod stop_column_statistics_task_run;
605
606mod stop_column_statistics_task_run_schedule;
607
608mod stop_crawler;
609
610mod stop_crawler_schedule;
611
612mod stop_session;
613
614mod stop_trigger;
615
616mod stop_workflow_run;
617
618mod tag_resource;
619
620mod test_connection;
621
622mod untag_resource;
623
624mod update_blueprint;
625
626mod update_catalog;
627
628mod update_classifier;
629
630mod update_column_statistics_for_partition;
631
632mod update_column_statistics_for_table;
633
634mod update_column_statistics_task_settings;
635
636mod update_connection;
637
638mod update_crawler;
639
640mod update_crawler_schedule;
641
642mod update_data_quality_ruleset;
643
644mod update_database;
645
646mod update_dev_endpoint;
647
648mod update_glue_identity_center_configuration;
649
650mod update_integration_resource_property;
651
652mod update_integration_table_properties;
653
654mod update_job;
655
656mod update_job_from_source_control;
657
658mod update_ml_transform;
659
660mod update_partition;
661
662mod update_registry;
663
664mod update_schema;
665
666mod update_source_control_from_job;
667
668mod update_table;
669
670mod update_table_optimizer;
671
672mod update_trigger;
673
674mod update_usage_profile;
675
676mod update_user_defined_function;
677
678mod update_workflow;