@@ -5453,29 +5453,107 @@ impl fmt::Display for FetchDirection {
5453
5453
#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
5454
5454
#[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
5455
5455
pub enum Action {
5456
+ AddSearchOptimization ,
5457
+ Apply {
5458
+ apply_type : ActionApplyType ,
5459
+ } ,
5460
+ ApplyBudget ,
5461
+ AttachListing ,
5462
+ AttachPolicy ,
5463
+ Audit ,
5464
+ BindServiceEndpoint ,
5456
5465
Connect ,
5457
- Create ,
5466
+ Create {
5467
+ obj_type : Option < ActionCreateObjectType > ,
5468
+ } ,
5458
5469
Delete ,
5459
- Execute ,
5460
- Insert { columns : Option < Vec < Ident > > } ,
5461
- References { columns : Option < Vec < Ident > > } ,
5462
- Select { columns : Option < Vec < Ident > > } ,
5470
+ EvolveSchema ,
5471
+ Execute {
5472
+ obj_type : Option < ActionExecuteObjectType > ,
5473
+ } ,
5474
+ Failover ,
5475
+ ImportedPrivileges ,
5476
+ ImportShare ,
5477
+ Insert {
5478
+ columns : Option < Vec < Ident > > ,
5479
+ } ,
5480
+ Manage {
5481
+ manage_type : ActionManageType ,
5482
+ } ,
5483
+ ManageReleases ,
5484
+ ManageVersions ,
5485
+ Modify {
5486
+ modify_type : ActionModifyType ,
5487
+ } ,
5488
+ Monitor {
5489
+ monitor_type : ActionMonitorType ,
5490
+ } ,
5491
+ Operate ,
5492
+ OverrideShareRestrictions ,
5493
+ Ownership ,
5494
+ PurchaseDataExchangeListing ,
5495
+ Read ,
5496
+ ReadSession ,
5497
+ References {
5498
+ columns : Option < Vec < Ident > > ,
5499
+ } ,
5500
+ Replicate ,
5501
+ ResolveAll ,
5502
+ Select {
5503
+ columns : Option < Vec < Ident > > ,
5504
+ } ,
5463
5505
Temporary ,
5464
5506
Trigger ,
5465
5507
Truncate ,
5466
- Update { columns : Option < Vec < Ident > > } ,
5508
+ Update {
5509
+ columns : Option < Vec < Ident > > ,
5510
+ } ,
5467
5511
Usage ,
5468
5512
}
5469
5513
5470
5514
impl fmt:: Display for Action {
5471
5515
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
5472
5516
match self {
5517
+ Action :: AddSearchOptimization => f. write_str ( "ADD SEARCH OPTIMIZATION" ) ?,
5518
+ Action :: Apply { apply_type } => write ! ( f, "APPLY {apply_type}" ) ?,
5519
+ Action :: ApplyBudget => f. write_str ( "APPLY BUDGET" ) ?,
5520
+ Action :: AttachListing => f. write_str ( "ATTACH LISTING" ) ?,
5521
+ Action :: AttachPolicy => f. write_str ( "ATTACH POLICY" ) ?,
5522
+ Action :: Audit => f. write_str ( "AUDIT" ) ?,
5523
+ Action :: BindServiceEndpoint => f. write_str ( "BIND SERVICE ENDPOINT" ) ?,
5473
5524
Action :: Connect => f. write_str ( "CONNECT" ) ?,
5474
- Action :: Create => f. write_str ( "CREATE" ) ?,
5525
+ Action :: Create { obj_type } => {
5526
+ f. write_str ( "CREATE" ) ?;
5527
+ if let Some ( obj_type) = obj_type {
5528
+ write ! ( f, " {obj_type}" ) ?
5529
+ }
5530
+ }
5475
5531
Action :: Delete => f. write_str ( "DELETE" ) ?,
5476
- Action :: Execute => f. write_str ( "EXECUTE" ) ?,
5532
+ Action :: EvolveSchema => f. write_str ( "EVOLVE SCHEMA" ) ?,
5533
+ Action :: Execute { obj_type } => {
5534
+ f. write_str ( "EXECUTE" ) ?;
5535
+ if let Some ( obj_type) = obj_type {
5536
+ write ! ( f, " {obj_type}" ) ?
5537
+ }
5538
+ }
5539
+ Action :: Failover => f. write_str ( "FAILOVER" ) ?,
5540
+ Action :: ImportedPrivileges => f. write_str ( "IMPORTED PRIVILEGES" ) ?,
5541
+ Action :: ImportShare => f. write_str ( "IMPORT SHARE" ) ?,
5477
5542
Action :: Insert { .. } => f. write_str ( "INSERT" ) ?,
5543
+ Action :: Manage { manage_type } => write ! ( f, "MANAGE {manage_type}" ) ?,
5544
+ Action :: ManageReleases => f. write_str ( "MANAGE RELEASES" ) ?,
5545
+ Action :: ManageVersions => f. write_str ( "MANAGE VERSIONS" ) ?,
5546
+ Action :: Modify { modify_type } => write ! ( f, "MODIFY {modify_type}" ) ?,
5547
+ Action :: Monitor { monitor_type } => write ! ( f, "MONITOR {monitor_type}" ) ?,
5548
+ Action :: Operate => f. write_str ( "OPERATE" ) ?,
5549
+ Action :: OverrideShareRestrictions => f. write_str ( "OVERRIDE SHARE RESTRICTIONS" ) ?,
5550
+ Action :: Ownership => f. write_str ( "OWNERSHIP" ) ?,
5551
+ Action :: PurchaseDataExchangeListing => f. write_str ( "PURCHASE DATA EXCHANGE LISTING" ) ?,
5552
+ Action :: Read => f. write_str ( "READ" ) ?,
5553
+ Action :: ReadSession => f. write_str ( "READ SESSION" ) ?,
5478
5554
Action :: References { .. } => f. write_str ( "REFERENCES" ) ?,
5555
+ Action :: Replicate => f. write_str ( "REPLICATE" ) ?,
5556
+ Action :: ResolveAll => f. write_str ( "RESOLVE ALL" ) ?,
5479
5557
Action :: Select { .. } => f. write_str ( "SELECT" ) ?,
5480
5558
Action :: Temporary => f. write_str ( "TEMPORARY" ) ?,
5481
5559
Action :: Trigger => f. write_str ( "TRIGGER" ) ?,
@@ -5498,6 +5576,186 @@ impl fmt::Display for Action {
5498
5576
}
5499
5577
}
5500
5578
5579
+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
5580
+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
5581
+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
5582
+ /// See <https://docs.snowflake.com/en/sql-reference/sql/grant-privilege>
5583
+ /// under `globalPrivileges` in the `CREATE` privilege.
5584
+ pub enum ActionCreateObjectType {
5585
+ Account ,
5586
+ Application ,
5587
+ ApplicationPackage ,
5588
+ ComputePool ,
5589
+ DataExchangeListing ,
5590
+ Database ,
5591
+ ExternalVolume ,
5592
+ FailoverGroup ,
5593
+ Integration ,
5594
+ NetworkPolicy ,
5595
+ OrganiationListing ,
5596
+ ReplicationGroup ,
5597
+ Role ,
5598
+ Share ,
5599
+ User ,
5600
+ Warehouse ,
5601
+ }
5602
+
5603
+ impl fmt:: Display for ActionCreateObjectType {
5604
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
5605
+ match self {
5606
+ ActionCreateObjectType :: Account => write ! ( f, "ACCOUNT" ) ,
5607
+ ActionCreateObjectType :: Application => write ! ( f, "APPLICATION" ) ,
5608
+ ActionCreateObjectType :: ApplicationPackage => write ! ( f, "APPLICATION PACKAGE" ) ,
5609
+ ActionCreateObjectType :: ComputePool => write ! ( f, "COMPUTE POOL" ) ,
5610
+ ActionCreateObjectType :: DataExchangeListing => write ! ( f, "DATA EXCHANGE LISTING" ) ,
5611
+ ActionCreateObjectType :: Database => write ! ( f, "DATABASE" ) ,
5612
+ ActionCreateObjectType :: ExternalVolume => write ! ( f, "EXTERNAL VOLUME" ) ,
5613
+ ActionCreateObjectType :: FailoverGroup => write ! ( f, "FAILOVER GROUP" ) ,
5614
+ ActionCreateObjectType :: Integration => write ! ( f, "INTEGRATION" ) ,
5615
+ ActionCreateObjectType :: NetworkPolicy => write ! ( f, "NETWORK POLICY" ) ,
5616
+ ActionCreateObjectType :: OrganiationListing => write ! ( f, "ORGANIZATION LISTING" ) ,
5617
+ ActionCreateObjectType :: ReplicationGroup => write ! ( f, "REPLICATION GROUP" ) ,
5618
+ ActionCreateObjectType :: Role => write ! ( f, "ROLE" ) ,
5619
+ ActionCreateObjectType :: Share => write ! ( f, "SHARE" ) ,
5620
+ ActionCreateObjectType :: User => write ! ( f, "USER" ) ,
5621
+ ActionCreateObjectType :: Warehouse => write ! ( f, "WAREHOUSE" ) ,
5622
+ }
5623
+ }
5624
+ }
5625
+
5626
+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
5627
+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
5628
+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
5629
+ /// See <https://docs.snowflake.com/en/sql-reference/sql/grant-privilege>
5630
+ /// under `globalPrivileges` in the `APPLY` privilege.
5631
+ pub enum ActionApplyType {
5632
+ AggregationPolicy ,
5633
+ AuthenticationPolicy ,
5634
+ JoinPolicy ,
5635
+ MaskingPolicy ,
5636
+ PackagesPolicy ,
5637
+ PasswordPolicy ,
5638
+ ProjectionPolicy ,
5639
+ RowAccessPolicy ,
5640
+ SessionPolicy ,
5641
+ Tag ,
5642
+ }
5643
+
5644
+ impl fmt:: Display for ActionApplyType {
5645
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
5646
+ match self {
5647
+ ActionApplyType :: AggregationPolicy => write ! ( f, "AGGREGATION POLICY" ) ,
5648
+ ActionApplyType :: AuthenticationPolicy => write ! ( f, "AUTHENTICATION POLICY" ) ,
5649
+ ActionApplyType :: JoinPolicy => write ! ( f, "JOIN POLICY" ) ,
5650
+ ActionApplyType :: MaskingPolicy => write ! ( f, "MASKING POLICY" ) ,
5651
+ ActionApplyType :: PackagesPolicy => write ! ( f, "PACKAGES POLICY" ) ,
5652
+ ActionApplyType :: PasswordPolicy => write ! ( f, "PASSWORD POLICY" ) ,
5653
+ ActionApplyType :: ProjectionPolicy => write ! ( f, "PROJECTION POLICY" ) ,
5654
+ ActionApplyType :: RowAccessPolicy => write ! ( f, "ROW ACCESS POLICY" ) ,
5655
+ ActionApplyType :: SessionPolicy => write ! ( f, "SESSION POLICY" ) ,
5656
+ ActionApplyType :: Tag => write ! ( f, "TAG" ) ,
5657
+ }
5658
+ }
5659
+ }
5660
+
5661
+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
5662
+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
5663
+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
5664
+ /// See <https://docs.snowflake.com/en/sql-reference/sql/grant-privilege>
5665
+ /// under `globalPrivileges` in the `EXECUTE` privilege.
5666
+ pub enum ActionExecuteObjectType {
5667
+ Alert ,
5668
+ DataMetricFunction ,
5669
+ ManagedAlert ,
5670
+ ManagedTask ,
5671
+ Task ,
5672
+ }
5673
+
5674
+ impl fmt:: Display for ActionExecuteObjectType {
5675
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
5676
+ match self {
5677
+ ActionExecuteObjectType :: Alert => write ! ( f, "ALERT" ) ,
5678
+ ActionExecuteObjectType :: DataMetricFunction => write ! ( f, "DATA METRIC FUNCTION" ) ,
5679
+ ActionExecuteObjectType :: ManagedAlert => write ! ( f, "MANAGED ALERT" ) ,
5680
+ ActionExecuteObjectType :: ManagedTask => write ! ( f, "MANAGED TASK" ) ,
5681
+ ActionExecuteObjectType :: Task => write ! ( f, "TASK" ) ,
5682
+ }
5683
+ }
5684
+ }
5685
+
5686
+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
5687
+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
5688
+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
5689
+ /// See <https://docs.snowflake.com/en/sql-reference/sql/grant-privilege>
5690
+ /// under `globalPrivileges` in the `MANAGE` privilege.
5691
+ pub enum ActionManageType {
5692
+ AccountSupportCases ,
5693
+ EventSharing ,
5694
+ Grants ,
5695
+ ListingAutoFulfillment ,
5696
+ OrganizationSupportCases ,
5697
+ UserSupportCases ,
5698
+ Warehouses ,
5699
+ }
5700
+
5701
+ impl fmt:: Display for ActionManageType {
5702
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
5703
+ match self {
5704
+ ActionManageType :: AccountSupportCases => write ! ( f, "ACCOUNT SUPPORT CASES" ) ,
5705
+ ActionManageType :: EventSharing => write ! ( f, "EVENT SHARING" ) ,
5706
+ ActionManageType :: Grants => write ! ( f, "GRANTS" ) ,
5707
+ ActionManageType :: ListingAutoFulfillment => write ! ( f, "LISTING AUTO FULFILLMENT" ) ,
5708
+ ActionManageType :: OrganizationSupportCases => write ! ( f, "ORGANIZATION SUPPORT CASES" ) ,
5709
+ ActionManageType :: UserSupportCases => write ! ( f, "USER SUPPORT CASES" ) ,
5710
+ ActionManageType :: Warehouses => write ! ( f, "WAREHOUSES" ) ,
5711
+ }
5712
+ }
5713
+ }
5714
+
5715
+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
5716
+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
5717
+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
5718
+ /// See <https://docs.snowflake.com/en/sql-reference/sql/grant-privilege>
5719
+ /// under `globalPrivileges` in the `MODIFY` privilege.
5720
+ pub enum ActionModifyType {
5721
+ LogLevel ,
5722
+ TraceLevel ,
5723
+ SessionLogLevel ,
5724
+ SessionTraceLevel ,
5725
+ }
5726
+
5727
+ impl fmt:: Display for ActionModifyType {
5728
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
5729
+ match self {
5730
+ ActionModifyType :: LogLevel => write ! ( f, "LOG LEVEL" ) ,
5731
+ ActionModifyType :: TraceLevel => write ! ( f, "TRACE LEVEL" ) ,
5732
+ ActionModifyType :: SessionLogLevel => write ! ( f, "SESSION LOG LEVEL" ) ,
5733
+ ActionModifyType :: SessionTraceLevel => write ! ( f, "SESSION TRACE LEVEL" ) ,
5734
+ }
5735
+ }
5736
+ }
5737
+
5738
+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
5739
+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
5740
+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
5741
+ /// See <https://docs.snowflake.com/en/sql-reference/sql/grant-privilege>
5742
+ /// under `globalPrivileges` in the `MONITOR` privilege.
5743
+ pub enum ActionMonitorType {
5744
+ Execution ,
5745
+ Security ,
5746
+ Usage ,
5747
+ }
5748
+
5749
+ impl fmt:: Display for ActionMonitorType {
5750
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
5751
+ match self {
5752
+ ActionMonitorType :: Execution => write ! ( f, "EXECUTION" ) ,
5753
+ ActionMonitorType :: Security => write ! ( f, "SECURITY" ) ,
5754
+ ActionMonitorType :: Usage => write ! ( f, "USAGE" ) ,
5755
+ }
5756
+ }
5757
+ }
5758
+
5501
5759
/// The principal that receives the privileges
5502
5760
#[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
5503
5761
#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
0 commit comments