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