|
1 |
| -// Code generated by iacg; DO NOT EDIT. |
2 | 1 | package organization
|
3 | 2 |
|
4 | 3 | import (
|
5 | 4 | "context"
|
| 5 | + "fmt" |
6 | 6 | "log"
|
| 7 | + "strconv" |
| 8 | + "strings" |
7 | 9 |
|
8 | 10 | organization "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/organization/v20210331"
|
9 | 11 |
|
@@ -116,6 +118,199 @@ func (me *OrganizationService) DescribeIdentityCenterUserGroupAttachmentById(ctx
|
116 | 118 | request.NextToken = response.Response.NextToken
|
117 | 119 | }
|
118 | 120 | }
|
119 |
| - |
| 121 | + return |
| 122 | +} |
| 123 | + |
| 124 | +func (me *OrganizationService) DescribeIdentityCenterExternalSamlIdentityProviderById(ctx context.Context, zoneId string) (ret *organization.SAMLServiceProvider, errRet error) { |
| 125 | + logId := tccommon.GetLogId(ctx) |
| 126 | + |
| 127 | + request := organization.NewGetZoneSAMLServiceProviderInfoRequest() |
| 128 | + request.ZoneId = helper.String(zoneId) |
| 129 | + |
| 130 | + defer func() { |
| 131 | + if errRet != nil { |
| 132 | + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) |
| 133 | + } |
| 134 | + }() |
| 135 | + |
| 136 | + ratelimit.Check(request.GetAction()) |
| 137 | + |
| 138 | + response, err := me.client.UseOrganizationClient().GetZoneSAMLServiceProviderInfo(request) |
| 139 | + if err != nil { |
| 140 | + errRet = err |
| 141 | + return |
| 142 | + } |
| 143 | + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) |
| 144 | + |
| 145 | + if response.Response == nil { |
| 146 | + return |
| 147 | + } |
| 148 | + |
| 149 | + ret = response.Response.SAMLServiceProvider |
| 150 | + return |
| 151 | +} |
| 152 | + |
| 153 | +func (me *OrganizationService) DescribeIdentityCenterExternalSamlIdentityProviderById1(ctx context.Context, zoneId string) (ret *organization.SAMLIdentityProviderConfiguration, errRet error) { |
| 154 | + logId := tccommon.GetLogId(ctx) |
| 155 | + |
| 156 | + request := organization.NewGetExternalSAMLIdentityProviderRequest() |
| 157 | + request.ZoneId = helper.String(zoneId) |
| 158 | + |
| 159 | + defer func() { |
| 160 | + if errRet != nil { |
| 161 | + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) |
| 162 | + } |
| 163 | + }() |
| 164 | + |
| 165 | + ratelimit.Check(request.GetAction()) |
| 166 | + |
| 167 | + response, err := me.client.UseOrganizationClient().GetExternalSAMLIdentityProvider(request) |
| 168 | + if err != nil { |
| 169 | + errRet = err |
| 170 | + return |
| 171 | + } |
| 172 | + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) |
| 173 | + |
| 174 | + if response.Response == nil { |
| 175 | + return |
| 176 | + } |
| 177 | + |
| 178 | + ret = response.Response.SAMLIdentityProviderConfiguration |
| 179 | + return |
| 180 | +} |
| 181 | + |
| 182 | +func (me *OrganizationService) DescribeIdentityCenterRoleConfigurationById(ctx context.Context, zoneId string, roleConfigurationId string) (ret *organization.RoleConfiguration, errRet error) { |
| 183 | + logId := tccommon.GetLogId(ctx) |
| 184 | + |
| 185 | + request := organization.NewGetRoleConfigurationRequest() |
| 186 | + request.ZoneId = helper.String(zoneId) |
| 187 | + request.RoleConfigurationId = helper.String(roleConfigurationId) |
| 188 | + |
| 189 | + defer func() { |
| 190 | + if errRet != nil { |
| 191 | + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) |
| 192 | + } |
| 193 | + }() |
| 194 | + |
| 195 | + ratelimit.Check(request.GetAction()) |
| 196 | + |
| 197 | + response, err := me.client.UseOrganizationClient().GetRoleConfiguration(request) |
| 198 | + if err != nil { |
| 199 | + errRet = err |
| 200 | + return |
| 201 | + } |
| 202 | + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) |
| 203 | + |
| 204 | + if response.Response == nil { |
| 205 | + return |
| 206 | + } |
| 207 | + |
| 208 | + ret = response.Response.RoleConfigurationInfo |
| 209 | + return |
| 210 | +} |
| 211 | + |
| 212 | +func (me *OrganizationService) DescribeIdentityCenterRoleConfigurationPermissionPolicyAttachmentById(ctx context.Context, zoneId, roleConfigurationId, rolePolicyType string) (ret *organization.ListPermissionPoliciesInRoleConfigurationResponseParams, errRet error) { |
| 213 | + logId := tccommon.GetLogId(ctx) |
| 214 | + |
| 215 | + request := organization.NewListPermissionPoliciesInRoleConfigurationRequest() |
| 216 | + request.ZoneId = helper.String(zoneId) |
| 217 | + request.RoleConfigurationId = helper.String(roleConfigurationId) |
| 218 | + request.RolePolicyType = helper.String(rolePolicyType) |
| 219 | + |
| 220 | + defer func() { |
| 221 | + if errRet != nil { |
| 222 | + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) |
| 223 | + } |
| 224 | + }() |
| 225 | + |
| 226 | + ratelimit.Check(request.GetAction()) |
| 227 | + |
| 228 | + response, err := me.client.UseOrganizationClient().ListPermissionPoliciesInRoleConfiguration(request) |
| 229 | + if err != nil { |
| 230 | + errRet = err |
| 231 | + return |
| 232 | + } |
| 233 | + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) |
| 234 | + |
| 235 | + ret = response.Response |
| 236 | + return |
| 237 | +} |
| 238 | + |
| 239 | +func (me *OrganizationService) DescribeIdentityCenterUserSyncProvisioningById(ctx context.Context, zoneId, userProvisioningId string) (ret *organization.UserProvisioning, errRet error) { |
| 240 | + logId := tccommon.GetLogId(ctx) |
| 241 | + |
| 242 | + request := organization.NewGetUserSyncProvisioningRequest() |
| 243 | + request.ZoneId = helper.String(zoneId) |
| 244 | + request.UserProvisioningId = helper.String(userProvisioningId) |
| 245 | + |
| 246 | + defer func() { |
| 247 | + if errRet != nil { |
| 248 | + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) |
| 249 | + } |
| 250 | + }() |
| 251 | + |
| 252 | + ratelimit.Check(request.GetAction()) |
| 253 | + |
| 254 | + response, err := me.client.UseOrganizationClient().GetUserSyncProvisioning(request) |
| 255 | + if err != nil { |
| 256 | + errRet = err |
| 257 | + return |
| 258 | + } |
| 259 | + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) |
| 260 | + |
| 261 | + if response.Response == nil { |
| 262 | + return |
| 263 | + } |
| 264 | + |
| 265 | + ret = response.Response.UserProvisioning |
| 266 | + return |
| 267 | +} |
| 268 | + |
| 269 | +func (me *OrganizationService) DescribeIdentityCenterRoleAssignmentById(ctx context.Context, roleAssignmentId string) (ret *organization.ListRoleAssignmentsResponseParams, errRet error) { |
| 270 | + logId := tccommon.GetLogId(ctx) |
| 271 | + |
| 272 | + idSplit := strings.Split(roleAssignmentId, tccommon.FILED_SP) |
| 273 | + if len(idSplit) != 6 { |
| 274 | + errRet = fmt.Errorf("roleAssignmentId is broken,%s", roleAssignmentId) |
| 275 | + return |
| 276 | + } |
| 277 | + |
| 278 | + zoneId := idSplit[0] |
| 279 | + roleConfigurationId := idSplit[1] |
| 280 | + targetType := idSplit[2] |
| 281 | + targetUinString := idSplit[3] |
| 282 | + principalType := idSplit[4] |
| 283 | + principalId := idSplit[5] |
| 284 | + |
| 285 | + request := organization.NewListRoleAssignmentsRequest() |
| 286 | + request.ZoneId = helper.String(zoneId) |
| 287 | + request.RoleConfigurationId = helper.String(roleConfigurationId) |
| 288 | + request.TargetType = helper.String(targetType) |
| 289 | + targetUin, err := strconv.ParseInt(targetUinString, 10, 64) |
| 290 | + if err != nil { |
| 291 | + errRet = err |
| 292 | + return |
| 293 | + } |
| 294 | + request.TargetUin = helper.Int64(targetUin) |
| 295 | + request.PrincipalType = helper.String(principalType) |
| 296 | + request.PrincipalId = helper.String(principalId) |
| 297 | + request.MaxResults = helper.Int64(10) |
| 298 | + |
| 299 | + defer func() { |
| 300 | + if errRet != nil { |
| 301 | + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) |
| 302 | + } |
| 303 | + }() |
| 304 | + |
| 305 | + ratelimit.Check(request.GetAction()) |
| 306 | + |
| 307 | + response, err := me.client.UseOrganizationClient().ListRoleAssignments(request) |
| 308 | + if err != nil { |
| 309 | + errRet = err |
| 310 | + return |
| 311 | + } |
| 312 | + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) |
| 313 | + |
| 314 | + ret = response.Response |
120 | 315 | return
|
121 | 316 | }
|
0 commit comments