From fa3614fb7960d86c00f858c5786e224c190b36cd Mon Sep 17 00:00:00 2001 From: KGSN Date: Wed, 2 Mar 2022 05:24:30 +0800 Subject: [PATCH 1/2] feat: add datasource: tencentcloud_user_info --- go.mod | 4 +- go.sum | 4 + tencentcloud/data_source_tc_user_info.go | 100 + tencentcloud/data_source_tc_user_info_test.go | 29 + tencentcloud/provider.go | 2 + tencentcloud/service_tencentcloud_cam.go | 26 + .../tencentcloud/cam/v20190116/client.go | 2208 ++++++++++++++++- .../tencentcloud/cam/v20190116/errors.go | 12 + .../tencentcloud/cam/v20190116/models.go | 862 ++++++- .../tencentcloud/common/http/request.go | 2 +- .../tencentcloud/common/regions/regions.go | 4 + vendor/modules.txt | 4 +- website/docs/d/user_info.html.markdown | 34 + website/tencentcloud.erb | 3 + 14 files changed, 3202 insertions(+), 92 deletions(-) create mode 100644 tencentcloud/data_source_tc_user_info.go create mode 100644 tencentcloud/data_source_tc_user_info_test.go create mode 100644 website/docs/d/user_info.html.markdown diff --git a/go.mod b/go.mod index 37d4581cb2..48cd072bf0 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/api v1.0.285 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apigateway v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as v1.0.199 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam v1.0.199 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam v1.0.357 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdb v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdn v1.0.199 @@ -30,7 +30,7 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.283 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.291 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.353 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.357 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.351 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cynosdb v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dayu v1.0.335 diff --git a/go.sum b/go.sum index 55b2649ea3..3b822d2137 100644 --- a/go.sum +++ b/go.sum @@ -458,6 +458,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as v1.0.199 h1:6g9q97yB github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as v1.0.199/go.mod h1:boLdxUceAK+98OfetsfVEX6RV1leu/JGyEtsrTf4kIY= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam v1.0.199 h1:caDwMPzGsG+WUZ9tJVnTxbD7nc6Uj8K+xop5xxvV0DQ= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam v1.0.199/go.mod h1:ys+65P4jdhUP5rQFSPI9O8/5s0lNcPycl5IPOTaZyVU= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam v1.0.357 h1:USpuZLFRHacOVo4urhDJcCIH2hb6DqNx0YmLvLt+w2Y= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam v1.0.357/go.mod h1:Whw7AWuWHNYQIdgwhl0/cf2DQ2N7JD9HUj9PvgiwRrQ= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs v1.0.199 h1:MkIdFgEGF+baYAU9Z/PUmudfuamCGtLsedQpopwyHNU= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs v1.0.199/go.mod h1:PTp058qpOV//RukBVdYQT962rZg71lIt6eHLK1zdvEc= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdb v1.0.199 h1:7ReZOKl95X+9SkPPtrAoUt4ZPJSIjiSxq4g/M54JmtU= @@ -489,6 +491,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.351 h1:BpVJ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.351/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.353 h1:rFkcKuLFxt2xolSWbyeznetTBw9Cyhe1ycILmEkE1Pk= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.353/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.357 h1:uaMtRfV/OYPolAldcOuChMPAnmYnG+CONdDAFcaOQGU= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.357/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.199 h1:ajgJogYSIQ5u1PIbiV5nsvr5K0fYpm1/T7Dy+mxEM6U= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.199/go.mod h1:AqyM/ZZMD7q5mHBqNY9YImbSpEpoEe7E/vrTbUWX+po= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.351 h1:zqJsH5pxGT57La7NAOOyMQxsuM11pupNBwV1dzXcT24= diff --git a/tencentcloud/data_source_tc_user_info.go b/tencentcloud/data_source_tc_user_info.go new file mode 100644 index 0000000000..979f518998 --- /dev/null +++ b/tencentcloud/data_source_tc_user_info.go @@ -0,0 +1,100 @@ +/* +Use this data source to query user appid, uin and ownerUin. + +Example Usage + +```hcl +data "tencentcloud_user_info" "foo" {} +``` + +*/ +package tencentcloud + +import ( + "context" + "fmt" + "math/rand" + "strconv" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +func datasourceTencentCloudUserInfo() *schema.Resource { + return &schema.Resource{ + Read: datasourceTencentCloudUserInfoRead, + + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "app_id": { + Type: schema.TypeString, + Computed: true, + Description: "Current account App ID.", + }, + + "uin": { + Type: schema.TypeString, + Computed: true, + Description: "Current account UIN.", + }, + + "owner_uin": { + Type: schema.TypeString, + Computed: true, + Description: "Current account OwnerUIN.", + }, + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used for save results.", + }, + }, + } +} + +func datasourceTencentCloudUserInfoRead(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("datasource.tencentcloud_user_info.read")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + client := meta.(*TencentCloudClient).apiV3Conn + + service := CamService{client: client} + + response, err := service.GetUserAppId(ctx) + if err != nil { + return err + } + + result := response.Response + + if result == nil { + return fmt.Errorf("get user appid error: empty response") + } + + appId := strconv.FormatUint(*result.AppId, 10) + uin := *result.Uin + ownerUin := *result.OwnerUin + + d.SetId(fmt.Sprintf("user-%s-%s-%d", uin, appId, rand.Intn(10000))) + + _ = d.Set("app_id", appId) + _ = d.Set("uin", uin) + _ = d.Set("owner_uin", ownerUin) + + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + if e := writeToFile(output.(string), map[string]interface{}{ + "app_id": appId, + "uin": uin, + "ownerUin": ownerUin, + }); e != nil { + return e + } + } + + return nil +} diff --git a/tencentcloud/data_source_tc_user_info_test.go b/tencentcloud/data_source_tc_user_info_test.go new file mode 100644 index 0000000000..4b2513abb8 --- /dev/null +++ b/tencentcloud/data_source_tc_user_info_test.go @@ -0,0 +1,29 @@ +package tencentcloud + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +func TestAccTencentCloudDataSourceUserInfo(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDataUserInfoBasic, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttrSet("data.tencentcloud_user_info.info", "app_id"), + resource.TestCheckResourceAttrSet("data.tencentcloud_user_info.info", "uin"), + resource.TestCheckResourceAttrSet("data.tencentcloud_user_info.info", "owner_uin"), + ), + }, + }, + }) +} + +const testAccDataUserInfoBasic = ` +data "tencentcloud_user_info" "info" {} +` diff --git a/tencentcloud/provider.go b/tencentcloud/provider.go index ab7336ec50..458e2b8f0c 100644 --- a/tencentcloud/provider.go +++ b/tencentcloud/provider.go @@ -153,6 +153,7 @@ Cloud Access Management(CAM) tencentcloud_cam_saml_providers tencentcloud_cam_user_policy_attachments tencentcloud_cam_users + tencentcloud_user_info Resource tencentcloud_cam_role @@ -807,6 +808,7 @@ func Provider() terraform.ResourceProvider { "tencentcloud_cam_user_policy_attachments": dataSourceTencentCloudCamUserPolicyAttachments(), "tencentcloud_cam_group_policy_attachments": dataSourceTencentCloudCamGroupPolicyAttachments(), "tencentcloud_cam_saml_providers": dataSourceTencentCloudCamSAMLProviders(), + "tencentcloud_user_info": datasourceTencentCloudUserInfo(), "tencentcloud_cdn_domains": dataSourceTencentCloudCdnDomains(), "tencentcloud_scf_functions": dataSourceTencentCloudScfFunctions(), "tencentcloud_scf_namespaces": dataSourceTencentCloudScfNamespaces(), diff --git a/tencentcloud/service_tencentcloud_cam.go b/tencentcloud/service_tencentcloud_cam.go index 8c03dbafd8..b66336bc91 100644 --- a/tencentcloud/service_tencentcloud_cam.go +++ b/tencentcloud/service_tencentcloud_cam.go @@ -1133,3 +1133,29 @@ func (me *CamService) PolicyDocumentForceCheck(document string) error { } return nil } + +func (me *CamService) GetUserAppId(ctx context.Context) (result *cam.GetUserAppIdResponse, errRet error) { + logId := getLogId(ctx) + request := cam.NewGetUserAppIdRequest() + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", + logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + ratelimit.Check(request.GetAction()) + response, err := me.client.UseCamClient().GetUserAppId(request) + + if err != nil { + errRet = err + return + } + + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", + logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + result = response + + return +} diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam/v20190116/client.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam/v20190116/client.go index 65ba078d7b..c06508caac 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam/v20190116/client.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam/v20190116/client.go @@ -15,6 +15,7 @@ package v20190116 import ( + "context" "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http" "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile" @@ -34,7 +35,7 @@ func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, return } -func NewClient(credential *common.Credential, region string, clientProfile *profile.ClientProfile) (client *Client, err error) { +func NewClient(credential common.CredentialIface, region string, clientProfile *profile.ClientProfile) (client *Client, err error) { client = &Client{} client.Init(region). WithCredential(credential). @@ -48,6 +49,8 @@ func NewAddUserRequest() (request *AddUserRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "AddUser") + + return } @@ -73,6 +76,29 @@ func (c *Client) AddUser(request *AddUserRequest) (response *AddUserResponse, er if request == nil { request = NewAddUserRequest() } + + response = NewAddUserResponse() + err = c.Send(request, response) + return +} + +// AddUser +// 添加子用户 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_PASSWORDVIOLATEDRULES = "InvalidParameter.PasswordViolatedRules" +// INVALIDPARAMETER_SUBUSERFULL = "InvalidParameter.SubUserFull" +// INVALIDPARAMETER_SUBUSERNAMEINUSE = "InvalidParameter.SubUserNameInUse" +// INVALIDPARAMETER_USERNAMEILLEGAL = "InvalidParameter.UserNameIllegal" +// REQUESTLIMITEXCEEDED_CREATEUSER = "RequestLimitExceeded.CreateUser" +func (c *Client) AddUserWithContext(ctx context.Context, request *AddUserRequest) (response *AddUserResponse, err error) { + if request == nil { + request = NewAddUserRequest() + } + request.SetContext(ctx) + response = NewAddUserResponse() err = c.Send(request, response) return @@ -83,6 +109,8 @@ func NewAddUserToGroupRequest() (request *AddUserToGroupRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "AddUserToGroup") + + return } @@ -101,11 +129,34 @@ func NewAddUserToGroupResponse() (response *AddUserToGroupResponse) { // INVALIDPARAMETER_GROUPNOTEXIST = "InvalidParameter.GroupNotExist" // INVALIDPARAMETER_GROUPUSERFULL = "InvalidParameter.GroupUserFull" // INVALIDPARAMETER_USERGROUPFULL = "InvalidParameter.UserGroupFull" +// INVALIDPARAMETER_USERUINANDUINNOTALLNULL = "InvalidParameter.UserUinAndUinNotAllNull" // RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" func (c *Client) AddUserToGroup(request *AddUserToGroupRequest) (response *AddUserToGroupResponse, err error) { if request == nil { request = NewAddUserToGroupRequest() } + + response = NewAddUserToGroupResponse() + err = c.Send(request, response) + return +} + +// AddUserToGroup +// 用户加入到用户组 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER_GROUPNOTEXIST = "InvalidParameter.GroupNotExist" +// INVALIDPARAMETER_GROUPUSERFULL = "InvalidParameter.GroupUserFull" +// INVALIDPARAMETER_USERGROUPFULL = "InvalidParameter.UserGroupFull" +// INVALIDPARAMETER_USERUINANDUINNOTALLNULL = "InvalidParameter.UserUinAndUinNotAllNull" +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +func (c *Client) AddUserToGroupWithContext(ctx context.Context, request *AddUserToGroupRequest) (response *AddUserToGroupResponse, err error) { + if request == nil { + request = NewAddUserToGroupRequest() + } + request.SetContext(ctx) + response = NewAddUserToGroupResponse() err = c.Send(request, response) return @@ -116,6 +167,8 @@ func NewAttachGroupPolicyRequest() (request *AttachGroupPolicyRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "AttachGroupPolicy") + + return } @@ -144,6 +197,32 @@ func (c *Client) AttachGroupPolicy(request *AttachGroupPolicyRequest) (response if request == nil { request = NewAttachGroupPolicyRequest() } + + response = NewAttachGroupPolicyResponse() + err = c.Send(request, response) + return +} + +// AttachGroupPolicy +// 本接口(AttachGroupPolicy)可用于绑定策略到用户组。 +// +// 可能返回的错误码: +// FAILEDOPERATION_POLICYFULL = "FailedOperation.PolicyFull" +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_ATTACHMENTFULL = "InvalidParameter.AttachmentFull" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYIDERROR = "InvalidParameter.PolicyIdError" +// INVALIDPARAMETER_POLICYIDNOTEXIST = "InvalidParameter.PolicyIdNotExist" +// INVALIDPARAMETER_USERNOTEXIST = "InvalidParameter.UserNotExist" +// RESOURCENOTFOUND_GROUPNOTEXIST = "ResourceNotFound.GroupNotExist" +// RESOURCENOTFOUND_POLICYIDNOTFOUND = "ResourceNotFound.PolicyIdNotFound" +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +func (c *Client) AttachGroupPolicyWithContext(ctx context.Context, request *AttachGroupPolicyRequest) (response *AttachGroupPolicyResponse, err error) { + if request == nil { + request = NewAttachGroupPolicyRequest() + } + request.SetContext(ctx) + response = NewAttachGroupPolicyResponse() err = c.Send(request, response) return @@ -154,6 +233,8 @@ func NewAttachRolePolicyRequest() (request *AttachRolePolicyRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "AttachRolePolicy") + + return } @@ -179,6 +260,29 @@ func (c *Client) AttachRolePolicy(request *AttachRolePolicyRequest) (response *A if request == nil { request = NewAttachRolePolicyRequest() } + + response = NewAttachRolePolicyResponse() + err = c.Send(request, response) + return +} + +// AttachRolePolicy +// 本接口(AttachRolePolicy)用于绑定策略到角色。 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_ATTACHMENTFULL = "InvalidParameter.AttachmentFull" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYIDNOTEXIST = "InvalidParameter.PolicyIdNotExist" +// INVALIDPARAMETER_POLICYNAMEERROR = "InvalidParameter.PolicyNameError" +// INVALIDPARAMETER_ROLENOTEXIST = "InvalidParameter.RoleNotExist" +// INVALIDPARAMETER_VERSIONERROR = "InvalidParameter.VersionError" +func (c *Client) AttachRolePolicyWithContext(ctx context.Context, request *AttachRolePolicyRequest) (response *AttachRolePolicyResponse, err error) { + if request == nil { + request = NewAttachRolePolicyRequest() + } + request.SetContext(ctx) + response = NewAttachRolePolicyResponse() err = c.Send(request, response) return @@ -189,6 +293,8 @@ func NewAttachUserPolicyRequest() (request *AttachUserPolicyRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "AttachUserPolicy") + + return } @@ -216,6 +322,31 @@ func (c *Client) AttachUserPolicy(request *AttachUserPolicyRequest) (response *A if request == nil { request = NewAttachUserPolicyRequest() } + + response = NewAttachUserPolicyResponse() + err = c.Send(request, response) + return +} + +// AttachUserPolicy +// 本接口(AttachUserPolicy)可用于绑定到用户的策略。 +// +// 可能返回的错误码: +// FAILEDOPERATION_POLICYFULL = "FailedOperation.PolicyFull" +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_ATTACHMENTFULL = "InvalidParameter.AttachmentFull" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYIDERROR = "InvalidParameter.PolicyIdError" +// INVALIDPARAMETER_POLICYIDNOTEXIST = "InvalidParameter.PolicyIdNotExist" +// INVALIDPARAMETER_USERNOTEXIST = "InvalidParameter.UserNotExist" +// RESOURCENOTFOUND_POLICYIDNOTFOUND = "ResourceNotFound.PolicyIdNotFound" +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +func (c *Client) AttachUserPolicyWithContext(ctx context.Context, request *AttachUserPolicyRequest) (response *AttachUserPolicyResponse, err error) { + if request == nil { + request = NewAttachUserPolicyRequest() + } + request.SetContext(ctx) + response = NewAttachUserPolicyResponse() err = c.Send(request, response) return @@ -226,6 +357,8 @@ func NewConsumeCustomMFATokenRequest() (request *ConsumeCustomMFATokenRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "ConsumeCustomMFAToken") + + return } @@ -245,6 +378,23 @@ func (c *Client) ConsumeCustomMFAToken(request *ConsumeCustomMFATokenRequest) (r if request == nil { request = NewConsumeCustomMFATokenRequest() } + + response = NewConsumeCustomMFATokenResponse() + err = c.Send(request, response) + return +} + +// ConsumeCustomMFAToken +// 验证自定义多因子Token +// +// 可能返回的错误码: +// INVALIDPARAMETER_MFATOKENERROR = "InvalidParameter.MFATokenError" +func (c *Client) ConsumeCustomMFATokenWithContext(ctx context.Context, request *ConsumeCustomMFATokenRequest) (response *ConsumeCustomMFATokenResponse, err error) { + if request == nil { + request = NewConsumeCustomMFATokenRequest() + } + request.SetContext(ctx) + response = NewConsumeCustomMFATokenResponse() err = c.Send(request, response) return @@ -255,6 +405,8 @@ func NewCreateGroupRequest() (request *CreateGroupRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "CreateGroup") + + return } @@ -275,6 +427,24 @@ func (c *Client) CreateGroup(request *CreateGroupRequest) (response *CreateGroup if request == nil { request = NewCreateGroupRequest() } + + response = NewCreateGroupResponse() + err = c.Send(request, response) + return +} + +// CreateGroup +// 创建用户组 +// +// 可能返回的错误码: +// INVALIDPARAMETER_GROUPFULL = "InvalidParameter.GroupFull" +// INVALIDPARAMETER_GROUPNAMEINUSE = "InvalidParameter.GroupNameInUse" +func (c *Client) CreateGroupWithContext(ctx context.Context, request *CreateGroupRequest) (response *CreateGroupResponse, err error) { + if request == nil { + request = NewCreateGroupRequest() + } + request.SetContext(ctx) + response = NewCreateGroupResponse() err = c.Send(request, response) return @@ -285,6 +455,8 @@ func NewCreatePolicyRequest() (request *CreatePolicyRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "CreatePolicy") + + return } @@ -335,6 +507,54 @@ func (c *Client) CreatePolicy(request *CreatePolicyRequest) (response *CreatePol if request == nil { request = NewCreatePolicyRequest() } + + response = NewCreatePolicyResponse() + err = c.Send(request, response) + return +} + +// CreatePolicy +// 本接口(CreatePolicy)可用于创建策略。 +// +// 可能返回的错误码: +// FAILEDOPERATION_POLICYFULL = "FailedOperation.PolicyFull" +// FAILEDOPERATION_POLICYNAMEINUSE = "FailedOperation.PolicyNameInUse" +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_ACTIONERROR = "InvalidParameter.ActionError" +// INVALIDPARAMETER_ACTIONMISS = "InvalidParameter.ActionMiss" +// INVALIDPARAMETER_ACTIONNOTEXIST = "InvalidParameter.ActionNotExist" +// INVALIDPARAMETER_ACTIONSERVICENOTEXIST = "InvalidParameter.ActionServiceNotExist" +// INVALIDPARAMETER_ATTACHMENTFULL = "InvalidParameter.AttachmentFull" +// INVALIDPARAMETER_CONDITIONCONTENTERROR = "InvalidParameter.ConditionContentError" +// INVALIDPARAMETER_CONDITIONERROR = "InvalidParameter.ConditionError" +// INVALIDPARAMETER_CONDITIONTYPEERROR = "InvalidParameter.ConditionTypeError" +// INVALIDPARAMETER_DESCRIPTIONLENGTHOVERLIMIT = "InvalidParameter.DescriptionLengthOverlimit" +// INVALIDPARAMETER_EFFECTERROR = "InvalidParameter.EffectError" +// INVALIDPARAMETER_NOTSUPPORTPRODUCT = "InvalidParameter.NotSupportProduct" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYDOCUMENTERROR = "InvalidParameter.PolicyDocumentError" +// INVALIDPARAMETER_POLICYDOCUMENTLENGTHOVERLIMIT = "InvalidParameter.PolicyDocumentLengthOverLimit" +// INVALIDPARAMETER_POLICYNAMEERROR = "InvalidParameter.PolicyNameError" +// INVALIDPARAMETER_PRINCIPALERROR = "InvalidParameter.PrincipalError" +// INVALIDPARAMETER_RESOURCECONTENTERROR = "InvalidParameter.ResourceContentError" +// INVALIDPARAMETER_RESOURCEERROR = "InvalidParameter.ResourceError" +// INVALIDPARAMETER_RESOURCEPROJECTERROR = "InvalidParameter.ResourceProjectError" +// INVALIDPARAMETER_RESOURCEQCSERROR = "InvalidParameter.ResourceQcsError" +// INVALIDPARAMETER_RESOURCEREGIONERROR = "InvalidParameter.ResourceRegionError" +// INVALIDPARAMETER_RESOURCESERVICENOTEXIST = "InvalidParameter.ResourceServiceNotExist" +// INVALIDPARAMETER_RESOURCEUINERROR = "InvalidParameter.ResourceUinError" +// INVALIDPARAMETER_STATEMENTERROR = "InvalidParameter.StatementError" +// INVALIDPARAMETER_USERNOTEXIST = "InvalidParameter.UserNotExist" +// INVALIDPARAMETER_VERSIONERROR = "InvalidParameter.VersionError" +// RESOURCENOTFOUND_GROUPNOTEXIST = "ResourceNotFound.GroupNotExist" +// RESOURCENOTFOUND_NOTFOUND = "ResourceNotFound.NotFound" +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +func (c *Client) CreatePolicyWithContext(ctx context.Context, request *CreatePolicyRequest) (response *CreatePolicyResponse, err error) { + if request == nil { + request = NewCreatePolicyRequest() + } + request.SetContext(ctx) + response = NewCreatePolicyResponse() err = c.Send(request, response) return @@ -345,6 +565,8 @@ func NewCreatePolicyVersionRequest() (request *CreatePolicyVersionRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "CreatePolicyVersion") + + return } @@ -397,6 +619,56 @@ func (c *Client) CreatePolicyVersion(request *CreatePolicyVersionRequest) (respo if request == nil { request = NewCreatePolicyVersionRequest() } + + response = NewCreatePolicyVersionResponse() + err = c.Send(request, response) + return +} + +// CreatePolicyVersion +// 该接口(CreatePolicyVersion)用于新增策略版本,用户创建了一个策略版本之后可以方便的通过变更策略版本的方式来变更策略。 +// +// 可能返回的错误码: +// FAILEDOPERATION_POLICYFULL = "FailedOperation.PolicyFull" +// FAILEDOPERATION_POLICYNAMEINUSE = "FailedOperation.PolicyNameInUse" +// FAILEDOPERATION_POLICYVERSIONFULL = "FailedOperation.PolicyVersionFull" +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_ACTIONERROR = "InvalidParameter.ActionError" +// INVALIDPARAMETER_ACTIONMISS = "InvalidParameter.ActionMiss" +// INVALIDPARAMETER_ACTIONNOTEXIST = "InvalidParameter.ActionNotExist" +// INVALIDPARAMETER_ACTIONSERVICENOTEXIST = "InvalidParameter.ActionServiceNotExist" +// INVALIDPARAMETER_ATTACHMENTFULL = "InvalidParameter.AttachmentFull" +// INVALIDPARAMETER_CONDITIONCONTENTERROR = "InvalidParameter.ConditionContentError" +// INVALIDPARAMETER_CONDITIONERROR = "InvalidParameter.ConditionError" +// INVALIDPARAMETER_CONDITIONTYPEERROR = "InvalidParameter.ConditionTypeError" +// INVALIDPARAMETER_DESCRIPTIONLENGTHOVERLIMIT = "InvalidParameter.DescriptionLengthOverlimit" +// INVALIDPARAMETER_EFFECTERROR = "InvalidParameter.EffectError" +// INVALIDPARAMETER_NOTSUPPORTPRODUCT = "InvalidParameter.NotSupportProduct" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYDOCUMENTERROR = "InvalidParameter.PolicyDocumentError" +// INVALIDPARAMETER_POLICYDOCUMENTLENGTHOVERLIMIT = "InvalidParameter.PolicyDocumentLengthOverLimit" +// INVALIDPARAMETER_POLICYIDNOTEXIST = "InvalidParameter.PolicyIdNotExist" +// INVALIDPARAMETER_POLICYNAMEERROR = "InvalidParameter.PolicyNameError" +// INVALIDPARAMETER_PRINCIPALERROR = "InvalidParameter.PrincipalError" +// INVALIDPARAMETER_RESOURCECONTENTERROR = "InvalidParameter.ResourceContentError" +// INVALIDPARAMETER_RESOURCEERROR = "InvalidParameter.ResourceError" +// INVALIDPARAMETER_RESOURCEPROJECTERROR = "InvalidParameter.ResourceProjectError" +// INVALIDPARAMETER_RESOURCEQCSERROR = "InvalidParameter.ResourceQcsError" +// INVALIDPARAMETER_RESOURCEREGIONERROR = "InvalidParameter.ResourceRegionError" +// INVALIDPARAMETER_RESOURCESERVICENOTEXIST = "InvalidParameter.ResourceServiceNotExist" +// INVALIDPARAMETER_RESOURCEUINERROR = "InvalidParameter.ResourceUinError" +// INVALIDPARAMETER_STATEMENTERROR = "InvalidParameter.StatementError" +// INVALIDPARAMETER_USERNOTEXIST = "InvalidParameter.UserNotExist" +// INVALIDPARAMETER_VERSIONERROR = "InvalidParameter.VersionError" +// RESOURCENOTFOUND_GROUPNOTEXIST = "ResourceNotFound.GroupNotExist" +// RESOURCENOTFOUND_NOTFOUND = "ResourceNotFound.NotFound" +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +func (c *Client) CreatePolicyVersionWithContext(ctx context.Context, request *CreatePolicyVersionRequest) (response *CreatePolicyVersionResponse, err error) { + if request == nil { + request = NewCreatePolicyVersionRequest() + } + request.SetContext(ctx) + response = NewCreatePolicyVersionResponse() err = c.Send(request, response) return @@ -407,6 +679,8 @@ func NewCreateRoleRequest() (request *CreateRoleRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "CreateRole") + + return } @@ -446,6 +720,43 @@ func (c *Client) CreateRole(request *CreateRoleRequest) (response *CreateRoleRes if request == nil { request = NewCreateRoleRequest() } + + response = NewCreateRoleResponse() + err = c.Send(request, response) + return +} + +// CreateRole +// 本接口(CreateRole)用于创建角色。 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_ACTIONERROR = "InvalidParameter.ActionError" +// INVALIDPARAMETER_ACTIONMISS = "InvalidParameter.ActionMiss" +// INVALIDPARAMETER_ATTACHMENTFULL = "InvalidParameter.AttachmentFull" +// INVALIDPARAMETER_CONDITIONCONTENTERROR = "InvalidParameter.ConditionContentError" +// INVALIDPARAMETER_CONDITIONERROR = "InvalidParameter.ConditionError" +// INVALIDPARAMETER_CONDITIONTYPEERROR = "InvalidParameter.ConditionTypeError" +// INVALIDPARAMETER_DESCRIPTIONLENGTHOVERLIMIT = "InvalidParameter.DescriptionLengthOverlimit" +// INVALIDPARAMETER_EFFECTERROR = "InvalidParameter.EffectError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_PRINCIPALERROR = "InvalidParameter.PrincipalError" +// INVALIDPARAMETER_PRINCIPALQCSCROSSERROR = "InvalidParameter.PrincipalQcsCrossError" +// INVALIDPARAMETER_PRINCIPALQCSERROR = "InvalidParameter.PrincipalQcsError" +// INVALIDPARAMETER_PRINCIPALQCSNOTEXIST = "InvalidParameter.PrincipalQcsNotExist" +// INVALIDPARAMETER_PRINCIPALSERVICENOTEXIST = "InvalidParameter.PrincipalServiceNotExist" +// INVALIDPARAMETER_ROLEFULL = "InvalidParameter.RoleFull" +// INVALIDPARAMETER_ROLENAMEERROR = "InvalidParameter.RoleNameError" +// INVALIDPARAMETER_ROLENAMEINUSE = "InvalidParameter.RoleNameInUse" +// INVALIDPARAMETER_STATEMENTERROR = "InvalidParameter.StatementError" +// INVALIDPARAMETER_USERNOTEXIST = "InvalidParameter.UserNotExist" +// INVALIDPARAMETER_VERSIONERROR = "InvalidParameter.VersionError" +func (c *Client) CreateRoleWithContext(ctx context.Context, request *CreateRoleRequest) (response *CreateRoleResponse, err error) { + if request == nil { + request = NewCreateRoleRequest() + } + request.SetContext(ctx) + response = NewCreateRoleResponse() err = c.Send(request, response) return @@ -456,6 +767,8 @@ func NewCreateSAMLProviderRequest() (request *CreateSAMLProviderRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "CreateSAMLProvider") + + return } @@ -479,19 +792,42 @@ func (c *Client) CreateSAMLProvider(request *CreateSAMLProviderRequest) (respons if request == nil { request = NewCreateSAMLProviderRequest() } + response = NewCreateSAMLProviderResponse() err = c.Send(request, response) return } -func NewCreateServiceLinkedRoleRequest() (request *CreateServiceLinkedRoleRequest) { - request = &CreateServiceLinkedRoleRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - request.Init().WithApiInfo("cam", APIVersion, "CreateServiceLinkedRole") - return -} - +// CreateSAMLProvider +// 创建SAML身份提供商 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER_IDENTITYNAMEINUSE = "InvalidParameter.IdentityNameInUse" +// INVALIDPARAMETERVALUE_METADATAERROR = "InvalidParameterValue.MetadataError" +// INVALIDPARAMETERVALUE_NAMEERROR = "InvalidParameterValue.NameError" +// LIMITEXCEEDED_IDENTITYFULL = "LimitExceeded.IdentityFull" +func (c *Client) CreateSAMLProviderWithContext(ctx context.Context, request *CreateSAMLProviderRequest) (response *CreateSAMLProviderResponse, err error) { + if request == nil { + request = NewCreateSAMLProviderRequest() + } + request.SetContext(ctx) + + response = NewCreateSAMLProviderResponse() + err = c.Send(request, response) + return +} + +func NewCreateServiceLinkedRoleRequest() (request *CreateServiceLinkedRoleRequest) { + request = &CreateServiceLinkedRoleRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("cam", APIVersion, "CreateServiceLinkedRole") + + + return +} + func NewCreateServiceLinkedRoleResponse() (response *CreateServiceLinkedRoleResponse) { response = &CreateServiceLinkedRoleResponse{ BaseResponse: &tchttp.BaseResponse{}, @@ -512,16 +848,87 @@ func (c *Client) CreateServiceLinkedRole(request *CreateServiceLinkedRoleRequest if request == nil { request = NewCreateServiceLinkedRoleRequest() } + + response = NewCreateServiceLinkedRoleResponse() + err = c.Send(request, response) + return +} + +// CreateServiceLinkedRole +// 创建服务相关角色 +// +// 可能返回的错误码: +// INVALIDPARAMETER_DESCRIPTIONLENGTHOVERLIMIT = "InvalidParameter.DescriptionLengthOverlimit" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYIDNOTEXIST = "InvalidParameter.PolicyIdNotExist" +// INVALIDPARAMETER_ROLENAMEERROR = "InvalidParameter.RoleNameError" +// INVALIDPARAMETER_ROLENAMEINUSE = "InvalidParameter.RoleNameInUse" +func (c *Client) CreateServiceLinkedRoleWithContext(ctx context.Context, request *CreateServiceLinkedRoleRequest) (response *CreateServiceLinkedRoleResponse, err error) { + if request == nil { + request = NewCreateServiceLinkedRoleRequest() + } + request.SetContext(ctx) + response = NewCreateServiceLinkedRoleResponse() err = c.Send(request, response) return } +func NewCreateUserSAMLConfigRequest() (request *CreateUserSAMLConfigRequest) { + request = &CreateUserSAMLConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("cam", APIVersion, "CreateUserSAMLConfig") + + + return +} + +func NewCreateUserSAMLConfigResponse() (response *CreateUserSAMLConfigResponse) { + response = &CreateUserSAMLConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// CreateUserSAMLConfig +// 创建用户SAML配置 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_METADATAERROR = "InvalidParameterValue.MetadataError" +func (c *Client) CreateUserSAMLConfig(request *CreateUserSAMLConfigRequest) (response *CreateUserSAMLConfigResponse, err error) { + if request == nil { + request = NewCreateUserSAMLConfigRequest() + } + + response = NewCreateUserSAMLConfigResponse() + err = c.Send(request, response) + return +} + +// CreateUserSAMLConfig +// 创建用户SAML配置 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_METADATAERROR = "InvalidParameterValue.MetadataError" +func (c *Client) CreateUserSAMLConfigWithContext(ctx context.Context, request *CreateUserSAMLConfigRequest) (response *CreateUserSAMLConfigResponse, err error) { + if request == nil { + request = NewCreateUserSAMLConfigRequest() + } + request.SetContext(ctx) + + response = NewCreateUserSAMLConfigResponse() + err = c.Send(request, response) + return +} + func NewDeleteGroupRequest() (request *DeleteGroupRequest) { request = &DeleteGroupRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "DeleteGroup") + + return } @@ -541,6 +948,23 @@ func (c *Client) DeleteGroup(request *DeleteGroupRequest) (response *DeleteGroup if request == nil { request = NewDeleteGroupRequest() } + + response = NewDeleteGroupResponse() + err = c.Send(request, response) + return +} + +// DeleteGroup +// 删除用户组 +// +// 可能返回的错误码: +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +func (c *Client) DeleteGroupWithContext(ctx context.Context, request *DeleteGroupRequest) (response *DeleteGroupResponse, err error) { + if request == nil { + request = NewDeleteGroupRequest() + } + request.SetContext(ctx) + response = NewDeleteGroupResponse() err = c.Send(request, response) return @@ -551,6 +975,8 @@ func NewDeletePolicyRequest() (request *DeletePolicyRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "DeletePolicy") + + return } @@ -575,6 +1001,28 @@ func (c *Client) DeletePolicy(request *DeletePolicyRequest) (response *DeletePol if request == nil { request = NewDeletePolicyRequest() } + + response = NewDeletePolicyResponse() + err = c.Send(request, response) + return +} + +// DeletePolicy +// 本接口(DeletePolicy)可用于删除策略。 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYIDERROR = "InvalidParameter.PolicyIdError" +// INVALIDPARAMETER_POLICYIDNOTEXIST = "InvalidParameter.PolicyIdNotExist" +// RESOURCENOTFOUND_NOTFOUND = "ResourceNotFound.NotFound" +// RESOURCENOTFOUND_POLICYIDNOTFOUND = "ResourceNotFound.PolicyIdNotFound" +func (c *Client) DeletePolicyWithContext(ctx context.Context, request *DeletePolicyRequest) (response *DeletePolicyResponse, err error) { + if request == nil { + request = NewDeletePolicyRequest() + } + request.SetContext(ctx) + response = NewDeletePolicyResponse() err = c.Send(request, response) return @@ -585,6 +1033,8 @@ func NewDeletePolicyVersionRequest() (request *DeletePolicyVersionRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "DeletePolicyVersion") + + return } @@ -628,6 +1078,47 @@ func (c *Client) DeletePolicyVersion(request *DeletePolicyVersionRequest) (respo if request == nil { request = NewDeletePolicyVersionRequest() } + + response = NewDeletePolicyVersionResponse() + err = c.Send(request, response) + return +} + +// DeletePolicyVersion +// 本接口(DeletePolicyVersion)可用于删除一个策略的策略版本。 +// +// 可能返回的错误码: +// FAILEDOPERATION_POLICYNAMEINUSE = "FailedOperation.PolicyNameInUse" +// FAILEDOPERATION_POLICYVERSIONALREADYDEFAULT = "FailedOperation.PolicyVersionAlreadyDefault" +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_ACTIONERROR = "InvalidParameter.ActionError" +// INVALIDPARAMETER_ATTACHMENTFULL = "InvalidParameter.AttachmentFull" +// INVALIDPARAMETER_CONDITIONERROR = "InvalidParameter.ConditionError" +// INVALIDPARAMETER_DESCRIPTIONLENGTHOVERLIMIT = "InvalidParameter.DescriptionLengthOverlimit" +// INVALIDPARAMETER_EFFECTERROR = "InvalidParameter.EffectError" +// INVALIDPARAMETER_NOTSUPPORTPRODUCT = "InvalidParameter.NotSupportProduct" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYDOCUMENTERROR = "InvalidParameter.PolicyDocumentError" +// INVALIDPARAMETER_POLICYDOCUMENTLENGTHOVERLIMIT = "InvalidParameter.PolicyDocumentLengthOverLimit" +// INVALIDPARAMETER_POLICYIDERROR = "InvalidParameter.PolicyIdError" +// INVALIDPARAMETER_POLICYIDNOTEXIST = "InvalidParameter.PolicyIdNotExist" +// INVALIDPARAMETER_POLICYNAMEERROR = "InvalidParameter.PolicyNameError" +// INVALIDPARAMETER_POLICYVERSIONNOTEXISTS = "InvalidParameter.PolicyVersionNotExists" +// INVALIDPARAMETER_PRINCIPALERROR = "InvalidParameter.PrincipalError" +// INVALIDPARAMETER_RESOURCEERROR = "InvalidParameter.ResourceError" +// INVALIDPARAMETER_STATEMENTERROR = "InvalidParameter.StatementError" +// INVALIDPARAMETER_USERNOTEXIST = "InvalidParameter.UserNotExist" +// INVALIDPARAMETER_VERSIONERROR = "InvalidParameter.VersionError" +// RESOURCENOTFOUND_GROUPNOTEXIST = "ResourceNotFound.GroupNotExist" +// RESOURCENOTFOUND_NOTFOUND = "ResourceNotFound.NotFound" +// RESOURCENOTFOUND_POLICYIDNOTFOUND = "ResourceNotFound.PolicyIdNotFound" +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +func (c *Client) DeletePolicyVersionWithContext(ctx context.Context, request *DeletePolicyVersionRequest) (response *DeletePolicyVersionResponse, err error) { + if request == nil { + request = NewDeletePolicyVersionRequest() + } + request.SetContext(ctx) + response = NewDeletePolicyVersionResponse() err = c.Send(request, response) return @@ -638,6 +1129,8 @@ func NewDeleteRoleRequest() (request *DeleteRoleRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "DeleteRole") + + return } @@ -660,6 +1153,26 @@ func (c *Client) DeleteRole(request *DeleteRoleRequest) (response *DeleteRoleRes if request == nil { request = NewDeleteRoleRequest() } + + response = NewDeleteRoleResponse() + err = c.Send(request, response) + return +} + +// DeleteRole +// 本接口(DeleteRole)用于删除指定角色。 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYNAMEERROR = "InvalidParameter.PolicyNameError" +// INVALIDPARAMETER_ROLENOTEXIST = "InvalidParameter.RoleNotExist" +func (c *Client) DeleteRoleWithContext(ctx context.Context, request *DeleteRoleRequest) (response *DeleteRoleResponse, err error) { + if request == nil { + request = NewDeleteRoleRequest() + } + request.SetContext(ctx) + response = NewDeleteRoleResponse() err = c.Send(request, response) return @@ -670,6 +1183,8 @@ func NewDeleteRolePermissionsBoundaryRequest() (request *DeleteRolePermissionsBo BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "DeleteRolePermissionsBoundary") + + return } @@ -696,6 +1211,30 @@ func (c *Client) DeleteRolePermissionsBoundary(request *DeleteRolePermissionsBou if request == nil { request = NewDeleteRolePermissionsBoundaryRequest() } + + response = NewDeleteRolePermissionsBoundaryResponse() + err = c.Send(request, response) + return +} + +// DeleteRolePermissionsBoundary +// 删除角色权限边界 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_OPERATEENTITIESOVERLIMIT = "InvalidParameter.OperateEntitiesOverLimit" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYIDNOTEXIST = "InvalidParameter.PolicyIdNotExist" +// INVALIDPARAMETER_ROLENOTEXIST = "InvalidParameter.RoleNotExist" +// INVALIDPARAMETER_SERVICELINKEDROLECANTUSEPERMISSIONBOUNDARY = "InvalidParameter.ServiceLinkedRoleCantUsePermissionBoundary" +// INVALIDPARAMETER_USERNOTEXIST = "InvalidParameter.UserNotExist" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +func (c *Client) DeleteRolePermissionsBoundaryWithContext(ctx context.Context, request *DeleteRolePermissionsBoundaryRequest) (response *DeleteRolePermissionsBoundaryResponse, err error) { + if request == nil { + request = NewDeleteRolePermissionsBoundaryRequest() + } + request.SetContext(ctx) + response = NewDeleteRolePermissionsBoundaryResponse() err = c.Send(request, response) return @@ -706,6 +1245,8 @@ func NewDeleteSAMLProviderRequest() (request *DeleteSAMLProviderRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "DeleteSAMLProvider") + + return } @@ -726,6 +1267,24 @@ func (c *Client) DeleteSAMLProvider(request *DeleteSAMLProviderRequest) (respons if request == nil { request = NewDeleteSAMLProviderRequest() } + + response = NewDeleteSAMLProviderResponse() + err = c.Send(request, response) + return +} + +// DeleteSAMLProvider +// 删除SAML身份提供商 +// +// 可能返回的错误码: +// RESOURCENOTFOUND_IDENTITYNOTEXIST = "ResourceNotFound.IdentityNotExist" +// RESOURCENOTFOUND_NOTFOUND = "ResourceNotFound.NotFound" +func (c *Client) DeleteSAMLProviderWithContext(ctx context.Context, request *DeleteSAMLProviderRequest) (response *DeleteSAMLProviderResponse, err error) { + if request == nil { + request = NewDeleteSAMLProviderRequest() + } + request.SetContext(ctx) + response = NewDeleteSAMLProviderResponse() err = c.Send(request, response) return @@ -736,6 +1295,8 @@ func NewDeleteServiceLinkedRoleRequest() (request *DeleteServiceLinkedRoleReques BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "DeleteServiceLinkedRole") + + return } @@ -757,6 +1318,25 @@ func (c *Client) DeleteServiceLinkedRole(request *DeleteServiceLinkedRoleRequest if request == nil { request = NewDeleteServiceLinkedRoleRequest() } + + response = NewDeleteServiceLinkedRoleResponse() + err = c.Send(request, response) + return +} + +// DeleteServiceLinkedRole +// 删除服务相关角色 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_ROLENOTEXIST = "InvalidParameter.RoleNotExist" +func (c *Client) DeleteServiceLinkedRoleWithContext(ctx context.Context, request *DeleteServiceLinkedRoleRequest) (response *DeleteServiceLinkedRoleResponse, err error) { + if request == nil { + request = NewDeleteServiceLinkedRoleRequest() + } + request.SetContext(ctx) + response = NewDeleteServiceLinkedRoleResponse() err = c.Send(request, response) return @@ -767,6 +1347,8 @@ func NewDeleteUserRequest() (request *DeleteUserRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "DeleteUser") + + return } @@ -783,12 +1365,34 @@ func NewDeleteUserResponse() (response *DeleteUserResponse) { // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" // OPERATIONDENIED_HAVEKEYS = "OperationDenied.HaveKeys" +// REQUESTLIMITEXCEEDED_UINLIMITEXCEEDED = "RequestLimitExceeded.UinLimitExceeded" // RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" // UNAUTHORIZEDOPERATION_DELETEAPIKEY = "UnauthorizedOperation.DeleteApiKey" func (c *Client) DeleteUser(request *DeleteUserRequest) (response *DeleteUserResponse, err error) { if request == nil { request = NewDeleteUserRequest() } + + response = NewDeleteUserResponse() + err = c.Send(request, response) + return +} + +// DeleteUser +// 删除子用户 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// OPERATIONDENIED_HAVEKEYS = "OperationDenied.HaveKeys" +// REQUESTLIMITEXCEEDED_UINLIMITEXCEEDED = "RequestLimitExceeded.UinLimitExceeded" +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +// UNAUTHORIZEDOPERATION_DELETEAPIKEY = "UnauthorizedOperation.DeleteApiKey" +func (c *Client) DeleteUserWithContext(ctx context.Context, request *DeleteUserRequest) (response *DeleteUserResponse, err error) { + if request == nil { + request = NewDeleteUserRequest() + } + request.SetContext(ctx) + response = NewDeleteUserResponse() err = c.Send(request, response) return @@ -799,6 +1403,8 @@ func NewDeleteUserPermissionsBoundaryRequest() (request *DeleteUserPermissionsBo BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "DeleteUserPermissionsBoundary") + + return } @@ -823,6 +1429,28 @@ func (c *Client) DeleteUserPermissionsBoundary(request *DeleteUserPermissionsBou if request == nil { request = NewDeleteUserPermissionsBoundaryRequest() } + + response = NewDeleteUserPermissionsBoundaryResponse() + err = c.Send(request, response) + return +} + +// DeleteUserPermissionsBoundary +// 删除用户权限边界 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_OPERATEENTITIESOVERLIMIT = "InvalidParameter.OperateEntitiesOverLimit" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_ROLENOTEXIST = "InvalidParameter.RoleNotExist" +// INVALIDPARAMETER_USERNOTEXIST = "InvalidParameter.UserNotExist" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +func (c *Client) DeleteUserPermissionsBoundaryWithContext(ctx context.Context, request *DeleteUserPermissionsBoundaryRequest) (response *DeleteUserPermissionsBoundaryResponse, err error) { + if request == nil { + request = NewDeleteUserPermissionsBoundaryRequest() + } + request.SetContext(ctx) + response = NewDeleteUserPermissionsBoundaryResponse() err = c.Send(request, response) return @@ -833,6 +1461,8 @@ func NewDescribeRoleListRequest() (request *DescribeRoleListRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "DescribeRoleList") + + return } @@ -853,6 +1483,24 @@ func (c *Client) DescribeRoleList(request *DescribeRoleListRequest) (response *D if request == nil { request = NewDescribeRoleListRequest() } + + response = NewDescribeRoleListResponse() + err = c.Send(request, response) + return +} + +// DescribeRoleList +// 本接口(DescribeRoleList)用于获取账号下的角色列表。 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +func (c *Client) DescribeRoleListWithContext(ctx context.Context, request *DescribeRoleListRequest) (response *DescribeRoleListResponse, err error) { + if request == nil { + request = NewDescribeRoleListRequest() + } + request.SetContext(ctx) + response = NewDescribeRoleListResponse() err = c.Send(request, response) return @@ -863,6 +1511,8 @@ func NewDescribeSafeAuthFlagRequest() (request *DescribeSafeAuthFlagRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "DescribeSafeAuthFlag") + + return } @@ -884,16 +1534,37 @@ func (c *Client) DescribeSafeAuthFlag(request *DescribeSafeAuthFlagRequest) (res if request == nil { request = NewDescribeSafeAuthFlagRequest() } + response = NewDescribeSafeAuthFlagResponse() err = c.Send(request, response) return } -func NewDescribeSafeAuthFlagCollRequest() (request *DescribeSafeAuthFlagCollRequest) { - request = &DescribeSafeAuthFlagCollRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - request.Init().WithApiInfo("cam", APIVersion, "DescribeSafeAuthFlagColl") +// DescribeSafeAuthFlag +// 查询安全设置 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +func (c *Client) DescribeSafeAuthFlagWithContext(ctx context.Context, request *DescribeSafeAuthFlagRequest) (response *DescribeSafeAuthFlagResponse, err error) { + if request == nil { + request = NewDescribeSafeAuthFlagRequest() + } + request.SetContext(ctx) + + response = NewDescribeSafeAuthFlagResponse() + err = c.Send(request, response) + return +} + +func NewDescribeSafeAuthFlagCollRequest() (request *DescribeSafeAuthFlagCollRequest) { + request = &DescribeSafeAuthFlagCollRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("cam", APIVersion, "DescribeSafeAuthFlagColl") + + return } @@ -915,16 +1586,89 @@ func (c *Client) DescribeSafeAuthFlagColl(request *DescribeSafeAuthFlagCollReque if request == nil { request = NewDescribeSafeAuthFlagCollRequest() } + + response = NewDescribeSafeAuthFlagCollResponse() + err = c.Send(request, response) + return +} + +// DescribeSafeAuthFlagColl +// 查询安全设置 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +func (c *Client) DescribeSafeAuthFlagCollWithContext(ctx context.Context, request *DescribeSafeAuthFlagCollRequest) (response *DescribeSafeAuthFlagCollResponse, err error) { + if request == nil { + request = NewDescribeSafeAuthFlagCollRequest() + } + request.SetContext(ctx) + response = NewDescribeSafeAuthFlagCollResponse() err = c.Send(request, response) return } +func NewDescribeSafeAuthFlagIntlRequest() (request *DescribeSafeAuthFlagIntlRequest) { + request = &DescribeSafeAuthFlagIntlRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("cam", APIVersion, "DescribeSafeAuthFlagIntl") + + + return +} + +func NewDescribeSafeAuthFlagIntlResponse() (response *DescribeSafeAuthFlagIntlResponse) { + response = &DescribeSafeAuthFlagIntlResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeSafeAuthFlagIntl +// 查询安全设置(国际站) +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +func (c *Client) DescribeSafeAuthFlagIntl(request *DescribeSafeAuthFlagIntlRequest) (response *DescribeSafeAuthFlagIntlResponse, err error) { + if request == nil { + request = NewDescribeSafeAuthFlagIntlRequest() + } + + response = NewDescribeSafeAuthFlagIntlResponse() + err = c.Send(request, response) + return +} + +// DescribeSafeAuthFlagIntl +// 查询安全设置(国际站) +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +func (c *Client) DescribeSafeAuthFlagIntlWithContext(ctx context.Context, request *DescribeSafeAuthFlagIntlRequest) (response *DescribeSafeAuthFlagIntlResponse, err error) { + if request == nil { + request = NewDescribeSafeAuthFlagIntlRequest() + } + request.SetContext(ctx) + + response = NewDescribeSafeAuthFlagIntlResponse() + err = c.Send(request, response) + return +} + func NewDescribeSubAccountsRequest() (request *DescribeSubAccountsRequest) { request = &DescribeSubAccountsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "DescribeSubAccounts") + + return } @@ -946,16 +1690,89 @@ func (c *Client) DescribeSubAccounts(request *DescribeSubAccountsRequest) (respo if request == nil { request = NewDescribeSubAccountsRequest() } + + response = NewDescribeSubAccountsResponse() + err = c.Send(request, response) + return +} + +// DescribeSubAccounts +// 通过子用户UIN列表查询子用户 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER = "InvalidParameter" +func (c *Client) DescribeSubAccountsWithContext(ctx context.Context, request *DescribeSubAccountsRequest) (response *DescribeSubAccountsResponse, err error) { + if request == nil { + request = NewDescribeSubAccountsRequest() + } + request.SetContext(ctx) + response = NewDescribeSubAccountsResponse() err = c.Send(request, response) return } +func NewDescribeUserSAMLConfigRequest() (request *DescribeUserSAMLConfigRequest) { + request = &DescribeUserSAMLConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("cam", APIVersion, "DescribeUserSAMLConfig") + + + return +} + +func NewDescribeUserSAMLConfigResponse() (response *DescribeUserSAMLConfigResponse) { + response = &DescribeUserSAMLConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeUserSAMLConfig +// 查询用户SAML配置 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER = "InvalidParameter" +func (c *Client) DescribeUserSAMLConfig(request *DescribeUserSAMLConfigRequest) (response *DescribeUserSAMLConfigResponse, err error) { + if request == nil { + request = NewDescribeUserSAMLConfigRequest() + } + + response = NewDescribeUserSAMLConfigResponse() + err = c.Send(request, response) + return +} + +// DescribeUserSAMLConfig +// 查询用户SAML配置 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER = "InvalidParameter" +func (c *Client) DescribeUserSAMLConfigWithContext(ctx context.Context, request *DescribeUserSAMLConfigRequest) (response *DescribeUserSAMLConfigResponse, err error) { + if request == nil { + request = NewDescribeUserSAMLConfigRequest() + } + request.SetContext(ctx) + + response = NewDescribeUserSAMLConfigResponse() + err = c.Send(request, response) + return +} + func NewDetachGroupPolicyRequest() (request *DetachGroupPolicyRequest) { request = &DetachGroupPolicyRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "DetachGroupPolicy") + + return } @@ -981,6 +1798,29 @@ func (c *Client) DetachGroupPolicy(request *DetachGroupPolicyRequest) (response if request == nil { request = NewDetachGroupPolicyRequest() } + + response = NewDetachGroupPolicyResponse() + err = c.Send(request, response) + return +} + +// DetachGroupPolicy +// 本接口(DetachGroupPolicy)可用于解除绑定到用户组的策略。 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYIDERROR = "InvalidParameter.PolicyIdError" +// INVALIDPARAMETER_POLICYIDNOTEXIST = "InvalidParameter.PolicyIdNotExist" +// INVALIDPARAMETER_USERNOTEXIST = "InvalidParameter.UserNotExist" +// RESOURCENOTFOUND_GROUPNOTEXIST = "ResourceNotFound.GroupNotExist" +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +func (c *Client) DetachGroupPolicyWithContext(ctx context.Context, request *DetachGroupPolicyRequest) (response *DetachGroupPolicyResponse, err error) { + if request == nil { + request = NewDetachGroupPolicyRequest() + } + request.SetContext(ctx) + response = NewDetachGroupPolicyResponse() err = c.Send(request, response) return @@ -991,6 +1831,8 @@ func NewDetachRolePolicyRequest() (request *DetachRolePolicyRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "DetachRolePolicy") + + return } @@ -1013,6 +1855,26 @@ func (c *Client) DetachRolePolicy(request *DetachRolePolicyRequest) (response *D if request == nil { request = NewDetachRolePolicyRequest() } + + response = NewDetachRolePolicyResponse() + err = c.Send(request, response) + return +} + +// DetachRolePolicy +// 本接口(DetachRolePolicy)用于解除绑定角色的策略。 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYIDNOTEXIST = "InvalidParameter.PolicyIdNotExist" +// INVALIDPARAMETER_ROLENOTEXIST = "InvalidParameter.RoleNotExist" +func (c *Client) DetachRolePolicyWithContext(ctx context.Context, request *DetachRolePolicyRequest) (response *DetachRolePolicyResponse, err error) { + if request == nil { + request = NewDetachRolePolicyRequest() + } + request.SetContext(ctx) + response = NewDetachRolePolicyResponse() err = c.Send(request, response) return @@ -1023,6 +1885,8 @@ func NewDetachUserPolicyRequest() (request *DetachUserPolicyRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "DetachUserPolicy") + + return } @@ -1049,16 +1913,90 @@ func (c *Client) DetachUserPolicy(request *DetachUserPolicyRequest) (response *D if request == nil { request = NewDetachUserPolicyRequest() } + + response = NewDetachUserPolicyResponse() + err = c.Send(request, response) + return +} + +// DetachUserPolicy +// 本接口(DetachUserPolicy)可用于解除绑定到用户的策略。 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_ATTACHMENTFULL = "InvalidParameter.AttachmentFull" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYIDERROR = "InvalidParameter.PolicyIdError" +// INVALIDPARAMETER_POLICYIDNOTEXIST = "InvalidParameter.PolicyIdNotExist" +// INVALIDPARAMETER_USERNOTEXIST = "InvalidParameter.UserNotExist" +// RESOURCENOTFOUND_POLICYIDNOTFOUND = "ResourceNotFound.PolicyIdNotFound" +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +func (c *Client) DetachUserPolicyWithContext(ctx context.Context, request *DetachUserPolicyRequest) (response *DetachUserPolicyResponse, err error) { + if request == nil { + request = NewDetachUserPolicyRequest() + } + request.SetContext(ctx) + response = NewDetachUserPolicyResponse() err = c.Send(request, response) return } +func NewGetAccountSummaryRequest() (request *GetAccountSummaryRequest) { + request = &GetAccountSummaryRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("cam", APIVersion, "GetAccountSummary") + + + return +} + +func NewGetAccountSummaryResponse() (response *GetAccountSummaryResponse) { + response = &GetAccountSummaryResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// GetAccountSummary +// 查询账户摘要 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +func (c *Client) GetAccountSummary(request *GetAccountSummaryRequest) (response *GetAccountSummaryResponse, err error) { + if request == nil { + request = NewGetAccountSummaryRequest() + } + + response = NewGetAccountSummaryResponse() + err = c.Send(request, response) + return +} + +// GetAccountSummary +// 查询账户摘要 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +func (c *Client) GetAccountSummaryWithContext(ctx context.Context, request *GetAccountSummaryRequest) (response *GetAccountSummaryResponse, err error) { + if request == nil { + request = NewGetAccountSummaryRequest() + } + request.SetContext(ctx) + + response = NewGetAccountSummaryResponse() + err = c.Send(request, response) + return +} + func NewGetCustomMFATokenInfoRequest() (request *GetCustomMFATokenInfoRequest) { request = &GetCustomMFATokenInfoRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "GetCustomMFATokenInfo") + + return } @@ -1078,6 +2016,23 @@ func (c *Client) GetCustomMFATokenInfo(request *GetCustomMFATokenInfoRequest) (r if request == nil { request = NewGetCustomMFATokenInfoRequest() } + + response = NewGetCustomMFATokenInfoResponse() + err = c.Send(request, response) + return +} + +// GetCustomMFATokenInfo +// 获取自定义多因子Token关联信息 +// +// 可能返回的错误码: +// INVALIDPARAMETER_MFATOKENERROR = "InvalidParameter.MFATokenError" +func (c *Client) GetCustomMFATokenInfoWithContext(ctx context.Context, request *GetCustomMFATokenInfoRequest) (response *GetCustomMFATokenInfoResponse, err error) { + if request == nil { + request = NewGetCustomMFATokenInfoRequest() + } + request.SetContext(ctx) + response = NewGetCustomMFATokenInfoResponse() err = c.Send(request, response) return @@ -1088,6 +2043,8 @@ func NewGetGroupRequest() (request *GetGroupRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "GetGroup") + + return } @@ -1108,6 +2065,24 @@ func (c *Client) GetGroup(request *GetGroupRequest) (response *GetGroupResponse, if request == nil { request = NewGetGroupRequest() } + + response = NewGetGroupResponse() + err = c.Send(request, response) + return +} + +// GetGroup +// 查询用户组详情 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +func (c *Client) GetGroupWithContext(ctx context.Context, request *GetGroupRequest) (response *GetGroupResponse, err error) { + if request == nil { + request = NewGetGroupRequest() + } + request.SetContext(ctx) + response = NewGetGroupResponse() err = c.Send(request, response) return @@ -1118,6 +2093,8 @@ func NewGetPolicyRequest() (request *GetPolicyRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "GetPolicy") + + return } @@ -1140,6 +2117,26 @@ func (c *Client) GetPolicy(request *GetPolicyRequest) (response *GetPolicyRespon if request == nil { request = NewGetPolicyRequest() } + + response = NewGetPolicyResponse() + err = c.Send(request, response) + return +} + +// GetPolicy +// 本接口(GetPolicy)可用于查询查看策略详情。 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYIDERROR = "InvalidParameter.PolicyIdError" +// RESOURCENOTFOUND_POLICYIDNOTFOUND = "ResourceNotFound.PolicyIdNotFound" +func (c *Client) GetPolicyWithContext(ctx context.Context, request *GetPolicyRequest) (response *GetPolicyResponse, err error) { + if request == nil { + request = NewGetPolicyRequest() + } + request.SetContext(ctx) + response = NewGetPolicyResponse() err = c.Send(request, response) return @@ -1150,6 +2147,8 @@ func NewGetPolicyVersionRequest() (request *GetPolicyVersionRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "GetPolicyVersion") + + return } @@ -1173,17 +2172,40 @@ func (c *Client) GetPolicyVersion(request *GetPolicyVersionRequest) (response *G if request == nil { request = NewGetPolicyVersionRequest() } + response = NewGetPolicyVersionResponse() err = c.Send(request, response) return } -func NewGetRoleRequest() (request *GetRoleRequest) { - request = &GetRoleRequest{ - BaseRequest: &tchttp.BaseRequest{}, +// GetPolicyVersion +// 该接口(GetPolicyVersion)用于查询策略版本详情 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYIDERROR = "InvalidParameter.PolicyIdError" +// INVALIDPARAMETER_POLICYVERSIONNOTEXISTS = "InvalidParameter.PolicyVersionNotExists" +// RESOURCENOTFOUND_POLICYIDNOTFOUND = "ResourceNotFound.PolicyIdNotFound" +func (c *Client) GetPolicyVersionWithContext(ctx context.Context, request *GetPolicyVersionRequest) (response *GetPolicyVersionResponse, err error) { + if request == nil { + request = NewGetPolicyVersionRequest() } - request.Init().WithApiInfo("cam", APIVersion, "GetRole") - return + request.SetContext(ctx) + + response = NewGetPolicyVersionResponse() + err = c.Send(request, response) + return +} + +func NewGetRoleRequest() (request *GetRoleRequest) { + request = &GetRoleRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("cam", APIVersion, "GetRole") + + + return } func NewGetRoleResponse() (response *GetRoleResponse) { @@ -1204,16 +2226,91 @@ func (c *Client) GetRole(request *GetRoleRequest) (response *GetRoleResponse, er if request == nil { request = NewGetRoleRequest() } + response = NewGetRoleResponse() err = c.Send(request, response) return } +// GetRole +// 本接口(GetRole)用于获取指定角色的详细信息。 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_ROLENOTEXIST = "InvalidParameter.RoleNotExist" +func (c *Client) GetRoleWithContext(ctx context.Context, request *GetRoleRequest) (response *GetRoleResponse, err error) { + if request == nil { + request = NewGetRoleRequest() + } + request.SetContext(ctx) + + response = NewGetRoleResponse() + err = c.Send(request, response) + return +} + +func NewGetRolePermissionBoundaryRequest() (request *GetRolePermissionBoundaryRequest) { + request = &GetRolePermissionBoundaryRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("cam", APIVersion, "GetRolePermissionBoundary") + + + return +} + +func NewGetRolePermissionBoundaryResponse() (response *GetRolePermissionBoundaryResponse) { + response = &GetRolePermissionBoundaryResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// GetRolePermissionBoundary +// 获取角色权限边界 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYIDNOTEXIST = "InvalidParameter.PolicyIdNotExist" +// RESOURCENOTFOUND_POLICYIDNOTFOUND = "ResourceNotFound.PolicyIdNotFound" +func (c *Client) GetRolePermissionBoundary(request *GetRolePermissionBoundaryRequest) (response *GetRolePermissionBoundaryResponse, err error) { + if request == nil { + request = NewGetRolePermissionBoundaryRequest() + } + + response = NewGetRolePermissionBoundaryResponse() + err = c.Send(request, response) + return +} + +// GetRolePermissionBoundary +// 获取角色权限边界 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYIDNOTEXIST = "InvalidParameter.PolicyIdNotExist" +// RESOURCENOTFOUND_POLICYIDNOTFOUND = "ResourceNotFound.PolicyIdNotFound" +func (c *Client) GetRolePermissionBoundaryWithContext(ctx context.Context, request *GetRolePermissionBoundaryRequest) (response *GetRolePermissionBoundaryResponse, err error) { + if request == nil { + request = NewGetRolePermissionBoundaryRequest() + } + request.SetContext(ctx) + + response = NewGetRolePermissionBoundaryResponse() + err = c.Send(request, response) + return +} + func NewGetSAMLProviderRequest() (request *GetSAMLProviderRequest) { request = &GetSAMLProviderRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "GetSAMLProvider") + + return } @@ -1234,16 +2331,86 @@ func (c *Client) GetSAMLProvider(request *GetSAMLProviderRequest) (response *Get if request == nil { request = NewGetSAMLProviderRequest() } + + response = NewGetSAMLProviderResponse() + err = c.Send(request, response) + return +} + +// GetSAMLProvider +// 查询SAML身份提供商详情 +// +// 可能返回的错误码: +// RESOURCENOTFOUND_IDENTITYNOTEXIST = "ResourceNotFound.IdentityNotExist" +// RESOURCENOTFOUND_NOTFOUND = "ResourceNotFound.NotFound" +func (c *Client) GetSAMLProviderWithContext(ctx context.Context, request *GetSAMLProviderRequest) (response *GetSAMLProviderResponse, err error) { + if request == nil { + request = NewGetSAMLProviderRequest() + } + request.SetContext(ctx) + response = NewGetSAMLProviderResponse() err = c.Send(request, response) return } +func NewGetSecurityLastUsedRequest() (request *GetSecurityLastUsedRequest) { + request = &GetSecurityLastUsedRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("cam", APIVersion, "GetSecurityLastUsed") + + + return +} + +func NewGetSecurityLastUsedResponse() (response *GetSecurityLastUsedResponse) { + response = &GetSecurityLastUsedResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// GetSecurityLastUsed +// 获取密钥最近使用情况 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +func (c *Client) GetSecurityLastUsed(request *GetSecurityLastUsedRequest) (response *GetSecurityLastUsedResponse, err error) { + if request == nil { + request = NewGetSecurityLastUsedRequest() + } + + response = NewGetSecurityLastUsedResponse() + err = c.Send(request, response) + return +} + +// GetSecurityLastUsed +// 获取密钥最近使用情况 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +func (c *Client) GetSecurityLastUsedWithContext(ctx context.Context, request *GetSecurityLastUsedRequest) (response *GetSecurityLastUsedResponse, err error) { + if request == nil { + request = NewGetSecurityLastUsedRequest() + } + request.SetContext(ctx) + + response = NewGetSecurityLastUsedResponse() + err = c.Send(request, response) + return +} + func NewGetServiceLinkedRoleDeletionStatusRequest() (request *GetServiceLinkedRoleDeletionStatusRequest) { request = &GetServiceLinkedRoleDeletionStatusRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "GetServiceLinkedRoleDeletionStatus") + + return } @@ -1265,6 +2432,25 @@ func (c *Client) GetServiceLinkedRoleDeletionStatus(request *GetServiceLinkedRol if request == nil { request = NewGetServiceLinkedRoleDeletionStatusRequest() } + + response = NewGetServiceLinkedRoleDeletionStatusResponse() + err = c.Send(request, response) + return +} + +// GetServiceLinkedRoleDeletionStatus +// 根据删除TaskId获取服务相关角色删除状态 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_DELETIONTASKNOTEXIST = "InvalidParameter.DeletionTaskNotExist" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +func (c *Client) GetServiceLinkedRoleDeletionStatusWithContext(ctx context.Context, request *GetServiceLinkedRoleDeletionStatusRequest) (response *GetServiceLinkedRoleDeletionStatusResponse, err error) { + if request == nil { + request = NewGetServiceLinkedRoleDeletionStatusRequest() + } + request.SetContext(ctx) + response = NewGetServiceLinkedRoleDeletionStatusResponse() err = c.Send(request, response) return @@ -1275,6 +2461,8 @@ func NewGetUserRequest() (request *GetUserRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "GetUser") + + return } @@ -1289,21 +2477,146 @@ func NewGetUserResponse() (response *GetUserResponse) { // 查询子用户 // // 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" // RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" func (c *Client) GetUser(request *GetUserRequest) (response *GetUserResponse, err error) { if request == nil { request = NewGetUserRequest() } + response = NewGetUserResponse() err = c.Send(request, response) return } +// GetUser +// 查询子用户 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +func (c *Client) GetUserWithContext(ctx context.Context, request *GetUserRequest) (response *GetUserResponse, err error) { + if request == nil { + request = NewGetUserRequest() + } + request.SetContext(ctx) + + response = NewGetUserResponse() + err = c.Send(request, response) + return +} + +func NewGetUserAppIdRequest() (request *GetUserAppIdRequest) { + request = &GetUserAppIdRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("cam", APIVersion, "GetUserAppId") + + + return +} + +func NewGetUserAppIdResponse() (response *GetUserAppIdResponse) { + response = &GetUserAppIdResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// GetUserAppId +// 获取用户AppId +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +func (c *Client) GetUserAppId(request *GetUserAppIdRequest) (response *GetUserAppIdResponse, err error) { + if request == nil { + request = NewGetUserAppIdRequest() + } + + response = NewGetUserAppIdResponse() + err = c.Send(request, response) + return +} + +// GetUserAppId +// 获取用户AppId +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +func (c *Client) GetUserAppIdWithContext(ctx context.Context, request *GetUserAppIdRequest) (response *GetUserAppIdResponse, err error) { + if request == nil { + request = NewGetUserAppIdRequest() + } + request.SetContext(ctx) + + response = NewGetUserAppIdResponse() + err = c.Send(request, response) + return +} + +func NewGetUserPermissionBoundaryRequest() (request *GetUserPermissionBoundaryRequest) { + request = &GetUserPermissionBoundaryRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("cam", APIVersion, "GetUserPermissionBoundary") + + + return +} + +func NewGetUserPermissionBoundaryResponse() (response *GetUserPermissionBoundaryResponse) { + response = &GetUserPermissionBoundaryResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// GetUserPermissionBoundary +// 获取用户权限边界 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYIDNOTEXIST = "InvalidParameter.PolicyIdNotExist" +// RESOURCENOTFOUND_POLICYIDNOTFOUND = "ResourceNotFound.PolicyIdNotFound" +func (c *Client) GetUserPermissionBoundary(request *GetUserPermissionBoundaryRequest) (response *GetUserPermissionBoundaryResponse, err error) { + if request == nil { + request = NewGetUserPermissionBoundaryRequest() + } + + response = NewGetUserPermissionBoundaryResponse() + err = c.Send(request, response) + return +} + +// GetUserPermissionBoundary +// 获取用户权限边界 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYIDNOTEXIST = "InvalidParameter.PolicyIdNotExist" +// RESOURCENOTFOUND_POLICYIDNOTFOUND = "ResourceNotFound.PolicyIdNotFound" +func (c *Client) GetUserPermissionBoundaryWithContext(ctx context.Context, request *GetUserPermissionBoundaryRequest) (response *GetUserPermissionBoundaryResponse, err error) { + if request == nil { + request = NewGetUserPermissionBoundaryRequest() + } + request.SetContext(ctx) + + response = NewGetUserPermissionBoundaryResponse() + err = c.Send(request, response) + return +} + func NewListAccessKeysRequest() (request *ListAccessKeysRequest) { request = &ListAccessKeysRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "ListAccessKeys") + + return } @@ -1318,6 +2631,7 @@ func NewListAccessKeysResponse() (response *ListAccessKeysResponse) { // 列出指定CAM用户的访问密钥 // // 可能返回的错误码: +// AUTHFAILURE_UNAUTHORIZEDOPERATION = "AuthFailure.UnauthorizedOperation" // FAILEDOPERATION_ACCESSKEY = "FailedOperation.Accesskey" // INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" // INVALIDPARAMETER_USERNOTEXIST = "InvalidParameter.UserNotExist" @@ -1328,6 +2642,29 @@ func (c *Client) ListAccessKeys(request *ListAccessKeysRequest) (response *ListA if request == nil { request = NewListAccessKeysRequest() } + + response = NewListAccessKeysResponse() + err = c.Send(request, response) + return +} + +// ListAccessKeys +// 列出指定CAM用户的访问密钥 +// +// 可能返回的错误码: +// AUTHFAILURE_UNAUTHORIZEDOPERATION = "AuthFailure.UnauthorizedOperation" +// FAILEDOPERATION_ACCESSKEY = "FailedOperation.Accesskey" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_USERNOTEXIST = "InvalidParameter.UserNotExist" +// OPERATIONDENIED_ACCESSKEYOVERLIMIT = "OperationDenied.AccessKeyOverLimit" +// OPERATIONDENIED_SUBUIN = "OperationDenied.SubUin" +// OPERATIONDENIED_UINNOTMATCH = "OperationDenied.UinNotMatch" +func (c *Client) ListAccessKeysWithContext(ctx context.Context, request *ListAccessKeysRequest) (response *ListAccessKeysResponse, err error) { + if request == nil { + request = NewListAccessKeysRequest() + } + request.SetContext(ctx) + response = NewListAccessKeysResponse() err = c.Send(request, response) return @@ -1338,6 +2675,8 @@ func NewListAttachedGroupPoliciesRequest() (request *ListAttachedGroupPoliciesRe BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "ListAttachedGroupPolicies") + + return } @@ -1358,6 +2697,24 @@ func (c *Client) ListAttachedGroupPolicies(request *ListAttachedGroupPoliciesReq if request == nil { request = NewListAttachedGroupPoliciesRequest() } + + response = NewListAttachedGroupPoliciesResponse() + err = c.Send(request, response) + return +} + +// ListAttachedGroupPolicies +// 本接口(ListAttachedGroupPolicies)可用于查询用户组关联的策略列表。 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +func (c *Client) ListAttachedGroupPoliciesWithContext(ctx context.Context, request *ListAttachedGroupPoliciesRequest) (response *ListAttachedGroupPoliciesResponse, err error) { + if request == nil { + request = NewListAttachedGroupPoliciesRequest() + } + request.SetContext(ctx) + response = NewListAttachedGroupPoliciesResponse() err = c.Send(request, response) return @@ -1368,6 +2725,8 @@ func NewListAttachedRolePoliciesRequest() (request *ListAttachedRolePoliciesRequ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "ListAttachedRolePolicies") + + return } @@ -1388,16 +2747,88 @@ func (c *Client) ListAttachedRolePolicies(request *ListAttachedRolePoliciesReque if request == nil { request = NewListAttachedRolePoliciesRequest() } + response = NewListAttachedRolePoliciesResponse() err = c.Send(request, response) return } +// ListAttachedRolePolicies +// 本接口(ListAttachedRolePolicies)用于获取角色绑定的策略列表。 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +func (c *Client) ListAttachedRolePoliciesWithContext(ctx context.Context, request *ListAttachedRolePoliciesRequest) (response *ListAttachedRolePoliciesResponse, err error) { + if request == nil { + request = NewListAttachedRolePoliciesRequest() + } + request.SetContext(ctx) + + response = NewListAttachedRolePoliciesResponse() + err = c.Send(request, response) + return +} + +func NewListAttachedUserAllPoliciesRequest() (request *ListAttachedUserAllPoliciesRequest) { + request = &ListAttachedUserAllPoliciesRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("cam", APIVersion, "ListAttachedUserAllPolicies") + + + return +} + +func NewListAttachedUserAllPoliciesResponse() (response *ListAttachedUserAllPoliciesResponse) { + response = &ListAttachedUserAllPoliciesResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// ListAttachedUserAllPolicies +// 列出用户关联的策略(包括随组关联) +// +// 可能返回的错误码: +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +func (c *Client) ListAttachedUserAllPolicies(request *ListAttachedUserAllPoliciesRequest) (response *ListAttachedUserAllPoliciesResponse, err error) { + if request == nil { + request = NewListAttachedUserAllPoliciesRequest() + } + + response = NewListAttachedUserAllPoliciesResponse() + err = c.Send(request, response) + return +} + +// ListAttachedUserAllPolicies +// 列出用户关联的策略(包括随组关联) +// +// 可能返回的错误码: +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +func (c *Client) ListAttachedUserAllPoliciesWithContext(ctx context.Context, request *ListAttachedUserAllPoliciesRequest) (response *ListAttachedUserAllPoliciesResponse, err error) { + if request == nil { + request = NewListAttachedUserAllPoliciesRequest() + } + request.SetContext(ctx) + + response = NewListAttachedUserAllPoliciesResponse() + err = c.Send(request, response) + return +} + func NewListAttachedUserPoliciesRequest() (request *ListAttachedUserPoliciesRequest) { request = &ListAttachedUserPoliciesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "ListAttachedUserPolicies") + + return } @@ -1418,6 +2849,24 @@ func (c *Client) ListAttachedUserPolicies(request *ListAttachedUserPoliciesReque if request == nil { request = NewListAttachedUserPoliciesRequest() } + + response = NewListAttachedUserPoliciesResponse() + err = c.Send(request, response) + return +} + +// ListAttachedUserPolicies +// 本接口(ListAttachedUserPolicies)可用于查询子账号关联的策略列表。 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +func (c *Client) ListAttachedUserPoliciesWithContext(ctx context.Context, request *ListAttachedUserPoliciesRequest) (response *ListAttachedUserPoliciesResponse, err error) { + if request == nil { + request = NewListAttachedUserPoliciesRequest() + } + request.SetContext(ctx) + response = NewListAttachedUserPoliciesResponse() err = c.Send(request, response) return @@ -1428,6 +2877,8 @@ func NewListCollaboratorsRequest() (request *ListCollaboratorsRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "ListCollaborators") + + return } @@ -1447,6 +2898,23 @@ func (c *Client) ListCollaborators(request *ListCollaboratorsRequest) (response if request == nil { request = NewListCollaboratorsRequest() } + + response = NewListCollaboratorsResponse() + err = c.Send(request, response) + return +} + +// ListCollaborators +// 获取协作者列表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +func (c *Client) ListCollaboratorsWithContext(ctx context.Context, request *ListCollaboratorsRequest) (response *ListCollaboratorsResponse, err error) { + if request == nil { + request = NewListCollaboratorsRequest() + } + request.SetContext(ctx) + response = NewListCollaboratorsResponse() err = c.Send(request, response) return @@ -1457,6 +2925,8 @@ func NewListEntitiesForPolicyRequest() (request *ListEntitiesForPolicyRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "ListEntitiesForPolicy") + + return } @@ -1479,6 +2949,26 @@ func (c *Client) ListEntitiesForPolicy(request *ListEntitiesForPolicyRequest) (r if request == nil { request = NewListEntitiesForPolicyRequest() } + + response = NewListEntitiesForPolicyResponse() + err = c.Send(request, response) + return +} + +// ListEntitiesForPolicy +// 本接口(ListEntitiesForPolicy)可用于查询策略关联的实体列表。 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_ENTITYFILTERERROR = "InvalidParameter.EntityFilterError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYIDERROR = "InvalidParameter.PolicyIdError" +func (c *Client) ListEntitiesForPolicyWithContext(ctx context.Context, request *ListEntitiesForPolicyRequest) (response *ListEntitiesForPolicyResponse, err error) { + if request == nil { + request = NewListEntitiesForPolicyRequest() + } + request.SetContext(ctx) + response = NewListEntitiesForPolicyResponse() err = c.Send(request, response) return @@ -1489,6 +2979,8 @@ func NewListGroupsRequest() (request *ListGroupsRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "ListGroups") + + return } @@ -1507,10 +2999,30 @@ func NewListGroupsResponse() (response *ListGroupsResponse) { // INVALIDPARAMETER_ENTITYFILTERERROR = "InvalidParameter.EntityFilterError" // INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" // INVALIDPARAMETER_POLICYIDERROR = "InvalidParameter.PolicyIdError" -func (c *Client) ListGroups(request *ListGroupsRequest) (response *ListGroupsResponse, err error) { +func (c *Client) ListGroups(request *ListGroupsRequest) (response *ListGroupsResponse, err error) { + if request == nil { + request = NewListGroupsRequest() + } + + response = NewListGroupsResponse() + err = c.Send(request, response) + return +} + +// ListGroups +// 查询用户组列表 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_ENTITYFILTERERROR = "InvalidParameter.EntityFilterError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYIDERROR = "InvalidParameter.PolicyIdError" +func (c *Client) ListGroupsWithContext(ctx context.Context, request *ListGroupsRequest) (response *ListGroupsResponse, err error) { if request == nil { request = NewListGroupsRequest() } + request.SetContext(ctx) + response = NewListGroupsResponse() err = c.Send(request, response) return @@ -1521,6 +3033,8 @@ func NewListGroupsForUserRequest() (request *ListGroupsForUserRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "ListGroupsForUser") + + return } @@ -1540,6 +3054,23 @@ func (c *Client) ListGroupsForUser(request *ListGroupsForUserRequest) (response if request == nil { request = NewListGroupsForUserRequest() } + + response = NewListGroupsForUserResponse() + err = c.Send(request, response) + return +} + +// ListGroupsForUser +// 列出用户关联的用户组 +// +// 可能返回的错误码: +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +func (c *Client) ListGroupsForUserWithContext(ctx context.Context, request *ListGroupsForUserRequest) (response *ListGroupsForUserResponse, err error) { + if request == nil { + request = NewListGroupsForUserRequest() + } + request.SetContext(ctx) + response = NewListGroupsForUserResponse() err = c.Send(request, response) return @@ -1550,6 +3081,8 @@ func NewListPoliciesRequest() (request *ListPoliciesRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "ListPolicies") + + return } @@ -1575,16 +3108,95 @@ func (c *Client) ListPolicies(request *ListPoliciesRequest) (response *ListPolic if request == nil { request = NewListPoliciesRequest() } + + response = NewListPoliciesResponse() + err = c.Send(request, response) + return +} + +// ListPolicies +// 本接口(ListPolicies)可用于查询策略列表。 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_GROUPIDERROR = "InvalidParameter.GroupIdError" +// INVALIDPARAMETER_KEYWORDERROR = "InvalidParameter.KeywordError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_SCOPEERROR = "InvalidParameter.ScopeError" +// INVALIDPARAMETER_SERVICETYPEERROR = "InvalidParameter.ServiceTypeError" +// INVALIDPARAMETER_UINERROR = "InvalidParameter.UinError" +func (c *Client) ListPoliciesWithContext(ctx context.Context, request *ListPoliciesRequest) (response *ListPoliciesResponse, err error) { + if request == nil { + request = NewListPoliciesRequest() + } + request.SetContext(ctx) + response = NewListPoliciesResponse() err = c.Send(request, response) return } +func NewListPoliciesGrantingServiceAccessRequest() (request *ListPoliciesGrantingServiceAccessRequest) { + request = &ListPoliciesGrantingServiceAccessRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("cam", APIVersion, "ListPoliciesGrantingServiceAccess") + + + return +} + +func NewListPoliciesGrantingServiceAccessResponse() (response *ListPoliciesGrantingServiceAccessResponse) { + response = &ListPoliciesGrantingServiceAccessResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// ListPoliciesGrantingServiceAccess +// 获取所有已授权服务 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +func (c *Client) ListPoliciesGrantingServiceAccess(request *ListPoliciesGrantingServiceAccessRequest) (response *ListPoliciesGrantingServiceAccessResponse, err error) { + if request == nil { + request = NewListPoliciesGrantingServiceAccessRequest() + } + + response = NewListPoliciesGrantingServiceAccessResponse() + err = c.Send(request, response) + return +} + +// ListPoliciesGrantingServiceAccess +// 获取所有已授权服务 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +func (c *Client) ListPoliciesGrantingServiceAccessWithContext(ctx context.Context, request *ListPoliciesGrantingServiceAccessRequest) (response *ListPoliciesGrantingServiceAccessResponse, err error) { + if request == nil { + request = NewListPoliciesGrantingServiceAccessRequest() + } + request.SetContext(ctx) + + response = NewListPoliciesGrantingServiceAccessResponse() + err = c.Send(request, response) + return +} + func NewListPolicyVersionsRequest() (request *ListPolicyVersionsRequest) { request = &ListPolicyVersionsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "ListPolicyVersions") + + return } @@ -1607,6 +3219,26 @@ func (c *Client) ListPolicyVersions(request *ListPolicyVersionsRequest) (respons if request == nil { request = NewListPolicyVersionsRequest() } + + response = NewListPolicyVersionsResponse() + err = c.Send(request, response) + return +} + +// ListPolicyVersions +// 该接口(ListPolicyVersions)用于获取策略版本列表 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYIDNOTEXIST = "InvalidParameter.PolicyIdNotExist" +// RESOURCENOTFOUND_POLICYIDNOTFOUND = "ResourceNotFound.PolicyIdNotFound" +func (c *Client) ListPolicyVersionsWithContext(ctx context.Context, request *ListPolicyVersionsRequest) (response *ListPolicyVersionsResponse, err error) { + if request == nil { + request = NewListPolicyVersionsRequest() + } + request.SetContext(ctx) + response = NewListPolicyVersionsResponse() err = c.Send(request, response) return @@ -1617,6 +3249,8 @@ func NewListSAMLProvidersRequest() (request *ListSAMLProvidersRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "ListSAMLProviders") + + return } @@ -1639,6 +3273,26 @@ func (c *Client) ListSAMLProviders(request *ListSAMLProvidersRequest) (response if request == nil { request = NewListSAMLProvidersRequest() } + + response = NewListSAMLProvidersResponse() + err = c.Send(request, response) + return +} + +// ListSAMLProviders +// 查询SAML身份提供商列表 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYIDNOTEXIST = "InvalidParameter.PolicyIdNotExist" +// RESOURCENOTFOUND_POLICYIDNOTFOUND = "ResourceNotFound.PolicyIdNotFound" +func (c *Client) ListSAMLProvidersWithContext(ctx context.Context, request *ListSAMLProvidersRequest) (response *ListSAMLProvidersResponse, err error) { + if request == nil { + request = NewListSAMLProvidersRequest() + } + request.SetContext(ctx) + response = NewListSAMLProvidersResponse() err = c.Send(request, response) return @@ -1649,6 +3303,8 @@ func NewListUsersRequest() (request *ListUsersRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "ListUsers") + + return } @@ -1668,6 +3324,23 @@ func (c *Client) ListUsers(request *ListUsersRequest) (response *ListUsersRespon if request == nil { request = NewListUsersRequest() } + + response = NewListUsersResponse() + err = c.Send(request, response) + return +} + +// ListUsers +// 拉取子用户 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +func (c *Client) ListUsersWithContext(ctx context.Context, request *ListUsersRequest) (response *ListUsersResponse, err error) { + if request == nil { + request = NewListUsersRequest() + } + request.SetContext(ctx) + response = NewListUsersResponse() err = c.Send(request, response) return @@ -1678,6 +3351,8 @@ func NewListUsersForGroupRequest() (request *ListUsersForGroupRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "ListUsersForGroup") + + return } @@ -1697,6 +3372,23 @@ func (c *Client) ListUsersForGroup(request *ListUsersForGroupRequest) (response if request == nil { request = NewListUsersForGroupRequest() } + + response = NewListUsersForGroupResponse() + err = c.Send(request, response) + return +} + +// ListUsersForGroup +// 查询用户组关联的用户列表 +// +// 可能返回的错误码: +// RESOURCENOTFOUND_GROUPNOTEXIST = "ResourceNotFound.GroupNotExist" +func (c *Client) ListUsersForGroupWithContext(ctx context.Context, request *ListUsersForGroupRequest) (response *ListUsersForGroupResponse, err error) { + if request == nil { + request = NewListUsersForGroupRequest() + } + request.SetContext(ctx) + response = NewListUsersForGroupResponse() err = c.Send(request, response) return @@ -1707,6 +3399,8 @@ func NewListWeChatWorkSubAccountsRequest() (request *ListWeChatWorkSubAccountsRe BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "ListWeChatWorkSubAccounts") + + return } @@ -1726,6 +3420,23 @@ func (c *Client) ListWeChatWorkSubAccounts(request *ListWeChatWorkSubAccountsReq if request == nil { request = NewListWeChatWorkSubAccountsRequest() } + + response = NewListWeChatWorkSubAccountsResponse() + err = c.Send(request, response) + return +} + +// ListWeChatWorkSubAccounts +// 获取企业微信子用户列表 +// +// 可能返回的错误码: +// RESOURCENOTFOUND_GROUPNOTEXIST = "ResourceNotFound.GroupNotExist" +func (c *Client) ListWeChatWorkSubAccountsWithContext(ctx context.Context, request *ListWeChatWorkSubAccountsRequest) (response *ListWeChatWorkSubAccountsResponse, err error) { + if request == nil { + request = NewListWeChatWorkSubAccountsRequest() + } + request.SetContext(ctx) + response = NewListWeChatWorkSubAccountsResponse() err = c.Send(request, response) return @@ -1736,6 +3447,8 @@ func NewPutRolePermissionsBoundaryRequest() (request *PutRolePermissionsBoundary BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "PutRolePermissionsBoundary") + + return } @@ -1763,6 +3476,31 @@ func (c *Client) PutRolePermissionsBoundary(request *PutRolePermissionsBoundaryR if request == nil { request = NewPutRolePermissionsBoundaryRequest() } + + response = NewPutRolePermissionsBoundaryResponse() + err = c.Send(request, response) + return +} + +// PutRolePermissionsBoundary +// 设置角色权限边界 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_OPERATEENTITIESOVERLIMIT = "InvalidParameter.OperateEntitiesOverLimit" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYIDNOTEXIST = "InvalidParameter.PolicyIdNotExist" +// INVALIDPARAMETER_ROLENOTEXIST = "InvalidParameter.RoleNotExist" +// INVALIDPARAMETER_SERVICELINKEDPOLICYCANTINPERMISSIONBOUNDARY = "InvalidParameter.ServiceLinkedPolicyCantInPermissionBoundary" +// INVALIDPARAMETER_SERVICELINKEDROLECANTUSEPERMISSIONBOUNDARY = "InvalidParameter.ServiceLinkedRoleCantUsePermissionBoundary" +// INVALIDPARAMETER_USERNOTEXIST = "InvalidParameter.UserNotExist" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +func (c *Client) PutRolePermissionsBoundaryWithContext(ctx context.Context, request *PutRolePermissionsBoundaryRequest) (response *PutRolePermissionsBoundaryResponse, err error) { + if request == nil { + request = NewPutRolePermissionsBoundaryRequest() + } + request.SetContext(ctx) + response = NewPutRolePermissionsBoundaryResponse() err = c.Send(request, response) return @@ -1773,6 +3511,8 @@ func NewPutUserPermissionsBoundaryRequest() (request *PutUserPermissionsBoundary BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "PutUserPermissionsBoundary") + + return } @@ -1799,6 +3539,30 @@ func (c *Client) PutUserPermissionsBoundary(request *PutUserPermissionsBoundaryR if request == nil { request = NewPutUserPermissionsBoundaryRequest() } + + response = NewPutUserPermissionsBoundaryResponse() + err = c.Send(request, response) + return +} + +// PutUserPermissionsBoundary +// 设置用户权限边界 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_OPERATEENTITIESOVERLIMIT = "InvalidParameter.OperateEntitiesOverLimit" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYIDNOTEXIST = "InvalidParameter.PolicyIdNotExist" +// INVALIDPARAMETER_ROLENOTEXIST = "InvalidParameter.RoleNotExist" +// INVALIDPARAMETER_SERVICELINKEDPOLICYCANTINPERMISSIONBOUNDARY = "InvalidParameter.ServiceLinkedPolicyCantInPermissionBoundary" +// INVALIDPARAMETER_USERNOTEXIST = "InvalidParameter.UserNotExist" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +func (c *Client) PutUserPermissionsBoundaryWithContext(ctx context.Context, request *PutUserPermissionsBoundaryRequest) (response *PutUserPermissionsBoundaryResponse, err error) { + if request == nil { + request = NewPutUserPermissionsBoundaryRequest() + } + request.SetContext(ctx) + response = NewPutUserPermissionsBoundaryResponse() err = c.Send(request, response) return @@ -1809,6 +3573,8 @@ func NewRemoveUserFromGroupRequest() (request *RemoveUserFromGroupRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "RemoveUserFromGroup") + + return } @@ -1823,31 +3589,105 @@ func NewRemoveUserFromGroupResponse() (response *RemoveUserFromGroupResponse) { // 从用户组删除用户 // // 可能返回的错误码: +// INVALIDPARAMETER_USERUINANDUINNOTALLNULL = "InvalidParameter.UserUinAndUinNotAllNull" +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +func (c *Client) RemoveUserFromGroup(request *RemoveUserFromGroupRequest) (response *RemoveUserFromGroupResponse, err error) { + if request == nil { + request = NewRemoveUserFromGroupRequest() + } + + response = NewRemoveUserFromGroupResponse() + err = c.Send(request, response) + return +} + +// RemoveUserFromGroup +// 从用户组删除用户 +// +// 可能返回的错误码: +// INVALIDPARAMETER_USERUINANDUINNOTALLNULL = "InvalidParameter.UserUinAndUinNotAllNull" +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +func (c *Client) RemoveUserFromGroupWithContext(ctx context.Context, request *RemoveUserFromGroupRequest) (response *RemoveUserFromGroupResponse, err error) { + if request == nil { + request = NewRemoveUserFromGroupRequest() + } + request.SetContext(ctx) + + response = NewRemoveUserFromGroupResponse() + err = c.Send(request, response) + return +} + +func NewSetDefaultPolicyVersionRequest() (request *SetDefaultPolicyVersionRequest) { + request = &SetDefaultPolicyVersionRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("cam", APIVersion, "SetDefaultPolicyVersion") + + + return +} + +func NewSetDefaultPolicyVersionResponse() (response *SetDefaultPolicyVersionResponse) { + response = &SetDefaultPolicyVersionResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// SetDefaultPolicyVersion +// 本接口(SetDefaultPolicyVersion)可用于设置生效的策略版本。 +// +// 可能返回的错误码: +// FAILEDOPERATION_POLICYNAMEINUSE = "FailedOperation.PolicyNameInUse" +// FAILEDOPERATION_POLICYVERSIONALREADYDEFAULT = "FailedOperation.PolicyVersionAlreadyDefault" +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_ACTIONERROR = "InvalidParameter.ActionError" +// INVALIDPARAMETER_ACTIONMISS = "InvalidParameter.ActionMiss" +// INVALIDPARAMETER_ACTIONNOTEXIST = "InvalidParameter.ActionNotExist" +// INVALIDPARAMETER_ACTIONSERVICENOTEXIST = "InvalidParameter.ActionServiceNotExist" +// INVALIDPARAMETER_ATTACHMENTFULL = "InvalidParameter.AttachmentFull" +// INVALIDPARAMETER_CONDITIONCONTENTERROR = "InvalidParameter.ConditionContentError" +// INVALIDPARAMETER_CONDITIONERROR = "InvalidParameter.ConditionError" +// INVALIDPARAMETER_CONDITIONTYPEERROR = "InvalidParameter.ConditionTypeError" +// INVALIDPARAMETER_DESCRIPTIONLENGTHOVERLIMIT = "InvalidParameter.DescriptionLengthOverlimit" +// INVALIDPARAMETER_EFFECTERROR = "InvalidParameter.EffectError" +// INVALIDPARAMETER_NOTSUPPORTPRODUCT = "InvalidParameter.NotSupportProduct" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYDOCUMENTERROR = "InvalidParameter.PolicyDocumentError" +// INVALIDPARAMETER_POLICYDOCUMENTLENGTHOVERLIMIT = "InvalidParameter.PolicyDocumentLengthOverLimit" +// INVALIDPARAMETER_POLICYIDERROR = "InvalidParameter.PolicyIdError" +// INVALIDPARAMETER_POLICYIDNOTEXIST = "InvalidParameter.PolicyIdNotExist" +// INVALIDPARAMETER_POLICYNAMEERROR = "InvalidParameter.PolicyNameError" +// INVALIDPARAMETER_POLICYVERSIONNOTEXISTS = "InvalidParameter.PolicyVersionNotExists" +// INVALIDPARAMETER_PRINCIPALERROR = "InvalidParameter.PrincipalError" +// INVALIDPARAMETER_PRINCIPALQCSERROR = "InvalidParameter.PrincipalQcsError" +// INVALIDPARAMETER_PRINCIPALQCSNOTEXIST = "InvalidParameter.PrincipalQcsNotExist" +// INVALIDPARAMETER_PRINCIPALSERVICENOTEXIST = "InvalidParameter.PrincipalServiceNotExist" +// INVALIDPARAMETER_RESOURCECONTENTERROR = "InvalidParameter.ResourceContentError" +// INVALIDPARAMETER_RESOURCEERROR = "InvalidParameter.ResourceError" +// INVALIDPARAMETER_RESOURCEPROJECTERROR = "InvalidParameter.ResourceProjectError" +// INVALIDPARAMETER_RESOURCEQCSERROR = "InvalidParameter.ResourceQcsError" +// INVALIDPARAMETER_RESOURCEREGIONERROR = "InvalidParameter.ResourceRegionError" +// INVALIDPARAMETER_RESOURCESERVICENOTEXIST = "InvalidParameter.ResourceServiceNotExist" +// INVALIDPARAMETER_RESOURCEUINERROR = "InvalidParameter.ResourceUinError" +// INVALIDPARAMETER_STATEMENTERROR = "InvalidParameter.StatementError" +// INVALIDPARAMETER_USERNOTEXIST = "InvalidParameter.UserNotExist" +// INVALIDPARAMETER_VERSIONERROR = "InvalidParameter.VersionError" +// RESOURCENOTFOUND_GROUPNOTEXIST = "ResourceNotFound.GroupNotExist" +// RESOURCENOTFOUND_NOTFOUND = "ResourceNotFound.NotFound" +// RESOURCENOTFOUND_POLICYIDNOTFOUND = "ResourceNotFound.PolicyIdNotFound" // RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" -func (c *Client) RemoveUserFromGroup(request *RemoveUserFromGroupRequest) (response *RemoveUserFromGroupResponse, err error) { +func (c *Client) SetDefaultPolicyVersion(request *SetDefaultPolicyVersionRequest) (response *SetDefaultPolicyVersionResponse, err error) { if request == nil { - request = NewRemoveUserFromGroupRequest() + request = NewSetDefaultPolicyVersionRequest() } - response = NewRemoveUserFromGroupResponse() + + response = NewSetDefaultPolicyVersionResponse() err = c.Send(request, response) return } -func NewSetDefaultPolicyVersionRequest() (request *SetDefaultPolicyVersionRequest) { - request = &SetDefaultPolicyVersionRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - request.Init().WithApiInfo("cam", APIVersion, "SetDefaultPolicyVersion") - return -} - -func NewSetDefaultPolicyVersionResponse() (response *SetDefaultPolicyVersionResponse) { - response = &SetDefaultPolicyVersionResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - // SetDefaultPolicyVersion // 本接口(SetDefaultPolicyVersion)可用于设置生效的策略版本。 // @@ -1856,10 +3696,13 @@ func NewSetDefaultPolicyVersionResponse() (response *SetDefaultPolicyVersionResp // FAILEDOPERATION_POLICYVERSIONALREADYDEFAULT = "FailedOperation.PolicyVersionAlreadyDefault" // INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" // INVALIDPARAMETER_ACTIONERROR = "InvalidParameter.ActionError" +// INVALIDPARAMETER_ACTIONMISS = "InvalidParameter.ActionMiss" // INVALIDPARAMETER_ACTIONNOTEXIST = "InvalidParameter.ActionNotExist" // INVALIDPARAMETER_ACTIONSERVICENOTEXIST = "InvalidParameter.ActionServiceNotExist" // INVALIDPARAMETER_ATTACHMENTFULL = "InvalidParameter.AttachmentFull" +// INVALIDPARAMETER_CONDITIONCONTENTERROR = "InvalidParameter.ConditionContentError" // INVALIDPARAMETER_CONDITIONERROR = "InvalidParameter.ConditionError" +// INVALIDPARAMETER_CONDITIONTYPEERROR = "InvalidParameter.ConditionTypeError" // INVALIDPARAMETER_DESCRIPTIONLENGTHOVERLIMIT = "InvalidParameter.DescriptionLengthOverlimit" // INVALIDPARAMETER_EFFECTERROR = "InvalidParameter.EffectError" // INVALIDPARAMETER_NOTSUPPORTPRODUCT = "InvalidParameter.NotSupportProduct" @@ -1871,8 +3714,16 @@ func NewSetDefaultPolicyVersionResponse() (response *SetDefaultPolicyVersionResp // INVALIDPARAMETER_POLICYNAMEERROR = "InvalidParameter.PolicyNameError" // INVALIDPARAMETER_POLICYVERSIONNOTEXISTS = "InvalidParameter.PolicyVersionNotExists" // INVALIDPARAMETER_PRINCIPALERROR = "InvalidParameter.PrincipalError" +// INVALIDPARAMETER_PRINCIPALQCSERROR = "InvalidParameter.PrincipalQcsError" +// INVALIDPARAMETER_PRINCIPALQCSNOTEXIST = "InvalidParameter.PrincipalQcsNotExist" +// INVALIDPARAMETER_PRINCIPALSERVICENOTEXIST = "InvalidParameter.PrincipalServiceNotExist" // INVALIDPARAMETER_RESOURCECONTENTERROR = "InvalidParameter.ResourceContentError" // INVALIDPARAMETER_RESOURCEERROR = "InvalidParameter.ResourceError" +// INVALIDPARAMETER_RESOURCEPROJECTERROR = "InvalidParameter.ResourceProjectError" +// INVALIDPARAMETER_RESOURCEQCSERROR = "InvalidParameter.ResourceQcsError" +// INVALIDPARAMETER_RESOURCEREGIONERROR = "InvalidParameter.ResourceRegionError" +// INVALIDPARAMETER_RESOURCESERVICENOTEXIST = "InvalidParameter.ResourceServiceNotExist" +// INVALIDPARAMETER_RESOURCEUINERROR = "InvalidParameter.ResourceUinError" // INVALIDPARAMETER_STATEMENTERROR = "InvalidParameter.StatementError" // INVALIDPARAMETER_USERNOTEXIST = "InvalidParameter.UserNotExist" // INVALIDPARAMETER_VERSIONERROR = "InvalidParameter.VersionError" @@ -1880,10 +3731,12 @@ func NewSetDefaultPolicyVersionResponse() (response *SetDefaultPolicyVersionResp // RESOURCENOTFOUND_NOTFOUND = "ResourceNotFound.NotFound" // RESOURCENOTFOUND_POLICYIDNOTFOUND = "ResourceNotFound.PolicyIdNotFound" // RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" -func (c *Client) SetDefaultPolicyVersion(request *SetDefaultPolicyVersionRequest) (response *SetDefaultPolicyVersionResponse, err error) { +func (c *Client) SetDefaultPolicyVersionWithContext(ctx context.Context, request *SetDefaultPolicyVersionRequest) (response *SetDefaultPolicyVersionResponse, err error) { if request == nil { request = NewSetDefaultPolicyVersionRequest() } + request.SetContext(ctx) + response = NewSetDefaultPolicyVersionResponse() err = c.Send(request, response) return @@ -1894,6 +3747,8 @@ func NewSetMfaFlagRequest() (request *SetMfaFlagRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "SetMfaFlag") + + return } @@ -1918,6 +3773,28 @@ func (c *Client) SetMfaFlag(request *SetMfaFlagRequest) (response *SetMfaFlagRes if request == nil { request = NewSetMfaFlagRequest() } + + response = NewSetMfaFlagResponse() + err = c.Send(request, response) + return +} + +// SetMfaFlag +// 设置子用户的登录保护和敏感操作校验方式 +// +// 可能返回的错误码: +// FAILEDOPERATION_USERNOTBINDPHONE = "FailedOperation.UserNotBindPhone" +// FAILEDOPERATION_USERNOTBINDWECHAT = "FailedOperation.UserNotBindWechat" +// FAILEDOPERATION_USERUNBINDNOPERMISSION = "FailedOperation.UserUnbindNoPermission" +// INVALIDPARAMETER_MFATOKENERROR = "InvalidParameter.MFATokenError" +// INVALIDPARAMETER_USERNOTEXIST = "InvalidParameter.UserNotExist" +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +func (c *Client) SetMfaFlagWithContext(ctx context.Context, request *SetMfaFlagRequest) (response *SetMfaFlagResponse, err error) { + if request == nil { + request = NewSetMfaFlagRequest() + } + request.SetContext(ctx) + response = NewSetMfaFlagResponse() err = c.Send(request, response) return @@ -1928,6 +3805,8 @@ func NewUpdateAssumeRolePolicyRequest() (request *UpdateAssumeRolePolicyRequest) BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "UpdateAssumeRolePolicy") + + return } @@ -1951,6 +3830,7 @@ func NewUpdateAssumeRolePolicyResponse() (response *UpdateAssumeRolePolicyRespon // INVALIDPARAMETER_CONDITIONTYPEERROR = "InvalidParameter.ConditionTypeError" // INVALIDPARAMETER_EFFECTERROR = "InvalidParameter.EffectError" // INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYDOCUMENTLENGTHOVERLIMIT = "InvalidParameter.PolicyDocumentLengthOverLimit" // INVALIDPARAMETER_PRINCIPALERROR = "InvalidParameter.PrincipalError" // INVALIDPARAMETER_PRINCIPALQCSCROSSERROR = "InvalidParameter.PrincipalQcsCrossError" // INVALIDPARAMETER_PRINCIPALQCSERROR = "InvalidParameter.PrincipalQcsError" @@ -1964,6 +3844,41 @@ func (c *Client) UpdateAssumeRolePolicy(request *UpdateAssumeRolePolicyRequest) if request == nil { request = NewUpdateAssumeRolePolicyRequest() } + + response = NewUpdateAssumeRolePolicyResponse() + err = c.Send(request, response) + return +} + +// UpdateAssumeRolePolicy +// 本接口(UpdateAssumeRolePolicy)用于修改角色信任策略的策略文档。 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_ACTIONERROR = "InvalidParameter.ActionError" +// INVALIDPARAMETER_ACTIONMISS = "InvalidParameter.ActionMiss" +// INVALIDPARAMETER_ATTACHMENTFULL = "InvalidParameter.AttachmentFull" +// INVALIDPARAMETER_CONDITIONCONTENTERROR = "InvalidParameter.ConditionContentError" +// INVALIDPARAMETER_CONDITIONERROR = "InvalidParameter.ConditionError" +// INVALIDPARAMETER_CONDITIONTYPEERROR = "InvalidParameter.ConditionTypeError" +// INVALIDPARAMETER_EFFECTERROR = "InvalidParameter.EffectError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYDOCUMENTLENGTHOVERLIMIT = "InvalidParameter.PolicyDocumentLengthOverLimit" +// INVALIDPARAMETER_PRINCIPALERROR = "InvalidParameter.PrincipalError" +// INVALIDPARAMETER_PRINCIPALQCSCROSSERROR = "InvalidParameter.PrincipalQcsCrossError" +// INVALIDPARAMETER_PRINCIPALQCSERROR = "InvalidParameter.PrincipalQcsError" +// INVALIDPARAMETER_PRINCIPALQCSNOTEXIST = "InvalidParameter.PrincipalQcsNotExist" +// INVALIDPARAMETER_PRINCIPALSERVICENOTEXIST = "InvalidParameter.PrincipalServiceNotExist" +// INVALIDPARAMETER_ROLENOTEXIST = "InvalidParameter.RoleNotExist" +// INVALIDPARAMETER_STATEMENTERROR = "InvalidParameter.StatementError" +// INVALIDPARAMETER_USERNOTEXIST = "InvalidParameter.UserNotExist" +// INVALIDPARAMETER_VERSIONERROR = "InvalidParameter.VersionError" +func (c *Client) UpdateAssumeRolePolicyWithContext(ctx context.Context, request *UpdateAssumeRolePolicyRequest) (response *UpdateAssumeRolePolicyResponse, err error) { + if request == nil { + request = NewUpdateAssumeRolePolicyRequest() + } + request.SetContext(ctx) + response = NewUpdateAssumeRolePolicyResponse() err = c.Send(request, response) return @@ -1974,6 +3889,8 @@ func NewUpdateGroupRequest() (request *UpdateGroupRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "UpdateGroup") + + return } @@ -1996,6 +3913,26 @@ func (c *Client) UpdateGroup(request *UpdateGroupRequest) (response *UpdateGroup if request == nil { request = NewUpdateGroupRequest() } + + response = NewUpdateGroupResponse() + err = c.Send(request, response) + return +} + +// UpdateGroup +// 更新用户组 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER_GROUPNAMEINUSE = "InvalidParameter.GroupNameInUse" +// INVALIDPARAMETER_GROUPNOTEXIST = "InvalidParameter.GroupNotExist" +// RESOURCENOTFOUND_GROUPNOTEXIST = "ResourceNotFound.GroupNotExist" +func (c *Client) UpdateGroupWithContext(ctx context.Context, request *UpdateGroupRequest) (response *UpdateGroupResponse, err error) { + if request == nil { + request = NewUpdateGroupRequest() + } + request.SetContext(ctx) + response = NewUpdateGroupResponse() err = c.Send(request, response) return @@ -2006,6 +3943,8 @@ func NewUpdatePolicyRequest() (request *UpdatePolicyRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "UpdatePolicy") + + return } @@ -2042,6 +3981,9 @@ func NewUpdatePolicyResponse() (response *UpdatePolicyResponse) { // INVALIDPARAMETER_POLICYIDNOTEXIST = "InvalidParameter.PolicyIdNotExist" // INVALIDPARAMETER_POLICYNAMEERROR = "InvalidParameter.PolicyNameError" // INVALIDPARAMETER_PRINCIPALERROR = "InvalidParameter.PrincipalError" +// INVALIDPARAMETER_PRINCIPALQCSERROR = "InvalidParameter.PrincipalQcsError" +// INVALIDPARAMETER_PRINCIPALQCSNOTEXIST = "InvalidParameter.PrincipalQcsNotExist" +// INVALIDPARAMETER_PRINCIPALSERVICENOTEXIST = "InvalidParameter.PrincipalServiceNotExist" // INVALIDPARAMETER_RESOURCECONTENTERROR = "InvalidParameter.ResourceContentError" // INVALIDPARAMETER_RESOURCEERROR = "InvalidParameter.ResourceError" // INVALIDPARAMETER_RESOURCEPROJECTERROR = "InvalidParameter.ResourceProjectError" @@ -2060,6 +4002,61 @@ func (c *Client) UpdatePolicy(request *UpdatePolicyRequest) (response *UpdatePol if request == nil { request = NewUpdatePolicyRequest() } + + response = NewUpdatePolicyResponse() + err = c.Send(request, response) + return +} + +// UpdatePolicy +// 本接口(UpdatePolicy )可用于更新策略。 +// +// 如果已存在策略版本,本接口会直接更新策略的默认版本,不会创建新版本,如果不存在任何策略版本,则直接创建一个默认版本。 +// +// 可能返回的错误码: +// FAILEDOPERATION_POLICYNAMEINUSE = "FailedOperation.PolicyNameInUse" +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_ACTIONERROR = "InvalidParameter.ActionError" +// INVALIDPARAMETER_ACTIONMISS = "InvalidParameter.ActionMiss" +// INVALIDPARAMETER_ACTIONNOTEXIST = "InvalidParameter.ActionNotExist" +// INVALIDPARAMETER_ACTIONSERVICENOTEXIST = "InvalidParameter.ActionServiceNotExist" +// INVALIDPARAMETER_ATTACHMENTFULL = "InvalidParameter.AttachmentFull" +// INVALIDPARAMETER_CONDITIONCONTENTERROR = "InvalidParameter.ConditionContentError" +// INVALIDPARAMETER_CONDITIONERROR = "InvalidParameter.ConditionError" +// INVALIDPARAMETER_CONDITIONTYPEERROR = "InvalidParameter.ConditionTypeError" +// INVALIDPARAMETER_DESCRIPTIONLENGTHOVERLIMIT = "InvalidParameter.DescriptionLengthOverlimit" +// INVALIDPARAMETER_EFFECTERROR = "InvalidParameter.EffectError" +// INVALIDPARAMETER_NOTSUPPORTPRODUCT = "InvalidParameter.NotSupportProduct" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_POLICYDOCUMENTERROR = "InvalidParameter.PolicyDocumentError" +// INVALIDPARAMETER_POLICYDOCUMENTLENGTHOVERLIMIT = "InvalidParameter.PolicyDocumentLengthOverLimit" +// INVALIDPARAMETER_POLICYIDERROR = "InvalidParameter.PolicyIdError" +// INVALIDPARAMETER_POLICYIDNOTEXIST = "InvalidParameter.PolicyIdNotExist" +// INVALIDPARAMETER_POLICYNAMEERROR = "InvalidParameter.PolicyNameError" +// INVALIDPARAMETER_PRINCIPALERROR = "InvalidParameter.PrincipalError" +// INVALIDPARAMETER_PRINCIPALQCSERROR = "InvalidParameter.PrincipalQcsError" +// INVALIDPARAMETER_PRINCIPALQCSNOTEXIST = "InvalidParameter.PrincipalQcsNotExist" +// INVALIDPARAMETER_PRINCIPALSERVICENOTEXIST = "InvalidParameter.PrincipalServiceNotExist" +// INVALIDPARAMETER_RESOURCECONTENTERROR = "InvalidParameter.ResourceContentError" +// INVALIDPARAMETER_RESOURCEERROR = "InvalidParameter.ResourceError" +// INVALIDPARAMETER_RESOURCEPROJECTERROR = "InvalidParameter.ResourceProjectError" +// INVALIDPARAMETER_RESOURCEQCSERROR = "InvalidParameter.ResourceQcsError" +// INVALIDPARAMETER_RESOURCEREGIONERROR = "InvalidParameter.ResourceRegionError" +// INVALIDPARAMETER_RESOURCESERVICENOTEXIST = "InvalidParameter.ResourceServiceNotExist" +// INVALIDPARAMETER_RESOURCEUINERROR = "InvalidParameter.ResourceUinError" +// INVALIDPARAMETER_STATEMENTERROR = "InvalidParameter.StatementError" +// INVALIDPARAMETER_USERNOTEXIST = "InvalidParameter.UserNotExist" +// INVALIDPARAMETER_VERSIONERROR = "InvalidParameter.VersionError" +// RESOURCENOTFOUND_GROUPNOTEXIST = "ResourceNotFound.GroupNotExist" +// RESOURCENOTFOUND_NOTFOUND = "ResourceNotFound.NotFound" +// RESOURCENOTFOUND_POLICYIDNOTFOUND = "ResourceNotFound.PolicyIdNotFound" +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +func (c *Client) UpdatePolicyWithContext(ctx context.Context, request *UpdatePolicyRequest) (response *UpdatePolicyResponse, err error) { + if request == nil { + request = NewUpdatePolicyRequest() + } + request.SetContext(ctx) + response = NewUpdatePolicyResponse() err = c.Send(request, response) return @@ -2070,6 +4067,8 @@ func NewUpdateRoleConsoleLoginRequest() (request *UpdateRoleConsoleLoginRequest) BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "UpdateRoleConsoleLogin") + + return } @@ -2091,6 +4090,25 @@ func (c *Client) UpdateRoleConsoleLogin(request *UpdateRoleConsoleLoginRequest) if request == nil { request = NewUpdateRoleConsoleLoginRequest() } + + response = NewUpdateRoleConsoleLoginResponse() + err = c.Send(request, response) + return +} + +// UpdateRoleConsoleLogin +// 本接口(UpdateRoleConsoleLogin)用于修改角色是否可登录。 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_ROLENOTEXIST = "InvalidParameter.RoleNotExist" +func (c *Client) UpdateRoleConsoleLoginWithContext(ctx context.Context, request *UpdateRoleConsoleLoginRequest) (response *UpdateRoleConsoleLoginResponse, err error) { + if request == nil { + request = NewUpdateRoleConsoleLoginRequest() + } + request.SetContext(ctx) + response = NewUpdateRoleConsoleLoginResponse() err = c.Send(request, response) return @@ -2101,6 +4119,8 @@ func NewUpdateRoleDescriptionRequest() (request *UpdateRoleDescriptionRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "UpdateRoleDescription") + + return } @@ -2123,6 +4143,26 @@ func (c *Client) UpdateRoleDescription(request *UpdateRoleDescriptionRequest) (r if request == nil { request = NewUpdateRoleDescriptionRequest() } + + response = NewUpdateRoleDescriptionResponse() + err = c.Send(request, response) + return +} + +// UpdateRoleDescription +// 本接口(UpdateRoleDescription)用于修改角色的描述信息。 +// +// 可能返回的错误码: +// INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" +// INVALIDPARAMETER_DESCRIPTIONLENGTHOVERLIMIT = "InvalidParameter.DescriptionLengthOverlimit" +// INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError" +// INVALIDPARAMETER_ROLENOTEXIST = "InvalidParameter.RoleNotExist" +func (c *Client) UpdateRoleDescriptionWithContext(ctx context.Context, request *UpdateRoleDescriptionRequest) (response *UpdateRoleDescriptionResponse, err error) { + if request == nil { + request = NewUpdateRoleDescriptionRequest() + } + request.SetContext(ctx) + response = NewUpdateRoleDescriptionResponse() err = c.Send(request, response) return @@ -2133,6 +4173,8 @@ func NewUpdateSAMLProviderRequest() (request *UpdateSAMLProviderRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "UpdateSAMLProvider") + + return } @@ -2153,6 +4195,24 @@ func (c *Client) UpdateSAMLProvider(request *UpdateSAMLProviderRequest) (respons if request == nil { request = NewUpdateSAMLProviderRequest() } + + response = NewUpdateSAMLProviderResponse() + err = c.Send(request, response) + return +} + +// UpdateSAMLProvider +// 更新SAML身份提供商信息 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_METADATAERROR = "InvalidParameterValue.MetadataError" +// RESOURCENOTFOUND_IDENTITYNOTEXIST = "ResourceNotFound.IdentityNotExist" +func (c *Client) UpdateSAMLProviderWithContext(ctx context.Context, request *UpdateSAMLProviderRequest) (response *UpdateSAMLProviderResponse, err error) { + if request == nil { + request = NewUpdateSAMLProviderRequest() + } + request.SetContext(ctx) + response = NewUpdateSAMLProviderResponse() err = c.Send(request, response) return @@ -2163,6 +4223,8 @@ func NewUpdateUserRequest() (request *UpdateUserRequest) { BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cam", APIVersion, "UpdateUser") + + return } @@ -2183,7 +4245,75 @@ func (c *Client) UpdateUser(request *UpdateUserRequest) (response *UpdateUserRes if request == nil { request = NewUpdateUserRequest() } + + response = NewUpdateUserResponse() + err = c.Send(request, response) + return +} + +// UpdateUser +// 更新子用户 +// +// 可能返回的错误码: +// INVALIDPARAMETER_PASSWORDVIOLATEDRULES = "InvalidParameter.PasswordViolatedRules" +// RESOURCENOTFOUND_USERNOTEXIST = "ResourceNotFound.UserNotExist" +func (c *Client) UpdateUserWithContext(ctx context.Context, request *UpdateUserRequest) (response *UpdateUserResponse, err error) { + if request == nil { + request = NewUpdateUserRequest() + } + request.SetContext(ctx) + response = NewUpdateUserResponse() err = c.Send(request, response) return } + +func NewUpdateUserSAMLConfigRequest() (request *UpdateUserSAMLConfigRequest) { + request = &UpdateUserSAMLConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("cam", APIVersion, "UpdateUserSAMLConfig") + + + return +} + +func NewUpdateUserSAMLConfigResponse() (response *UpdateUserSAMLConfigResponse) { + response = &UpdateUserSAMLConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// UpdateUserSAMLConfig +// 修改用户SAML配置 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_METADATAERROR = "InvalidParameterValue.MetadataError" +// RESOURCENOTFOUND_IDENTITYNOTEXIST = "ResourceNotFound.IdentityNotExist" +func (c *Client) UpdateUserSAMLConfig(request *UpdateUserSAMLConfigRequest) (response *UpdateUserSAMLConfigResponse, err error) { + if request == nil { + request = NewUpdateUserSAMLConfigRequest() + } + + response = NewUpdateUserSAMLConfigResponse() + err = c.Send(request, response) + return +} + +// UpdateUserSAMLConfig +// 修改用户SAML配置 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_METADATAERROR = "InvalidParameterValue.MetadataError" +// RESOURCENOTFOUND_IDENTITYNOTEXIST = "ResourceNotFound.IdentityNotExist" +func (c *Client) UpdateUserSAMLConfigWithContext(ctx context.Context, request *UpdateUserSAMLConfigRequest) (response *UpdateUserSAMLConfigResponse, err error) { + if request == nil { + request = NewUpdateUserSAMLConfigRequest() + } + request.SetContext(ctx) + + response = NewUpdateUserSAMLConfigResponse() + err = c.Send(request, response) + return +} diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam/v20190116/errors.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam/v20190116/errors.go index bb298e06d6..bb651fa54b 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam/v20190116/errors.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam/v20190116/errors.go @@ -17,6 +17,9 @@ package v20190116 const ( // 此产品的特有错误码 + // 没有权限。 + AUTHFAILURE_UNAUTHORIZEDOPERATION = "AuthFailure.UnauthorizedOperation" + // 操作失败。 FAILEDOPERATION = "FailedOperation" @@ -44,6 +47,9 @@ const ( // 设置的用户没有权限。 FAILEDOPERATION_USERUNBINDNOPERMISSION = "FailedOperation.UserUnbindNoPermission" + // 内部错误。 + INTERNALERROR = "InternalError" + // 内部错误。 INTERNALERROR_SYSTEMERROR = "InternalError.SystemError" @@ -221,6 +227,9 @@ const ( // 用户对象不存在。 INVALIDPARAMETER_USERNOTEXIST = "InvalidParameter.UserNotExist" + // 用户的Uin和Uid不能都为空。 + INVALIDPARAMETER_USERUINANDUINNOTALLNULL = "InvalidParameter.UserUinAndUinNotAllNull" + // 策略文档的Version字段不合法。 INVALIDPARAMETER_VERSIONERROR = "InvalidParameter.VersionError" @@ -248,6 +257,9 @@ const ( // 创建子用户频率超过限制。 REQUESTLIMITEXCEEDED_CREATEUSER = "RequestLimitExceeded.CreateUser" + // 用户账号超出了限制。 + REQUESTLIMITEXCEEDED_UINLIMITEXCEEDED = "RequestLimitExceeded.UinLimitExceeded" + // 用户组不存在。 RESOURCENOTFOUND_GROUPNOTEXIST = "ResourceNotFound.GroupNotExist" diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam/v20190116/models.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam/v20190116/models.go index cc88412bce..a389f59550 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam/v20190116/models.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam/v20190116/models.go @@ -131,7 +131,7 @@ func (r *AddUserResponse) FromJsonString(s string) error { type AddUserToGroupRequest struct { *tchttp.BaseRequest - // 添加的子用户 UID 和用户组 ID 关联关系 + // 添加的子用户 UIN/UID 和用户组 ID 关联关系 Info []*GroupIdOfUidInfo `json:"Info,omitempty" name:"Info"` } @@ -430,6 +430,48 @@ type AttachedPolicyOfRole struct { Description *string `json:"Description,omitempty" name:"Description"` } +type AttachedUserPolicy struct { + + // 策略ID + PolicyId *string `json:"PolicyId,omitempty" name:"PolicyId"` + + // 策略名 + PolicyName *string `json:"PolicyName,omitempty" name:"PolicyName"` + + // 策略描述 + Description *string `json:"Description,omitempty" name:"Description"` + + // 创建时间 + AddTime *string `json:"AddTime,omitempty" name:"AddTime"` + + // 策略类型(1表示自定义策略,2表示预设策略) + StrategyType *string `json:"StrategyType,omitempty" name:"StrategyType"` + + // 创建模式(1表示按产品或项目权限创建的策略,其他表示策略语法创建的策略) + CreateMode *string `json:"CreateMode,omitempty" name:"CreateMode"` + + // 随组关联信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + Groups []*AttachedUserPolicyGroupInfo `json:"Groups,omitempty" name:"Groups"` + + // 是否已下线(0:否 1:是) + // 注意:此字段可能返回 null,表示取不到有效值。 + Deactived *uint64 `json:"Deactived,omitempty" name:"Deactived"` + + // 已下线的产品列表 + // 注意:此字段可能返回 null,表示取不到有效值。 + DeactivedDetail []*string `json:"DeactivedDetail,omitempty" name:"DeactivedDetail"` +} + +type AttachedUserPolicyGroupInfo struct { + + // 分组ID + GroupId *uint64 `json:"GroupId,omitempty" name:"GroupId"` + + // 分组名称 + GroupName *string `json:"GroupName,omitempty" name:"GroupName"` +} + type ConsumeCustomMFATokenRequest struct { *tchttp.BaseRequest @@ -824,6 +866,52 @@ func (r *CreateServiceLinkedRoleResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type CreateUserSAMLConfigRequest struct { + *tchttp.BaseRequest + + // SAML元数据文档,需要base64 encode + SAMLMetadataDocument *string `json:"SAMLMetadataDocument,omitempty" name:"SAMLMetadataDocument"` +} + +func (r *CreateUserSAMLConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateUserSAMLConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "SAMLMetadataDocument") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateUserSAMLConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type CreateUserSAMLConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *CreateUserSAMLConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateUserSAMLConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type DeleteGroupRequest struct { *tchttp.BaseRequest @@ -1369,6 +1457,57 @@ func (r *DescribeSafeAuthFlagCollResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type DescribeSafeAuthFlagIntlRequest struct { + *tchttp.BaseRequest +} + +func (r *DescribeSafeAuthFlagIntlRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeSafeAuthFlagIntlRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeSafeAuthFlagIntlRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeSafeAuthFlagIntlResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 登录保护设置 + LoginFlag *LoginActionFlagIntl `json:"LoginFlag,omitempty" name:"LoginFlag"` + + // 敏感操作保护设置 + ActionFlag *LoginActionFlagIntl `json:"ActionFlag,omitempty" name:"ActionFlag"` + + // 异地登录保护设置 + OffsiteFlag *OffsiteFlag `json:"OffsiteFlag,omitempty" name:"OffsiteFlag"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeSafeAuthFlagIntlResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeSafeAuthFlagIntlResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type DescribeSafeAuthFlagRequest struct { *tchttp.BaseRequest } @@ -1469,6 +1608,54 @@ func (r *DescribeSubAccountsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type DescribeUserSAMLConfigRequest struct { + *tchttp.BaseRequest +} + +func (r *DescribeUserSAMLConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeUserSAMLConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeUserSAMLConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeUserSAMLConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // SAML元数据文档 + SAMLMetadata *string `json:"SAMLMetadata,omitempty" name:"SAMLMetadata"` + + // 状态:0:未设置,1:已开启,2:已禁用 + Status *uint64 `json:"Status,omitempty" name:"Status"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeUserSAMLConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeUserSAMLConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type DetachGroupPolicyRequest struct { *tchttp.BaseRequest @@ -1627,6 +1814,66 @@ func (r *DetachUserPolicyResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type GetAccountSummaryRequest struct { + *tchttp.BaseRequest +} + +func (r *GetAccountSummaryRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *GetAccountSummaryRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "GetAccountSummaryRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type GetAccountSummaryResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 策略数 + Policies *uint64 `json:"Policies,omitempty" name:"Policies"` + + // 角色数 + Roles *uint64 `json:"Roles,omitempty" name:"Roles"` + + // 身份提供商数 + Idps *uint64 `json:"Idps,omitempty" name:"Idps"` + + // 子账户数 + User *uint64 `json:"User,omitempty" name:"User"` + + // 分组数 + Group *uint64 `json:"Group,omitempty" name:"Group"` + + // 分组用户总数 + Member *uint64 `json:"Member,omitempty" name:"Member"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *GetAccountSummaryResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *GetAccountSummaryResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type GetCustomMFATokenInfoRequest struct { *tchttp.BaseRequest @@ -1824,7 +2071,7 @@ type GetPolicyVersionRequest struct { // 策略ID PolicyId *uint64 `json:"PolicyId,omitempty" name:"PolicyId"` - // 策略版本号 + // 策略版本号,可由ListPolicyVersions获取 VersionId *uint64 `json:"VersionId,omitempty" name:"VersionId"` } @@ -1872,6 +2119,72 @@ func (r *GetPolicyVersionResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type GetRolePermissionBoundaryRequest struct { + *tchttp.BaseRequest + + // 角色ID + RoleId *string `json:"RoleId,omitempty" name:"RoleId"` +} + +func (r *GetRolePermissionBoundaryRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *GetRolePermissionBoundaryRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "RoleId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "GetRolePermissionBoundaryRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type GetRolePermissionBoundaryResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 策略ID + // 注意:此字段可能返回 null,表示取不到有效值。 + PolicyId *int64 `json:"PolicyId,omitempty" name:"PolicyId"` + + // 策略名 + // 注意:此字段可能返回 null,表示取不到有效值。 + PolicyName *string `json:"PolicyName,omitempty" name:"PolicyName"` + + // 策略语法 + // 注意:此字段可能返回 null,表示取不到有效值。 + PolicyDocument *string `json:"PolicyDocument,omitempty" name:"PolicyDocument"` + + // 策略类型:1.自定义策略,2.预设策略 + // 注意:此字段可能返回 null,表示取不到有效值。 + PolicyType *int64 `json:"PolicyType,omitempty" name:"PolicyType"` + + // 创建方式:1.按产品功能或项目权限创建,2.按策略语法创建,3.按策略生成器创建,4.按标签授权创建,5.按权限边界规则创建 + // 注意:此字段可能返回 null,表示取不到有效值。 + CreateMode *int64 `json:"CreateMode,omitempty" name:"CreateMode"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *GetRolePermissionBoundaryResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *GetRolePermissionBoundaryResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type GetRoleRequest struct { *tchttp.BaseRequest @@ -1951,98 +2264,264 @@ func (r *GetSAMLProviderRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } -type GetSAMLProviderResponse struct { +type GetSAMLProviderResponse struct { + *tchttp.BaseResponse + Response *struct { + + // SAML身份提供商名称 + Name *string `json:"Name,omitempty" name:"Name"` + + // SAML身份提供商描述 + Description *string `json:"Description,omitempty" name:"Description"` + + // SAML身份提供商创建时间 + CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` + + // SAML身份提供商上次修改时间 + ModifyTime *string `json:"ModifyTime,omitempty" name:"ModifyTime"` + + // SAML身份提供商元数据文档 + SAMLMetadata *string `json:"SAMLMetadata,omitempty" name:"SAMLMetadata"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *GetSAMLProviderResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *GetSAMLProviderResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type GetSecurityLastUsedRequest struct { + *tchttp.BaseRequest + + // 查询密钥ID列表。最多支持10个。 + SecretIdList []*string `json:"SecretIdList,omitempty" name:"SecretIdList"` +} + +func (r *GetSecurityLastUsedRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *GetSecurityLastUsedRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "SecretIdList") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "GetSecurityLastUsedRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type GetSecurityLastUsedResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 密钥ID最近访问列表 + SecretIdLastUsedRows []*SecretIdLastUsed `json:"SecretIdLastUsedRows,omitempty" name:"SecretIdLastUsedRows"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *GetSecurityLastUsedResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *GetSecurityLastUsedResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type GetServiceLinkedRoleDeletionStatusRequest struct { + *tchttp.BaseRequest + + // 删除任务ID + DeletionTaskId *string `json:"DeletionTaskId,omitempty" name:"DeletionTaskId"` +} + +func (r *GetServiceLinkedRoleDeletionStatusRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *GetServiceLinkedRoleDeletionStatusRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DeletionTaskId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "GetServiceLinkedRoleDeletionStatusRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type GetServiceLinkedRoleDeletionStatusResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 状态:NOT_STARTED,IN_PROGRESS,SUCCEEDED,FAILED + Status *string `json:"Status,omitempty" name:"Status"` + + // 失败原因 + Reason *string `json:"Reason,omitempty" name:"Reason"` + + // 服务类型 + // 注意:此字段可能返回 null,表示取不到有效值。 + ServiceType *string `json:"ServiceType,omitempty" name:"ServiceType"` + + // 服务名称 + // 注意:此字段可能返回 null,表示取不到有效值。 + ServiceName *string `json:"ServiceName,omitempty" name:"ServiceName"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *GetServiceLinkedRoleDeletionStatusResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *GetServiceLinkedRoleDeletionStatusResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type GetUserAppIdRequest struct { + *tchttp.BaseRequest +} + +func (r *GetUserAppIdRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *GetUserAppIdRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "GetUserAppIdRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type GetUserAppIdResponse struct { *tchttp.BaseResponse Response *struct { - // SAML身份提供商名称 - Name *string `json:"Name,omitempty" name:"Name"` - - // SAML身份提供商描述 - Description *string `json:"Description,omitempty" name:"Description"` - - // SAML身份提供商创建时间 - CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` + // 当前账号Uin + Uin *string `json:"Uin,omitempty" name:"Uin"` - // SAML身份提供商上次修改时间 - ModifyTime *string `json:"ModifyTime,omitempty" name:"ModifyTime"` + // 当前账号OwnerUin + OwnerUin *string `json:"OwnerUin,omitempty" name:"OwnerUin"` - // SAML身份提供商元数据文档 - SAMLMetadata *string `json:"SAMLMetadata,omitempty" name:"SAMLMetadata"` + // 当前账号AppId + AppId *uint64 `json:"AppId,omitempty" name:"AppId"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } -func (r *GetSAMLProviderResponse) ToJsonString() string { +func (r *GetUserAppIdResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } // FromJsonString It is highly **NOT** recommended to use this function // because it has no param check, nor strict type check -func (r *GetSAMLProviderResponse) FromJsonString(s string) error { +func (r *GetUserAppIdResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } -type GetServiceLinkedRoleDeletionStatusRequest struct { +type GetUserPermissionBoundaryRequest struct { *tchttp.BaseRequest - // 删除任务ID - DeletionTaskId *string `json:"DeletionTaskId,omitempty" name:"DeletionTaskId"` + // 子账号Uin + TargetUin *int64 `json:"TargetUin,omitempty" name:"TargetUin"` } -func (r *GetServiceLinkedRoleDeletionStatusRequest) ToJsonString() string { +func (r *GetUserPermissionBoundaryRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } // FromJsonString It is highly **NOT** recommended to use this function // because it has no param check, nor strict type check -func (r *GetServiceLinkedRoleDeletionStatusRequest) FromJsonString(s string) error { +func (r *GetUserPermissionBoundaryRequest) FromJsonString(s string) error { f := make(map[string]interface{}) if err := json.Unmarshal([]byte(s), &f); err != nil { return err } - delete(f, "DeletionTaskId") + delete(f, "TargetUin") if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "GetServiceLinkedRoleDeletionStatusRequest has unknown keys!", "") + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "GetUserPermissionBoundaryRequest has unknown keys!", "") } return json.Unmarshal([]byte(s), &r) } -type GetServiceLinkedRoleDeletionStatusResponse struct { +type GetUserPermissionBoundaryResponse struct { *tchttp.BaseResponse Response *struct { - // 状态:NOT_STARTED,IN_PROGRESS,SUCCEEDED,FAILED - Status *string `json:"Status,omitempty" name:"Status"` + // 策略ID + // 注意:此字段可能返回 null,表示取不到有效值。 + PolicyId *int64 `json:"PolicyId,omitempty" name:"PolicyId"` - // 失败原因 - Reason *string `json:"Reason,omitempty" name:"Reason"` + // 策略名 + // 注意:此字段可能返回 null,表示取不到有效值。 + PolicyName *string `json:"PolicyName,omitempty" name:"PolicyName"` - // 服务类型 + // 策略语法 // 注意:此字段可能返回 null,表示取不到有效值。 - ServiceType *string `json:"ServiceType,omitempty" name:"ServiceType"` + PolicyDocument *string `json:"PolicyDocument,omitempty" name:"PolicyDocument"` - // 服务名称 + // 策略类型:1.自定义策略,2.预设策略 // 注意:此字段可能返回 null,表示取不到有效值。 - ServiceName *string `json:"ServiceName,omitempty" name:"ServiceName"` + PolicyType *int64 `json:"PolicyType,omitempty" name:"PolicyType"` + + // 创建方式:1.按产品功能或项目权限创建,2.按策略语法创建,3.按策略生成器创建,4.按标签授权创建,5.按权限边界规则创建 + // 注意:此字段可能返回 null,表示取不到有效值。 + CreateMode *int64 `json:"CreateMode,omitempty" name:"CreateMode"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } -func (r *GetServiceLinkedRoleDeletionStatusResponse) ToJsonString() string { +func (r *GetUserPermissionBoundaryResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } // FromJsonString It is highly **NOT** recommended to use this function // because it has no param check, nor strict type check -func (r *GetServiceLinkedRoleDeletionStatusResponse) FromJsonString(s string) error { +func (r *GetUserPermissionBoundaryResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } @@ -2086,9 +2565,10 @@ type GetUserResponse struct { Uid *uint64 `json:"Uid,omitempty" name:"Uid"` // 子用户备注 + // 注意:此字段可能返回 null,表示取不到有效值。 Remark *string `json:"Remark,omitempty" name:"Remark"` - // 子用户能否登录控制台 + // 子用户能否登录控制台 0-无法登录控制台,1-可以登录控制台 ConsoleLogin *uint64 `json:"ConsoleLogin,omitempty" name:"ConsoleLogin"` // 手机号 @@ -2118,11 +2598,14 @@ func (r *GetUserResponse) FromJsonString(s string) error { type GroupIdOfUidInfo struct { + // 用户组 ID + GroupId *uint64 `json:"GroupId,omitempty" name:"GroupId"` + // 子用户 UID Uid *uint64 `json:"Uid,omitempty" name:"Uid"` - // 用户组 ID - GroupId *uint64 `json:"GroupId,omitempty" name:"GroupId"` + // 子用户 Uin,Uid和Uin至少有一个必填 + Uin *uint64 `json:"Uin,omitempty" name:"Uin"` } type GroupInfo struct { @@ -2157,22 +2640,22 @@ type GroupMemberInfo struct { // 手机区域代码。 CountryCode *string `json:"CountryCode,omitempty" name:"CountryCode"` - // 是否已验证手机。 + // 是否已验证手机。0-未验证 1-验证 PhoneFlag *uint64 `json:"PhoneFlag,omitempty" name:"PhoneFlag"` // 邮箱地址。 Email *string `json:"Email,omitempty" name:"Email"` - // 是否已验证邮箱。 + // 是否已验证邮箱。0-未验证 1-验证 EmailFlag *uint64 `json:"EmailFlag,omitempty" name:"EmailFlag"` - // 用户类型。 + // 用户类型。1-全局协作者 2-项目协作者 3-消息接收者 UserType *uint64 `json:"UserType,omitempty" name:"UserType"` // 创建时间。 CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` - // 是否为主消息接收人。 + // 是否为主消息接收人。0-否 1-是 IsReceiverOwner *uint64 `json:"IsReceiverOwner,omitempty" name:"IsReceiverOwner"` } @@ -2237,6 +2720,9 @@ type ListAttachedGroupPoliciesRequest struct { // 每页大小,默认值是 20 Rp *uint64 `json:"Rp,omitempty" name:"Rp"` + + // 搜索关键字 + Keyword *string `json:"Keyword,omitempty" name:"Keyword"` } func (r *ListAttachedGroupPoliciesRequest) ToJsonString() string { @@ -2254,6 +2740,7 @@ func (r *ListAttachedGroupPoliciesRequest) FromJsonString(s string) error { delete(f, "TargetGroupId") delete(f, "Page") delete(f, "Rp") + delete(f, "Keyword") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ListAttachedGroupPoliciesRequest has unknown keys!", "") } @@ -2303,6 +2790,9 @@ type ListAttachedRolePoliciesRequest struct { // 按策略类型过滤,User表示仅查询自定义策略,QCS表示仅查询预设策略 PolicyType *string `json:"PolicyType,omitempty" name:"PolicyType"` + + // 搜索关键字 + Keyword *string `json:"Keyword,omitempty" name:"Keyword"` } func (r *ListAttachedRolePoliciesRequest) ToJsonString() string { @@ -2322,6 +2812,7 @@ func (r *ListAttachedRolePoliciesRequest) FromJsonString(s string) error { delete(f, "RoleId") delete(f, "RoleName") delete(f, "PolicyType") + delete(f, "Keyword") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ListAttachedRolePoliciesRequest has unknown keys!", "") } @@ -2354,6 +2845,78 @@ func (r *ListAttachedRolePoliciesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type ListAttachedUserAllPoliciesRequest struct { + *tchttp.BaseRequest + + // 目标用户ID + TargetUin *uint64 `json:"TargetUin,omitempty" name:"TargetUin"` + + // 每页数量,必须大于 0 且小于或等于 200 + Rp *uint64 `json:"Rp,omitempty" name:"Rp"` + + // 页码,从 1开始,不能大于 200 + Page *uint64 `json:"Page,omitempty" name:"Page"` + + // 0:返回直接关联和随组关联策略,1:只返回直接关联策略,2:只返回随组关联策略 + AttachType *uint64 `json:"AttachType,omitempty" name:"AttachType"` + + // 策略类型 + StrategyType *uint64 `json:"StrategyType,omitempty" name:"StrategyType"` + + // 搜索关键字 + Keyword *string `json:"Keyword,omitempty" name:"Keyword"` +} + +func (r *ListAttachedUserAllPoliciesRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ListAttachedUserAllPoliciesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "TargetUin") + delete(f, "Rp") + delete(f, "Page") + delete(f, "AttachType") + delete(f, "StrategyType") + delete(f, "Keyword") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ListAttachedUserAllPoliciesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type ListAttachedUserAllPoliciesResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 策略列表数据 + PolicyList []*AttachedUserPolicy `json:"PolicyList,omitempty" name:"PolicyList"` + + // 策略总数 + TotalNum *uint64 `json:"TotalNum,omitempty" name:"TotalNum"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *ListAttachedUserAllPoliciesResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ListAttachedUserAllPoliciesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type ListAttachedUserPoliciesRequest struct { *tchttp.BaseRequest @@ -2536,6 +3099,51 @@ func (r *ListEntitiesForPolicyResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type ListGrantServiceAccessActionNode struct { + + // 接口名 + Name *string `json:"Name,omitempty" name:"Name"` + + // 接口描述 + Description *string `json:"Description,omitempty" name:"Description"` +} + +type ListGrantServiceAccessNode struct { + + // 服务 + Service *ListGrantServiceAccessService `json:"Service,omitempty" name:"Service"` + + // 接口信息 + Action []*ListGrantServiceAccessActionNode `json:"Action,omitempty" name:"Action"` + + // 授权的策略 + Policy []*ListGrantServiceAccessPolicy `json:"Policy,omitempty" name:"Policy"` +} + +type ListGrantServiceAccessPolicy struct { + + // 策略ID + PolicyId *string `json:"PolicyId,omitempty" name:"PolicyId"` + + // 策略名 + PolicyName *string `json:"PolicyName,omitempty" name:"PolicyName"` + + // 策略类型: Custom自定义策略,Presetting预设策略 + PolicyType *string `json:"PolicyType,omitempty" name:"PolicyType"` + + // 策略描述 + PolicyDescription *string `json:"PolicyDescription,omitempty" name:"PolicyDescription"` +} + +type ListGrantServiceAccessService struct { + + // 服务 + ServiceType *string `json:"ServiceType,omitempty" name:"ServiceType"` + + // 服务名 + ServiceName *string `json:"ServiceName,omitempty" name:"ServiceName"` +} + type ListGroupsForUserRequest struct { *tchttp.BaseRequest @@ -2660,6 +3268,67 @@ func (r *ListGroupsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type ListPoliciesGrantingServiceAccessRequest struct { + *tchttp.BaseRequest + + // 子账号uin,与RoleId、GroupId三选一必传 + TargetUin *uint64 `json:"TargetUin,omitempty" name:"TargetUin"` + + // 角色ID,与TargetUin、GroupId三选一必传 + RoleId *uint64 `json:"RoleId,omitempty" name:"RoleId"` + + // 用户组ID,与TargetUin、RoleId三选一必传 + GroupId *uint64 `json:"GroupId,omitempty" name:"GroupId"` + + // 服务名,查看服务授权接口详情时需传该字段 + ServiceType *string `json:"ServiceType,omitempty" name:"ServiceType"` +} + +func (r *ListPoliciesGrantingServiceAccessRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ListPoliciesGrantingServiceAccessRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "TargetUin") + delete(f, "RoleId") + delete(f, "GroupId") + delete(f, "ServiceType") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ListPoliciesGrantingServiceAccessRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type ListPoliciesGrantingServiceAccessResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 列表 + List []*ListGrantServiceAccessNode `json:"List,omitempty" name:"List"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *ListPoliciesGrantingServiceAccessResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ListPoliciesGrantingServiceAccessResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type ListPoliciesRequest struct { *tchttp.BaseRequest @@ -3014,6 +3683,27 @@ type LoginActionFlag struct { Custom *uint64 `json:"Custom,omitempty" name:"Custom"` } +type LoginActionFlagIntl struct { + + // 手机 + Phone *uint64 `json:"Phone,omitempty" name:"Phone"` + + // 硬token + Token *uint64 `json:"Token,omitempty" name:"Token"` + + // 软token + Stoken *uint64 `json:"Stoken,omitempty" name:"Stoken"` + + // 微信 + Wechat *uint64 `json:"Wechat,omitempty" name:"Wechat"` + + // 自定义 + Custom *uint64 `json:"Custom,omitempty" name:"Custom"` + + // 邮件 + Mail *uint64 `json:"Mail,omitempty" name:"Mail"` +} + type LoginActionMfaFlag struct { // 手机 @@ -3185,7 +3875,7 @@ func (r *PutUserPermissionsBoundaryResponse) FromJsonString(s string) error { type RemoveUserFromGroupRequest struct { *tchttp.BaseRequest - // 要删除的用户 UID和用户组 ID对应数组 + // 要删除的用户 UIN/UID和用户组 ID对应数组 Info []*GroupIdOfUidInfo `json:"Info,omitempty" name:"Info"` } @@ -3279,13 +3969,23 @@ type SAMLProviderInfo struct { ModifyTime *string `json:"ModifyTime,omitempty" name:"ModifyTime"` } +type SecretIdLastUsed struct { + + // 密钥ID + SecretId *string `json:"SecretId,omitempty" name:"SecretId"` + + // 最后访问日期(有1天延迟) + // 注意:此字段可能返回 null,表示取不到有效值。 + LastUsedDate *string `json:"LastUsedDate,omitempty" name:"LastUsedDate"` +} + type SetDefaultPolicyVersionRequest struct { *tchttp.BaseRequest // 策略ID PolicyId *uint64 `json:"PolicyId,omitempty" name:"PolicyId"` - // 策略版本号 + // 策略版本号,可由ListPolicyVersions获取 VersionId *uint64 `json:"VersionId,omitempty" name:"VersionId"` } @@ -3427,6 +4127,18 @@ type StrategyInfo struct { // 是否是服务相关角色策略 // 注意:此字段可能返回 null,表示取不到有效值。 IsServiceLinkedPolicy *uint64 `json:"IsServiceLinkedPolicy,omitempty" name:"IsServiceLinkedPolicy"` + + // 关联策略实体数 + // 注意:此字段可能返回 null,表示取不到有效值。 + AttachEntityCount *int64 `json:"AttachEntityCount,omitempty" name:"AttachEntityCount"` + + // 关联权限边界实体数 + // 注意:此字段可能返回 null,表示取不到有效值。 + AttachEntityBoundaryCount *int64 `json:"AttachEntityBoundaryCount,omitempty" name:"AttachEntityBoundaryCount"` + + // 最后编辑时间 + // 注意:此字段可能返回 null,表示取不到有效值。 + UpdateTime *string `json:"UpdateTime,omitempty" name:"UpdateTime"` } type SubAccountInfo struct { @@ -3458,6 +4170,10 @@ type SubAccountInfo struct { // 创建时间 // 注意:此字段可能返回 null,表示取不到有效值。 CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` + + // 昵称 + // 注意:此字段可能返回 null,表示取不到有效值。 + NickName *string `json:"NickName,omitempty" name:"NickName"` } type SubAccountUser struct { @@ -3468,7 +4184,7 @@ type SubAccountUser struct { // 子用户用户名 Name *string `json:"Name,omitempty" name:"Name"` - // 子用户 UID + // 子用户 UID,UID是用户作为消息接收人时的唯一标识,和 UIN 一样可以唯一标识一个用户,可通过接口https://cloud.tencent.com/document/api/598/53486 获取 Uid *uint64 `json:"Uid,omitempty" name:"Uid"` // 子用户备注 @@ -3478,7 +4194,7 @@ type SubAccountUser struct { // 注意:此字段可能返回 null,表示取不到有效值。 CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` - // 用户类型(1:主账号;2:子用户;3:企业微信子用户;4:协作者;5:消息接收人) + // 用户类型(2:子用户;3:企业微信子用户;4:协作者;5:消息接收人) UserType *uint64 `json:"UserType,omitempty" name:"UserType"` // 最近登录IP @@ -3669,10 +4385,10 @@ type UpdateRoleConsoleLoginRequest struct { // 是否可登录,可登录:1,不可登录:0 ConsoleLogin *int64 `json:"ConsoleLogin,omitempty" name:"ConsoleLogin"` - // 角色ID + // 角色ID,入参 RoleId 与 RoleName 二选一 RoleId *int64 `json:"RoleId,omitempty" name:"RoleId"` - // 角色名 + // 角色名,入参 RoleId 与 RoleName 二选一 RoleName *string `json:"RoleName,omitempty" name:"RoleName"` } @@ -3899,6 +4615,56 @@ func (r *UpdateUserResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type UpdateUserSAMLConfigRequest struct { + *tchttp.BaseRequest + + // 修改的操作类型:enable:启用,disable:禁用,updateSAML:修改元数据文档 + Operate *string `json:"Operate,omitempty" name:"Operate"` + + // 元数据文档,需要base64 encode,仅当Operate为updateSAML时需要此参数 + SAMLMetadataDocument *string `json:"SAMLMetadataDocument,omitempty" name:"SAMLMetadataDocument"` +} + +func (r *UpdateUserSAMLConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *UpdateUserSAMLConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Operate") + delete(f, "SAMLMetadataDocument") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "UpdateUserSAMLConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type UpdateUserSAMLConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *UpdateUserSAMLConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *UpdateUserSAMLConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type WeChatWorkSubAccount struct { // 子用户用户 ID diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go index 2c7576abad..f77929bfd1 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go @@ -240,7 +240,7 @@ func CompleteCommonParams(request Request, region string) { params["Action"] = request.GetAction() params["Timestamp"] = strconv.FormatInt(time.Now().Unix(), 10) params["Nonce"] = strconv.Itoa(rand.Int()) - params["RequestClient"] = "SDK_GO_1.0.353" + params["RequestClient"] = "SDK_GO_1.0.357" } func ConstructParams(req Request) (err error) { diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/regions/regions.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/regions/regions.go index 8b2b6d1131..a8036e74cf 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/regions/regions.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/regions/regions.go @@ -29,6 +29,8 @@ const ( GuangzhouOpen = "ap-guangzhou-open" // 中国香港 HongKong = "ap-hongkong" + // 雅加达 + Jakarta = "ap-jakarta" // 孟买 Mumbai = "ap-mumbai" // 首尔 @@ -55,4 +57,6 @@ const ( SiliconValley = "na-siliconvalley" // 多伦多 Toronto = "na-toronto" + // 圣保罗 + SaoPaulo = "sa-saopaulo" ) diff --git a/vendor/modules.txt b/vendor/modules.txt index 5ede6c0bf3..4aac515f60 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -537,7 +537,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/api/v20201106 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apigateway/v20180808 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as/v20180419 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam v1.0.199 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam v1.0.357 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam/v20190116 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs/v20170312 @@ -555,7 +555,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb/v20180317 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit/v20190319 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.291 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls/v20201016 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.353 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.357 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http diff --git a/website/docs/d/user_info.html.markdown b/website/docs/d/user_info.html.markdown new file mode 100644 index 0000000000..41ea0f1b9d --- /dev/null +++ b/website/docs/d/user_info.html.markdown @@ -0,0 +1,34 @@ +--- +subcategory: "Cloud Access Management(CAM)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_user_info" +sidebar_current: "docs-tencentcloud-datasource-user_info" +description: |- + Use this data source to query user appid, uin and ownerUin. +--- + +# tencentcloud_user_info + +Use this data source to query user appid, uin and ownerUin. + +## Example Usage + +```hcl +data "tencentcloud_user_info" "foo" {} +``` + +## Argument Reference + +The following arguments are supported: + +* `result_output_file` - (Optional) Used for save results. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `app_id` - Current account App ID. +* `owner_uin` - Current account OwnerUIN. +* `uin` - Current account UIN. + + diff --git a/website/tencentcloud.erb b/website/tencentcloud.erb index d9df333702..3fab9aa31a 100644 --- a/website/tencentcloud.erb +++ b/website/tencentcloud.erb @@ -351,6 +351,9 @@
  • tencentcloud_cam_users
  • +
  • + tencentcloud_user_info +
  • From 359ceb45799e1682b43a15c74e9964ff8f8fab15 Mon Sep 17 00:00:00 2001 From: KGSN Date: Wed, 2 Mar 2022 15:45:22 +0800 Subject: [PATCH 2/2] fix: move api invoke logic to datasource file --- tencentcloud/data_source_tc_user_info.go | 20 ++++++++++++++++-- tencentcloud/service_tencentcloud_cam.go | 26 ------------------------ 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/tencentcloud/data_source_tc_user_info.go b/tencentcloud/data_source_tc_user_info.go index 979f518998..e4b9ee31ff 100644 --- a/tencentcloud/data_source_tc_user_info.go +++ b/tencentcloud/data_source_tc_user_info.go @@ -13,9 +13,13 @@ package tencentcloud import ( "context" "fmt" + "log" "math/rand" "strconv" + cam "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam/v20190116" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/ratelimit" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) @@ -62,9 +66,21 @@ func datasourceTencentCloudUserInfoRead(d *schema.ResourceData, meta interface{} client := meta.(*TencentCloudClient).apiV3Conn - service := CamService{client: client} + logId = getLogId(ctx) + request := cam.NewGetUserAppIdRequest() + + ratelimit.Check(request.GetAction()) + response, err := client.UseCamClient().GetUserAppId(request) + + if err != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", + logId, request.GetAction(), request.ToJsonString(), err.Error()) + return err + } + + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", + logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) - response, err := service.GetUserAppId(ctx) if err != nil { return err } diff --git a/tencentcloud/service_tencentcloud_cam.go b/tencentcloud/service_tencentcloud_cam.go index b66336bc91..8c03dbafd8 100644 --- a/tencentcloud/service_tencentcloud_cam.go +++ b/tencentcloud/service_tencentcloud_cam.go @@ -1133,29 +1133,3 @@ func (me *CamService) PolicyDocumentForceCheck(document string) error { } return nil } - -func (me *CamService) GetUserAppId(ctx context.Context) (result *cam.GetUserAppIdResponse, errRet error) { - logId := getLogId(ctx) - request := cam.NewGetUserAppIdRequest() - defer func() { - if errRet != nil { - log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", - logId, request.GetAction(), request.ToJsonString(), errRet.Error()) - } - }() - - ratelimit.Check(request.GetAction()) - response, err := me.client.UseCamClient().GetUserAppId(request) - - if err != nil { - errRet = err - return - } - - log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", - logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) - - result = response - - return -}