@@ -5633,29 +5633,107 @@ impl fmt::Display for FetchDirection {
5633
5633
#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
5634
5634
#[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
5635
5635
pub enum Action {
5636
+ AddSearchOptimization ,
5637
+ Apply {
5638
+ apply_type : ActionApplyType ,
5639
+ } ,
5640
+ ApplyBudget ,
5641
+ AttachListing ,
5642
+ AttachPolicy ,
5643
+ Audit ,
5644
+ BindServiceEndpoint ,
5636
5645
Connect ,
5637
- Create ,
5646
+ Create {
5647
+ obj_type : Option < ActionCreateObjectType > ,
5648
+ } ,
5638
5649
Delete ,
5639
- Execute ,
5640
- Insert { columns : Option < Vec < Ident > > } ,
5641
- References { columns : Option < Vec < Ident > > } ,
5642
- Select { columns : Option < Vec < Ident > > } ,
5650
+ EvolveSchema ,
5651
+ Execute {
5652
+ obj_type : Option < ActionExecuteObjectType > ,
5653
+ } ,
5654
+ Failover ,
5655
+ ImportedPrivileges ,
5656
+ ImportShare ,
5657
+ Insert {
5658
+ columns : Option < Vec < Ident > > ,
5659
+ } ,
5660
+ Manage {
5661
+ manage_type : ActionManageType ,
5662
+ } ,
5663
+ ManageReleases ,
5664
+ ManageVersions ,
5665
+ Modify {
5666
+ modify_type : ActionModifyType ,
5667
+ } ,
5668
+ Monitor {
5669
+ monitor_type : ActionMonitorType ,
5670
+ } ,
5671
+ Operate ,
5672
+ OverrideShareRestrictions ,
5673
+ Ownership ,
5674
+ PurchaseDataExchangeListing ,
5675
+ Read ,
5676
+ ReadSession ,
5677
+ References {
5678
+ columns : Option < Vec < Ident > > ,
5679
+ } ,
5680
+ Replicate ,
5681
+ ResolveAll ,
5682
+ Select {
5683
+ columns : Option < Vec < Ident > > ,
5684
+ } ,
5643
5685
Temporary ,
5644
5686
Trigger ,
5645
5687
Truncate ,
5646
- Update { columns : Option < Vec < Ident > > } ,
5688
+ Update {
5689
+ columns : Option < Vec < Ident > > ,
5690
+ } ,
5647
5691
Usage ,
5648
5692
}
5649
5693
5650
5694
impl fmt:: Display for Action {
5651
5695
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
5652
5696
match self {
5697
+ Action :: AddSearchOptimization => f. write_str ( "ADD SEARCH OPTIMIZATION" ) ?,
5698
+ Action :: Apply { apply_type } => write ! ( f, "APPLY {apply_type}" ) ?,
5699
+ Action :: ApplyBudget => f. write_str ( "APPLY BUDGET" ) ?,
5700
+ Action :: AttachListing => f. write_str ( "ATTACH LISTING" ) ?,
5701
+ Action :: AttachPolicy => f. write_str ( "ATTACH POLICY" ) ?,
5702
+ Action :: Audit => f. write_str ( "AUDIT" ) ?,
5703
+ Action :: BindServiceEndpoint => f. write_str ( "BIND SERVICE ENDPOINT" ) ?,
5653
5704
Action :: Connect => f. write_str ( "CONNECT" ) ?,
5654
- Action :: Create => f. write_str ( "CREATE" ) ?,
5705
+ Action :: Create { obj_type } => {
5706
+ f. write_str ( "CREATE" ) ?;
5707
+ if let Some ( obj_type) = obj_type {
5708
+ write ! ( f, " {obj_type}" ) ?
5709
+ }
5710
+ }
5655
5711
Action :: Delete => f. write_str ( "DELETE" ) ?,
5656
- Action :: Execute => f. write_str ( "EXECUTE" ) ?,
5712
+ Action :: EvolveSchema => f. write_str ( "EVOLVE SCHEMA" ) ?,
5713
+ Action :: Execute { obj_type } => {
5714
+ f. write_str ( "EXECUTE" ) ?;
5715
+ if let Some ( obj_type) = obj_type {
5716
+ write ! ( f, " {obj_type}" ) ?
5717
+ }
5718
+ }
5719
+ Action :: Failover => f. write_str ( "FAILOVER" ) ?,
5720
+ Action :: ImportedPrivileges => f. write_str ( "IMPORTED PRIVILEGES" ) ?,
5721
+ Action :: ImportShare => f. write_str ( "IMPORT SHARE" ) ?,
5657
5722
Action :: Insert { .. } => f. write_str ( "INSERT" ) ?,
5723
+ Action :: Manage { manage_type } => write ! ( f, "MANAGE {manage_type}" ) ?,
5724
+ Action :: ManageReleases => f. write_str ( "MANAGE RELEASES" ) ?,
5725
+ Action :: ManageVersions => f. write_str ( "MANAGE VERSIONS" ) ?,
5726
+ Action :: Modify { modify_type } => write ! ( f, "MODIFY {modify_type}" ) ?,
5727
+ Action :: Monitor { monitor_type } => write ! ( f, "MONITOR {monitor_type}" ) ?,
5728
+ Action :: Operate => f. write_str ( "OPERATE" ) ?,
5729
+ Action :: OverrideShareRestrictions => f. write_str ( "OVERRIDE SHARE RESTRICTIONS" ) ?,
5730
+ Action :: Ownership => f. write_str ( "OWNERSHIP" ) ?,
5731
+ Action :: PurchaseDataExchangeListing => f. write_str ( "PURCHASE DATA EXCHANGE LISTING" ) ?,
5732
+ Action :: Read => f. write_str ( "READ" ) ?,
5733
+ Action :: ReadSession => f. write_str ( "READ SESSION" ) ?,
5658
5734
Action :: References { .. } => f. write_str ( "REFERENCES" ) ?,
5735
+ Action :: Replicate => f. write_str ( "REPLICATE" ) ?,
5736
+ Action :: ResolveAll => f. write_str ( "RESOLVE ALL" ) ?,
5659
5737
Action :: Select { .. } => f. write_str ( "SELECT" ) ?,
5660
5738
Action :: Temporary => f. write_str ( "TEMPORARY" ) ?,
5661
5739
Action :: Trigger => f. write_str ( "TRIGGER" ) ?,
@@ -5678,6 +5756,186 @@ impl fmt::Display for Action {
5678
5756
}
5679
5757
}
5680
5758
5759
+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
5760
+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
5761
+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
5762
+ /// See <https://docs.snowflake.com/en/sql-reference/sql/grant-privilege>
5763
+ /// under `globalPrivileges` in the `CREATE` privilege.
5764
+ pub enum ActionCreateObjectType {
5765
+ Account ,
5766
+ Application ,
5767
+ ApplicationPackage ,
5768
+ ComputePool ,
5769
+ DataExchangeListing ,
5770
+ Database ,
5771
+ ExternalVolume ,
5772
+ FailoverGroup ,
5773
+ Integration ,
5774
+ NetworkPolicy ,
5775
+ OrganiationListing ,
5776
+ ReplicationGroup ,
5777
+ Role ,
5778
+ Share ,
5779
+ User ,
5780
+ Warehouse ,
5781
+ }
5782
+
5783
+ impl fmt:: Display for ActionCreateObjectType {
5784
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
5785
+ match self {
5786
+ ActionCreateObjectType :: Account => write ! ( f, "ACCOUNT" ) ,
5787
+ ActionCreateObjectType :: Application => write ! ( f, "APPLICATION" ) ,
5788
+ ActionCreateObjectType :: ApplicationPackage => write ! ( f, "APPLICATION PACKAGE" ) ,
5789
+ ActionCreateObjectType :: ComputePool => write ! ( f, "COMPUTE POOL" ) ,
5790
+ ActionCreateObjectType :: DataExchangeListing => write ! ( f, "DATA EXCHANGE LISTING" ) ,
5791
+ ActionCreateObjectType :: Database => write ! ( f, "DATABASE" ) ,
5792
+ ActionCreateObjectType :: ExternalVolume => write ! ( f, "EXTERNAL VOLUME" ) ,
5793
+ ActionCreateObjectType :: FailoverGroup => write ! ( f, "FAILOVER GROUP" ) ,
5794
+ ActionCreateObjectType :: Integration => write ! ( f, "INTEGRATION" ) ,
5795
+ ActionCreateObjectType :: NetworkPolicy => write ! ( f, "NETWORK POLICY" ) ,
5796
+ ActionCreateObjectType :: OrganiationListing => write ! ( f, "ORGANIZATION LISTING" ) ,
5797
+ ActionCreateObjectType :: ReplicationGroup => write ! ( f, "REPLICATION GROUP" ) ,
5798
+ ActionCreateObjectType :: Role => write ! ( f, "ROLE" ) ,
5799
+ ActionCreateObjectType :: Share => write ! ( f, "SHARE" ) ,
5800
+ ActionCreateObjectType :: User => write ! ( f, "USER" ) ,
5801
+ ActionCreateObjectType :: Warehouse => write ! ( f, "WAREHOUSE" ) ,
5802
+ }
5803
+ }
5804
+ }
5805
+
5806
+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
5807
+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
5808
+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
5809
+ /// See <https://docs.snowflake.com/en/sql-reference/sql/grant-privilege>
5810
+ /// under `globalPrivileges` in the `APPLY` privilege.
5811
+ pub enum ActionApplyType {
5812
+ AggregationPolicy ,
5813
+ AuthenticationPolicy ,
5814
+ JoinPolicy ,
5815
+ MaskingPolicy ,
5816
+ PackagesPolicy ,
5817
+ PasswordPolicy ,
5818
+ ProjectionPolicy ,
5819
+ RowAccessPolicy ,
5820
+ SessionPolicy ,
5821
+ Tag ,
5822
+ }
5823
+
5824
+ impl fmt:: Display for ActionApplyType {
5825
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
5826
+ match self {
5827
+ ActionApplyType :: AggregationPolicy => write ! ( f, "AGGREGATION POLICY" ) ,
5828
+ ActionApplyType :: AuthenticationPolicy => write ! ( f, "AUTHENTICATION POLICY" ) ,
5829
+ ActionApplyType :: JoinPolicy => write ! ( f, "JOIN POLICY" ) ,
5830
+ ActionApplyType :: MaskingPolicy => write ! ( f, "MASKING POLICY" ) ,
5831
+ ActionApplyType :: PackagesPolicy => write ! ( f, "PACKAGES POLICY" ) ,
5832
+ ActionApplyType :: PasswordPolicy => write ! ( f, "PASSWORD POLICY" ) ,
5833
+ ActionApplyType :: ProjectionPolicy => write ! ( f, "PROJECTION POLICY" ) ,
5834
+ ActionApplyType :: RowAccessPolicy => write ! ( f, "ROW ACCESS POLICY" ) ,
5835
+ ActionApplyType :: SessionPolicy => write ! ( f, "SESSION POLICY" ) ,
5836
+ ActionApplyType :: Tag => write ! ( f, "TAG" ) ,
5837
+ }
5838
+ }
5839
+ }
5840
+
5841
+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
5842
+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
5843
+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
5844
+ /// See <https://docs.snowflake.com/en/sql-reference/sql/grant-privilege>
5845
+ /// under `globalPrivileges` in the `EXECUTE` privilege.
5846
+ pub enum ActionExecuteObjectType {
5847
+ Alert ,
5848
+ DataMetricFunction ,
5849
+ ManagedAlert ,
5850
+ ManagedTask ,
5851
+ Task ,
5852
+ }
5853
+
5854
+ impl fmt:: Display for ActionExecuteObjectType {
5855
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
5856
+ match self {
5857
+ ActionExecuteObjectType :: Alert => write ! ( f, "ALERT" ) ,
5858
+ ActionExecuteObjectType :: DataMetricFunction => write ! ( f, "DATA METRIC FUNCTION" ) ,
5859
+ ActionExecuteObjectType :: ManagedAlert => write ! ( f, "MANAGED ALERT" ) ,
5860
+ ActionExecuteObjectType :: ManagedTask => write ! ( f, "MANAGED TASK" ) ,
5861
+ ActionExecuteObjectType :: Task => write ! ( f, "TASK" ) ,
5862
+ }
5863
+ }
5864
+ }
5865
+
5866
+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
5867
+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
5868
+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
5869
+ /// See <https://docs.snowflake.com/en/sql-reference/sql/grant-privilege>
5870
+ /// under `globalPrivileges` in the `MANAGE` privilege.
5871
+ pub enum ActionManageType {
5872
+ AccountSupportCases ,
5873
+ EventSharing ,
5874
+ Grants ,
5875
+ ListingAutoFulfillment ,
5876
+ OrganizationSupportCases ,
5877
+ UserSupportCases ,
5878
+ Warehouses ,
5879
+ }
5880
+
5881
+ impl fmt:: Display for ActionManageType {
5882
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
5883
+ match self {
5884
+ ActionManageType :: AccountSupportCases => write ! ( f, "ACCOUNT SUPPORT CASES" ) ,
5885
+ ActionManageType :: EventSharing => write ! ( f, "EVENT SHARING" ) ,
5886
+ ActionManageType :: Grants => write ! ( f, "GRANTS" ) ,
5887
+ ActionManageType :: ListingAutoFulfillment => write ! ( f, "LISTING AUTO FULFILLMENT" ) ,
5888
+ ActionManageType :: OrganizationSupportCases => write ! ( f, "ORGANIZATION SUPPORT CASES" ) ,
5889
+ ActionManageType :: UserSupportCases => write ! ( f, "USER SUPPORT CASES" ) ,
5890
+ ActionManageType :: Warehouses => write ! ( f, "WAREHOUSES" ) ,
5891
+ }
5892
+ }
5893
+ }
5894
+
5895
+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
5896
+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
5897
+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
5898
+ /// See <https://docs.snowflake.com/en/sql-reference/sql/grant-privilege>
5899
+ /// under `globalPrivileges` in the `MODIFY` privilege.
5900
+ pub enum ActionModifyType {
5901
+ LogLevel ,
5902
+ TraceLevel ,
5903
+ SessionLogLevel ,
5904
+ SessionTraceLevel ,
5905
+ }
5906
+
5907
+ impl fmt:: Display for ActionModifyType {
5908
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
5909
+ match self {
5910
+ ActionModifyType :: LogLevel => write ! ( f, "LOG LEVEL" ) ,
5911
+ ActionModifyType :: TraceLevel => write ! ( f, "TRACE LEVEL" ) ,
5912
+ ActionModifyType :: SessionLogLevel => write ! ( f, "SESSION LOG LEVEL" ) ,
5913
+ ActionModifyType :: SessionTraceLevel => write ! ( f, "SESSION TRACE LEVEL" ) ,
5914
+ }
5915
+ }
5916
+ }
5917
+
5918
+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
5919
+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
5920
+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
5921
+ /// See <https://docs.snowflake.com/en/sql-reference/sql/grant-privilege>
5922
+ /// under `globalPrivileges` in the `MONITOR` privilege.
5923
+ pub enum ActionMonitorType {
5924
+ Execution ,
5925
+ Security ,
5926
+ Usage ,
5927
+ }
5928
+
5929
+ impl fmt:: Display for ActionMonitorType {
5930
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
5931
+ match self {
5932
+ ActionMonitorType :: Execution => write ! ( f, "EXECUTION" ) ,
5933
+ ActionMonitorType :: Security => write ! ( f, "SECURITY" ) ,
5934
+ ActionMonitorType :: Usage => write ! ( f, "USAGE" ) ,
5935
+ }
5936
+ }
5937
+ }
5938
+
5681
5939
/// The principal that receives the privileges
5682
5940
#[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
5683
5941
#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
0 commit comments