-
Notifications
You must be signed in to change notification settings - Fork 38
/
model.go
executable file
·1386 lines (1101 loc) · 46.2 KB
/
model.go
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
// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT.
package sharing
import (
"fmt"
"github.com/databricks/databricks-sdk-go/marshal"
"github.com/databricks/databricks-sdk-go/service/catalog"
)
// The delta sharing authentication type.
type AuthenticationType string
const AuthenticationTypeDatabricks AuthenticationType = `DATABRICKS`
const AuthenticationTypeToken AuthenticationType = `TOKEN`
// String representation for [fmt.Print]
func (f *AuthenticationType) String() string {
return string(*f)
}
// Set raw string value and validate it against allowed values
func (f *AuthenticationType) Set(v string) error {
switch v {
case `DATABRICKS`, `TOKEN`:
*f = AuthenticationType(v)
return nil
default:
return fmt.Errorf(`value "%s" is not one of "DATABRICKS", "TOKEN"`, v)
}
}
// Type always returns AuthenticationType to satisfy [pflag.Value] interface
func (f *AuthenticationType) Type() string {
return "AuthenticationType"
}
type CentralCleanRoomInfo struct {
// All assets from all collaborators that are available in the clean room.
// Only one of table_info or notebook_info will be filled in.
CleanRoomAssets []CleanRoomAssetInfo `json:"clean_room_assets,omitempty"`
// All collaborators who are in the clean room.
Collaborators []CleanRoomCollaboratorInfo `json:"collaborators,omitempty"`
// The collaborator who created the clean room.
Creator *CleanRoomCollaboratorInfo `json:"creator,omitempty"`
// The cloud where clean room tasks will be run.
StationCloud string `json:"station_cloud,omitempty"`
// The region where clean room tasks will be run.
StationRegion string `json:"station_region,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *CentralCleanRoomInfo) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s CentralCleanRoomInfo) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
type CleanRoomAssetInfo struct {
// Time at which this asset was added, in epoch milliseconds.
AddedAt int64 `json:"added_at,omitempty"`
// Details about the notebook asset.
NotebookInfo *CleanRoomNotebookInfo `json:"notebook_info,omitempty"`
// The collaborator who owns the asset.
Owner *CleanRoomCollaboratorInfo `json:"owner,omitempty"`
// Details about the table asset.
TableInfo *CleanRoomTableInfo `json:"table_info,omitempty"`
// Time at which this asset was updated, in epoch milliseconds.
UpdatedAt int64 `json:"updated_at,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *CleanRoomAssetInfo) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s CleanRoomAssetInfo) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
type CleanRoomCatalog struct {
// Name of the catalog in the clean room station. Empty for notebooks.
CatalogName string `json:"catalog_name,omitempty"`
// The details of the shared notebook files.
NotebookFiles []SharedDataObject `json:"notebook_files,omitempty"`
// The details of the shared tables.
Tables []SharedDataObject `json:"tables,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *CleanRoomCatalog) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s CleanRoomCatalog) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
type CleanRoomCatalogUpdate struct {
// The name of the catalog to update assets.
CatalogName string `json:"catalog_name,omitempty"`
// The updates to the assets in the catalog.
Updates *SharedDataObjectUpdate `json:"updates,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *CleanRoomCatalogUpdate) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s CleanRoomCatalogUpdate) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
type CleanRoomCollaboratorInfo struct {
// The global Unity Catalog metastore id of the collaborator. Also known as
// the sharing identifier. The identifier is of format
// __cloud__:__region__:__metastore-uuid__.
GlobalMetastoreId string `json:"global_metastore_id,omitempty"`
// The organization name of the collaborator. This is configured in the
// metastore for Delta Sharing and is used to identify the organization to
// other collaborators.
OrganizationName string `json:"organization_name,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *CleanRoomCollaboratorInfo) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s CleanRoomCollaboratorInfo) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
type CleanRoomInfo struct {
// User-provided free-form text description.
Comment string `json:"comment,omitempty"`
// Time at which this clean room was created, in epoch milliseconds.
CreatedAt int64 `json:"created_at,omitempty"`
// Username of clean room creator.
CreatedBy string `json:"created_by,omitempty"`
// Catalog aliases shared by the current collaborator with asset details.
LocalCatalogs []CleanRoomCatalog `json:"local_catalogs,omitempty"`
// Name of the clean room.
Name string `json:"name,omitempty"`
// Username of current owner of clean room.
Owner string `json:"owner,omitempty"`
// Central clean room details.
RemoteDetailedInfo *CentralCleanRoomInfo `json:"remote_detailed_info,omitempty"`
// Time at which this clean room was updated, in epoch milliseconds.
UpdatedAt int64 `json:"updated_at,omitempty"`
// Username of clean room updater.
UpdatedBy string `json:"updated_by,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *CleanRoomInfo) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s CleanRoomInfo) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
type CleanRoomNotebookInfo struct {
// The base64 representation of the notebook content in HTML.
NotebookContent string `json:"notebook_content,omitempty"`
// The name of the notebook.
NotebookName string `json:"notebook_name,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *CleanRoomNotebookInfo) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s CleanRoomNotebookInfo) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
type CleanRoomTableInfo struct {
// Name of parent catalog.
CatalogName string `json:"catalog_name,omitempty"`
// The array of __ColumnInfo__ definitions of the table's columns.
Columns []ColumnInfo `json:"columns,omitempty"`
// Full name of table, in form of
// __catalog_name__.__schema_name__.__table_name__
FullName string `json:"full_name,omitempty"`
// Name of table, relative to parent schema.
Name string `json:"name,omitempty"`
// Name of parent schema relative to its parent catalog.
SchemaName string `json:"schema_name,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *CleanRoomTableInfo) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s CleanRoomTableInfo) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
type ColumnInfo struct {
// User-provided free-form text description.
Comment string `json:"comment,omitempty"`
Mask *ColumnMask `json:"mask,omitempty"`
// Name of Column.
Name string `json:"name,omitempty"`
// Whether field may be Null (default: true).
Nullable bool `json:"nullable,omitempty"`
// Partition index for column.
PartitionIndex int `json:"partition_index,omitempty"`
// Ordinal position of column (starting at position 0).
Position int `json:"position,omitempty"`
// Format of IntervalType.
TypeIntervalType string `json:"type_interval_type,omitempty"`
// Full data type specification, JSON-serialized.
TypeJson string `json:"type_json,omitempty"`
// Name of type (INT, STRUCT, MAP, etc.).
TypeName ColumnTypeName `json:"type_name,omitempty"`
// Digits of precision; required for DecimalTypes.
TypePrecision int `json:"type_precision,omitempty"`
// Digits to right of decimal; Required for DecimalTypes.
TypeScale int `json:"type_scale,omitempty"`
// Full data type specification as SQL/catalogString text.
TypeText string `json:"type_text,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *ColumnInfo) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s ColumnInfo) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
type ColumnMask struct {
// The full name of the column mask SQL UDF.
FunctionName string `json:"function_name,omitempty"`
// The list of additional table columns to be passed as input to the column
// mask function. The first arg of the mask function should be of the type
// of the column being masked and the types of the rest of the args should
// match the types of columns in 'using_column_names'.
UsingColumnNames []string `json:"using_column_names,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *ColumnMask) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s ColumnMask) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
// Name of type (INT, STRUCT, MAP, etc.).
type ColumnTypeName string
const ColumnTypeNameArray ColumnTypeName = `ARRAY`
const ColumnTypeNameBinary ColumnTypeName = `BINARY`
const ColumnTypeNameBoolean ColumnTypeName = `BOOLEAN`
const ColumnTypeNameByte ColumnTypeName = `BYTE`
const ColumnTypeNameChar ColumnTypeName = `CHAR`
const ColumnTypeNameDate ColumnTypeName = `DATE`
const ColumnTypeNameDecimal ColumnTypeName = `DECIMAL`
const ColumnTypeNameDouble ColumnTypeName = `DOUBLE`
const ColumnTypeNameFloat ColumnTypeName = `FLOAT`
const ColumnTypeNameInt ColumnTypeName = `INT`
const ColumnTypeNameInterval ColumnTypeName = `INTERVAL`
const ColumnTypeNameLong ColumnTypeName = `LONG`
const ColumnTypeNameMap ColumnTypeName = `MAP`
const ColumnTypeNameNull ColumnTypeName = `NULL`
const ColumnTypeNameShort ColumnTypeName = `SHORT`
const ColumnTypeNameString ColumnTypeName = `STRING`
const ColumnTypeNameStruct ColumnTypeName = `STRUCT`
const ColumnTypeNameTableType ColumnTypeName = `TABLE_TYPE`
const ColumnTypeNameTimestamp ColumnTypeName = `TIMESTAMP`
const ColumnTypeNameTimestampNtz ColumnTypeName = `TIMESTAMP_NTZ`
const ColumnTypeNameUserDefinedType ColumnTypeName = `USER_DEFINED_TYPE`
// String representation for [fmt.Print]
func (f *ColumnTypeName) String() string {
return string(*f)
}
// Set raw string value and validate it against allowed values
func (f *ColumnTypeName) Set(v string) error {
switch v {
case `ARRAY`, `BINARY`, `BOOLEAN`, `BYTE`, `CHAR`, `DATE`, `DECIMAL`, `DOUBLE`, `FLOAT`, `INT`, `INTERVAL`, `LONG`, `MAP`, `NULL`, `SHORT`, `STRING`, `STRUCT`, `TABLE_TYPE`, `TIMESTAMP`, `TIMESTAMP_NTZ`, `USER_DEFINED_TYPE`:
*f = ColumnTypeName(v)
return nil
default:
return fmt.Errorf(`value "%s" is not one of "ARRAY", "BINARY", "BOOLEAN", "BYTE", "CHAR", "DATE", "DECIMAL", "DOUBLE", "FLOAT", "INT", "INTERVAL", "LONG", "MAP", "NULL", "SHORT", "STRING", "STRUCT", "TABLE_TYPE", "TIMESTAMP", "TIMESTAMP_NTZ", "USER_DEFINED_TYPE"`, v)
}
}
// Type always returns ColumnTypeName to satisfy [pflag.Value] interface
func (f *ColumnTypeName) Type() string {
return "ColumnTypeName"
}
type CreateCleanRoom struct {
// User-provided free-form text description.
Comment string `json:"comment,omitempty"`
// Name of the clean room.
Name string `json:"name"`
// Central clean room details.
RemoteDetailedInfo CentralCleanRoomInfo `json:"remote_detailed_info"`
ForceSendFields []string `json:"-"`
}
func (s *CreateCleanRoom) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s CreateCleanRoom) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
type CreateProvider struct {
// The delta sharing authentication type.
AuthenticationType AuthenticationType `json:"authentication_type"`
// Description about the provider.
Comment string `json:"comment,omitempty"`
// The name of the Provider.
Name string `json:"name"`
// This field is required when the __authentication_type__ is **TOKEN** or
// not provided.
RecipientProfileStr string `json:"recipient_profile_str,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *CreateProvider) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s CreateProvider) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
type CreateRecipient struct {
// The delta sharing authentication type.
AuthenticationType AuthenticationType `json:"authentication_type"`
// Description about the recipient.
Comment string `json:"comment,omitempty"`
// The global Unity Catalog metastore id provided by the data recipient.
// This field is required when the __authentication_type__ is
// **DATABRICKS**. The identifier is of format
// __cloud__:__region__:__metastore-uuid__.
DataRecipientGlobalMetastoreId string `json:"data_recipient_global_metastore_id,omitempty"`
// IP Access List
IpAccessList *IpAccessList `json:"ip_access_list,omitempty"`
// Name of Recipient.
Name string `json:"name"`
// Username of the recipient owner.
Owner string `json:"owner,omitempty"`
// Recipient properties as map of string key-value pairs.
PropertiesKvpairs *SecurablePropertiesKvPairs `json:"properties_kvpairs,omitempty"`
// The one-time sharing code provided by the data recipient. This field is
// required when the __authentication_type__ is **DATABRICKS**.
SharingCode string `json:"sharing_code,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *CreateRecipient) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s CreateRecipient) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
type CreateShare struct {
// User-provided free-form text description.
Comment string `json:"comment,omitempty"`
// Name of the share.
Name string `json:"name"`
// Storage root URL for the share.
StorageRoot string `json:"storage_root,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *CreateShare) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s CreateShare) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
// Delete a clean room
type DeleteCleanRoomRequest struct {
// The name of the clean room.
Name string `json:"-" url:"-"`
}
// Delete a provider
type DeleteProviderRequest struct {
// Name of the provider.
Name string `json:"-" url:"-"`
}
// Delete a share recipient
type DeleteRecipientRequest struct {
// Name of the recipient.
Name string `json:"-" url:"-"`
}
type DeleteResponse struct {
}
// Delete a share
type DeleteShareRequest struct {
// The name of the share.
Name string `json:"-" url:"-"`
}
// Get a share activation URL
type GetActivationUrlInfoRequest struct {
// The one time activation url. It also accepts activation token.
ActivationUrl string `json:"-" url:"-"`
}
type GetActivationUrlInfoResponse struct {
}
// Get a clean room
type GetCleanRoomRequest struct {
// Whether to include remote details (central) on the clean room.
IncludeRemoteDetails bool `json:"-" url:"include_remote_details,omitempty"`
// The name of the clean room.
Name string `json:"-" url:"-"`
ForceSendFields []string `json:"-"`
}
func (s *GetCleanRoomRequest) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s GetCleanRoomRequest) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
// Get a provider
type GetProviderRequest struct {
// Name of the provider.
Name string `json:"-" url:"-"`
}
// Get a share recipient
type GetRecipientRequest struct {
// Name of the recipient.
Name string `json:"-" url:"-"`
}
type GetRecipientSharePermissionsResponse struct {
// An array of data share permissions for a recipient.
PermissionsOut []ShareToPrivilegeAssignment `json:"permissions_out,omitempty"`
}
// Get a share
type GetShareRequest struct {
// Query for data to include in the share.
IncludeSharedData bool `json:"-" url:"include_shared_data,omitempty"`
// The name of the share.
Name string `json:"-" url:"-"`
ForceSendFields []string `json:"-"`
}
func (s *GetShareRequest) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s GetShareRequest) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
type IpAccessList struct {
// Allowed IP Addresses in CIDR notation. Limit of 100.
AllowedIpAddresses []string `json:"allowed_ip_addresses,omitempty"`
}
// List clean rooms
type ListCleanRoomsRequest struct {
// Maximum number of clean rooms to return. If not set, all the clean rooms
// are returned (not recommended). - when set to a value greater than 0, the
// page length is the minimum of this value and a server configured value; -
// when set to 0, the page length is set to a server configured value
// (recommended); - when set to a value less than 0, an invalid parameter
// error is returned;
MaxResults int `json:"-" url:"max_results,omitempty"`
// Opaque pagination token to go to next page based on previous query.
PageToken string `json:"-" url:"page_token,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *ListCleanRoomsRequest) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s ListCleanRoomsRequest) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
type ListCleanRoomsResponse struct {
// An array of clean rooms. Remote details (central) are not included.
CleanRooms []CleanRoomInfo `json:"clean_rooms,omitempty"`
// Opaque token to retrieve the next page of results. Absent if there are no
// more pages. __page_token__ should be set to this value for the next
// request (for the next page of results).
NextPageToken string `json:"next_page_token,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *ListCleanRoomsResponse) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s ListCleanRoomsResponse) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
type ListProviderSharesResponse struct {
// An array of provider shares.
Shares []ProviderShare `json:"shares,omitempty"`
}
// List providers
type ListProvidersRequest struct {
// If not provided, all providers will be returned. If no providers exist
// with this ID, no results will be returned.
DataProviderGlobalMetastoreId string `json:"-" url:"data_provider_global_metastore_id,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *ListProvidersRequest) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s ListProvidersRequest) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
type ListProvidersResponse struct {
// An array of provider information objects.
Providers []ProviderInfo `json:"providers,omitempty"`
}
// List share recipients
type ListRecipientsRequest struct {
// If not provided, all recipients will be returned. If no recipients exist
// with this ID, no results will be returned.
DataRecipientGlobalMetastoreId string `json:"-" url:"data_recipient_global_metastore_id,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *ListRecipientsRequest) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s ListRecipientsRequest) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
type ListRecipientsResponse struct {
// An array of recipient information objects.
Recipients []RecipientInfo `json:"recipients,omitempty"`
}
// List shares by Provider
type ListSharesRequest struct {
// Name of the provider in which to list shares.
Name string `json:"-" url:"-"`
}
type ListSharesResponse struct {
// An array of data share information objects.
Shares []ShareInfo `json:"shares,omitempty"`
}
type Partition struct {
// An array of partition values.
Values []PartitionValue `json:"values,omitempty"`
}
type PartitionValue struct {
// The name of the partition column.
Name string `json:"name,omitempty"`
// The operator to apply for the value.
Op PartitionValueOp `json:"op,omitempty"`
// The key of a Delta Sharing recipient's property. For example
// `databricks-account-id`. When this field is set, field `value` can not be
// set.
RecipientPropertyKey string `json:"recipient_property_key,omitempty"`
// The value of the partition column. When this value is not set, it means
// `null` value. When this field is set, field `recipient_property_key` can
// not be set.
Value string `json:"value,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *PartitionValue) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s PartitionValue) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
// The operator to apply for the value.
type PartitionValueOp string
const PartitionValueOpEqual PartitionValueOp = `EQUAL`
const PartitionValueOpLike PartitionValueOp = `LIKE`
// String representation for [fmt.Print]
func (f *PartitionValueOp) String() string {
return string(*f)
}
// Set raw string value and validate it against allowed values
func (f *PartitionValueOp) Set(v string) error {
switch v {
case `EQUAL`, `LIKE`:
*f = PartitionValueOp(v)
return nil
default:
return fmt.Errorf(`value "%s" is not one of "EQUAL", "LIKE"`, v)
}
}
// Type always returns PartitionValueOp to satisfy [pflag.Value] interface
func (f *PartitionValueOp) Type() string {
return "PartitionValueOp"
}
type Privilege string
const PrivilegeAccess Privilege = `ACCESS`
const PrivilegeAllPrivileges Privilege = `ALL_PRIVILEGES`
const PrivilegeApplyTag Privilege = `APPLY_TAG`
const PrivilegeCreate Privilege = `CREATE`
const PrivilegeCreateCatalog Privilege = `CREATE_CATALOG`
const PrivilegeCreateConnection Privilege = `CREATE_CONNECTION`
const PrivilegeCreateExternalLocation Privilege = `CREATE_EXTERNAL_LOCATION`
const PrivilegeCreateExternalTable Privilege = `CREATE_EXTERNAL_TABLE`
const PrivilegeCreateExternalVolume Privilege = `CREATE_EXTERNAL_VOLUME`
const PrivilegeCreateForeignCatalog Privilege = `CREATE_FOREIGN_CATALOG`
const PrivilegeCreateFunction Privilege = `CREATE_FUNCTION`
const PrivilegeCreateManagedStorage Privilege = `CREATE_MANAGED_STORAGE`
const PrivilegeCreateMaterializedView Privilege = `CREATE_MATERIALIZED_VIEW`
const PrivilegeCreateModel Privilege = `CREATE_MODEL`
const PrivilegeCreateProvider Privilege = `CREATE_PROVIDER`
const PrivilegeCreateRecipient Privilege = `CREATE_RECIPIENT`
const PrivilegeCreateSchema Privilege = `CREATE_SCHEMA`
const PrivilegeCreateServiceCredential Privilege = `CREATE_SERVICE_CREDENTIAL`
const PrivilegeCreateShare Privilege = `CREATE_SHARE`
const PrivilegeCreateStorageCredential Privilege = `CREATE_STORAGE_CREDENTIAL`
const PrivilegeCreateTable Privilege = `CREATE_TABLE`
const PrivilegeCreateView Privilege = `CREATE_VIEW`
const PrivilegeCreateVolume Privilege = `CREATE_VOLUME`
const PrivilegeExecute Privilege = `EXECUTE`
const PrivilegeManageAllowlist Privilege = `MANAGE_ALLOWLIST`
const PrivilegeModify Privilege = `MODIFY`
const PrivilegeReadFiles Privilege = `READ_FILES`
const PrivilegeReadPrivateFiles Privilege = `READ_PRIVATE_FILES`
const PrivilegeReadVolume Privilege = `READ_VOLUME`
const PrivilegeRefresh Privilege = `REFRESH`
const PrivilegeSelect Privilege = `SELECT`
const PrivilegeSetSharePermission Privilege = `SET_SHARE_PERMISSION`
const PrivilegeSingleUserAccess Privilege = `SINGLE_USER_ACCESS`
const PrivilegeUsage Privilege = `USAGE`
const PrivilegeUseCatalog Privilege = `USE_CATALOG`
const PrivilegeUseConnection Privilege = `USE_CONNECTION`
const PrivilegeUseMarketplaceAssets Privilege = `USE_MARKETPLACE_ASSETS`
const PrivilegeUseProvider Privilege = `USE_PROVIDER`
const PrivilegeUseRecipient Privilege = `USE_RECIPIENT`
const PrivilegeUseSchema Privilege = `USE_SCHEMA`
const PrivilegeUseShare Privilege = `USE_SHARE`
const PrivilegeWriteFiles Privilege = `WRITE_FILES`
const PrivilegeWritePrivateFiles Privilege = `WRITE_PRIVATE_FILES`
const PrivilegeWriteVolume Privilege = `WRITE_VOLUME`
// String representation for [fmt.Print]
func (f *Privilege) String() string {
return string(*f)
}
// Set raw string value and validate it against allowed values
func (f *Privilege) Set(v string) error {
switch v {
case `ACCESS`, `ALL_PRIVILEGES`, `APPLY_TAG`, `CREATE`, `CREATE_CATALOG`, `CREATE_CONNECTION`, `CREATE_EXTERNAL_LOCATION`, `CREATE_EXTERNAL_TABLE`, `CREATE_EXTERNAL_VOLUME`, `CREATE_FOREIGN_CATALOG`, `CREATE_FUNCTION`, `CREATE_MANAGED_STORAGE`, `CREATE_MATERIALIZED_VIEW`, `CREATE_MODEL`, `CREATE_PROVIDER`, `CREATE_RECIPIENT`, `CREATE_SCHEMA`, `CREATE_SERVICE_CREDENTIAL`, `CREATE_SHARE`, `CREATE_STORAGE_CREDENTIAL`, `CREATE_TABLE`, `CREATE_VIEW`, `CREATE_VOLUME`, `EXECUTE`, `MANAGE_ALLOWLIST`, `MODIFY`, `READ_FILES`, `READ_PRIVATE_FILES`, `READ_VOLUME`, `REFRESH`, `SELECT`, `SET_SHARE_PERMISSION`, `SINGLE_USER_ACCESS`, `USAGE`, `USE_CATALOG`, `USE_CONNECTION`, `USE_MARKETPLACE_ASSETS`, `USE_PROVIDER`, `USE_RECIPIENT`, `USE_SCHEMA`, `USE_SHARE`, `WRITE_FILES`, `WRITE_PRIVATE_FILES`, `WRITE_VOLUME`:
*f = Privilege(v)
return nil
default:
return fmt.Errorf(`value "%s" is not one of "ACCESS", "ALL_PRIVILEGES", "APPLY_TAG", "CREATE", "CREATE_CATALOG", "CREATE_CONNECTION", "CREATE_EXTERNAL_LOCATION", "CREATE_EXTERNAL_TABLE", "CREATE_EXTERNAL_VOLUME", "CREATE_FOREIGN_CATALOG", "CREATE_FUNCTION", "CREATE_MANAGED_STORAGE", "CREATE_MATERIALIZED_VIEW", "CREATE_MODEL", "CREATE_PROVIDER", "CREATE_RECIPIENT", "CREATE_SCHEMA", "CREATE_SERVICE_CREDENTIAL", "CREATE_SHARE", "CREATE_STORAGE_CREDENTIAL", "CREATE_TABLE", "CREATE_VIEW", "CREATE_VOLUME", "EXECUTE", "MANAGE_ALLOWLIST", "MODIFY", "READ_FILES", "READ_PRIVATE_FILES", "READ_VOLUME", "REFRESH", "SELECT", "SET_SHARE_PERMISSION", "SINGLE_USER_ACCESS", "USAGE", "USE_CATALOG", "USE_CONNECTION", "USE_MARKETPLACE_ASSETS", "USE_PROVIDER", "USE_RECIPIENT", "USE_SCHEMA", "USE_SHARE", "WRITE_FILES", "WRITE_PRIVATE_FILES", "WRITE_VOLUME"`, v)
}
}
// Type always returns Privilege to satisfy [pflag.Value] interface
func (f *Privilege) Type() string {
return "Privilege"
}
type PrivilegeAssignment struct {
// The principal (user email address or group name).
Principal string `json:"principal,omitempty"`
// The privileges assigned to the principal.
Privileges []Privilege `json:"privileges,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *PrivilegeAssignment) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s PrivilegeAssignment) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
type ProviderInfo struct {
// The delta sharing authentication type.
AuthenticationType AuthenticationType `json:"authentication_type,omitempty"`
// Cloud vendor of the provider's UC metastore. This field is only present
// when the __authentication_type__ is **DATABRICKS**.
Cloud string `json:"cloud,omitempty"`
// Description about the provider.
Comment string `json:"comment,omitempty"`
// Time at which this Provider was created, in epoch milliseconds.
CreatedAt int64 `json:"created_at,omitempty"`
// Username of Provider creator.
CreatedBy string `json:"created_by,omitempty"`
// The global UC metastore id of the data provider. This field is only
// present when the __authentication_type__ is **DATABRICKS**. The
// identifier is of format <cloud>:<region>:<metastore-uuid>.
DataProviderGlobalMetastoreId string `json:"data_provider_global_metastore_id,omitempty"`
// UUID of the provider's UC metastore. This field is only present when the
// __authentication_type__ is **DATABRICKS**.
MetastoreId string `json:"metastore_id,omitempty"`
// The name of the Provider.
Name string `json:"name,omitempty"`
// Username of Provider owner.
Owner string `json:"owner,omitempty"`
// The recipient profile. This field is only present when the
// authentication_type is `TOKEN`.
RecipientProfile *RecipientProfile `json:"recipient_profile,omitempty"`
// This field is only present when the authentication_type is `TOKEN` or not
// provided.
RecipientProfileStr string `json:"recipient_profile_str,omitempty"`
// Cloud region of the provider's UC metastore. This field is only present
// when the __authentication_type__ is **DATABRICKS**.
Region string `json:"region,omitempty"`
// Time at which this Provider was created, in epoch milliseconds.
UpdatedAt int64 `json:"updated_at,omitempty"`
// Username of user who last modified Share.
UpdatedBy string `json:"updated_by,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *ProviderInfo) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s ProviderInfo) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
type ProviderShare struct {
// The name of the Provider Share.
Name string `json:"name,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *ProviderShare) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s ProviderShare) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
type RecipientInfo struct {
// A boolean status field showing whether the Recipient's activation URL has
// been exercised or not.
Activated bool `json:"activated,omitempty"`
// Full activation url to retrieve the access token. It will be empty if the
// token is already retrieved.
ActivationUrl string `json:"activation_url,omitempty"`
// The delta sharing authentication type.
AuthenticationType AuthenticationType `json:"authentication_type,omitempty"`
// Cloud vendor of the recipient's Unity Catalog Metstore. This field is
// only present when the __authentication_type__ is **DATABRICKS**`.
Cloud string `json:"cloud,omitempty"`
// Description about the recipient.
Comment string `json:"comment,omitempty"`
// Time at which this recipient was created, in epoch milliseconds.
CreatedAt int64 `json:"created_at,omitempty"`
// Username of recipient creator.
CreatedBy string `json:"created_by,omitempty"`
// The global Unity Catalog metastore id provided by the data recipient.
// This field is only present when the __authentication_type__ is
// **DATABRICKS**. The identifier is of format
// __cloud__:__region__:__metastore-uuid__.
DataRecipientGlobalMetastoreId string `json:"data_recipient_global_metastore_id,omitempty"`
// IP Access List
IpAccessList *IpAccessList `json:"ip_access_list,omitempty"`
// Unique identifier of recipient's Unity Catalog metastore. This field is
// only present when the __authentication_type__ is **DATABRICKS**
MetastoreId string `json:"metastore_id,omitempty"`
// Name of Recipient.
Name string `json:"name,omitempty"`
// Username of the recipient owner.
Owner string `json:"owner,omitempty"`
// Recipient properties as map of string key-value pairs.
PropertiesKvpairs *SecurablePropertiesKvPairs `json:"properties_kvpairs,omitempty"`
// Cloud region of the recipient's Unity Catalog Metstore. This field is
// only present when the __authentication_type__ is **DATABRICKS**.
Region string `json:"region,omitempty"`
// The one-time sharing code provided by the data recipient. This field is
// only present when the __authentication_type__ is **DATABRICKS**.
SharingCode string `json:"sharing_code,omitempty"`
// This field is only present when the __authentication_type__ is **TOKEN**.
Tokens []RecipientTokenInfo `json:"tokens,omitempty"`
// Time at which the recipient was updated, in epoch milliseconds.
UpdatedAt int64 `json:"updated_at,omitempty"`
// Username of recipient updater.
UpdatedBy string `json:"updated_by,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *RecipientInfo) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s RecipientInfo) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
type RecipientProfile struct {
// The token used to authorize the recipient.
BearerToken string `json:"bearer_token,omitempty"`
// The endpoint for the share to be used by the recipient.
Endpoint string `json:"endpoint,omitempty"`
// The version number of the recipient's credentials on a share.
ShareCredentialsVersion int `json:"share_credentials_version,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *RecipientProfile) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s RecipientProfile) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
type RecipientTokenInfo struct {
// Full activation URL to retrieve the access token. It will be empty if the
// token is already retrieved.
ActivationUrl string `json:"activation_url,omitempty"`
// Time at which this recipient Token was created, in epoch milliseconds.
CreatedAt int64 `json:"created_at,omitempty"`
// Username of recipient token creator.
CreatedBy string `json:"created_by,omitempty"`
// Expiration timestamp of the token in epoch milliseconds.
ExpirationTime int64 `json:"expiration_time,omitempty"`
// Unique ID of the recipient token.
Id string `json:"id,omitempty"`
// Time at which this recipient Token was updated, in epoch milliseconds.
UpdatedAt int64 `json:"updated_at,omitempty"`
// Username of recipient Token updater.
UpdatedBy string `json:"updated_by,omitempty"`
ForceSendFields []string `json:"-"`
}
func (s *RecipientTokenInfo) UnmarshalJSON(b []byte) error {
return marshal.Unmarshal(b, s)
}
func (s RecipientTokenInfo) MarshalJSON() ([]byte, error) {
return marshal.Marshal(s)
}
// Get an access token
type RetrieveTokenRequest struct {
// The one time activation url. It also accepts activation token.
ActivationUrl string `json:"-" url:"-"`
}
type RetrieveTokenResponse struct {
// The token used to authorize the recipient.
BearerToken string `json:"bearerToken,omitempty"`
// The endpoint for the share to be used by the recipient.
Endpoint string `json:"endpoint,omitempty"`
// Expiration timestamp of the token in epoch milliseconds.
ExpirationTime string `json:"expirationTime,omitempty"`
// These field names must follow the delta sharing protocol.
ShareCredentialsVersion int `json:"shareCredentialsVersion,omitempty"`
ForceSendFields []string `json:"-"`
}