Skip to main content

unitycatalog_client/codegen/
client.rs

1// @generated — do not edit by hand.
2#![allow(unused_imports)]
3use crate::codegen::agent_skills::*;
4use crate::codegen::agents::*;
5use crate::codegen::catalogs::*;
6use crate::codegen::credentials::*;
7use crate::codegen::delta_commits::*;
8use crate::codegen::entity_tag_assignments::*;
9use crate::codegen::external_locations::*;
10use crate::codegen::functions::*;
11use crate::codegen::providers::*;
12use crate::codegen::recipients::*;
13use crate::codegen::schemas::*;
14use crate::codegen::shares::*;
15use crate::codegen::staging_tables::*;
16use crate::codegen::tables::*;
17use crate::codegen::tag_policies::*;
18use crate::codegen::temporary_credentials::*;
19use crate::codegen::volumes::*;
20use olai_http::CloudClient;
21use unitycatalog_common::models::agent_skills::v0alpha1::*;
22use unitycatalog_common::models::agents::v0alpha1::*;
23use unitycatalog_common::models::catalogs::v1::*;
24use unitycatalog_common::models::credentials::v1::*;
25use unitycatalog_common::models::delta_commits::v1::*;
26use unitycatalog_common::models::external_locations::v1::*;
27use unitycatalog_common::models::functions::v1::*;
28use unitycatalog_common::models::providers::v1::*;
29use unitycatalog_common::models::recipients::v1::*;
30use unitycatalog_common::models::schemas::v1::*;
31use unitycatalog_common::models::shares::v1::*;
32use unitycatalog_common::models::staging_tables::v1::*;
33use unitycatalog_common::models::tables::v1::*;
34use unitycatalog_common::models::tags::v1::*;
35use unitycatalog_common::models::temporary_credentials::v1::*;
36use unitycatalog_common::models::volumes::v1::*;
37use url::Url;
38#[derive(Clone)]
39pub struct UnityCatalogClient {
40    client: CloudClient,
41    base_url: Url,
42}
43impl UnityCatalogClient {
44    /// Create a new aggregate client from a cloud client and base URL.
45    ///
46    /// Per-service clients are constructed on demand (they only hold a cheaply-cloneable
47    /// `CloudClient` + `Url`), so nothing is allocated per service here.
48    pub fn new(client: CloudClient, mut base_url: Url) -> Self {
49        if !base_url.path().ends_with('/') {
50            base_url.set_path(&format!("{}/", base_url.path()));
51        }
52        Self { client, base_url }
53    }
54    /// Create a new aggregate client with no authentication.
55    pub fn new_unauthenticated(base_url: Url) -> Self {
56        Self::new(CloudClient::new_unauthenticated(), base_url)
57    }
58    /// Create a new aggregate client authenticating with a bearer token.
59    pub fn new_with_token(base_url: Url, token: impl ToString) -> Self {
60        Self::new(CloudClient::new_with_token(token), base_url)
61    }
62    ///Low-level `agent_skills` client exposing request/response passthrough methods.
63    pub fn agent_skills_client(&self) -> crate::codegen::agent_skills::AgentSkillServiceClient {
64        crate::codegen::agent_skills::AgentSkillServiceClient::new(
65            self.client.clone(),
66            self.base_url.clone(),
67        )
68    }
69    ///Low-level `agents` client exposing request/response passthrough methods.
70    pub fn agents_client(&self) -> crate::codegen::agents::AgentServiceClient {
71        crate::codegen::agents::AgentServiceClient::new(self.client.clone(), self.base_url.clone())
72    }
73    ///Low-level `catalogs` client exposing request/response passthrough methods.
74    pub fn catalogs_client(&self) -> crate::codegen::catalogs::CatalogServiceClient {
75        crate::codegen::catalogs::CatalogServiceClient::new(
76            self.client.clone(),
77            self.base_url.clone(),
78        )
79    }
80    ///Low-level `credentials` client exposing request/response passthrough methods.
81    pub fn credentials_client(&self) -> crate::codegen::credentials::CredentialServiceClient {
82        crate::codegen::credentials::CredentialServiceClient::new(
83            self.client.clone(),
84            self.base_url.clone(),
85        )
86    }
87    ///Low-level `delta_commits` client exposing request/response passthrough methods.
88    pub fn delta_commits_client(&self) -> crate::codegen::delta_commits::DeltaCommitClient {
89        crate::codegen::delta_commits::DeltaCommitClient::new(
90            self.client.clone(),
91            self.base_url.clone(),
92        )
93    }
94    ///Low-level `entity_tag_assignments` client exposing request/response passthrough methods.
95    pub fn entity_tag_assignments_client(
96        &self,
97    ) -> crate::codegen::entity_tag_assignments::EntityTagAssignmentClient {
98        crate::codegen::entity_tag_assignments::EntityTagAssignmentClient::new(
99            self.client.clone(),
100            self.base_url.clone(),
101        )
102    }
103    ///Low-level `external_locations` client exposing request/response passthrough methods.
104    pub fn external_locations_client(
105        &self,
106    ) -> crate::codegen::external_locations::ExternalLocationServiceClient {
107        crate::codegen::external_locations::ExternalLocationServiceClient::new(
108            self.client.clone(),
109            self.base_url.clone(),
110        )
111    }
112    ///Low-level `functions` client exposing request/response passthrough methods.
113    pub fn functions_client(&self) -> crate::codegen::functions::FunctionServiceClient {
114        crate::codegen::functions::FunctionServiceClient::new(
115            self.client.clone(),
116            self.base_url.clone(),
117        )
118    }
119    ///Low-level `providers` client exposing request/response passthrough methods.
120    pub fn providers_client(&self) -> crate::codegen::providers::ProviderServiceClient {
121        crate::codegen::providers::ProviderServiceClient::new(
122            self.client.clone(),
123            self.base_url.clone(),
124        )
125    }
126    ///Low-level `recipients` client exposing request/response passthrough methods.
127    pub fn recipients_client(&self) -> crate::codegen::recipients::RecipientServiceClient {
128        crate::codegen::recipients::RecipientServiceClient::new(
129            self.client.clone(),
130            self.base_url.clone(),
131        )
132    }
133    ///Low-level `schemas` client exposing request/response passthrough methods.
134    pub fn schemas_client(&self) -> crate::codegen::schemas::SchemaServiceClient {
135        crate::codegen::schemas::SchemaServiceClient::new(
136            self.client.clone(),
137            self.base_url.clone(),
138        )
139    }
140    ///Low-level `shares` client exposing request/response passthrough methods.
141    pub fn shares_client(&self) -> crate::codegen::shares::ShareServiceClient {
142        crate::codegen::shares::ShareServiceClient::new(self.client.clone(), self.base_url.clone())
143    }
144    ///Low-level `staging_tables` client exposing request/response passthrough methods.
145    pub fn staging_tables_client(
146        &self,
147    ) -> crate::codegen::staging_tables::StagingTableServiceClient {
148        crate::codegen::staging_tables::StagingTableServiceClient::new(
149            self.client.clone(),
150            self.base_url.clone(),
151        )
152    }
153    ///Low-level `tables` client exposing request/response passthrough methods.
154    pub fn tables_client(&self) -> crate::codegen::tables::TableServiceClient {
155        crate::codegen::tables::TableServiceClient::new(self.client.clone(), self.base_url.clone())
156    }
157    ///Low-level `tag_policies` client exposing request/response passthrough methods.
158    pub fn tag_policies_client(&self) -> crate::codegen::tag_policies::TagPolicyServiceClient {
159        crate::codegen::tag_policies::TagPolicyServiceClient::new(
160            self.client.clone(),
161            self.base_url.clone(),
162        )
163    }
164    ///Low-level `temporary_credentials` client exposing request/response passthrough methods.
165    pub fn temporary_credentials_client(
166        &self,
167    ) -> crate::codegen::temporary_credentials::TemporaryCredentialClient {
168        crate::codegen::temporary_credentials::TemporaryCredentialClient::new(
169            self.client.clone(),
170            self.base_url.clone(),
171        )
172    }
173    ///Low-level `volumes` client exposing request/response passthrough methods.
174    pub fn volumes_client(&self) -> crate::codegen::volumes::VolumeServiceClient {
175        crate::codegen::volumes::VolumeServiceClient::new(
176            self.client.clone(),
177            self.base_url.clone(),
178        )
179    }
180    /// Lists agent skills.
181    ///
182    /// # Arguments
183    ///
184    /// * `catalog_name` - The identifier of the catalog.
185    /// * `schema_name` - The identifier of the schema.
186    pub fn list_agent_skills(
187        &self,
188        catalog_name: impl Into<String>,
189        schema_name: impl Into<String>,
190    ) -> ListAgentSkillsBuilder {
191        ListAgentSkillsBuilder::new(
192            crate::codegen::agent_skills::AgentSkillServiceClient::new(
193                self.client.clone(),
194                self.base_url.clone(),
195            ),
196            catalog_name,
197            schema_name,
198        )
199    }
200    /// # Arguments
201    ///
202    /// * `catalog_name` - The identifier of the catalog.
203    /// * `schema_name` - The identifier of the schema.
204    /// * `name` - The identifier of the agent skill.
205    /// * `agent_skill_type` - How the storage location is provisioned (external or managed).
206    pub fn create_agent_skill(
207        &self,
208        catalog_name: impl Into<String>,
209        schema_name: impl Into<String>,
210        name: impl Into<String>,
211        agent_skill_type: AgentSkillType,
212    ) -> CreateAgentSkillBuilder {
213        CreateAgentSkillBuilder::new(
214            crate::codegen::agent_skills::AgentSkillServiceClient::new(
215                self.client.clone(),
216                self.base_url.clone(),
217            ),
218            catalog_name,
219            schema_name,
220            name,
221            agent_skill_type,
222        )
223    }
224    /// Access the `agent_skill` resource scoped to the given name.
225    pub fn agent_skill(
226        &self,
227        catalog_name: impl Into<String>,
228        schema_name: impl Into<String>,
229        agent_skill_name: impl Into<String>,
230    ) -> AgentSkillClient {
231        AgentSkillClient::new(
232            catalog_name,
233            schema_name,
234            agent_skill_name,
235            crate::codegen::agent_skills::AgentSkillServiceClient::new(
236                self.client.clone(),
237                self.base_url.clone(),
238            ),
239        )
240    }
241    /// Access the `agent_skill` resource from its dot-joined full name.
242    pub fn agent_skill_from_full_name(&self, full_name: impl Into<String>) -> AgentSkillClient {
243        AgentSkillClient::from_full_name(
244            full_name,
245            crate::codegen::agent_skills::AgentSkillServiceClient::new(
246                self.client.clone(),
247                self.base_url.clone(),
248            ),
249        )
250    }
251    /// Lists agents.
252    ///
253    /// # Arguments
254    ///
255    /// * `catalog_name` - The identifier of the catalog.
256    /// * `schema_name` - The identifier of the schema.
257    pub fn list_agents(
258        &self,
259        catalog_name: impl Into<String>,
260        schema_name: impl Into<String>,
261    ) -> ListAgentsBuilder {
262        ListAgentsBuilder::new(
263            crate::codegen::agents::AgentServiceClient::new(
264                self.client.clone(),
265                self.base_url.clone(),
266            ),
267            catalog_name,
268            schema_name,
269        )
270    }
271    /// # Arguments
272    ///
273    /// * `catalog_name` - The identifier of the catalog.
274    /// * `schema_name` - The identifier of the schema.
275    /// * `name` - The identifier of the agent.
276    /// * `invocation_protocol` - The protocol a recipient uses to invoke the agent.
277    /// * `endpoint` - The agent's invocation endpoint URL.
278    pub fn create_agent(
279        &self,
280        catalog_name: impl Into<String>,
281        schema_name: impl Into<String>,
282        name: impl Into<String>,
283        invocation_protocol: InvocationProtocol,
284        endpoint: impl Into<String>,
285    ) -> CreateAgentBuilder {
286        CreateAgentBuilder::new(
287            crate::codegen::agents::AgentServiceClient::new(
288                self.client.clone(),
289                self.base_url.clone(),
290            ),
291            catalog_name,
292            schema_name,
293            name,
294            invocation_protocol,
295            endpoint,
296        )
297    }
298    /// Access the `agent` resource scoped to the given name.
299    pub fn agent(
300        &self,
301        catalog_name: impl Into<String>,
302        schema_name: impl Into<String>,
303        agent_name: impl Into<String>,
304    ) -> AgentClient {
305        AgentClient::new(
306            catalog_name,
307            schema_name,
308            agent_name,
309            crate::codegen::agents::AgentServiceClient::new(
310                self.client.clone(),
311                self.base_url.clone(),
312            ),
313        )
314    }
315    /// Access the `agent` resource from its dot-joined full name.
316    pub fn agent_from_full_name(&self, full_name: impl Into<String>) -> AgentClient {
317        AgentClient::from_full_name(
318            full_name,
319            crate::codegen::agents::AgentServiceClient::new(
320                self.client.clone(),
321                self.base_url.clone(),
322            ),
323        )
324    }
325    /// List catalogs
326    ///
327    /// Gets an array of catalogs in the metastore. If the caller is the metastore admin,
328    /// all catalogs will be retrieved. Otherwise, only catalogs owned by the caller
329    /// (or for which the caller has the USE_CATALOG privilege) will be retrieved.
330    /// There is no guarantee of a specific ordering of the elements in the array.
331    pub fn list_catalogs(&self) -> ListCatalogsBuilder {
332        ListCatalogsBuilder::new(crate::codegen::catalogs::CatalogServiceClient::new(
333            self.client.clone(),
334            self.base_url.clone(),
335        ))
336    }
337    /// Create a new catalog
338    ///
339    /// Creates a new catalog instance in the parent metastore if the caller
340    /// is a metastore admin or has the CREATE_CATALOG privilege.
341    ///
342    /// # Arguments
343    ///
344    /// * `name` - Name of catalog.
345    pub fn create_catalog(&self, name: impl Into<String>) -> CreateCatalogBuilder {
346        CreateCatalogBuilder::new(
347            crate::codegen::catalogs::CatalogServiceClient::new(
348                self.client.clone(),
349                self.base_url.clone(),
350            ),
351            name,
352        )
353    }
354    /// Access the `catalog` resource scoped to the given name.
355    pub fn catalog(&self, catalog_name: impl Into<String>) -> CatalogClient {
356        CatalogClient::new(
357            catalog_name,
358            crate::codegen::catalogs::CatalogServiceClient::new(
359                self.client.clone(),
360                self.base_url.clone(),
361            ),
362        )
363    }
364    pub fn list_credentials(&self) -> ListCredentialsBuilder {
365        ListCredentialsBuilder::new(crate::codegen::credentials::CredentialServiceClient::new(
366            self.client.clone(),
367            self.base_url.clone(),
368        ))
369    }
370    /// # Arguments
371    ///
372    /// * `name` - The credential name. The name must be unique among storage and service credentials within the metastore.
373    /// * `purpose` - Indicates the purpose of the credential.
374    pub fn create_credential(
375        &self,
376        name: impl Into<String>,
377        purpose: Purpose,
378    ) -> CreateCredentialBuilder {
379        CreateCredentialBuilder::new(
380            crate::codegen::credentials::CredentialServiceClient::new(
381                self.client.clone(),
382                self.base_url.clone(),
383            ),
384            name,
385            purpose,
386        )
387    }
388    /// Access the `credential` resource scoped to the given name.
389    pub fn credential(&self, credential_name: impl Into<String>) -> CredentialClient {
390        CredentialClient::new(
391            credential_name,
392            crate::codegen::credentials::CredentialServiceClient::new(
393                self.client.clone(),
394                self.base_url.clone(),
395            ),
396        )
397    }
398    /// Ratify a staged commit at the requested version (first-writer-wins), and/or
399    /// notify the catalog that commits have been backfilled to the Delta log.
400    ///
401    /// # Arguments
402    ///
403    /// * `table_id` - UUID of the catalog-managed table being committed to.
404    /// * `table_uri` - The storage URI of the table. Must match the table's registered storage
405    /// location (normalized) on the commit path.
406    pub fn commit(
407        &self,
408        table_id: impl Into<String>,
409        table_uri: impl Into<String>,
410    ) -> CommitBuilder {
411        CommitBuilder::new(
412            crate::codegen::delta_commits::DeltaCommitClient::new(
413                self.client.clone(),
414                self.base_url.clone(),
415            ),
416            table_id,
417            table_uri,
418        )
419    }
420    /// Return ratified-but-unpublished commits for a table, plus the latest
421    /// version the catalog tracks.
422    ///
423    /// # Arguments
424    ///
425    /// * `table_id` - UUID of the catalog-managed table.
426    /// * `table_uri` - The storage URI of the table.
427    /// * `start_version` - The lowest version to return (inclusive). Defaults to 0.
428    pub fn get_commits(
429        &self,
430        table_id: impl Into<String>,
431        table_uri: impl Into<String>,
432        start_version: i64,
433    ) -> GetCommitsBuilder {
434        GetCommitsBuilder::new(
435            crate::codegen::delta_commits::DeltaCommitClient::new(
436                self.client.clone(),
437                self.base_url.clone(),
438            ),
439            table_id,
440            table_uri,
441            start_version,
442        )
443    }
444    /// List entity tag assignments
445    ///
446    /// Gets the tag assignments for the specified entity.
447    ///
448    /// # Arguments
449    ///
450    /// * `entity_type` - The type of the entity whose tag assignments to list.
451    /// * `entity_name` - The fully qualified name of the entity whose tag assignments to list.
452    pub fn list_entity_tag_assignments(
453        &self,
454        entity_type: impl Into<String>,
455        entity_name: impl Into<String>,
456    ) -> ListEntityTagAssignmentsBuilder {
457        ListEntityTagAssignmentsBuilder::new(
458            crate::codegen::entity_tag_assignments::EntityTagAssignmentClient::new(
459                self.client.clone(),
460                self.base_url.clone(),
461            ),
462            entity_type,
463            entity_name,
464        )
465    }
466    /// Create an entity tag assignment
467    ///
468    /// Assigns a tag to a Unity Catalog entity.
469    ///
470    /// # Arguments
471    ///
472    /// * `tag_assignment` - The tag assignment to create.
473    pub fn create_entity_tag_assignment(
474        &self,
475        tag_assignment: EntityTagAssignment,
476    ) -> CreateEntityTagAssignmentBuilder {
477        CreateEntityTagAssignmentBuilder::new(
478            crate::codegen::entity_tag_assignments::EntityTagAssignmentClient::new(
479                self.client.clone(),
480                self.base_url.clone(),
481            ),
482            tag_assignment,
483        )
484    }
485    /// Get an entity tag assignment
486    ///
487    /// Gets the tag assignment for the specified entity and tag key.
488    ///
489    /// # Arguments
490    ///
491    /// * `entity_type` - The type of the entity to which the tag is assigned.
492    /// * `entity_name` - The fully qualified name of the entity to which the tag is assigned.
493    /// * `tag_key` - The key of the tag.
494    pub fn get_entity_tag_assignment(
495        &self,
496        entity_type: impl Into<String>,
497        entity_name: impl Into<String>,
498        tag_key: impl Into<String>,
499    ) -> GetEntityTagAssignmentBuilder {
500        GetEntityTagAssignmentBuilder::new(
501            crate::codegen::entity_tag_assignments::EntityTagAssignmentClient::new(
502                self.client.clone(),
503                self.base_url.clone(),
504            ),
505            entity_type,
506            entity_name,
507            tag_key,
508        )
509    }
510    /// Update an entity tag assignment
511    ///
512    /// Updates the tag assignment for the specified entity and tag key.
513    ///
514    /// # Arguments
515    ///
516    /// * `entity_type` - The type of the entity to which the tag is assigned.
517    /// * `entity_name` - The fully qualified name of the entity to which the tag is assigned.
518    /// * `tag_key` - The key of the tag to update.
519    /// * `tag_assignment` - The tag assignment with the updated fields.
520    pub fn update_entity_tag_assignment(
521        &self,
522        entity_type: impl Into<String>,
523        entity_name: impl Into<String>,
524        tag_key: impl Into<String>,
525        tag_assignment: EntityTagAssignment,
526    ) -> UpdateEntityTagAssignmentBuilder {
527        UpdateEntityTagAssignmentBuilder::new(
528            crate::codegen::entity_tag_assignments::EntityTagAssignmentClient::new(
529                self.client.clone(),
530                self.base_url.clone(),
531            ),
532            entity_type,
533            entity_name,
534            tag_key,
535            tag_assignment,
536        )
537    }
538    /// Delete an entity tag assignment
539    ///
540    /// Deletes the tag assignment for the specified entity and tag key.
541    ///
542    /// # Arguments
543    ///
544    /// * `entity_type` - The type of the entity to which the tag is assigned.
545    /// * `entity_name` - The fully qualified name of the entity to which the tag is assigned.
546    /// * `tag_key` - The key of the tag to delete.
547    pub fn delete_entity_tag_assignment(
548        &self,
549        entity_type: impl Into<String>,
550        entity_name: impl Into<String>,
551        tag_key: impl Into<String>,
552    ) -> DeleteEntityTagAssignmentBuilder {
553        DeleteEntityTagAssignmentBuilder::new(
554            crate::codegen::entity_tag_assignments::EntityTagAssignmentClient::new(
555                self.client.clone(),
556                self.base_url.clone(),
557            ),
558            entity_type,
559            entity_name,
560            tag_key,
561        )
562    }
563    /// List external locations
564    pub fn list_external_locations(&self) -> ListExternalLocationsBuilder {
565        ListExternalLocationsBuilder::new(
566            crate::codegen::external_locations::ExternalLocationServiceClient::new(
567                self.client.clone(),
568                self.base_url.clone(),
569            ),
570        )
571    }
572    /// Create a new external location
573    ///
574    /// # Arguments
575    ///
576    /// * `name` - Name of external location.
577    /// * `url` - Path URL of the external location.
578    /// * `credential_name` - Name of the storage credential used with this location.
579    pub fn create_external_location(
580        &self,
581        name: impl Into<String>,
582        url: impl Into<String>,
583        credential_name: impl Into<String>,
584    ) -> CreateExternalLocationBuilder {
585        CreateExternalLocationBuilder::new(
586            crate::codegen::external_locations::ExternalLocationServiceClient::new(
587                self.client.clone(),
588                self.base_url.clone(),
589            ),
590            name,
591            url,
592            credential_name,
593        )
594    }
595    /// Access the `external_location` resource scoped to the given name.
596    pub fn external_location(
597        &self,
598        external_location_name: impl Into<String>,
599    ) -> ExternalLocationClient {
600        ExternalLocationClient::new(
601            external_location_name,
602            crate::codegen::external_locations::ExternalLocationServiceClient::new(
603                self.client.clone(),
604                self.base_url.clone(),
605            ),
606        )
607    }
608    /// List functions
609    ///
610    /// List functions within the specified parent catalog and schema. If the caller is the metastore
611    /// admin, all functions are returned in the response. Otherwise, the caller must have USE_CATALOG
612    /// on the parent catalog and USE_SCHEMA on the parent schema, and the function must either be
613    /// owned by the caller or have SELECT on the function.
614    ///
615    /// # Arguments
616    ///
617    /// * `catalog_name` - Name of parent catalog for functions of interest.
618    /// * `schema_name` - Parent schema of functions.
619    pub fn list_functions(
620        &self,
621        catalog_name: impl Into<String>,
622        schema_name: impl Into<String>,
623    ) -> ListFunctionsBuilder {
624        ListFunctionsBuilder::new(
625            crate::codegen::functions::FunctionServiceClient::new(
626                self.client.clone(),
627                self.base_url.clone(),
628            ),
629            catalog_name,
630            schema_name,
631        )
632    }
633    /// Create a function
634    ///
635    /// Creates a new function. The caller must be a metastore admin or have the CREATE_FUNCTION
636    /// privilege on the parent catalog and schema.
637    ///
638    /// # Arguments
639    ///
640    /// * `name` - Name of function, relative to parent schema.
641    /// * `catalog_name` - Name of parent catalog.
642    /// * `schema_name` - Name of parent schema.
643    /// * `data_type` - Full data type specification of the return type of the function.
644    /// * `full_data_type` - Full data type specification as SQL/catalogString text.
645    /// * `parameter_style` - The parameter-passing style.
646    /// * `is_deterministic` - Indicates whether the function is deterministic.
647    /// * `sql_data_access` - SQL data access information.
648    /// * `is_null_call` - Indicates whether the function is null-calling.
649    /// * `security_type` - The security type of the function.
650    /// * `routine_body` - The routine body.
651    pub fn create_function(
652        &self,
653        name: impl Into<String>,
654        catalog_name: impl Into<String>,
655        schema_name: impl Into<String>,
656        data_type: impl Into<String>,
657        full_data_type: impl Into<String>,
658        parameter_style: ParameterStyle,
659        is_deterministic: bool,
660        sql_data_access: SqlDataAccess,
661        is_null_call: bool,
662        security_type: SecurityType,
663        routine_body: RoutineBody,
664    ) -> CreateFunctionBuilder {
665        CreateFunctionBuilder::new(
666            crate::codegen::functions::FunctionServiceClient::new(
667                self.client.clone(),
668                self.base_url.clone(),
669            ),
670            name,
671            catalog_name,
672            schema_name,
673            data_type,
674            full_data_type,
675            parameter_style,
676            is_deterministic,
677            sql_data_access,
678            is_null_call,
679            security_type,
680            routine_body,
681        )
682    }
683    /// Access the `function` resource scoped to the given name.
684    pub fn function(
685        &self,
686        catalog_name: impl Into<String>,
687        schema_name: impl Into<String>,
688        function_name: impl Into<String>,
689    ) -> FunctionClient {
690        FunctionClient::new(
691            catalog_name,
692            schema_name,
693            function_name,
694            crate::codegen::functions::FunctionServiceClient::new(
695                self.client.clone(),
696                self.base_url.clone(),
697            ),
698        )
699    }
700    /// Access the `function` resource from its dot-joined full name.
701    pub fn function_from_full_name(&self, full_name: impl Into<String>) -> FunctionClient {
702        FunctionClient::from_full_name(
703            full_name,
704            crate::codegen::functions::FunctionServiceClient::new(
705                self.client.clone(),
706                self.base_url.clone(),
707            ),
708        )
709    }
710    /// List providers.
711    pub fn list_providers(&self) -> ListProvidersBuilder {
712        ListProvidersBuilder::new(crate::codegen::providers::ProviderServiceClient::new(
713            self.client.clone(),
714            self.base_url.clone(),
715        ))
716    }
717    /// Create a new provider.
718    ///
719    /// # Arguments
720    ///
721    /// * `name` - Name of the provider.
722    /// * `authentication_type` - The delta sharing authentication type.
723    pub fn create_provider(
724        &self,
725        name: impl Into<String>,
726        authentication_type: ProviderAuthenticationType,
727    ) -> CreateProviderBuilder {
728        CreateProviderBuilder::new(
729            crate::codegen::providers::ProviderServiceClient::new(
730                self.client.clone(),
731                self.base_url.clone(),
732            ),
733            name,
734            authentication_type,
735        )
736    }
737    /// Access the `provider` resource scoped to the given name.
738    pub fn provider(&self, provider_name: impl Into<String>) -> ProviderClient {
739        ProviderClient::new(
740            provider_name,
741            crate::codegen::providers::ProviderServiceClient::new(
742                self.client.clone(),
743                self.base_url.clone(),
744            ),
745        )
746    }
747    /// List recipients.
748    pub fn list_recipients(&self) -> ListRecipientsBuilder {
749        ListRecipientsBuilder::new(crate::codegen::recipients::RecipientServiceClient::new(
750            self.client.clone(),
751            self.base_url.clone(),
752        ))
753    }
754    /// Create a new recipient.
755    ///
756    /// # Arguments
757    ///
758    /// * `name` - Name of the recipient.
759    /// * `authentication_type` - The delta sharing authentication type.
760    /// * `owner` - Username of the recipient owner.
761    pub fn create_recipient(
762        &self,
763        name: impl Into<String>,
764        authentication_type: AuthenticationType,
765        owner: impl Into<String>,
766    ) -> CreateRecipientBuilder {
767        CreateRecipientBuilder::new(
768            crate::codegen::recipients::RecipientServiceClient::new(
769                self.client.clone(),
770                self.base_url.clone(),
771            ),
772            name,
773            authentication_type,
774            owner,
775        )
776    }
777    /// Access the `recipient` resource scoped to the given name.
778    pub fn recipient(&self, recipient_name: impl Into<String>) -> RecipientClient {
779        RecipientClient::new(
780            recipient_name,
781            crate::codegen::recipients::RecipientServiceClient::new(
782                self.client.clone(),
783                self.base_url.clone(),
784            ),
785        )
786    }
787    /// Gets an array of schemas for a catalog in the metastore. If the caller is the metastore
788    /// admin or the owner of the parent catalog, all schemas for the catalog will be retrieved.
789    /// Otherwise, only schemas owned by the caller (or for which the caller has the USE_SCHEMA privilege)
790    /// will be retrieved. There is no guarantee of a specific ordering of the elements in the array.
791    ///
792    /// # Arguments
793    ///
794    /// * `catalog_name` - Name of parent catalog.
795    pub fn list_schemas(&self, catalog_name: impl Into<String>) -> ListSchemasBuilder {
796        ListSchemasBuilder::new(
797            crate::codegen::schemas::SchemaServiceClient::new(
798                self.client.clone(),
799                self.base_url.clone(),
800            ),
801            catalog_name,
802        )
803    }
804    /// Creates a new schema for catalog in the Metatastore. The caller must be a metastore admin,
805    /// or have the CREATE_SCHEMA privilege in the parent catalog.
806    ///
807    /// # Arguments
808    ///
809    /// * `name` - Name of schema, relative to parent catalog.
810    /// * `catalog_name` - Name of parent catalog.
811    pub fn create_schema(
812        &self,
813        name: impl Into<String>,
814        catalog_name: impl Into<String>,
815    ) -> CreateSchemaBuilder {
816        CreateSchemaBuilder::new(
817            crate::codegen::schemas::SchemaServiceClient::new(
818                self.client.clone(),
819                self.base_url.clone(),
820            ),
821            name,
822            catalog_name,
823        )
824    }
825    /// Access the `schema` resource scoped to the given name.
826    pub fn schema(
827        &self,
828        catalog_name: impl Into<String>,
829        schema_name: impl Into<String>,
830    ) -> SchemaClient {
831        SchemaClient::new(
832            catalog_name,
833            schema_name,
834            crate::codegen::schemas::SchemaServiceClient::new(
835                self.client.clone(),
836                self.base_url.clone(),
837            ),
838        )
839    }
840    /// Access the `schema` resource from its dot-joined full name.
841    pub fn schema_from_full_name(&self, full_name: impl Into<String>) -> SchemaClient {
842        SchemaClient::from_full_name(
843            full_name,
844            crate::codegen::schemas::SchemaServiceClient::new(
845                self.client.clone(),
846                self.base_url.clone(),
847            ),
848        )
849    }
850    /// List shares.
851    pub fn list_shares(&self) -> ListSharesBuilder {
852        ListSharesBuilder::new(crate::codegen::shares::ShareServiceClient::new(
853            self.client.clone(),
854            self.base_url.clone(),
855        ))
856    }
857    /// Create a new share.
858    ///
859    /// # Arguments
860    ///
861    /// * `name` - Name of the share.
862    pub fn create_share(&self, name: impl Into<String>) -> CreateShareBuilder {
863        CreateShareBuilder::new(
864            crate::codegen::shares::ShareServiceClient::new(
865                self.client.clone(),
866                self.base_url.clone(),
867            ),
868            name,
869        )
870    }
871    /// Access the `share` resource scoped to the given name.
872    pub fn share(&self, share_name: impl Into<String>) -> ShareClient {
873        ShareClient::new(
874            share_name,
875            crate::codegen::shares::ShareServiceClient::new(
876                self.client.clone(),
877                self.base_url.clone(),
878            ),
879        )
880    }
881    /// Creates a new staging table, allocating an immutable table id and a storage
882    /// location under the parent schema/catalog managed storage root. The caller
883    /// must have the CREATE privilege on the parent schema.
884    ///
885    /// # Arguments
886    ///
887    /// * `name` - Name of the staging table, relative to the parent schema.
888    /// * `catalog_name` - Name of the parent catalog.
889    /// * `schema_name` - Name of the parent schema relative to its parent catalog.
890    pub fn create_staging_table(
891        &self,
892        name: impl Into<String>,
893        catalog_name: impl Into<String>,
894        schema_name: impl Into<String>,
895    ) -> CreateStagingTableBuilder {
896        CreateStagingTableBuilder::new(
897            crate::codegen::staging_tables::StagingTableServiceClient::new(
898                self.client.clone(),
899                self.base_url.clone(),
900            ),
901            name,
902            catalog_name,
903            schema_name,
904        )
905    }
906    /// Access the `staging_table` resource scoped to the given name.
907    pub fn staging_table(&self, staging_table_name: impl Into<String>) -> StagingTableClient {
908        StagingTableClient::new(
909            staging_table_name,
910            crate::codegen::staging_tables::StagingTableServiceClient::new(
911                self.client.clone(),
912                self.base_url.clone(),
913            ),
914        )
915    }
916    /// Gets an array of summaries for tables for a schema and catalog within the metastore. The table summaries returned are either:
917    /// - summaries for tables (within the current metastore and parent catalog and schema), when the user is a metastore admin, or:
918    /// - summaries for tables and schemas (within the current metastore and parent catalog) for which the user has ownership or the
919    /// SELECT privilege on the table and ownership or USE_SCHEMA privilege on the schema, provided that the user also has ownership
920    /// or the USE_CATALOG privilege on the parent catalog.
921    ///
922    /// There is no guarantee of a specific ordering of the elements in the array.
923    ///
924    /// # Arguments
925    ///
926    /// * `catalog_name` - Name of parent catalog for tables of interest.
927    pub fn list_table_summaries(
928        &self,
929        catalog_name: impl Into<String>,
930    ) -> ListTableSummariesBuilder {
931        ListTableSummariesBuilder::new(
932            crate::codegen::tables::TableServiceClient::new(
933                self.client.clone(),
934                self.base_url.clone(),
935            ),
936            catalog_name,
937        )
938    }
939    /// Gets an array of all tables for the current metastore under the parent catalog and schema.
940    ///
941    /// The caller must be a metastore admin or an owner of (or have the SELECT privilege on) the table.
942    /// For the latter case, the caller must also be the owner or have the USE_CATALOG privilege on the
943    /// parent catalog and the USE_SCHEMA privilege on the parent schema. There is no guarantee of a
944    /// specific ordering of the elements in the array.
945    ///
946    /// # Arguments
947    ///
948    /// * `catalog_name` - Name of parent catalog for tables of interest.
949    /// * `schema_name` - Name of parent schema for tables of interest.
950    pub fn list_tables(
951        &self,
952        catalog_name: impl Into<String>,
953        schema_name: impl Into<String>,
954    ) -> ListTablesBuilder {
955        ListTablesBuilder::new(
956            crate::codegen::tables::TableServiceClient::new(
957                self.client.clone(),
958                self.base_url.clone(),
959            ),
960            catalog_name,
961            schema_name,
962        )
963    }
964    /// Create a table
965    ///
966    /// # Arguments
967    ///
968    /// * `name` - Name of table, relative to parent schema.
969    /// * `schema_name` - Name of parent schema relative to its parent catalog.
970    /// * `catalog_name` - Name of parent catalog.
971    pub fn create_table(
972        &self,
973        name: impl Into<String>,
974        schema_name: impl Into<String>,
975        catalog_name: impl Into<String>,
976        table_type: TableType,
977        data_source_format: DataSourceFormat,
978    ) -> CreateTableBuilder {
979        CreateTableBuilder::new(
980            crate::codegen::tables::TableServiceClient::new(
981                self.client.clone(),
982                self.base_url.clone(),
983            ),
984            name,
985            schema_name,
986            catalog_name,
987            table_type,
988            data_source_format,
989        )
990    }
991    /// Access the `table` resource scoped to the given name.
992    pub fn table(
993        &self,
994        catalog_name: impl Into<String>,
995        schema_name: impl Into<String>,
996        table_name: impl Into<String>,
997    ) -> TableClient {
998        TableClient::new(
999            catalog_name,
1000            schema_name,
1001            table_name,
1002            crate::codegen::tables::TableServiceClient::new(
1003                self.client.clone(),
1004                self.base_url.clone(),
1005            ),
1006        )
1007    }
1008    /// Access the `table` resource from its dot-joined full name.
1009    pub fn table_from_full_name(&self, full_name: impl Into<String>) -> TableClient {
1010        TableClient::from_full_name(
1011            full_name,
1012            crate::codegen::tables::TableServiceClient::new(
1013                self.client.clone(),
1014                self.base_url.clone(),
1015            ),
1016        )
1017    }
1018    /// List tag policies
1019    ///
1020    /// Gets an array of tag policies. There is no guarantee of a specific ordering
1021    /// of the elements in the array.
1022    pub fn list_tag_policies(&self) -> ListTagPoliciesBuilder {
1023        ListTagPoliciesBuilder::new(crate::codegen::tag_policies::TagPolicyServiceClient::new(
1024            self.client.clone(),
1025            self.base_url.clone(),
1026        ))
1027    }
1028    /// Create a new tag policy
1029    ///
1030    /// Creates a new governed tag definition.
1031    ///
1032    /// # Arguments
1033    ///
1034    /// * `tag_policy` - The tag policy to create.
1035    pub fn create_tag_policy(&self, tag_policy: TagPolicy) -> CreateTagPolicyBuilder {
1036        CreateTagPolicyBuilder::new(
1037            crate::codegen::tag_policies::TagPolicyServiceClient::new(
1038                self.client.clone(),
1039                self.base_url.clone(),
1040            ),
1041            tag_policy,
1042        )
1043    }
1044    /// Access the `tag_policy` resource scoped to the given name.
1045    pub fn tag_policy(&self, tag_policy_name: impl Into<String>) -> TagPolicyClient {
1046        TagPolicyClient::new(
1047            tag_policy_name,
1048            crate::codegen::tag_policies::TagPolicyServiceClient::new(
1049                self.client.clone(),
1050                self.base_url.clone(),
1051            ),
1052        )
1053    }
1054    /// Generate a new set of credentials for a table.
1055    ///
1056    /// # Arguments
1057    ///
1058    /// * `table_id` - UUID of the table to read or write.
1059    /// * `operation` - The operation performed against the table data, either READ or READ_WRITE.
1060    /// If READ_WRITE is specified, the credentials returned will have write
1061    /// permissions, otherwise, it will be read only.
1062    pub fn generate_temporary_table_credentials(
1063        &self,
1064        table_id: impl Into<String>,
1065        operation: generate_temporary_table_credentials_request::Operation,
1066    ) -> GenerateTemporaryTableCredentialsBuilder {
1067        GenerateTemporaryTableCredentialsBuilder::new(
1068            crate::codegen::temporary_credentials::TemporaryCredentialClient::new(
1069                self.client.clone(),
1070                self.base_url.clone(),
1071            ),
1072            table_id,
1073            operation,
1074        )
1075    }
1076    /// Generate a new set of credentials for a path.
1077    ///
1078    /// # Arguments
1079    ///
1080    /// * `url` - URL for path-based access.
1081    /// * `operation` - The operation being performed on the path.
1082    pub fn generate_temporary_path_credentials(
1083        &self,
1084        url: impl Into<String>,
1085        operation: generate_temporary_path_credentials_request::Operation,
1086    ) -> GenerateTemporaryPathCredentialsBuilder {
1087        GenerateTemporaryPathCredentialsBuilder::new(
1088            crate::codegen::temporary_credentials::TemporaryCredentialClient::new(
1089                self.client.clone(),
1090                self.base_url.clone(),
1091            ),
1092            url,
1093            operation,
1094        )
1095    }
1096    /// Generate a new set of credentials for a volume.
1097    ///
1098    /// The metastore must have the `external_access_enabled` flag set to true
1099    /// (default false). The caller must have the `EXTERNAL_USE_SCHEMA`
1100    /// privilege on the parent schema (granted by a catalog owner).
1101    ///
1102    /// # Arguments
1103    ///
1104    /// * `volume_id` - UUID of the volume to read or write.
1105    /// * `operation` - The operation performed against the volume data, either READ_VOLUME or
1106    /// WRITE_VOLUME. If WRITE_VOLUME is specified, the credentials returned will
1107    /// have write permissions, otherwise, it will be read only.
1108    pub fn generate_temporary_volume_credentials(
1109        &self,
1110        volume_id: impl Into<String>,
1111        operation: generate_temporary_volume_credentials_request::Operation,
1112    ) -> GenerateTemporaryVolumeCredentialsBuilder {
1113        GenerateTemporaryVolumeCredentialsBuilder::new(
1114            crate::codegen::temporary_credentials::TemporaryCredentialClient::new(
1115                self.client.clone(),
1116                self.base_url.clone(),
1117            ),
1118            volume_id,
1119            operation,
1120        )
1121    }
1122    /// Lists volumes.
1123    ///
1124    /// # Arguments
1125    ///
1126    /// * `catalog_name` - The identifier of the catalog
1127    /// * `schema_name` - The identifier of the schema
1128    pub fn list_volumes(
1129        &self,
1130        catalog_name: impl Into<String>,
1131        schema_name: impl Into<String>,
1132    ) -> ListVolumesBuilder {
1133        ListVolumesBuilder::new(
1134            crate::codegen::volumes::VolumeServiceClient::new(
1135                self.client.clone(),
1136                self.base_url.clone(),
1137            ),
1138            catalog_name,
1139            schema_name,
1140        )
1141    }
1142    /// # Arguments
1143    ///
1144    /// * `catalog_name` - The identifier of the catalog
1145    /// * `schema_name` - The identifier of the schema
1146    /// * `name` - The identifier of the volume
1147    /// * `volume_type` - The type of the volume.
1148    ///
1149    /// An external volume is located in the specified external location.
1150    /// A managed volume is located in the default location which is specified
1151    /// by the parent schema, or the parent catalog, or the Metastore.
1152    pub fn create_volume(
1153        &self,
1154        catalog_name: impl Into<String>,
1155        schema_name: impl Into<String>,
1156        name: impl Into<String>,
1157        volume_type: VolumeType,
1158    ) -> CreateVolumeBuilder {
1159        CreateVolumeBuilder::new(
1160            crate::codegen::volumes::VolumeServiceClient::new(
1161                self.client.clone(),
1162                self.base_url.clone(),
1163            ),
1164            catalog_name,
1165            schema_name,
1166            name,
1167            volume_type,
1168        )
1169    }
1170    /// Access the `volume` resource scoped to the given name.
1171    pub fn volume(
1172        &self,
1173        catalog_name: impl Into<String>,
1174        schema_name: impl Into<String>,
1175        volume_name: impl Into<String>,
1176    ) -> VolumeClient {
1177        VolumeClient::new(
1178            catalog_name,
1179            schema_name,
1180            volume_name,
1181            crate::codegen::volumes::VolumeServiceClient::new(
1182                self.client.clone(),
1183                self.base_url.clone(),
1184            ),
1185        )
1186    }
1187    /// Access the `volume` resource from its dot-joined full name.
1188    pub fn volume_from_full_name(&self, full_name: impl Into<String>) -> VolumeClient {
1189        VolumeClient::from_full_name(
1190            full_name,
1191            crate::codegen::volumes::VolumeServiceClient::new(
1192                self.client.clone(),
1193                self.base_url.clone(),
1194            ),
1195        )
1196    }
1197}