/* * Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ namespace TencentCloud.Dcdb.V20180411.Models { using Newtonsoft.Json; using System.Collections.Generic; using TencentCloud.Common; public class GrantAccountPrivilegesRequest : AbstractModel { /// /// 实例 ID,形如:dcdbt-ow728lmc。 /// [JsonProperty("InstanceId")] public string InstanceId{ get; set; } /// /// 登录用户名。 /// [JsonProperty("UserName")] public string UserName{ get; set; } /// /// 用户允许的访问 host,用户名+host唯一确定一个账号。 /// [JsonProperty("Host")] public string Host{ get; set; } /// /// 数据库名。如果为 \*,表示查询全局权限(即 \*.\*),此时忽略 Type 和 Object 参数 /// [JsonProperty("DbName")] public string DbName{ get; set; } /// /// 全局权限: SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,REFERENCES,INDEX,ALTER,CREATE TEMPORARY TABLES,LOCK TABLES,EXECUTE,CREATE VIEW,SHOW VIEW,CREATE ROUTINE,ALTER ROUTINE,EVENT,TRIGGER,SHOW DATABASES /// 库权限: SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,REFERENCES,INDEX,ALTER,CREATE TEMPORARY TABLES,LOCK TABLES,EXECUTE,CREATE VIEW,SHOW VIEW,CREATE ROUTINE,ALTER ROUTINE,EVENT,TRIGGER /// 表/视图权限: SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,REFERENCES,INDEX,ALTER,CREATE VIEW,SHOW VIEW,TRIGGER /// 存储过程/函数权限: ALTER ROUTINE,EXECUTE /// 字段权限: INSERT,REFERENCES,SELECT,UPDATE /// [JsonProperty("Privileges")] public string[] Privileges{ get; set; } /// /// 类型,可以填入 table 、 view 、 proc 、 func 和 \*。当 DbName 为具体数据库名,Type为 \* 时,表示设置该数据库权限(即db.\*),此时忽略 Object 参数 /// [JsonProperty("Type")] public string Type{ get; set; } /// /// 具体的 Type 的名称,例如 Type 为 table 时就是具体的表名。DbName 和 Type 都为具体名称,则 Object 表示具体对象名,不能为 \* 或者为空 /// [JsonProperty("Object")] public string Object{ get; set; } /// /// 当 Type=table 时,ColName 为 \* 表示对表授权,如果为具体字段名,表示对字段授权 /// [JsonProperty("ColName")] public string ColName{ get; set; } /// /// For internal usage only. DO NOT USE IT. /// internal override void ToMap(Dictionary map, string prefix) { this.SetParamSimple(map, prefix + "InstanceId", this.InstanceId); this.SetParamSimple(map, prefix + "UserName", this.UserName); this.SetParamSimple(map, prefix + "Host", this.Host); this.SetParamSimple(map, prefix + "DbName", this.DbName); this.SetParamArraySimple(map, prefix + "Privileges.", this.Privileges); this.SetParamSimple(map, prefix + "Type", this.Type); this.SetParamSimple(map, prefix + "Object", this.Object); this.SetParamSimple(map, prefix + "ColName", this.ColName); } } }