diff --git a/go.mod b/go.mod index d8de7bcf..370ce88c 100644 --- a/go.mod +++ b/go.mod @@ -6,8 +6,8 @@ require ( github.com/AlecAivazis/survey/v2 v2.3.7 github.com/AliyunContainerService/ack-ram-tool/pkg/credentials/provider v0.0.0 github.com/alibabacloud-go/darabonba-openapi v0.2.1 - github.com/alibabacloud-go/darabonba-openapi/v2 v2.1.12 - github.com/alibabacloud-go/tea v1.3.12 + github.com/alibabacloud-go/darabonba-openapi/v2 v2.1.13 + github.com/alibabacloud-go/tea v1.3.13 github.com/aliyun/alibaba-cloud-sdk-go v1.63.107 github.com/aliyun/credentials-go v1.4.7 github.com/briandowns/spinner v1.23.2 @@ -29,7 +29,7 @@ require ( github.com/alibabacloud-go/cs-20151215/v5 v5.9.5 github.com/alibabacloud-go/ram-20150501/v2 v2.2.0 github.com/alibabacloud-go/sts-20150401 v1.1.2 - github.com/alibabacloud-go/sts-20150401/v2 v2.0.4 + github.com/alibabacloud-go/sts-20150401/v2 v2.1.0 github.com/alibabacloud-go/tea-utils/v2 v2.0.7 github.com/aliyun/aliyun-cli/v3 v3.2.6 github.com/go-logr/zapr v1.3.0 diff --git a/go.sum b/go.sum index 01ffbe10..c8c38eb7 100644 --- a/go.sum +++ b/go.sum @@ -25,8 +25,8 @@ github.com/alibabacloud-go/darabonba-openapi v0.1.16/go.mod h1:ZjyqRbbZOaUBSh7ke github.com/alibabacloud-go/darabonba-openapi v0.2.1 h1:WyzxxKvhdVDlwpAMOHgAiCJ+NXa6g5ZWPFEzaK/ewwY= github.com/alibabacloud-go/darabonba-openapi v0.2.1/go.mod h1:zXOqLbpIqq543oioL9IuuZYOQgHQ5B8/n5OPrnko8aY= github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.11/go.mod h1:wHxkgZT1ClZdcwEVP/pDgYK/9HucsnCfMipmJgCz4xY= -github.com/alibabacloud-go/darabonba-openapi/v2 v2.1.12 h1:e2yCrhtWd6Qcsy4he2OL+jIAU+93Lx9OcLlPRoFLT1w= -github.com/alibabacloud-go/darabonba-openapi/v2 v2.1.12/go.mod h1:f2wDpbM7hK9SvLIH09zSKVU1TsyemUNOqErMscMMl7c= +github.com/alibabacloud-go/darabonba-openapi/v2 v2.1.13 h1:Q00FU3H94Ts0ZIHDmY+fYGgB7dV9D/YX6FGsgorQPgw= +github.com/alibabacloud-go/darabonba-openapi/v2 v2.1.13/go.mod h1:lxFGfobinVsQ49ntjpgWghXmIF0/Sm4+wvBJ1h5RtaE= github.com/alibabacloud-go/darabonba-signature-util v0.0.7 h1:UzCnKvsjPFzApvODDNEYqBHMFt1w98wC7FOo0InLyxg= github.com/alibabacloud-go/darabonba-signature-util v0.0.7/go.mod h1:oUzCYV2fcCH797xKdL6BDH8ADIHlzrtKVjeRtunBNTQ= github.com/alibabacloud-go/darabonba-string v1.0.0/go.mod h1:93cTfV3vuPhhEwGGpKKqhVW4jLe7tDpo3LUM0i0g6mA= @@ -47,8 +47,8 @@ github.com/alibabacloud-go/ram-20150501/v2 v2.2.0 h1:Rj11zNIANgtGuQUmE4+q1tccKpb github.com/alibabacloud-go/ram-20150501/v2 v2.2.0/go.mod h1:fFp3ySh7WB4po5MLXRcp+SyB31gIoeNCxXBhmcA4uCU= github.com/alibabacloud-go/sts-20150401 v1.1.2 h1:Bs+5YxsiJf1Zdij1ziWUmvsm8VQM599JALOmom7T1T8= github.com/alibabacloud-go/sts-20150401 v1.1.2/go.mod h1:JQImPX2JjCaARhUB51H3JUPSpbXCT1PFJkDJvgl+f5I= -github.com/alibabacloud-go/sts-20150401/v2 v2.0.4 h1:LCw5Wq/oGhCT1DxM3KGzEAeeJjPcKpWTnhs+ZIG3RYE= -github.com/alibabacloud-go/sts-20150401/v2 v2.0.4/go.mod h1:IUTzgO9AhR6xm/wKnHPZYVsOr1GMRuPK6KFXYP3BrM8= +github.com/alibabacloud-go/sts-20150401/v2 v2.1.0 h1:Z5FOpAW003CjNSEPSemkPGj+OHWvF5bu7gz+Rdx/1zU= +github.com/alibabacloud-go/sts-20150401/v2 v2.1.0/go.mod h1:8q8jpK/mnC7fcp83naYBa7wzlIMuQrMWCbNmBfxh2wM= github.com/alibabacloud-go/tea v1.1.0/go.mod h1:IkGyUSX4Ba1V+k4pCtJUc6jDpZLFph9QMy2VUPTwukg= github.com/alibabacloud-go/tea v1.1.7/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4= github.com/alibabacloud-go/tea v1.1.8/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4= @@ -57,8 +57,8 @@ github.com/alibabacloud-go/tea v1.1.17/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy github.com/alibabacloud-go/tea v1.1.19/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy6cujmKFUq98A= github.com/alibabacloud-go/tea v1.1.20/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy6cujmKFUq98A= github.com/alibabacloud-go/tea v1.2.2/go.mod h1:CF3vOzEMAG+bR4WOql8gc2G9H3EkH3ZLAQdpmpXMgwk= -github.com/alibabacloud-go/tea v1.3.12 h1:ir2Io80UlBy1JHf7t+uCTxmaGQtiEta1WpV29NGJTkE= -github.com/alibabacloud-go/tea v1.3.12/go.mod h1:A560v/JTQ1n5zklt2BEpurJzZTI8TUT+Psg2drWlxRg= +github.com/alibabacloud-go/tea v1.3.13 h1:WhGy6LIXaMbBM6VBYcsDCz6K/TPsT1Ri2hPmmZffZ94= +github.com/alibabacloud-go/tea v1.3.13/go.mod h1:A560v/JTQ1n5zklt2BEpurJzZTI8TUT+Psg2drWlxRg= github.com/alibabacloud-go/tea-utils v1.3.1/go.mod h1:EI/o33aBfj3hETm4RLiAxF/ThQdSngxrpF8rKUDJjPE= github.com/alibabacloud-go/tea-utils v1.4.3/go.mod h1:KNcT0oXlZZxOXINnZBs6YvgOd5aYp9U67G+E3R8fcQw= github.com/alibabacloud-go/tea-utils v1.4.5 h1:h0/6Xd2f3bPE4XHTvkpjwxowIwRCJAJOqY6Eq8f3zfA= diff --git a/vendor/github.com/alibabacloud-go/darabonba-openapi/v2/models/model.go b/vendor/github.com/alibabacloud-go/darabonba-openapi/v2/models/model.go index 98ba2213..30d04c70 100644 --- a/vendor/github.com/alibabacloud-go/darabonba-openapi/v2/models/model.go +++ b/vendor/github.com/alibabacloud-go/darabonba-openapi/v2/models/model.go @@ -2,129 +2,132 @@ package models import ( "io" + "github.com/alibabacloud-go/tea/dara" credential "github.com/aliyun/credentials-go/credentials" - ) +) // Description: -// +// // This is for OpenApi Util type iGlobalParameters interface { dara.Model String() string GoString() string SetHeaders(v map[string]*string) *GlobalParameters - GetHeaders() map[string]*string + GetHeaders() map[string]*string SetQueries(v map[string]*string) *GlobalParameters - GetQueries() map[string]*string - } - - type GlobalParameters struct { + GetQueries() map[string]*string +} + +type GlobalParameters struct { dara.Model Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"` Queries map[string]*string `json:"queries,omitempty" xml:"queries,omitempty"` - } - - func (s GlobalParameters) String() string { +} + +func (s GlobalParameters) String() string { return dara.Prettify(s) - } - - func (s GlobalParameters) GoString() string { +} + +func (s GlobalParameters) GoString() string { return s.String() - } - - func (s *GlobalParameters) GetHeaders() map[string]*string { +} + +func (s *GlobalParameters) GetHeaders() map[string]*string { return s.Headers - } - - func (s *GlobalParameters) GetQueries() map[string]*string { +} + +func (s *GlobalParameters) GetQueries() map[string]*string { return s.Queries - } - - func (s *GlobalParameters) SetHeaders(v map[string]*string) *GlobalParameters { +} + +func (s *GlobalParameters) SetHeaders(v map[string]*string) *GlobalParameters { s.Headers = v return s - } - - func (s *GlobalParameters) SetQueries(v map[string]*string) *GlobalParameters { +} + +func (s *GlobalParameters) SetQueries(v map[string]*string) *GlobalParameters { s.Queries = v return s - } - - type iConfig interface { +} + +type iConfig interface { dara.Model String() string GoString() string SetAccessKeyId(v string) *Config - GetAccessKeyId() *string + GetAccessKeyId() *string SetAccessKeySecret(v string) *Config - GetAccessKeySecret() *string + GetAccessKeySecret() *string SetSecurityToken(v string) *Config - GetSecurityToken() *string + GetSecurityToken() *string SetBearerToken(v string) *Config - GetBearerToken() *string + GetBearerToken() *string SetProtocol(v string) *Config - GetProtocol() *string + GetProtocol() *string SetMethod(v string) *Config - GetMethod() *string + GetMethod() *string SetRegionId(v string) *Config - GetRegionId() *string + GetRegionId() *string SetReadTimeout(v int) *Config - GetReadTimeout() *int + GetReadTimeout() *int + SetIdleTimeout(v int) *Config + GetIdleTimeout() *int SetConnectTimeout(v int) *Config - GetConnectTimeout() *int + GetConnectTimeout() *int SetHttpProxy(v string) *Config - GetHttpProxy() *string + GetHttpProxy() *string SetHttpsProxy(v string) *Config - GetHttpsProxy() *string + GetHttpsProxy() *string SetCredential(v credential.Credential) *Config - GetCredential() credential.Credential + GetCredential() credential.Credential SetEndpoint(v string) *Config - GetEndpoint() *string + GetEndpoint() *string SetNoProxy(v string) *Config - GetNoProxy() *string + GetNoProxy() *string SetMaxIdleConns(v int) *Config - GetMaxIdleConns() *int + GetMaxIdleConns() *int SetNetwork(v string) *Config - GetNetwork() *string + GetNetwork() *string SetUserAgent(v string) *Config - GetUserAgent() *string + GetUserAgent() *string SetSuffix(v string) *Config - GetSuffix() *string + GetSuffix() *string SetSocks5Proxy(v string) *Config - GetSocks5Proxy() *string + GetSocks5Proxy() *string SetSocks5NetWork(v string) *Config - GetSocks5NetWork() *string + GetSocks5NetWork() *string SetEndpointType(v string) *Config - GetEndpointType() *string + GetEndpointType() *string SetOpenPlatformEndpoint(v string) *Config - GetOpenPlatformEndpoint() *string + GetOpenPlatformEndpoint() *string SetType(v string) *Config - GetType() *string + GetType() *string SetSignatureVersion(v string) *Config - GetSignatureVersion() *string + GetSignatureVersion() *string SetSignatureAlgorithm(v string) *Config - GetSignatureAlgorithm() *string + GetSignatureAlgorithm() *string SetGlobalParameters(v *GlobalParameters) *Config - GetGlobalParameters() *GlobalParameters + GetGlobalParameters() *GlobalParameters SetKey(v string) *Config - GetKey() *string + GetKey() *string SetCert(v string) *Config - GetCert() *string + GetCert() *string SetCa(v string) *Config - GetCa() *string + GetCa() *string SetDisableHttp2(v bool) *Config - GetDisableHttp2() *bool + GetDisableHttp2() *bool SetRetryOptions(v *dara.RetryOptions) *Config - GetRetryOptions() *dara.RetryOptions + GetRetryOptions() *dara.RetryOptions GetTlsMinVersion() *string SetTlsMinVersion(v string) *Config - } - - // Description: - // - // Model for initing client - type Config struct { +} + +// Description: +// +// Model for initing client +type Config struct { dara.Model // accesskey id AccessKeyId *string `json:"accessKeyId,omitempty" xml:"accessKeyId,omitempty"` @@ -133,677 +136,691 @@ type iGlobalParameters interface { // security token SecurityToken *string `json:"securityToken,omitempty" xml:"securityToken,omitempty"` // bearer token - // + // // example: - // + // // the-bearer-token BearerToken *string `json:"bearerToken,omitempty" xml:"bearerToken,omitempty"` // http protocol - // + // // example: - // + // // http Protocol *string `json:"protocol,omitempty" xml:"protocol,omitempty"` // http method - // + // // example: - // + // // GET Method *string `json:"method,omitempty" xml:"method,omitempty"` // region id - // + // // example: - // + // // cn-hangzhou RegionId *string `json:"regionId,omitempty" xml:"regionId,omitempty"` // read timeout - // + // // example: - // + // // 10 ReadTimeout *int `json:"readTimeout,omitempty" xml:"readTimeout,omitempty"` // connect timeout - // + // // example: - // + // // 10 ConnectTimeout *int `json:"connectTimeout,omitempty" xml:"connectTimeout,omitempty"` + // idle timeout + // + // example: + // + // 30 + IdleTimeout *int `json:"idleTimeout,omitempty" xml:"idleTimeout,omitempty"` // http proxy - // + // // example: - // + // // http://localhost HttpProxy *string `json:"httpProxy,omitempty" xml:"httpProxy,omitempty"` // https proxy - // + // // example: - // + // // https://localhost HttpsProxy *string `json:"httpsProxy,omitempty" xml:"httpsProxy,omitempty"` // credential Credential credential.Credential `json:"credential,omitempty" xml:"credential,omitempty"` // endpoint - // + // // example: - // + // // cs.aliyuncs.com Endpoint *string `json:"endpoint,omitempty" xml:"endpoint,omitempty"` // proxy white list - // + // // example: - // + // // http://localhost NoProxy *string `json:"noProxy,omitempty" xml:"noProxy,omitempty"` // max idle conns - // + // // example: - // + // // 3 MaxIdleConns *int `json:"maxIdleConns,omitempty" xml:"maxIdleConns,omitempty"` // network for endpoint - // + // // example: - // + // // public Network *string `json:"network,omitempty" xml:"network,omitempty"` // user agent - // + // // example: - // + // // Alibabacloud/1 UserAgent *string `json:"userAgent,omitempty" xml:"userAgent,omitempty"` // suffix for endpoint - // + // // example: - // + // // aliyun Suffix *string `json:"suffix,omitempty" xml:"suffix,omitempty"` // socks5 proxy Socks5Proxy *string `json:"socks5Proxy,omitempty" xml:"socks5Proxy,omitempty"` // socks5 network - // + // // example: - // + // // TCP Socks5NetWork *string `json:"socks5NetWork,omitempty" xml:"socks5NetWork,omitempty"` // endpoint type - // + // // example: - // + // // internal EndpointType *string `json:"endpointType,omitempty" xml:"endpointType,omitempty"` // OpenPlatform endpoint - // + // // example: - // + // // openplatform.aliyuncs.com OpenPlatformEndpoint *string `json:"openPlatformEndpoint,omitempty" xml:"openPlatformEndpoint,omitempty"` // Deprecated - // + // // credential type - // + // // example: - // + // // access_key Type *string `json:"type,omitempty" xml:"type,omitempty"` // Signature Version - // + // // example: - // + // // v1 SignatureVersion *string `json:"signatureVersion,omitempty" xml:"signatureVersion,omitempty"` // Signature Algorithm - // + // // example: - // + // // ACS3-HMAC-SHA256 SignatureAlgorithm *string `json:"signatureAlgorithm,omitempty" xml:"signatureAlgorithm,omitempty"` // Global Parameters GlobalParameters *GlobalParameters `json:"globalParameters,omitempty" xml:"globalParameters,omitempty"` // privite key for client certificate - // + // // example: - // + // // MIIEvQ Key *string `json:"key,omitempty" xml:"key,omitempty"` // client certificate - // + // // example: - // + // // -----BEGIN CERTIFICATE----- - // + // // xxx-----END CERTIFICATE----- Cert *string `json:"cert,omitempty" xml:"cert,omitempty"` // server certificate - // + // // example: - // + // // -----BEGIN CERTIFICATE----- - // + // // xxx-----END CERTIFICATE----- Ca *string `json:"ca,omitempty" xml:"ca,omitempty"` // disable HTTP/2 - // + // // example: - // + // // false DisableHttp2 *bool `json:"disableHttp2,omitempty" xml:"disableHttp2,omitempty"` // retry options RetryOptions *dara.RetryOptions `json:"retryOptions,omitempty" xml:"retryOptions,omitempty"` // http client - HttpClient dara.HttpClient `json:"httpClient,omitempty" xml:"httpClient,omitempty"` - TlsMinVersion *string `json:"tlsMinVersion,omitempty" xml:"tlsMinVersion,omitempty"` - } - - func (s Config) String() string { + HttpClient dara.HttpClient `json:"httpClient,omitempty" xml:"httpClient,omitempty"` + TlsMinVersion *string `json:"tlsMinVersion,omitempty" xml:"tlsMinVersion,omitempty"` +} + +func (s Config) String() string { return dara.Prettify(s) - } - - func (s Config) GoString() string { +} + +func (s Config) GoString() string { return s.String() - } - - func (s *Config) GetAccessKeyId() *string { +} + +func (s *Config) GetAccessKeyId() *string { return s.AccessKeyId - } - - func (s *Config) GetAccessKeySecret() *string { +} + +func (s *Config) GetAccessKeySecret() *string { return s.AccessKeySecret - } - - func (s *Config) GetSecurityToken() *string { +} + +func (s *Config) GetSecurityToken() *string { return s.SecurityToken - } - - func (s *Config) GetBearerToken() *string { +} + +func (s *Config) GetBearerToken() *string { return s.BearerToken - } - - func (s *Config) GetProtocol() *string { +} + +func (s *Config) GetProtocol() *string { return s.Protocol - } - - func (s *Config) GetMethod() *string { +} + +func (s *Config) GetMethod() *string { return s.Method - } - - func (s *Config) GetRegionId() *string { +} + +func (s *Config) GetRegionId() *string { return s.RegionId - } - - func (s *Config) GetReadTimeout() *int { +} + +func (s *Config) GetReadTimeout() *int { return s.ReadTimeout - } - - func (s *Config) GetConnectTimeout() *int { +} + +func (s *Config) GetConnectTimeout() *int { return s.ConnectTimeout - } - - func (s *Config) GetHttpProxy() *string { +} + +func (s *Config) GetIdleTimeout() *int { + return s.IdleTimeout +} + +func (s *Config) GetHttpProxy() *string { return s.HttpProxy - } - - func (s *Config) GetHttpsProxy() *string { +} + +func (s *Config) GetHttpsProxy() *string { return s.HttpsProxy - } - - func (s *Config) GetCredential() credential.Credential { +} + +func (s *Config) GetCredential() credential.Credential { return s.Credential - } - - func (s *Config) GetEndpoint() *string { +} + +func (s *Config) GetEndpoint() *string { return s.Endpoint - } - - func (s *Config) GetNoProxy() *string { +} + +func (s *Config) GetNoProxy() *string { return s.NoProxy - } - - func (s *Config) GetMaxIdleConns() *int { +} + +func (s *Config) GetMaxIdleConns() *int { return s.MaxIdleConns - } - - func (s *Config) GetNetwork() *string { +} + +func (s *Config) GetNetwork() *string { return s.Network - } - - func (s *Config) GetUserAgent() *string { +} + +func (s *Config) GetUserAgent() *string { return s.UserAgent - } - - func (s *Config) GetSuffix() *string { +} + +func (s *Config) GetSuffix() *string { return s.Suffix - } - - func (s *Config) GetSocks5Proxy() *string { +} + +func (s *Config) GetSocks5Proxy() *string { return s.Socks5Proxy - } - - func (s *Config) GetSocks5NetWork() *string { +} + +func (s *Config) GetSocks5NetWork() *string { return s.Socks5NetWork - } - - func (s *Config) GetEndpointType() *string { +} + +func (s *Config) GetEndpointType() *string { return s.EndpointType - } - - func (s *Config) GetOpenPlatformEndpoint() *string { +} + +func (s *Config) GetOpenPlatformEndpoint() *string { return s.OpenPlatformEndpoint - } - - func (s *Config) GetType() *string { +} + +func (s *Config) GetType() *string { return s.Type - } - - func (s *Config) GetSignatureVersion() *string { +} + +func (s *Config) GetSignatureVersion() *string { return s.SignatureVersion - } - - func (s *Config) GetSignatureAlgorithm() *string { +} + +func (s *Config) GetSignatureAlgorithm() *string { return s.SignatureAlgorithm - } - - func (s *Config) GetGlobalParameters() *GlobalParameters { +} + +func (s *Config) GetGlobalParameters() *GlobalParameters { return s.GlobalParameters - } - - func (s *Config) GetKey() *string { +} + +func (s *Config) GetKey() *string { return s.Key - } - - func (s *Config) GetCert() *string { +} + +func (s *Config) GetCert() *string { return s.Cert - } - - func (s *Config) GetCa() *string { +} + +func (s *Config) GetCa() *string { return s.Ca - } - - func (s *Config) GetDisableHttp2() *bool { +} + +func (s *Config) GetDisableHttp2() *bool { return s.DisableHttp2 - } - - func (s *Config) GetRetryOptions() *dara.RetryOptions { +} + +func (s *Config) GetRetryOptions() *dara.RetryOptions { return s.RetryOptions - } +} - func (s *Config) GetHttpClient() dara.HttpClient { +func (s *Config) GetHttpClient() dara.HttpClient { return s.HttpClient - } - - func (s *Config) SetAccessKeyId(v string) *Config { +} + +func (s *Config) SetAccessKeyId(v string) *Config { s.AccessKeyId = &v return s - } - - func (s *Config) SetAccessKeySecret(v string) *Config { +} + +func (s *Config) SetAccessKeySecret(v string) *Config { s.AccessKeySecret = &v return s - } - - func (s *Config) SetSecurityToken(v string) *Config { +} + +func (s *Config) SetSecurityToken(v string) *Config { s.SecurityToken = &v return s - } - - func (s *Config) SetBearerToken(v string) *Config { +} + +func (s *Config) SetBearerToken(v string) *Config { s.BearerToken = &v return s - } - - func (s *Config) SetProtocol(v string) *Config { +} + +func (s *Config) SetProtocol(v string) *Config { s.Protocol = &v return s - } - - func (s *Config) SetMethod(v string) *Config { +} + +func (s *Config) SetMethod(v string) *Config { s.Method = &v return s - } - - func (s *Config) SetRegionId(v string) *Config { +} + +func (s *Config) SetRegionId(v string) *Config { s.RegionId = &v return s - } - - func (s *Config) SetReadTimeout(v int) *Config { +} + +func (s *Config) SetReadTimeout(v int) *Config { s.ReadTimeout = &v return s - } - - func (s *Config) SetConnectTimeout(v int) *Config { +} + +func (s *Config) SetConnectTimeout(v int) *Config { s.ConnectTimeout = &v return s - } - - func (s *Config) SetHttpProxy(v string) *Config { +} + +func (s *Config) SetIdleTimeout(v int) *Config { + s.IdleTimeout = &v + return s +} + +func (s *Config) SetHttpProxy(v string) *Config { s.HttpProxy = &v return s - } - - func (s *Config) SetHttpsProxy(v string) *Config { +} + +func (s *Config) SetHttpsProxy(v string) *Config { s.HttpsProxy = &v return s - } - - func (s *Config) SetCredential(v credential.Credential) *Config { +} + +func (s *Config) SetCredential(v credential.Credential) *Config { s.Credential = v return s - } - - func (s *Config) SetEndpoint(v string) *Config { +} + +func (s *Config) SetEndpoint(v string) *Config { s.Endpoint = &v return s - } - - func (s *Config) SetNoProxy(v string) *Config { +} + +func (s *Config) SetNoProxy(v string) *Config { s.NoProxy = &v return s - } - - func (s *Config) SetMaxIdleConns(v int) *Config { +} + +func (s *Config) SetMaxIdleConns(v int) *Config { s.MaxIdleConns = &v return s - } - - func (s *Config) SetNetwork(v string) *Config { +} + +func (s *Config) SetNetwork(v string) *Config { s.Network = &v return s - } - - func (s *Config) SetUserAgent(v string) *Config { +} + +func (s *Config) SetUserAgent(v string) *Config { s.UserAgent = &v return s - } - - func (s *Config) SetSuffix(v string) *Config { +} + +func (s *Config) SetSuffix(v string) *Config { s.Suffix = &v return s - } - - func (s *Config) SetSocks5Proxy(v string) *Config { +} + +func (s *Config) SetSocks5Proxy(v string) *Config { s.Socks5Proxy = &v return s - } - - func (s *Config) SetSocks5NetWork(v string) *Config { +} + +func (s *Config) SetSocks5NetWork(v string) *Config { s.Socks5NetWork = &v return s - } - - func (s *Config) SetEndpointType(v string) *Config { +} + +func (s *Config) SetEndpointType(v string) *Config { s.EndpointType = &v return s - } - - func (s *Config) SetOpenPlatformEndpoint(v string) *Config { +} + +func (s *Config) SetOpenPlatformEndpoint(v string) *Config { s.OpenPlatformEndpoint = &v return s - } - - func (s *Config) SetType(v string) *Config { +} + +func (s *Config) SetType(v string) *Config { s.Type = &v return s - } - - func (s *Config) SetSignatureVersion(v string) *Config { +} + +func (s *Config) SetSignatureVersion(v string) *Config { s.SignatureVersion = &v return s - } - - func (s *Config) SetSignatureAlgorithm(v string) *Config { +} + +func (s *Config) SetSignatureAlgorithm(v string) *Config { s.SignatureAlgorithm = &v return s - } - - func (s *Config) SetGlobalParameters(v *GlobalParameters) *Config { +} + +func (s *Config) SetGlobalParameters(v *GlobalParameters) *Config { s.GlobalParameters = v return s - } - - func (s *Config) SetKey(v string) *Config { +} + +func (s *Config) SetKey(v string) *Config { s.Key = &v return s - } - - func (s *Config) SetCert(v string) *Config { +} + +func (s *Config) SetCert(v string) *Config { s.Cert = &v return s - } - - func (s *Config) SetCa(v string) *Config { +} + +func (s *Config) SetCa(v string) *Config { s.Ca = &v return s - } - - func (s *Config) SetDisableHttp2(v bool) *Config { +} + +func (s *Config) SetDisableHttp2(v bool) *Config { s.DisableHttp2 = &v return s - } - - func (s *Config) SetRetryOptions(v *dara.RetryOptions) *Config { +} + +func (s *Config) SetRetryOptions(v *dara.RetryOptions) *Config { s.RetryOptions = v return s - } +} - func (s *Config) SetHttpClient(v dara.HttpClient) *Config { +func (s *Config) SetHttpClient(v dara.HttpClient) *Config { s.HttpClient = v return s - } - - type iParams interface { +} + +type iParams interface { dara.Model String() string GoString() string SetAction(v string) *Params - GetAction() *string + GetAction() *string SetVersion(v string) *Params - GetVersion() *string + GetVersion() *string SetProtocol(v string) *Params - GetProtocol() *string + GetProtocol() *string SetPathname(v string) *Params - GetPathname() *string + GetPathname() *string SetMethod(v string) *Params - GetMethod() *string + GetMethod() *string SetAuthType(v string) *Params - GetAuthType() *string + GetAuthType() *string SetBodyType(v string) *Params - GetBodyType() *string + GetBodyType() *string SetReqBodyType(v string) *Params - GetReqBodyType() *string + GetReqBodyType() *string SetStyle(v string) *Params - GetStyle() *string - } - - type Params struct { + GetStyle() *string +} + +type Params struct { dara.Model - Action *string `json:"action,omitempty" xml:"action,omitempty" require:"true"` - Version *string `json:"version,omitempty" xml:"version,omitempty" require:"true"` - Protocol *string `json:"protocol,omitempty" xml:"protocol,omitempty" require:"true"` - Pathname *string `json:"pathname,omitempty" xml:"pathname,omitempty" require:"true"` - Method *string `json:"method,omitempty" xml:"method,omitempty" require:"true"` - AuthType *string `json:"authType,omitempty" xml:"authType,omitempty" require:"true"` - BodyType *string `json:"bodyType,omitempty" xml:"bodyType,omitempty" require:"true"` + Action *string `json:"action,omitempty" xml:"action,omitempty" require:"true"` + Version *string `json:"version,omitempty" xml:"version,omitempty" require:"true"` + Protocol *string `json:"protocol,omitempty" xml:"protocol,omitempty" require:"true"` + Pathname *string `json:"pathname,omitempty" xml:"pathname,omitempty" require:"true"` + Method *string `json:"method,omitempty" xml:"method,omitempty" require:"true"` + AuthType *string `json:"authType,omitempty" xml:"authType,omitempty" require:"true"` + BodyType *string `json:"bodyType,omitempty" xml:"bodyType,omitempty" require:"true"` ReqBodyType *string `json:"reqBodyType,omitempty" xml:"reqBodyType,omitempty" require:"true"` - Style *string `json:"style,omitempty" xml:"style,omitempty"` - } - - func (s Params) String() string { + Style *string `json:"style,omitempty" xml:"style,omitempty"` +} + +func (s Params) String() string { return dara.Prettify(s) - } - - func (s Params) GoString() string { +} + +func (s Params) GoString() string { return s.String() - } - - func (s *Params) GetAction() *string { +} + +func (s *Params) GetAction() *string { return s.Action - } - - func (s *Params) GetVersion() *string { +} + +func (s *Params) GetVersion() *string { return s.Version - } - - func (s *Params) GetProtocol() *string { +} + +func (s *Params) GetProtocol() *string { return s.Protocol - } - - func (s *Params) GetPathname() *string { +} + +func (s *Params) GetPathname() *string { return s.Pathname - } - - func (s *Params) GetMethod() *string { +} + +func (s *Params) GetMethod() *string { return s.Method - } - - func (s *Params) GetAuthType() *string { +} + +func (s *Params) GetAuthType() *string { return s.AuthType - } - - func (s *Params) GetBodyType() *string { +} + +func (s *Params) GetBodyType() *string { return s.BodyType - } - - func (s *Params) GetReqBodyType() *string { +} + +func (s *Params) GetReqBodyType() *string { return s.ReqBodyType - } - - func (s *Params) GetStyle() *string { +} + +func (s *Params) GetStyle() *string { return s.Style - } - - func (s *Params) SetAction(v string) *Params { +} + +func (s *Params) SetAction(v string) *Params { s.Action = &v return s - } - - func (s *Params) SetVersion(v string) *Params { +} + +func (s *Params) SetVersion(v string) *Params { s.Version = &v return s - } - - func (s *Params) SetProtocol(v string) *Params { +} + +func (s *Params) SetProtocol(v string) *Params { s.Protocol = &v return s - } - - func (s *Params) SetPathname(v string) *Params { +} + +func (s *Params) SetPathname(v string) *Params { s.Pathname = &v return s - } - - func (s *Params) SetMethod(v string) *Params { +} + +func (s *Params) SetMethod(v string) *Params { s.Method = &v return s - } - - func (s *Params) SetAuthType(v string) *Params { +} + +func (s *Params) SetAuthType(v string) *Params { s.AuthType = &v return s - } - - func (s *Params) SetBodyType(v string) *Params { +} + +func (s *Params) SetBodyType(v string) *Params { s.BodyType = &v return s - } - - func (s *Params) SetReqBodyType(v string) *Params { +} + +func (s *Params) SetReqBodyType(v string) *Params { s.ReqBodyType = &v return s - } - - func (s *Params) SetStyle(v string) *Params { +} + +func (s *Params) SetStyle(v string) *Params { s.Style = &v return s - } - - type iOpenApiRequest interface { +} + +type iOpenApiRequest interface { dara.Model String() string GoString() string SetHeaders(v map[string]*string) *OpenApiRequest - GetHeaders() map[string]*string + GetHeaders() map[string]*string SetQuery(v map[string]*string) *OpenApiRequest - GetQuery() map[string]*string + GetQuery() map[string]*string SetBody(v interface{}) *OpenApiRequest - GetBody() interface{} + GetBody() interface{} SetStream(v io.Reader) *OpenApiRequest - GetStream() io.Reader + GetStream() io.Reader SetHostMap(v map[string]*string) *OpenApiRequest - GetHostMap() map[string]*string + GetHostMap() map[string]*string SetEndpointOverride(v string) *OpenApiRequest - GetEndpointOverride() *string - } - - type OpenApiRequest struct { + GetEndpointOverride() *string +} + +type OpenApiRequest struct { dara.Model - Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"` - Query map[string]*string `json:"query,omitempty" xml:"query,omitempty"` - Body interface{} `json:"body,omitempty" xml:"body,omitempty"` - Stream io.Reader `json:"stream,omitempty" xml:"stream,omitempty"` - HostMap map[string]*string `json:"hostMap,omitempty" xml:"hostMap,omitempty"` - EndpointOverride *string `json:"endpointOverride,omitempty" xml:"endpointOverride,omitempty"` - } - - func (s OpenApiRequest) String() string { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"` + Query map[string]*string `json:"query,omitempty" xml:"query,omitempty"` + Body interface{} `json:"body,omitempty" xml:"body,omitempty"` + Stream io.Reader `json:"stream,omitempty" xml:"stream,omitempty"` + HostMap map[string]*string `json:"hostMap,omitempty" xml:"hostMap,omitempty"` + EndpointOverride *string `json:"endpointOverride,omitempty" xml:"endpointOverride,omitempty"` +} + +func (s OpenApiRequest) String() string { return dara.Prettify(s) - } - - func (s OpenApiRequest) GoString() string { +} + +func (s OpenApiRequest) GoString() string { return s.String() - } - - func (s *OpenApiRequest) GetHeaders() map[string]*string { +} + +func (s *OpenApiRequest) GetHeaders() map[string]*string { return s.Headers - } - - func (s *OpenApiRequest) GetQuery() map[string]*string { +} + +func (s *OpenApiRequest) GetQuery() map[string]*string { return s.Query - } - - func (s *OpenApiRequest) GetBody() interface{} { +} + +func (s *OpenApiRequest) GetBody() interface{} { return s.Body - } - - func (s *OpenApiRequest) GetStream() io.Reader { +} + +func (s *OpenApiRequest) GetStream() io.Reader { return s.Stream - } - - func (s *OpenApiRequest) GetHostMap() map[string]*string { +} + +func (s *OpenApiRequest) GetHostMap() map[string]*string { return s.HostMap - } - - func (s *OpenApiRequest) GetEndpointOverride() *string { +} + +func (s *OpenApiRequest) GetEndpointOverride() *string { return s.EndpointOverride - } - - func (s *OpenApiRequest) SetHeaders(v map[string]*string) *OpenApiRequest { +} + +func (s *OpenApiRequest) SetHeaders(v map[string]*string) *OpenApiRequest { s.Headers = v return s - } - - func (s *OpenApiRequest) SetQuery(v map[string]*string) *OpenApiRequest { +} + +func (s *OpenApiRequest) SetQuery(v map[string]*string) *OpenApiRequest { s.Query = v return s - } - - func (s *OpenApiRequest) SetBody(v interface{}) *OpenApiRequest { +} + +func (s *OpenApiRequest) SetBody(v interface{}) *OpenApiRequest { s.Body = v return s - } - - func (s *OpenApiRequest) SetStream(v io.Reader) *OpenApiRequest { +} + +func (s *OpenApiRequest) SetStream(v io.Reader) *OpenApiRequest { s.Stream = v return s - } - - func (s *OpenApiRequest) SetHostMap(v map[string]*string) *OpenApiRequest { +} + +func (s *OpenApiRequest) SetHostMap(v map[string]*string) *OpenApiRequest { s.HostMap = v return s - } - - func (s *OpenApiRequest) SetEndpointOverride(v string) *OpenApiRequest { +} + +func (s *OpenApiRequest) SetEndpointOverride(v string) *OpenApiRequest { s.EndpointOverride = &v return s - } - \ No newline at end of file +} diff --git a/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_request_model.go b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_request_model.go new file mode 100644 index 00000000..fee2b5e6 --- /dev/null +++ b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_request_model.go @@ -0,0 +1,158 @@ +// This file is auto-generated, don't edit it. Thanks. +package client + +import ( + "github.com/alibabacloud-go/tea/dara" +) + +type iAssumeRoleRequest interface { + dara.Model + String() string + GoString() string + SetDurationSeconds(v int64) *AssumeRoleRequest + GetDurationSeconds() *int64 + SetExternalId(v string) *AssumeRoleRequest + GetExternalId() *string + SetPolicy(v string) *AssumeRoleRequest + GetPolicy() *string + SetRoleArn(v string) *AssumeRoleRequest + GetRoleArn() *string + SetRoleSessionName(v string) *AssumeRoleRequest + GetRoleSessionName() *string + SetSourceIdentity(v string) *AssumeRoleRequest + GetSourceIdentity() *string +} + +type AssumeRoleRequest struct { + // The validity period of the STS token. Unit: seconds. + // + // Minimum value: 900. Maximum value: the value of the `MaxSessionDuration` parameter. Default value: 3600. + // + // You can call the CreateRole or UpdateRole operation to configure the `MaxSessionDuration` parameter. For more information, see [CreateRole](https://help.aliyun.com/document_detail/28710.html) or [UpdateRole](https://help.aliyun.com/document_detail/28712.html). + // + // example: + // + // 3600 + DurationSeconds *int64 `json:"DurationSeconds,omitempty" xml:"DurationSeconds,omitempty"` + // The external ID of the RAM role. + // + // This parameter is provided by an external party and is used to prevent the confused deputy problem. For more information, see [Use ExternalId to prevent the confused deputy problem](https://help.aliyun.com/document_detail/2361741.html). + // + // The value must be 2 to 1,224 characters in length and can contain letters, digits, and the following special characters: `= , . @ : / - _`. The regular expression for this parameter is `[\\w+=,.@:\\/-]*`. + // + // example: + // + // abcd1234 + ExternalId *string `json:"ExternalId,omitempty" xml:"ExternalId,omitempty"` + // The policy that specifies the permissions of the returned STS token. You can use this parameter to grant the STS token fewer permissions than the permissions granted to the RAM role. + // + // - If you specify this parameter, the permissions of the returned STS token are the permissions that are included in the value of this parameter and owned by the RAM role. + // + // - If you do not specify this parameter, the returned STS token has all the permissions of the RAM role. + // + // The value must be 1 to 2,048 characters in length. + // + // For more information about policy elements and sample policies, see [Policy elements](https://help.aliyun.com/document_detail/93738.html) and [Overview of sample policies](https://help.aliyun.com/document_detail/210969.html). + // + // example: + // + // {"Statement": [{"Action": ["*"],"Effect": "Allow","Resource": ["*"]}],"Version":"1"} + Policy *string `json:"Policy,omitempty" xml:"Policy,omitempty"` + // The Alibaba Cloud Resource Name (ARN) of the RAM role. + // + // The trusted entity of the RAM role is an Alibaba Cloud account. For more information, see [Create a RAM role for a trusted Alibaba Cloud account](https://help.aliyun.com/document_detail/93691.html) or [CreateRole](https://help.aliyun.com/document_detail/28710.html). + // + // Format: `acs:ram:::role/`. + // + // You can view the ARN in the RAM console or by calling operations. The following items describe the validity periods of storage addresses: + // + // - For more information about how to view the ARN in the RAM console, see [How do I find the ARN of the RAM role?](https://help.aliyun.com/document_detail/39744.html) + // + // - For more information about how to view the ARN by calling operations, see [ListRoles](https://help.aliyun.com/document_detail/28713.html) or [GetRole](https://help.aliyun.com/document_detail/28711.html). + // + // This parameter is required. + // + // example: + // + // acs:ram::123456789012****:role/adminrole + RoleArn *string `json:"RoleArn,omitempty" xml:"RoleArn,omitempty"` + // The custom name of the role session. + // + // Set this parameter based on your business requirements. In most cases, you can set this parameter to the identity of the API caller. For example, you can specify a username. You can specify `RoleSessionName` to identify API callers that assume the same RAM role in ActionTrail logs. This allows you to track the users that perform the operations. + // + // The value must be 2 to 64 characters in length and can contain letters, digits, and the following special characters: `. @ - _`. + // + // This parameter is required. + // + // example: + // + // alice + RoleSessionName *string `json:"RoleSessionName,omitempty" xml:"RoleSessionName,omitempty"` + SourceIdentity *string `json:"SourceIdentity,omitempty" xml:"SourceIdentity,omitempty"` +} + +func (s AssumeRoleRequest) String() string { + return dara.Prettify(s) +} + +func (s AssumeRoleRequest) GoString() string { + return s.String() +} + +func (s *AssumeRoleRequest) GetDurationSeconds() *int64 { + return s.DurationSeconds +} + +func (s *AssumeRoleRequest) GetExternalId() *string { + return s.ExternalId +} + +func (s *AssumeRoleRequest) GetPolicy() *string { + return s.Policy +} + +func (s *AssumeRoleRequest) GetRoleArn() *string { + return s.RoleArn +} + +func (s *AssumeRoleRequest) GetRoleSessionName() *string { + return s.RoleSessionName +} + +func (s *AssumeRoleRequest) GetSourceIdentity() *string { + return s.SourceIdentity +} + +func (s *AssumeRoleRequest) SetDurationSeconds(v int64) *AssumeRoleRequest { + s.DurationSeconds = &v + return s +} + +func (s *AssumeRoleRequest) SetExternalId(v string) *AssumeRoleRequest { + s.ExternalId = &v + return s +} + +func (s *AssumeRoleRequest) SetPolicy(v string) *AssumeRoleRequest { + s.Policy = &v + return s +} + +func (s *AssumeRoleRequest) SetRoleArn(v string) *AssumeRoleRequest { + s.RoleArn = &v + return s +} + +func (s *AssumeRoleRequest) SetRoleSessionName(v string) *AssumeRoleRequest { + s.RoleSessionName = &v + return s +} + +func (s *AssumeRoleRequest) SetSourceIdentity(v string) *AssumeRoleRequest { + s.SourceIdentity = &v + return s +} + +func (s *AssumeRoleRequest) Validate() error { + return dara.Validate(s) +} diff --git a/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_response_body_model.go b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_response_body_model.go new file mode 100644 index 00000000..b5d53853 --- /dev/null +++ b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_response_body_model.go @@ -0,0 +1,214 @@ +// This file is auto-generated, don't edit it. Thanks. +package client + +import ( + "github.com/alibabacloud-go/tea/dara" +) + +type iAssumeRoleResponseBody interface { + dara.Model + String() string + GoString() string + SetAssumedRoleUser(v *AssumeRoleResponseBodyAssumedRoleUser) *AssumeRoleResponseBody + GetAssumedRoleUser() *AssumeRoleResponseBodyAssumedRoleUser + SetCredentials(v *AssumeRoleResponseBodyCredentials) *AssumeRoleResponseBody + GetCredentials() *AssumeRoleResponseBodyCredentials + SetRequestId(v string) *AssumeRoleResponseBody + GetRequestId() *string + SetSourceIdentity(v string) *AssumeRoleResponseBody + GetSourceIdentity() *string +} + +type AssumeRoleResponseBody struct { + // The temporary identity that you use to assume the RAM role. + AssumedRoleUser *AssumeRoleResponseBodyAssumedRoleUser `json:"AssumedRoleUser,omitempty" xml:"AssumedRoleUser,omitempty" type:"Struct"` + // The STS credentials. + Credentials *AssumeRoleResponseBodyCredentials `json:"Credentials,omitempty" xml:"Credentials,omitempty" type:"Struct"` + // The ID of the request. + // + // example: + // + // 6894B13B-6D71-4EF5-88FA-F32781734A7F + RequestId *string `json:"RequestId,omitempty" xml:"RequestId,omitempty"` + SourceIdentity *string `json:"SourceIdentity,omitempty" xml:"SourceIdentity,omitempty"` +} + +func (s AssumeRoleResponseBody) String() string { + return dara.Prettify(s) +} + +func (s AssumeRoleResponseBody) GoString() string { + return s.String() +} + +func (s *AssumeRoleResponseBody) GetAssumedRoleUser() *AssumeRoleResponseBodyAssumedRoleUser { + return s.AssumedRoleUser +} + +func (s *AssumeRoleResponseBody) GetCredentials() *AssumeRoleResponseBodyCredentials { + return s.Credentials +} + +func (s *AssumeRoleResponseBody) GetRequestId() *string { + return s.RequestId +} + +func (s *AssumeRoleResponseBody) GetSourceIdentity() *string { + return s.SourceIdentity +} + +func (s *AssumeRoleResponseBody) SetAssumedRoleUser(v *AssumeRoleResponseBodyAssumedRoleUser) *AssumeRoleResponseBody { + s.AssumedRoleUser = v + return s +} + +func (s *AssumeRoleResponseBody) SetCredentials(v *AssumeRoleResponseBodyCredentials) *AssumeRoleResponseBody { + s.Credentials = v + return s +} + +func (s *AssumeRoleResponseBody) SetRequestId(v string) *AssumeRoleResponseBody { + s.RequestId = &v + return s +} + +func (s *AssumeRoleResponseBody) SetSourceIdentity(v string) *AssumeRoleResponseBody { + s.SourceIdentity = &v + return s +} + +func (s *AssumeRoleResponseBody) Validate() error { + if s.AssumedRoleUser != nil { + if err := s.AssumedRoleUser.Validate(); err != nil { + return err + } + } + if s.Credentials != nil { + if err := s.Credentials.Validate(); err != nil { + return err + } + } + return nil +} + +type AssumeRoleResponseBodyAssumedRoleUser struct { + // The ARN of the temporary identity that you use to assume the RAM role. + // + // example: + // + // acs:ram::123456789012****:role/adminrole/alice + Arn *string `json:"Arn,omitempty" xml:"Arn,omitempty"` + // The ID of the temporary identity that you use to assume the RAM role. + // + // example: + // + // 34458433936495****:alice + AssumedRoleId *string `json:"AssumedRoleId,omitempty" xml:"AssumedRoleId,omitempty"` +} + +func (s AssumeRoleResponseBodyAssumedRoleUser) String() string { + return dara.Prettify(s) +} + +func (s AssumeRoleResponseBodyAssumedRoleUser) GoString() string { + return s.String() +} + +func (s *AssumeRoleResponseBodyAssumedRoleUser) GetArn() *string { + return s.Arn +} + +func (s *AssumeRoleResponseBodyAssumedRoleUser) GetAssumedRoleId() *string { + return s.AssumedRoleId +} + +func (s *AssumeRoleResponseBodyAssumedRoleUser) SetArn(v string) *AssumeRoleResponseBodyAssumedRoleUser { + s.Arn = &v + return s +} + +func (s *AssumeRoleResponseBodyAssumedRoleUser) SetAssumedRoleId(v string) *AssumeRoleResponseBodyAssumedRoleUser { + s.AssumedRoleId = &v + return s +} + +func (s *AssumeRoleResponseBodyAssumedRoleUser) Validate() error { + return dara.Validate(s) +} + +type AssumeRoleResponseBodyCredentials struct { + // The AccessKey ID. + // + // example: + // + // STS.L4aBSCSJVMuKg5U1**** + AccessKeyId *string `json:"AccessKeyId,omitempty" xml:"AccessKeyId,omitempty"` + // The AccessKey secret. + // + // example: + // + // wyLTSmsyPGP1ohvvw8xYgB29dlGI8KMiH2pK**** + AccessKeySecret *string `json:"AccessKeySecret,omitempty" xml:"AccessKeySecret,omitempty"` + // The time when the STS token expires. The time is displayed in UTC. + // + // example: + // + // 2015-04-09T11:52:19Z + Expiration *string `json:"Expiration,omitempty" xml:"Expiration,omitempty"` + // The STS token. + // + // > Alibaba Cloud STS does not impose limits on the length of STS tokens. We strongly recommend that you do not specify a maximum length for STS tokens. + // + // example: + // + // ******** + SecurityToken *string `json:"SecurityToken,omitempty" xml:"SecurityToken,omitempty"` +} + +func (s AssumeRoleResponseBodyCredentials) String() string { + return dara.Prettify(s) +} + +func (s AssumeRoleResponseBodyCredentials) GoString() string { + return s.String() +} + +func (s *AssumeRoleResponseBodyCredentials) GetAccessKeyId() *string { + return s.AccessKeyId +} + +func (s *AssumeRoleResponseBodyCredentials) GetAccessKeySecret() *string { + return s.AccessKeySecret +} + +func (s *AssumeRoleResponseBodyCredentials) GetExpiration() *string { + return s.Expiration +} + +func (s *AssumeRoleResponseBodyCredentials) GetSecurityToken() *string { + return s.SecurityToken +} + +func (s *AssumeRoleResponseBodyCredentials) SetAccessKeyId(v string) *AssumeRoleResponseBodyCredentials { + s.AccessKeyId = &v + return s +} + +func (s *AssumeRoleResponseBodyCredentials) SetAccessKeySecret(v string) *AssumeRoleResponseBodyCredentials { + s.AccessKeySecret = &v + return s +} + +func (s *AssumeRoleResponseBodyCredentials) SetExpiration(v string) *AssumeRoleResponseBodyCredentials { + s.Expiration = &v + return s +} + +func (s *AssumeRoleResponseBodyCredentials) SetSecurityToken(v string) *AssumeRoleResponseBodyCredentials { + s.SecurityToken = &v + return s +} + +func (s *AssumeRoleResponseBodyCredentials) Validate() error { + return dara.Validate(s) +} diff --git a/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_response_model.go b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_response_model.go new file mode 100644 index 00000000..f0e37d19 --- /dev/null +++ b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_response_model.go @@ -0,0 +1,68 @@ +// This file is auto-generated, don't edit it. Thanks. +package client + +import ( + "github.com/alibabacloud-go/tea/dara" +) + +type iAssumeRoleResponse interface { + dara.Model + String() string + GoString() string + SetHeaders(v map[string]*string) *AssumeRoleResponse + GetHeaders() map[string]*string + SetStatusCode(v int32) *AssumeRoleResponse + GetStatusCode() *int32 + SetBody(v *AssumeRoleResponseBody) *AssumeRoleResponse + GetBody() *AssumeRoleResponseBody +} + +type AssumeRoleResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"` + StatusCode *int32 `json:"statusCode,omitempty" xml:"statusCode,omitempty"` + Body *AssumeRoleResponseBody `json:"body,omitempty" xml:"body,omitempty"` +} + +func (s AssumeRoleResponse) String() string { + return dara.Prettify(s) +} + +func (s AssumeRoleResponse) GoString() string { + return s.String() +} + +func (s *AssumeRoleResponse) GetHeaders() map[string]*string { + return s.Headers +} + +func (s *AssumeRoleResponse) GetStatusCode() *int32 { + return s.StatusCode +} + +func (s *AssumeRoleResponse) GetBody() *AssumeRoleResponseBody { + return s.Body +} + +func (s *AssumeRoleResponse) SetHeaders(v map[string]*string) *AssumeRoleResponse { + s.Headers = v + return s +} + +func (s *AssumeRoleResponse) SetStatusCode(v int32) *AssumeRoleResponse { + s.StatusCode = &v + return s +} + +func (s *AssumeRoleResponse) SetBody(v *AssumeRoleResponseBody) *AssumeRoleResponse { + s.Body = v + return s +} + +func (s *AssumeRoleResponse) Validate() error { + if s.Body != nil { + if err := s.Body.Validate(); err != nil { + return err + } + } + return nil +} diff --git a/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_with_oidcrequest_model.go b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_with_oidcrequest_model.go new file mode 100644 index 00000000..f537e1e6 --- /dev/null +++ b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_with_oidcrequest_model.go @@ -0,0 +1,161 @@ +// This file is auto-generated, don't edit it. Thanks. +package client + +import ( + "github.com/alibabacloud-go/tea/dara" +) + +type iAssumeRoleWithOIDCRequest interface { + dara.Model + String() string + GoString() string + SetDurationSeconds(v int64) *AssumeRoleWithOIDCRequest + GetDurationSeconds() *int64 + SetOIDCProviderArn(v string) *AssumeRoleWithOIDCRequest + GetOIDCProviderArn() *string + SetOIDCToken(v string) *AssumeRoleWithOIDCRequest + GetOIDCToken() *string + SetPolicy(v string) *AssumeRoleWithOIDCRequest + GetPolicy() *string + SetRoleArn(v string) *AssumeRoleWithOIDCRequest + GetRoleArn() *string + SetRoleSessionName(v string) *AssumeRoleWithOIDCRequest + GetRoleSessionName() *string +} + +type AssumeRoleWithOIDCRequest struct { + // The validity period of the STS token. Unit: seconds. + // + // Default value: 3600. Minimum value: 900. Maximum value: the value of the `MaxSessionDuration` parameter. + // + // For more information about how to specify `MaxSessionDuration`, see [CreateRole](https://help.aliyun.com/document_detail/28710.html) or [UpdateRole](https://help.aliyun.com/document_detail/28712.html). + // + // example: + // + // 3600 + DurationSeconds *int64 `json:"DurationSeconds,omitempty" xml:"DurationSeconds,omitempty"` + // The Alibaba Cloud Resource Name (ARN) of the OIDC IdP. + // + // You can view the ARN in the RAM console or by calling operations. + // + // - For more information about how to view the ARN in the RAM console, see [View the information about an OIDC IdP](https://help.aliyun.com/document_detail/327123.html). + // + // - For more information about how to view the ARN by calling operations, see [GetOIDCProvider](https://help.aliyun.com/document_detail/327126.html) or [ListOIDCProviders](https://help.aliyun.com/document_detail/327127.html). + // + // example: + // + // acs:ram::113511544585****:oidc-provider/TestOidcIdp + OIDCProviderArn *string `json:"OIDCProviderArn,omitempty" xml:"OIDCProviderArn,omitempty"` + // The OIDC token that is issued by the external IdP. + // + // The OIDC token must be 4 to 20,000 characters in length. + // + // > You must enter the original OIDC token. You do not need to enter the Base64-encoded OIDC token. + // + // example: + // + // eyJraWQiOiJKQzl3eHpyaHFKMGd0**** + OIDCToken *string `json:"OIDCToken,omitempty" xml:"OIDCToken,omitempty"` + // The policy that specifies the permissions of the returned STS token. You can use this parameter to grant the STS token fewer permissions than the permissions granted to the RAM role. + // + // - If you specify this parameter, the permissions of the returned STS token are the permissions that are included in the value of this parameter and owned by the RAM role. + // + // - If you do not specify this parameter, the returned STS token has all the permissions of the RAM role. + // + // The value must be 1 to 2,048 characters in length. + // + // example: + // + // {"Statement": [{"Action": ["*"],"Effect": "Allow","Resource": ["*"]}],"Version":"1"} + Policy *string `json:"Policy,omitempty" xml:"Policy,omitempty"` + // The ARN of the RAM role. + // + // You can view the ARN in the RAM console or by calling operations. + // + // - For more information about how to view the ARN in the RAM console, see [How do I view the ARN of the RAM role?](https://help.aliyun.com/document_detail/39744.html) + // + // - For more information about how to view the ARN by calling operations, see [ListRoles](https://help.aliyun.com/document_detail/28713.html) or [GetRole](https://help.aliyun.com/document_detail/28711.html). + // + // example: + // + // acs:ram::113511544585****:role/testoidc + RoleArn *string `json:"RoleArn,omitempty" xml:"RoleArn,omitempty"` + // The custom name of the role session. + // + // Set this parameter based on your business requirements. In most cases, this parameter is set to the identity of the user who calls the operation, for example, the username. In ActionTrail logs, you can distinguish the users who assume the same RAM role to perform operations based on the value of the RoleSessionName parameter. This way, you can perform user-specific auditing. + // + // The value can contain letters, digits, periods (.), at signs (@), hyphens (-), and underscores (_). + // + // The value must be 2 to 64 characters in length. + // + // example: + // + // TestOidcAssumedRoleSession + RoleSessionName *string `json:"RoleSessionName,omitempty" xml:"RoleSessionName,omitempty"` +} + +func (s AssumeRoleWithOIDCRequest) String() string { + return dara.Prettify(s) +} + +func (s AssumeRoleWithOIDCRequest) GoString() string { + return s.String() +} + +func (s *AssumeRoleWithOIDCRequest) GetDurationSeconds() *int64 { + return s.DurationSeconds +} + +func (s *AssumeRoleWithOIDCRequest) GetOIDCProviderArn() *string { + return s.OIDCProviderArn +} + +func (s *AssumeRoleWithOIDCRequest) GetOIDCToken() *string { + return s.OIDCToken +} + +func (s *AssumeRoleWithOIDCRequest) GetPolicy() *string { + return s.Policy +} + +func (s *AssumeRoleWithOIDCRequest) GetRoleArn() *string { + return s.RoleArn +} + +func (s *AssumeRoleWithOIDCRequest) GetRoleSessionName() *string { + return s.RoleSessionName +} + +func (s *AssumeRoleWithOIDCRequest) SetDurationSeconds(v int64) *AssumeRoleWithOIDCRequest { + s.DurationSeconds = &v + return s +} + +func (s *AssumeRoleWithOIDCRequest) SetOIDCProviderArn(v string) *AssumeRoleWithOIDCRequest { + s.OIDCProviderArn = &v + return s +} + +func (s *AssumeRoleWithOIDCRequest) SetOIDCToken(v string) *AssumeRoleWithOIDCRequest { + s.OIDCToken = &v + return s +} + +func (s *AssumeRoleWithOIDCRequest) SetPolicy(v string) *AssumeRoleWithOIDCRequest { + s.Policy = &v + return s +} + +func (s *AssumeRoleWithOIDCRequest) SetRoleArn(v string) *AssumeRoleWithOIDCRequest { + s.RoleArn = &v + return s +} + +func (s *AssumeRoleWithOIDCRequest) SetRoleSessionName(v string) *AssumeRoleWithOIDCRequest { + s.RoleSessionName = &v + return s +} + +func (s *AssumeRoleWithOIDCRequest) Validate() error { + return dara.Validate(s) +} diff --git a/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_with_oidcresponse_body_model.go b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_with_oidcresponse_body_model.go new file mode 100644 index 00000000..5b6c875a --- /dev/null +++ b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_with_oidcresponse_body_model.go @@ -0,0 +1,343 @@ +// This file is auto-generated, don't edit it. Thanks. +package client + +import ( + "github.com/alibabacloud-go/tea/dara" +) + +type iAssumeRoleWithOIDCResponseBody interface { + dara.Model + String() string + GoString() string + SetAssumedRoleUser(v *AssumeRoleWithOIDCResponseBodyAssumedRoleUser) *AssumeRoleWithOIDCResponseBody + GetAssumedRoleUser() *AssumeRoleWithOIDCResponseBodyAssumedRoleUser + SetCredentials(v *AssumeRoleWithOIDCResponseBodyCredentials) *AssumeRoleWithOIDCResponseBody + GetCredentials() *AssumeRoleWithOIDCResponseBodyCredentials + SetOIDCTokenInfo(v *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) *AssumeRoleWithOIDCResponseBody + GetOIDCTokenInfo() *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo + SetRequestId(v string) *AssumeRoleWithOIDCResponseBody + GetRequestId() *string + SetSourceIdentity(v string) *AssumeRoleWithOIDCResponseBody + GetSourceIdentity() *string +} + +type AssumeRoleWithOIDCResponseBody struct { + // The temporary identity that you use to assume the RAM role. + AssumedRoleUser *AssumeRoleWithOIDCResponseBodyAssumedRoleUser `json:"AssumedRoleUser,omitempty" xml:"AssumedRoleUser,omitempty" type:"Struct"` + // The access credentials. + Credentials *AssumeRoleWithOIDCResponseBodyCredentials `json:"Credentials,omitempty" xml:"Credentials,omitempty" type:"Struct"` + // The information about the OIDC token. + OIDCTokenInfo *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo `json:"OIDCTokenInfo,omitempty" xml:"OIDCTokenInfo,omitempty" type:"Struct"` + // The ID of the request. + // + // example: + // + // 3D57EAD2-8723-1F26-B69C-F8707D8B565D + RequestId *string `json:"RequestId,omitempty" xml:"RequestId,omitempty"` + SourceIdentity *string `json:"SourceIdentity,omitempty" xml:"SourceIdentity,omitempty"` +} + +func (s AssumeRoleWithOIDCResponseBody) String() string { + return dara.Prettify(s) +} + +func (s AssumeRoleWithOIDCResponseBody) GoString() string { + return s.String() +} + +func (s *AssumeRoleWithOIDCResponseBody) GetAssumedRoleUser() *AssumeRoleWithOIDCResponseBodyAssumedRoleUser { + return s.AssumedRoleUser +} + +func (s *AssumeRoleWithOIDCResponseBody) GetCredentials() *AssumeRoleWithOIDCResponseBodyCredentials { + return s.Credentials +} + +func (s *AssumeRoleWithOIDCResponseBody) GetOIDCTokenInfo() *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo { + return s.OIDCTokenInfo +} + +func (s *AssumeRoleWithOIDCResponseBody) GetRequestId() *string { + return s.RequestId +} + +func (s *AssumeRoleWithOIDCResponseBody) GetSourceIdentity() *string { + return s.SourceIdentity +} + +func (s *AssumeRoleWithOIDCResponseBody) SetAssumedRoleUser(v *AssumeRoleWithOIDCResponseBodyAssumedRoleUser) *AssumeRoleWithOIDCResponseBody { + s.AssumedRoleUser = v + return s +} + +func (s *AssumeRoleWithOIDCResponseBody) SetCredentials(v *AssumeRoleWithOIDCResponseBodyCredentials) *AssumeRoleWithOIDCResponseBody { + s.Credentials = v + return s +} + +func (s *AssumeRoleWithOIDCResponseBody) SetOIDCTokenInfo(v *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) *AssumeRoleWithOIDCResponseBody { + s.OIDCTokenInfo = v + return s +} + +func (s *AssumeRoleWithOIDCResponseBody) SetRequestId(v string) *AssumeRoleWithOIDCResponseBody { + s.RequestId = &v + return s +} + +func (s *AssumeRoleWithOIDCResponseBody) SetSourceIdentity(v string) *AssumeRoleWithOIDCResponseBody { + s.SourceIdentity = &v + return s +} + +func (s *AssumeRoleWithOIDCResponseBody) Validate() error { + if s.AssumedRoleUser != nil { + if err := s.AssumedRoleUser.Validate(); err != nil { + return err + } + } + if s.Credentials != nil { + if err := s.Credentials.Validate(); err != nil { + return err + } + } + if s.OIDCTokenInfo != nil { + if err := s.OIDCTokenInfo.Validate(); err != nil { + return err + } + } + return nil +} + +type AssumeRoleWithOIDCResponseBodyAssumedRoleUser struct { + // The ARN of the temporary identity that you use to assume the RAM role. + // + // example: + // + // acs:ram::113511544585****:role/testoidc/TestOidcAssumedRoleSession + Arn *string `json:"Arn,omitempty" xml:"Arn,omitempty"` + // The ID of the temporary identity that you use to assume the RAM role. + // + // example: + // + // 33157794895460**** + AssumedRoleId *string `json:"AssumedRoleId,omitempty" xml:"AssumedRoleId,omitempty"` +} + +func (s AssumeRoleWithOIDCResponseBodyAssumedRoleUser) String() string { + return dara.Prettify(s) +} + +func (s AssumeRoleWithOIDCResponseBodyAssumedRoleUser) GoString() string { + return s.String() +} + +func (s *AssumeRoleWithOIDCResponseBodyAssumedRoleUser) GetArn() *string { + return s.Arn +} + +func (s *AssumeRoleWithOIDCResponseBodyAssumedRoleUser) GetAssumedRoleId() *string { + return s.AssumedRoleId +} + +func (s *AssumeRoleWithOIDCResponseBodyAssumedRoleUser) SetArn(v string) *AssumeRoleWithOIDCResponseBodyAssumedRoleUser { + s.Arn = &v + return s +} + +func (s *AssumeRoleWithOIDCResponseBodyAssumedRoleUser) SetAssumedRoleId(v string) *AssumeRoleWithOIDCResponseBodyAssumedRoleUser { + s.AssumedRoleId = &v + return s +} + +func (s *AssumeRoleWithOIDCResponseBodyAssumedRoleUser) Validate() error { + return dara.Validate(s) +} + +type AssumeRoleWithOIDCResponseBodyCredentials struct { + // The AccessKey ID. + // + // example: + // + // STS.NUgYrLnoC37mZZCNnAbez**** + AccessKeyId *string `json:"AccessKeyId,omitempty" xml:"AccessKeyId,omitempty"` + // The AccessKey secret. + // + // example: + // + // CVwjCkNzTMupZ8NbTCxCBRq3K16jtcWFTJAyBEv2**** + AccessKeySecret *string `json:"AccessKeySecret,omitempty" xml:"AccessKeySecret,omitempty"` + // The time when the STS token expires. The time is displayed in UTC. + // + // example: + // + // 2021-10-20T04:27:09Z + Expiration *string `json:"Expiration,omitempty" xml:"Expiration,omitempty"` + // The STS token. + // + // > Alibaba Cloud STS does not impose limits on the length of STS tokens. We strongly recommend that you do not specify a maximum length for STS tokens. + // + // example: + // + // CAIShwJ1q6Ft5B2yfSjIr5bSEsj4g7BihPWGWHz**** + SecurityToken *string `json:"SecurityToken,omitempty" xml:"SecurityToken,omitempty"` +} + +func (s AssumeRoleWithOIDCResponseBodyCredentials) String() string { + return dara.Prettify(s) +} + +func (s AssumeRoleWithOIDCResponseBodyCredentials) GoString() string { + return s.String() +} + +func (s *AssumeRoleWithOIDCResponseBodyCredentials) GetAccessKeyId() *string { + return s.AccessKeyId +} + +func (s *AssumeRoleWithOIDCResponseBodyCredentials) GetAccessKeySecret() *string { + return s.AccessKeySecret +} + +func (s *AssumeRoleWithOIDCResponseBodyCredentials) GetExpiration() *string { + return s.Expiration +} + +func (s *AssumeRoleWithOIDCResponseBodyCredentials) GetSecurityToken() *string { + return s.SecurityToken +} + +func (s *AssumeRoleWithOIDCResponseBodyCredentials) SetAccessKeyId(v string) *AssumeRoleWithOIDCResponseBodyCredentials { + s.AccessKeyId = &v + return s +} + +func (s *AssumeRoleWithOIDCResponseBodyCredentials) SetAccessKeySecret(v string) *AssumeRoleWithOIDCResponseBodyCredentials { + s.AccessKeySecret = &v + return s +} + +func (s *AssumeRoleWithOIDCResponseBodyCredentials) SetExpiration(v string) *AssumeRoleWithOIDCResponseBodyCredentials { + s.Expiration = &v + return s +} + +func (s *AssumeRoleWithOIDCResponseBodyCredentials) SetSecurityToken(v string) *AssumeRoleWithOIDCResponseBodyCredentials { + s.SecurityToken = &v + return s +} + +func (s *AssumeRoleWithOIDCResponseBodyCredentials) Validate() error { + return dara.Validate(s) +} + +type AssumeRoleWithOIDCResponseBodyOIDCTokenInfo struct { + // The audience. If multiple audiences are returned, the audiences are separated by commas (,). + // + // The audience is represented by the `aud` field in the OIDC Token. + // + // example: + // + // 496271242565057**** + ClientIds *string `json:"ClientIds,omitempty" xml:"ClientIds,omitempty"` + // The time when the OIDC token expires. + // + // example: + // + // 2021-10-20T04:27:09Z + ExpirationTime *string `json:"ExpirationTime,omitempty" xml:"ExpirationTime,omitempty"` + // The time when the OIDC token was issued. + // + // example: + // + // 2021-10-20T03:27:09Z + IssuanceTime *string `json:"IssuanceTime,omitempty" xml:"IssuanceTime,omitempty"` + // The URL of the issuer, + // + // which is represented by the `iss` field in the OIDC Token. + // + // example: + // + // https://dev-xxxxxx.okta.com + Issuer *string `json:"Issuer,omitempty" xml:"Issuer,omitempty"` + // The subject, + // + // which is represented by the `sub` field in the OIDC Token. + // + // example: + // + // KryrkIdjylZb7agUgCEf**** + Subject *string `json:"Subject,omitempty" xml:"Subject,omitempty"` + // The verification information about the OIDC token. For more information, see [Manage an OIDC IdP](https://help.aliyun.com/document_detail/327123.html). + // + // example: + // + // Success + VerificationInfo *string `json:"VerificationInfo,omitempty" xml:"VerificationInfo,omitempty"` +} + +func (s AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) String() string { + return dara.Prettify(s) +} + +func (s AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) GoString() string { + return s.String() +} + +func (s *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) GetClientIds() *string { + return s.ClientIds +} + +func (s *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) GetExpirationTime() *string { + return s.ExpirationTime +} + +func (s *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) GetIssuanceTime() *string { + return s.IssuanceTime +} + +func (s *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) GetIssuer() *string { + return s.Issuer +} + +func (s *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) GetSubject() *string { + return s.Subject +} + +func (s *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) GetVerificationInfo() *string { + return s.VerificationInfo +} + +func (s *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) SetClientIds(v string) *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo { + s.ClientIds = &v + return s +} + +func (s *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) SetExpirationTime(v string) *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo { + s.ExpirationTime = &v + return s +} + +func (s *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) SetIssuanceTime(v string) *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo { + s.IssuanceTime = &v + return s +} + +func (s *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) SetIssuer(v string) *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo { + s.Issuer = &v + return s +} + +func (s *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) SetSubject(v string) *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo { + s.Subject = &v + return s +} + +func (s *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) SetVerificationInfo(v string) *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo { + s.VerificationInfo = &v + return s +} + +func (s *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) Validate() error { + return dara.Validate(s) +} diff --git a/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_with_oidcresponse_model.go b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_with_oidcresponse_model.go new file mode 100644 index 00000000..eb39ea05 --- /dev/null +++ b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_with_oidcresponse_model.go @@ -0,0 +1,68 @@ +// This file is auto-generated, don't edit it. Thanks. +package client + +import ( + "github.com/alibabacloud-go/tea/dara" +) + +type iAssumeRoleWithOIDCResponse interface { + dara.Model + String() string + GoString() string + SetHeaders(v map[string]*string) *AssumeRoleWithOIDCResponse + GetHeaders() map[string]*string + SetStatusCode(v int32) *AssumeRoleWithOIDCResponse + GetStatusCode() *int32 + SetBody(v *AssumeRoleWithOIDCResponseBody) *AssumeRoleWithOIDCResponse + GetBody() *AssumeRoleWithOIDCResponseBody +} + +type AssumeRoleWithOIDCResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"` + StatusCode *int32 `json:"statusCode,omitempty" xml:"statusCode,omitempty"` + Body *AssumeRoleWithOIDCResponseBody `json:"body,omitempty" xml:"body,omitempty"` +} + +func (s AssumeRoleWithOIDCResponse) String() string { + return dara.Prettify(s) +} + +func (s AssumeRoleWithOIDCResponse) GoString() string { + return s.String() +} + +func (s *AssumeRoleWithOIDCResponse) GetHeaders() map[string]*string { + return s.Headers +} + +func (s *AssumeRoleWithOIDCResponse) GetStatusCode() *int32 { + return s.StatusCode +} + +func (s *AssumeRoleWithOIDCResponse) GetBody() *AssumeRoleWithOIDCResponseBody { + return s.Body +} + +func (s *AssumeRoleWithOIDCResponse) SetHeaders(v map[string]*string) *AssumeRoleWithOIDCResponse { + s.Headers = v + return s +} + +func (s *AssumeRoleWithOIDCResponse) SetStatusCode(v int32) *AssumeRoleWithOIDCResponse { + s.StatusCode = &v + return s +} + +func (s *AssumeRoleWithOIDCResponse) SetBody(v *AssumeRoleWithOIDCResponseBody) *AssumeRoleWithOIDCResponse { + s.Body = v + return s +} + +func (s *AssumeRoleWithOIDCResponse) Validate() error { + if s.Body != nil { + if err := s.Body.Validate(); err != nil { + return err + } + } + return nil +} diff --git a/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_with_samlrequest_model.go b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_with_samlrequest_model.go new file mode 100644 index 00000000..c146b978 --- /dev/null +++ b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_with_samlrequest_model.go @@ -0,0 +1,144 @@ +// This file is auto-generated, don't edit it. Thanks. +package client + +import ( + "github.com/alibabacloud-go/tea/dara" +) + +type iAssumeRoleWithSAMLRequest interface { + dara.Model + String() string + GoString() string + SetDurationSeconds(v int64) *AssumeRoleWithSAMLRequest + GetDurationSeconds() *int64 + SetPolicy(v string) *AssumeRoleWithSAMLRequest + GetPolicy() *string + SetRoleArn(v string) *AssumeRoleWithSAMLRequest + GetRoleArn() *string + SetSAMLAssertion(v string) *AssumeRoleWithSAMLRequest + GetSAMLAssertion() *string + SetSAMLProviderArn(v string) *AssumeRoleWithSAMLRequest + GetSAMLProviderArn() *string +} + +type AssumeRoleWithSAMLRequest struct { + // The validity period of the STS token. Unit: seconds. + // + // Minimum value: 900. Maximum value: the value of the `MaxSessionDuration` parameter. Default value: 3600. + // + // You can call the CreateRole or UpdateRole operation to configure the `MaxSessionDuration` parameter. For more information, see [CreateRole](https://help.aliyun.com/document_detail/28710.html) or [UpdateRole](https://help.aliyun.com/document_detail/28712.html). + // + // example: + // + // 3600 + DurationSeconds *int64 `json:"DurationSeconds,omitempty" xml:"DurationSeconds,omitempty"` + // The policy that specifies the permissions of the returned STS token. You can use this parameter to grant the STS token fewer permissions than the permissions granted to the RAM role. + // + // - If you specify this parameter, the permissions of the returned STS token are the permissions that are included in the value of this parameter and owned by the RAM role. + // + // - If you do not specify this parameter, the returned STS token has all the permissions of the RAM role. + // + // The value must be 1 to 2,048 characters in length. + // + // example: + // + // url_encoded_policy + Policy *string `json:"Policy,omitempty" xml:"Policy,omitempty"` + // The ARN of the RAM role. + // + // The trust entity of the RAM role is a SAML IdP. For more information, see [Create a RAM role for a trusted IdP](https://help.aliyun.com/document_detail/116805.html) or [CreateRole](https://help.aliyun.com/document_detail/28710.html). + // + // Format: `acs:ram:::role/`. + // + // You can view the ARN in the RAM console or by calling operations. + // + // - For more information about how to view the ARN in the RAM console, see [How do I view the ARN of the RAM role?](https://help.aliyun.com/document_detail/39744.html). + // + // - For more information about how to view the ARN by calling operations, see [ListRoles](https://help.aliyun.com/document_detail/28713.html) or [GetRole](https://help.aliyun.com/document_detail/28711.html). + // + // example: + // + // acs:ram::123456789012****:role/adminrole + RoleArn *string `json:"RoleArn,omitempty" xml:"RoleArn,omitempty"` + // The Base64-encoded SAML assertion. + // + // The value must be 4 to 100,000 characters in length. + // + // > A complete SAML response rather than a single SAMLAssertion field must be retrieved from the external IdP. + // + // example: + // + // base64_encoded_saml_assertion + SAMLAssertion *string `json:"SAMLAssertion,omitempty" xml:"SAMLAssertion,omitempty"` + // The Alibaba Cloud Resource Name (ARN) of the SAML IdP that is created in the RAM console. + // + // Format: `acs:ram:::saml-provider/`. + // + // You can view the ARN in the RAM console or by calling operations. + // + // - For more information about how to view the ARN in the RAM console, see [How do I view the ARN of a RAM role?](https://help.aliyun.com/document_detail/116795.html) + // + // - For more information about how to view the ARN by calling operations, see [GetSAMLProvider](https://help.aliyun.com/document_detail/186833.html) or [ListSAMLProviders](https://help.aliyun.com/document_detail/186851.html). + // + // example: + // + // acs:ram::123456789012****:saml-provider/company1 + SAMLProviderArn *string `json:"SAMLProviderArn,omitempty" xml:"SAMLProviderArn,omitempty"` +} + +func (s AssumeRoleWithSAMLRequest) String() string { + return dara.Prettify(s) +} + +func (s AssumeRoleWithSAMLRequest) GoString() string { + return s.String() +} + +func (s *AssumeRoleWithSAMLRequest) GetDurationSeconds() *int64 { + return s.DurationSeconds +} + +func (s *AssumeRoleWithSAMLRequest) GetPolicy() *string { + return s.Policy +} + +func (s *AssumeRoleWithSAMLRequest) GetRoleArn() *string { + return s.RoleArn +} + +func (s *AssumeRoleWithSAMLRequest) GetSAMLAssertion() *string { + return s.SAMLAssertion +} + +func (s *AssumeRoleWithSAMLRequest) GetSAMLProviderArn() *string { + return s.SAMLProviderArn +} + +func (s *AssumeRoleWithSAMLRequest) SetDurationSeconds(v int64) *AssumeRoleWithSAMLRequest { + s.DurationSeconds = &v + return s +} + +func (s *AssumeRoleWithSAMLRequest) SetPolicy(v string) *AssumeRoleWithSAMLRequest { + s.Policy = &v + return s +} + +func (s *AssumeRoleWithSAMLRequest) SetRoleArn(v string) *AssumeRoleWithSAMLRequest { + s.RoleArn = &v + return s +} + +func (s *AssumeRoleWithSAMLRequest) SetSAMLAssertion(v string) *AssumeRoleWithSAMLRequest { + s.SAMLAssertion = &v + return s +} + +func (s *AssumeRoleWithSAMLRequest) SetSAMLProviderArn(v string) *AssumeRoleWithSAMLRequest { + s.SAMLProviderArn = &v + return s +} + +func (s *AssumeRoleWithSAMLRequest) Validate() error { + return dara.Validate(s) +} diff --git a/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_with_samlresponse_body_model.go b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_with_samlresponse_body_model.go new file mode 100644 index 00000000..16949d14 --- /dev/null +++ b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_with_samlresponse_body_model.go @@ -0,0 +1,307 @@ +// This file is auto-generated, don't edit it. Thanks. +package client + +import ( + "github.com/alibabacloud-go/tea/dara" +) + +type iAssumeRoleWithSAMLResponseBody interface { + dara.Model + String() string + GoString() string + SetAssumedRoleUser(v *AssumeRoleWithSAMLResponseBodyAssumedRoleUser) *AssumeRoleWithSAMLResponseBody + GetAssumedRoleUser() *AssumeRoleWithSAMLResponseBodyAssumedRoleUser + SetCredentials(v *AssumeRoleWithSAMLResponseBodyCredentials) *AssumeRoleWithSAMLResponseBody + GetCredentials() *AssumeRoleWithSAMLResponseBodyCredentials + SetRequestId(v string) *AssumeRoleWithSAMLResponseBody + GetRequestId() *string + SetSAMLAssertionInfo(v *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo) *AssumeRoleWithSAMLResponseBody + GetSAMLAssertionInfo() *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo + SetSourceIdentity(v string) *AssumeRoleWithSAMLResponseBody + GetSourceIdentity() *string +} + +type AssumeRoleWithSAMLResponseBody struct { + // The temporary identity that you use to assume the RAM role. + AssumedRoleUser *AssumeRoleWithSAMLResponseBodyAssumedRoleUser `json:"AssumedRoleUser,omitempty" xml:"AssumedRoleUser,omitempty" type:"Struct"` + // The STS credentials. + Credentials *AssumeRoleWithSAMLResponseBodyCredentials `json:"Credentials,omitempty" xml:"Credentials,omitempty" type:"Struct"` + // The ID of the request. + // + // example: + // + // 6894B13B-6D71-4EF5-88FA-F32781734A7F + RequestId *string `json:"RequestId,omitempty" xml:"RequestId,omitempty"` + // The information in the SAML assertion. + SAMLAssertionInfo *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo `json:"SAMLAssertionInfo,omitempty" xml:"SAMLAssertionInfo,omitempty" type:"Struct"` + SourceIdentity *string `json:"SourceIdentity,omitempty" xml:"SourceIdentity,omitempty"` +} + +func (s AssumeRoleWithSAMLResponseBody) String() string { + return dara.Prettify(s) +} + +func (s AssumeRoleWithSAMLResponseBody) GoString() string { + return s.String() +} + +func (s *AssumeRoleWithSAMLResponseBody) GetAssumedRoleUser() *AssumeRoleWithSAMLResponseBodyAssumedRoleUser { + return s.AssumedRoleUser +} + +func (s *AssumeRoleWithSAMLResponseBody) GetCredentials() *AssumeRoleWithSAMLResponseBodyCredentials { + return s.Credentials +} + +func (s *AssumeRoleWithSAMLResponseBody) GetRequestId() *string { + return s.RequestId +} + +func (s *AssumeRoleWithSAMLResponseBody) GetSAMLAssertionInfo() *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo { + return s.SAMLAssertionInfo +} + +func (s *AssumeRoleWithSAMLResponseBody) GetSourceIdentity() *string { + return s.SourceIdentity +} + +func (s *AssumeRoleWithSAMLResponseBody) SetAssumedRoleUser(v *AssumeRoleWithSAMLResponseBodyAssumedRoleUser) *AssumeRoleWithSAMLResponseBody { + s.AssumedRoleUser = v + return s +} + +func (s *AssumeRoleWithSAMLResponseBody) SetCredentials(v *AssumeRoleWithSAMLResponseBodyCredentials) *AssumeRoleWithSAMLResponseBody { + s.Credentials = v + return s +} + +func (s *AssumeRoleWithSAMLResponseBody) SetRequestId(v string) *AssumeRoleWithSAMLResponseBody { + s.RequestId = &v + return s +} + +func (s *AssumeRoleWithSAMLResponseBody) SetSAMLAssertionInfo(v *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo) *AssumeRoleWithSAMLResponseBody { + s.SAMLAssertionInfo = v + return s +} + +func (s *AssumeRoleWithSAMLResponseBody) SetSourceIdentity(v string) *AssumeRoleWithSAMLResponseBody { + s.SourceIdentity = &v + return s +} + +func (s *AssumeRoleWithSAMLResponseBody) Validate() error { + if s.AssumedRoleUser != nil { + if err := s.AssumedRoleUser.Validate(); err != nil { + return err + } + } + if s.Credentials != nil { + if err := s.Credentials.Validate(); err != nil { + return err + } + } + if s.SAMLAssertionInfo != nil { + if err := s.SAMLAssertionInfo.Validate(); err != nil { + return err + } + } + return nil +} + +type AssumeRoleWithSAMLResponseBodyAssumedRoleUser struct { + // The ARN of the temporary identity that you use to assume the RAM role. + // + // example: + // + // acs:sts::123456789012****:assumed-role/AdminRole/alice + Arn *string `json:"Arn,omitempty" xml:"Arn,omitempty"` + // The ID of the temporary identity that you use to assume the RAM role. + // + // example: + // + // 34458433936495****:alice + AssumedRoleId *string `json:"AssumedRoleId,omitempty" xml:"AssumedRoleId,omitempty"` +} + +func (s AssumeRoleWithSAMLResponseBodyAssumedRoleUser) String() string { + return dara.Prettify(s) +} + +func (s AssumeRoleWithSAMLResponseBodyAssumedRoleUser) GoString() string { + return s.String() +} + +func (s *AssumeRoleWithSAMLResponseBodyAssumedRoleUser) GetArn() *string { + return s.Arn +} + +func (s *AssumeRoleWithSAMLResponseBodyAssumedRoleUser) GetAssumedRoleId() *string { + return s.AssumedRoleId +} + +func (s *AssumeRoleWithSAMLResponseBodyAssumedRoleUser) SetArn(v string) *AssumeRoleWithSAMLResponseBodyAssumedRoleUser { + s.Arn = &v + return s +} + +func (s *AssumeRoleWithSAMLResponseBodyAssumedRoleUser) SetAssumedRoleId(v string) *AssumeRoleWithSAMLResponseBodyAssumedRoleUser { + s.AssumedRoleId = &v + return s +} + +func (s *AssumeRoleWithSAMLResponseBodyAssumedRoleUser) Validate() error { + return dara.Validate(s) +} + +type AssumeRoleWithSAMLResponseBodyCredentials struct { + // The AccessKey ID. + // + // example: + // + // STS.L4aBSCSJVMuKg5U1**** + AccessKeyId *string `json:"AccessKeyId,omitempty" xml:"AccessKeyId,omitempty"` + // The AccessKey secret. + // + // example: + // + // wyLTSmsyPGP1ohvvw8xYgB29dlGI8KMiH2pK**** + AccessKeySecret *string `json:"AccessKeySecret,omitempty" xml:"AccessKeySecret,omitempty"` + // The time when the STS token expires. The time is displayed in UTC. + // + // example: + // + // 2015-04-09T11:52:19Z + Expiration *string `json:"Expiration,omitempty" xml:"Expiration,omitempty"` + // The STS token. + // + // > Alibaba Cloud STS does not impose limits on the length of STS tokens. We strongly recommend that you do not specify a maximum length for STS tokens. + // + // example: + // + // ******** + SecurityToken *string `json:"SecurityToken,omitempty" xml:"SecurityToken,omitempty"` +} + +func (s AssumeRoleWithSAMLResponseBodyCredentials) String() string { + return dara.Prettify(s) +} + +func (s AssumeRoleWithSAMLResponseBodyCredentials) GoString() string { + return s.String() +} + +func (s *AssumeRoleWithSAMLResponseBodyCredentials) GetAccessKeyId() *string { + return s.AccessKeyId +} + +func (s *AssumeRoleWithSAMLResponseBodyCredentials) GetAccessKeySecret() *string { + return s.AccessKeySecret +} + +func (s *AssumeRoleWithSAMLResponseBodyCredentials) GetExpiration() *string { + return s.Expiration +} + +func (s *AssumeRoleWithSAMLResponseBodyCredentials) GetSecurityToken() *string { + return s.SecurityToken +} + +func (s *AssumeRoleWithSAMLResponseBodyCredentials) SetAccessKeyId(v string) *AssumeRoleWithSAMLResponseBodyCredentials { + s.AccessKeyId = &v + return s +} + +func (s *AssumeRoleWithSAMLResponseBodyCredentials) SetAccessKeySecret(v string) *AssumeRoleWithSAMLResponseBodyCredentials { + s.AccessKeySecret = &v + return s +} + +func (s *AssumeRoleWithSAMLResponseBodyCredentials) SetExpiration(v string) *AssumeRoleWithSAMLResponseBodyCredentials { + s.Expiration = &v + return s +} + +func (s *AssumeRoleWithSAMLResponseBodyCredentials) SetSecurityToken(v string) *AssumeRoleWithSAMLResponseBodyCredentials { + s.SecurityToken = &v + return s +} + +func (s *AssumeRoleWithSAMLResponseBodyCredentials) Validate() error { + return dara.Validate(s) +} + +type AssumeRoleWithSAMLResponseBodySAMLAssertionInfo struct { + // The value in the `Issuer` element in the SAML assertion. + // + // example: + // + // http://example.com/adfs/services/trust + Issuer *string `json:"Issuer,omitempty" xml:"Issuer,omitempty"` + // The `Recipient` attribute of the SubjectConfirmationData sub-element. SubjectConfirmationData is a sub-element of the `Subject` element in the SAML assertion. + // + // example: + // + // https://signin.aliyun.com/saml-role/SSO + Recipient *string `json:"Recipient,omitempty" xml:"Recipient,omitempty"` + // The value in the NameID sub-element of the `Subject` element in the SAML assertion. + // + // example: + // + // alice@example.com + Subject *string `json:"Subject,omitempty" xml:"Subject,omitempty"` + // The Format attribute of the `NameID` element in the SAML assertion. If the Format attribute is prefixed with `urn:oasis:names:tc:SAML:2.0:nameid-format:`, the prefix is not included in the value of this parameter. For example, if the value of the Format attribute is urn:oasis:names:tc:SAML:2.0:nameid-format:persistent/transient, the value of this parameter is `persistent/transient`. + // + // example: + // + // persistent + SubjectType *string `json:"SubjectType,omitempty" xml:"SubjectType,omitempty"` +} + +func (s AssumeRoleWithSAMLResponseBodySAMLAssertionInfo) String() string { + return dara.Prettify(s) +} + +func (s AssumeRoleWithSAMLResponseBodySAMLAssertionInfo) GoString() string { + return s.String() +} + +func (s *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo) GetIssuer() *string { + return s.Issuer +} + +func (s *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo) GetRecipient() *string { + return s.Recipient +} + +func (s *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo) GetSubject() *string { + return s.Subject +} + +func (s *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo) GetSubjectType() *string { + return s.SubjectType +} + +func (s *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo) SetIssuer(v string) *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo { + s.Issuer = &v + return s +} + +func (s *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo) SetRecipient(v string) *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo { + s.Recipient = &v + return s +} + +func (s *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo) SetSubject(v string) *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo { + s.Subject = &v + return s +} + +func (s *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo) SetSubjectType(v string) *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo { + s.SubjectType = &v + return s +} + +func (s *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo) Validate() error { + return dara.Validate(s) +} diff --git a/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_with_samlresponse_model.go b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_with_samlresponse_model.go new file mode 100644 index 00000000..f74cde9c --- /dev/null +++ b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/assume_role_with_samlresponse_model.go @@ -0,0 +1,68 @@ +// This file is auto-generated, don't edit it. Thanks. +package client + +import ( + "github.com/alibabacloud-go/tea/dara" +) + +type iAssumeRoleWithSAMLResponse interface { + dara.Model + String() string + GoString() string + SetHeaders(v map[string]*string) *AssumeRoleWithSAMLResponse + GetHeaders() map[string]*string + SetStatusCode(v int32) *AssumeRoleWithSAMLResponse + GetStatusCode() *int32 + SetBody(v *AssumeRoleWithSAMLResponseBody) *AssumeRoleWithSAMLResponse + GetBody() *AssumeRoleWithSAMLResponseBody +} + +type AssumeRoleWithSAMLResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"` + StatusCode *int32 `json:"statusCode,omitempty" xml:"statusCode,omitempty"` + Body *AssumeRoleWithSAMLResponseBody `json:"body,omitempty" xml:"body,omitempty"` +} + +func (s AssumeRoleWithSAMLResponse) String() string { + return dara.Prettify(s) +} + +func (s AssumeRoleWithSAMLResponse) GoString() string { + return s.String() +} + +func (s *AssumeRoleWithSAMLResponse) GetHeaders() map[string]*string { + return s.Headers +} + +func (s *AssumeRoleWithSAMLResponse) GetStatusCode() *int32 { + return s.StatusCode +} + +func (s *AssumeRoleWithSAMLResponse) GetBody() *AssumeRoleWithSAMLResponseBody { + return s.Body +} + +func (s *AssumeRoleWithSAMLResponse) SetHeaders(v map[string]*string) *AssumeRoleWithSAMLResponse { + s.Headers = v + return s +} + +func (s *AssumeRoleWithSAMLResponse) SetStatusCode(v int32) *AssumeRoleWithSAMLResponse { + s.StatusCode = &v + return s +} + +func (s *AssumeRoleWithSAMLResponse) SetBody(v *AssumeRoleWithSAMLResponseBody) *AssumeRoleWithSAMLResponse { + s.Body = v + return s +} + +func (s *AssumeRoleWithSAMLResponse) Validate() error { + if s.Body != nil { + if err := s.Body.Validate(); err != nil { + return err + } + } + return nil +} diff --git a/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/client.go b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/client.go index a2c91da2..c42e3dc5 100644 --- a/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/client.go +++ b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/client.go @@ -3,1122 +3,67 @@ package client import ( openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client" - endpointutil "github.com/alibabacloud-go/endpoint-util/service" - openapiutil "github.com/alibabacloud-go/openapi-util/service" - util "github.com/alibabacloud-go/tea-utils/v2/service" - "github.com/alibabacloud-go/tea/tea" + openapiutil "github.com/alibabacloud-go/darabonba-openapi/v2/utils" + "github.com/alibabacloud-go/tea/dara" ) -type AssumeRoleRequest struct { - // The validity period of the STS token. Unit: seconds. - // - // Minimum value: 900. Maximum value: the value of the `MaxSessionDuration` parameter. Default value: 3600. - // - // You can call the CreateRole or UpdateRole operation to configure the `MaxSessionDuration` parameter. For more information, see [CreateRole](https://help.aliyun.com/document_detail/28710.html) or [UpdateRole](https://help.aliyun.com/document_detail/28712.html). - // - // example: - // - // 3600 - DurationSeconds *int64 `json:"DurationSeconds,omitempty" xml:"DurationSeconds,omitempty"` - // The external ID of the RAM role. - // - // This parameter is provided by an external party and is used to prevent the confused deputy problem. For more information, see [Use ExternalId to prevent the confused deputy problem](https://help.aliyun.com/document_detail/2361741.html). - // - // The value must be 2 to 1,224 characters in length and can contain letters, digits, and the following special characters: `= , . @ : / - _`. The regular expression for this parameter is `[\\w+=,.@:\\/-]*`. - // - // example: - // - // abcd1234 - ExternalId *string `json:"ExternalId,omitempty" xml:"ExternalId,omitempty"` - // The policy that specifies the permissions of the returned STS token. You can use this parameter to grant the STS token fewer permissions than the permissions granted to the RAM role. - // - // - If you specify this parameter, the permissions of the returned STS token are the permissions that are included in the value of this parameter and owned by the RAM role. - // - // - If you do not specify this parameter, the returned STS token has all the permissions of the RAM role. - // - // The value must be 1 to 2,048 characters in length. - // - // For more information about policy elements and sample policies, see [Policy elements](https://help.aliyun.com/document_detail/93738.html) and [Overview of sample policies](https://help.aliyun.com/document_detail/210969.html). - // - // example: - // - // {"Statement": [{"Action": ["*"],"Effect": "Allow","Resource": ["*"]}],"Version":"1"} - Policy *string `json:"Policy,omitempty" xml:"Policy,omitempty"` - // The Alibaba Cloud Resource Name (ARN) of the RAM role. - // - // The trusted entity of the RAM role is an Alibaba Cloud account. For more information, see [Create a RAM role for a trusted Alibaba Cloud account](https://help.aliyun.com/document_detail/93691.html) or [CreateRole](https://help.aliyun.com/document_detail/28710.html). - // - // Format: `acs:ram:::role/`. - // - // You can view the ARN in the RAM console or by calling operations. The following items describe the validity periods of storage addresses: - // - // - For more information about how to view the ARN in the RAM console, see [How do I find the ARN of the RAM role?](https://help.aliyun.com/document_detail/39744.html) - // - // - For more information about how to view the ARN by calling operations, see [ListRoles](https://help.aliyun.com/document_detail/28713.html) or [GetRole](https://help.aliyun.com/document_detail/28711.html). - // - // This parameter is required. - // - // example: - // - // acs:ram::123456789012****:role/adminrole - RoleArn *string `json:"RoleArn,omitempty" xml:"RoleArn,omitempty"` - // The custom name of the role session. - // - // Set this parameter based on your business requirements. In most cases, you can set this parameter to the identity of the API caller. For example, you can specify a username. You can specify `RoleSessionName` to identify API callers that assume the same RAM role in ActionTrail logs. This allows you to track the users that perform the operations. - // - // The value must be 2 to 64 characters in length and can contain letters, digits, and the following special characters: `. @ - _`. - // - // This parameter is required. - // - // example: - // - // alice - RoleSessionName *string `json:"RoleSessionName,omitempty" xml:"RoleSessionName,omitempty"` - SourceIdentity *string `json:"SourceIdentity,omitempty" xml:"SourceIdentity,omitempty"` -} - -func (s AssumeRoleRequest) String() string { - return tea.Prettify(s) -} - -func (s AssumeRoleRequest) GoString() string { - return s.String() -} - -func (s *AssumeRoleRequest) SetDurationSeconds(v int64) *AssumeRoleRequest { - s.DurationSeconds = &v - return s -} - -func (s *AssumeRoleRequest) SetExternalId(v string) *AssumeRoleRequest { - s.ExternalId = &v - return s -} - -func (s *AssumeRoleRequest) SetPolicy(v string) *AssumeRoleRequest { - s.Policy = &v - return s -} - -func (s *AssumeRoleRequest) SetRoleArn(v string) *AssumeRoleRequest { - s.RoleArn = &v - return s -} - -func (s *AssumeRoleRequest) SetRoleSessionName(v string) *AssumeRoleRequest { - s.RoleSessionName = &v - return s -} - -func (s *AssumeRoleRequest) SetSourceIdentity(v string) *AssumeRoleRequest { - s.SourceIdentity = &v - return s -} - -type AssumeRoleResponseBody struct { - // The temporary identity that you use to assume the RAM role. - AssumedRoleUser *AssumeRoleResponseBodyAssumedRoleUser `json:"AssumedRoleUser,omitempty" xml:"AssumedRoleUser,omitempty" type:"Struct"` - // The STS credentials. - Credentials *AssumeRoleResponseBodyCredentials `json:"Credentials,omitempty" xml:"Credentials,omitempty" type:"Struct"` - // The ID of the request. - // - // example: - // - // 6894B13B-6D71-4EF5-88FA-F32781734A7F - RequestId *string `json:"RequestId,omitempty" xml:"RequestId,omitempty"` - SourceIdentity *string `json:"SourceIdentity,omitempty" xml:"SourceIdentity,omitempty"` -} - -func (s AssumeRoleResponseBody) String() string { - return tea.Prettify(s) -} - -func (s AssumeRoleResponseBody) GoString() string { - return s.String() -} - -func (s *AssumeRoleResponseBody) SetAssumedRoleUser(v *AssumeRoleResponseBodyAssumedRoleUser) *AssumeRoleResponseBody { - s.AssumedRoleUser = v - return s -} - -func (s *AssumeRoleResponseBody) SetCredentials(v *AssumeRoleResponseBodyCredentials) *AssumeRoleResponseBody { - s.Credentials = v - return s -} - -func (s *AssumeRoleResponseBody) SetRequestId(v string) *AssumeRoleResponseBody { - s.RequestId = &v - return s -} - -func (s *AssumeRoleResponseBody) SetSourceIdentity(v string) *AssumeRoleResponseBody { - s.SourceIdentity = &v - return s -} - -type AssumeRoleResponseBodyAssumedRoleUser struct { - // The ARN of the temporary identity that you use to assume the RAM role. - // - // example: - // - // acs:ram::123456789012****:role/adminrole/alice - Arn *string `json:"Arn,omitempty" xml:"Arn,omitempty"` - // The ID of the temporary identity that you use to assume the RAM role. - // - // example: - // - // 34458433936495****:alice - AssumedRoleId *string `json:"AssumedRoleId,omitempty" xml:"AssumedRoleId,omitempty"` -} - -func (s AssumeRoleResponseBodyAssumedRoleUser) String() string { - return tea.Prettify(s) -} - -func (s AssumeRoleResponseBodyAssumedRoleUser) GoString() string { - return s.String() -} - -func (s *AssumeRoleResponseBodyAssumedRoleUser) SetArn(v string) *AssumeRoleResponseBodyAssumedRoleUser { - s.Arn = &v - return s -} - -func (s *AssumeRoleResponseBodyAssumedRoleUser) SetAssumedRoleId(v string) *AssumeRoleResponseBodyAssumedRoleUser { - s.AssumedRoleId = &v - return s -} - -type AssumeRoleResponseBodyCredentials struct { - // The AccessKey ID. - // - // example: - // - // STS.L4aBSCSJVMuKg5U1**** - AccessKeyId *string `json:"AccessKeyId,omitempty" xml:"AccessKeyId,omitempty"` - // The AccessKey secret. - // - // example: - // - // wyLTSmsyPGP1ohvvw8xYgB29dlGI8KMiH2pK**** - AccessKeySecret *string `json:"AccessKeySecret,omitempty" xml:"AccessKeySecret,omitempty"` - // The time when the STS token expires. The time is displayed in UTC. - // - // example: - // - // 2015-04-09T11:52:19Z - Expiration *string `json:"Expiration,omitempty" xml:"Expiration,omitempty"` - // The STS token. - // - // > Alibaba Cloud STS does not impose limits on the length of STS tokens. We strongly recommend that you do not specify a maximum length for STS tokens. - // - // example: - // - // ******** - SecurityToken *string `json:"SecurityToken,omitempty" xml:"SecurityToken,omitempty"` -} - -func (s AssumeRoleResponseBodyCredentials) String() string { - return tea.Prettify(s) -} - -func (s AssumeRoleResponseBodyCredentials) GoString() string { - return s.String() -} - -func (s *AssumeRoleResponseBodyCredentials) SetAccessKeyId(v string) *AssumeRoleResponseBodyCredentials { - s.AccessKeyId = &v - return s -} - -func (s *AssumeRoleResponseBodyCredentials) SetAccessKeySecret(v string) *AssumeRoleResponseBodyCredentials { - s.AccessKeySecret = &v - return s -} - -func (s *AssumeRoleResponseBodyCredentials) SetExpiration(v string) *AssumeRoleResponseBodyCredentials { - s.Expiration = &v - return s -} - -func (s *AssumeRoleResponseBodyCredentials) SetSecurityToken(v string) *AssumeRoleResponseBodyCredentials { - s.SecurityToken = &v - return s -} - -type AssumeRoleResponse struct { - Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"` - StatusCode *int32 `json:"statusCode,omitempty" xml:"statusCode,omitempty"` - Body *AssumeRoleResponseBody `json:"body,omitempty" xml:"body,omitempty"` -} - -func (s AssumeRoleResponse) String() string { - return tea.Prettify(s) -} - -func (s AssumeRoleResponse) GoString() string { - return s.String() -} - -func (s *AssumeRoleResponse) SetHeaders(v map[string]*string) *AssumeRoleResponse { - s.Headers = v - return s -} - -func (s *AssumeRoleResponse) SetStatusCode(v int32) *AssumeRoleResponse { - s.StatusCode = &v - return s -} - -func (s *AssumeRoleResponse) SetBody(v *AssumeRoleResponseBody) *AssumeRoleResponse { - s.Body = v - return s -} - -type AssumeRoleWithOIDCRequest struct { - // The validity period of the STS token. Unit: seconds. - // - // Default value: 3600. Minimum value: 900. Maximum value: the value of the `MaxSessionDuration` parameter. - // - // For more information about how to specify `MaxSessionDuration`, see [CreateRole](https://help.aliyun.com/document_detail/28710.html) or [UpdateRole](https://help.aliyun.com/document_detail/28712.html). - // - // example: - // - // 3600 - DurationSeconds *int64 `json:"DurationSeconds,omitempty" xml:"DurationSeconds,omitempty"` - // The Alibaba Cloud Resource Name (ARN) of the OIDC IdP. - // - // You can view the ARN in the RAM console or by calling operations. - // - // - For more information about how to view the ARN in the RAM console, see [View the information about an OIDC IdP](https://help.aliyun.com/document_detail/327123.html). - // - // - For more information about how to view the ARN by calling operations, see [GetOIDCProvider](https://help.aliyun.com/document_detail/327126.html) or [ListOIDCProviders](https://help.aliyun.com/document_detail/327127.html). - // - // example: - // - // acs:ram::113511544585****:oidc-provider/TestOidcIdp - OIDCProviderArn *string `json:"OIDCProviderArn,omitempty" xml:"OIDCProviderArn,omitempty"` - // The OIDC token that is issued by the external IdP. - // - // The OIDC token must be 4 to 20,000 characters in length. - // - // > You must enter the original OIDC token. You do not need to enter the Base64-encoded OIDC token. - // - // example: - // - // eyJraWQiOiJKQzl3eHpyaHFKMGd0**** - OIDCToken *string `json:"OIDCToken,omitempty" xml:"OIDCToken,omitempty"` - // The policy that specifies the permissions of the returned STS token. You can use this parameter to grant the STS token fewer permissions than the permissions granted to the RAM role. - // - // - If you specify this parameter, the permissions of the returned STS token are the permissions that are included in the value of this parameter and owned by the RAM role. - // - // - If you do not specify this parameter, the returned STS token has all the permissions of the RAM role. - // - // The value must be 1 to 2,048 characters in length. - // - // example: - // - // {"Statement": [{"Action": ["*"],"Effect": "Allow","Resource": ["*"]}],"Version":"1"} - Policy *string `json:"Policy,omitempty" xml:"Policy,omitempty"` - // The ARN of the RAM role. - // - // You can view the ARN in the RAM console or by calling operations. - // - // - For more information about how to view the ARN in the RAM console, see [How do I view the ARN of the RAM role?](https://help.aliyun.com/document_detail/39744.html) - // - // - For more information about how to view the ARN by calling operations, see [ListRoles](https://help.aliyun.com/document_detail/28713.html) or [GetRole](https://help.aliyun.com/document_detail/28711.html). - // - // example: - // - // acs:ram::113511544585****:role/testoidc - RoleArn *string `json:"RoleArn,omitempty" xml:"RoleArn,omitempty"` - // The custom name of the role session. - // - // Set this parameter based on your business requirements. In most cases, this parameter is set to the identity of the user who calls the operation, for example, the username. In ActionTrail logs, you can distinguish the users who assume the same RAM role to perform operations based on the value of the RoleSessionName parameter. This way, you can perform user-specific auditing. - // - // The value can contain letters, digits, periods (.), at signs (@), hyphens (-), and underscores (_). - // - // The value must be 2 to 64 characters in length. - // - // example: - // - // TestOidcAssumedRoleSession - RoleSessionName *string `json:"RoleSessionName,omitempty" xml:"RoleSessionName,omitempty"` -} - -func (s AssumeRoleWithOIDCRequest) String() string { - return tea.Prettify(s) -} - -func (s AssumeRoleWithOIDCRequest) GoString() string { - return s.String() -} - -func (s *AssumeRoleWithOIDCRequest) SetDurationSeconds(v int64) *AssumeRoleWithOIDCRequest { - s.DurationSeconds = &v - return s -} - -func (s *AssumeRoleWithOIDCRequest) SetOIDCProviderArn(v string) *AssumeRoleWithOIDCRequest { - s.OIDCProviderArn = &v - return s -} - -func (s *AssumeRoleWithOIDCRequest) SetOIDCToken(v string) *AssumeRoleWithOIDCRequest { - s.OIDCToken = &v - return s -} - -func (s *AssumeRoleWithOIDCRequest) SetPolicy(v string) *AssumeRoleWithOIDCRequest { - s.Policy = &v - return s -} - -func (s *AssumeRoleWithOIDCRequest) SetRoleArn(v string) *AssumeRoleWithOIDCRequest { - s.RoleArn = &v - return s -} - -func (s *AssumeRoleWithOIDCRequest) SetRoleSessionName(v string) *AssumeRoleWithOIDCRequest { - s.RoleSessionName = &v - return s -} - -type AssumeRoleWithOIDCResponseBody struct { - // The temporary identity that you use to assume the RAM role. - AssumedRoleUser *AssumeRoleWithOIDCResponseBodyAssumedRoleUser `json:"AssumedRoleUser,omitempty" xml:"AssumedRoleUser,omitempty" type:"Struct"` - // The access credentials. - Credentials *AssumeRoleWithOIDCResponseBodyCredentials `json:"Credentials,omitempty" xml:"Credentials,omitempty" type:"Struct"` - // The information about the OIDC token. - OIDCTokenInfo *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo `json:"OIDCTokenInfo,omitempty" xml:"OIDCTokenInfo,omitempty" type:"Struct"` - // The ID of the request. - // - // example: - // - // 3D57EAD2-8723-1F26-B69C-F8707D8B565D - RequestId *string `json:"RequestId,omitempty" xml:"RequestId,omitempty"` - SourceIdentity *string `json:"SourceIdentity,omitempty" xml:"SourceIdentity,omitempty"` -} - -func (s AssumeRoleWithOIDCResponseBody) String() string { - return tea.Prettify(s) -} - -func (s AssumeRoleWithOIDCResponseBody) GoString() string { - return s.String() -} - -func (s *AssumeRoleWithOIDCResponseBody) SetAssumedRoleUser(v *AssumeRoleWithOIDCResponseBodyAssumedRoleUser) *AssumeRoleWithOIDCResponseBody { - s.AssumedRoleUser = v - return s -} - -func (s *AssumeRoleWithOIDCResponseBody) SetCredentials(v *AssumeRoleWithOIDCResponseBodyCredentials) *AssumeRoleWithOIDCResponseBody { - s.Credentials = v - return s -} - -func (s *AssumeRoleWithOIDCResponseBody) SetOIDCTokenInfo(v *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) *AssumeRoleWithOIDCResponseBody { - s.OIDCTokenInfo = v - return s -} - -func (s *AssumeRoleWithOIDCResponseBody) SetRequestId(v string) *AssumeRoleWithOIDCResponseBody { - s.RequestId = &v - return s -} - -func (s *AssumeRoleWithOIDCResponseBody) SetSourceIdentity(v string) *AssumeRoleWithOIDCResponseBody { - s.SourceIdentity = &v - return s -} - -type AssumeRoleWithOIDCResponseBodyAssumedRoleUser struct { - // The ARN of the temporary identity that you use to assume the RAM role. - // - // example: - // - // acs:ram::113511544585****:role/testoidc/TestOidcAssumedRoleSession - Arn *string `json:"Arn,omitempty" xml:"Arn,omitempty"` - // The ID of the temporary identity that you use to assume the RAM role. - // - // example: - // - // 33157794895460**** - AssumedRoleId *string `json:"AssumedRoleId,omitempty" xml:"AssumedRoleId,omitempty"` -} - -func (s AssumeRoleWithOIDCResponseBodyAssumedRoleUser) String() string { - return tea.Prettify(s) -} - -func (s AssumeRoleWithOIDCResponseBodyAssumedRoleUser) GoString() string { - return s.String() -} - -func (s *AssumeRoleWithOIDCResponseBodyAssumedRoleUser) SetArn(v string) *AssumeRoleWithOIDCResponseBodyAssumedRoleUser { - s.Arn = &v - return s -} - -func (s *AssumeRoleWithOIDCResponseBodyAssumedRoleUser) SetAssumedRoleId(v string) *AssumeRoleWithOIDCResponseBodyAssumedRoleUser { - s.AssumedRoleId = &v - return s -} - -type AssumeRoleWithOIDCResponseBodyCredentials struct { - // The AccessKey ID. - // - // example: - // - // STS.NUgYrLnoC37mZZCNnAbez**** - AccessKeyId *string `json:"AccessKeyId,omitempty" xml:"AccessKeyId,omitempty"` - // The AccessKey secret. - // - // example: - // - // CVwjCkNzTMupZ8NbTCxCBRq3K16jtcWFTJAyBEv2**** - AccessKeySecret *string `json:"AccessKeySecret,omitempty" xml:"AccessKeySecret,omitempty"` - // The time when the STS token expires. The time is displayed in UTC. - // - // example: - // - // 2021-10-20T04:27:09Z - Expiration *string `json:"Expiration,omitempty" xml:"Expiration,omitempty"` - // The STS token. - // - // > Alibaba Cloud STS does not impose limits on the length of STS tokens. We strongly recommend that you do not specify a maximum length for STS tokens. - // - // example: - // - // CAIShwJ1q6Ft5B2yfSjIr5bSEsj4g7BihPWGWHz**** - SecurityToken *string `json:"SecurityToken,omitempty" xml:"SecurityToken,omitempty"` -} - -func (s AssumeRoleWithOIDCResponseBodyCredentials) String() string { - return tea.Prettify(s) -} - -func (s AssumeRoleWithOIDCResponseBodyCredentials) GoString() string { - return s.String() -} - -func (s *AssumeRoleWithOIDCResponseBodyCredentials) SetAccessKeyId(v string) *AssumeRoleWithOIDCResponseBodyCredentials { - s.AccessKeyId = &v - return s -} - -func (s *AssumeRoleWithOIDCResponseBodyCredentials) SetAccessKeySecret(v string) *AssumeRoleWithOIDCResponseBodyCredentials { - s.AccessKeySecret = &v - return s -} - -func (s *AssumeRoleWithOIDCResponseBodyCredentials) SetExpiration(v string) *AssumeRoleWithOIDCResponseBodyCredentials { - s.Expiration = &v - return s -} - -func (s *AssumeRoleWithOIDCResponseBodyCredentials) SetSecurityToken(v string) *AssumeRoleWithOIDCResponseBodyCredentials { - s.SecurityToken = &v - return s -} - -type AssumeRoleWithOIDCResponseBodyOIDCTokenInfo struct { - // The audience. If multiple audiences are returned, the audiences are separated by commas (,). - // - // The audience is represented by the `aud` field in the OIDC Token. - // - // example: - // - // 496271242565057**** - ClientIds *string `json:"ClientIds,omitempty" xml:"ClientIds,omitempty"` - // The time when the OIDC token expires. - // - // example: - // - // 2021-10-20T04:27:09Z - ExpirationTime *string `json:"ExpirationTime,omitempty" xml:"ExpirationTime,omitempty"` - // The time when the OIDC token was issued. - // - // example: - // - // 2021-10-20T03:27:09Z - IssuanceTime *string `json:"IssuanceTime,omitempty" xml:"IssuanceTime,omitempty"` - // The URL of the issuer, - // - // which is represented by the `iss` field in the OIDC Token. - // - // example: - // - // https://dev-xxxxxx.okta.com - Issuer *string `json:"Issuer,omitempty" xml:"Issuer,omitempty"` - // The subject, - // - // which is represented by the `sub` field in the OIDC Token. - // - // example: - // - // KryrkIdjylZb7agUgCEf**** - Subject *string `json:"Subject,omitempty" xml:"Subject,omitempty"` - // The verification information about the OIDC token. For more information, see [Manage an OIDC IdP](https://help.aliyun.com/document_detail/327123.html). - // - // example: - // - // Success - VerificationInfo *string `json:"VerificationInfo,omitempty" xml:"VerificationInfo,omitempty"` -} - -func (s AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) String() string { - return tea.Prettify(s) -} - -func (s AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) GoString() string { - return s.String() -} - -func (s *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) SetClientIds(v string) *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo { - s.ClientIds = &v - return s -} - -func (s *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) SetExpirationTime(v string) *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo { - s.ExpirationTime = &v - return s -} - -func (s *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) SetIssuanceTime(v string) *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo { - s.IssuanceTime = &v - return s -} - -func (s *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) SetIssuer(v string) *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo { - s.Issuer = &v - return s -} - -func (s *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) SetSubject(v string) *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo { - s.Subject = &v - return s -} - -func (s *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo) SetVerificationInfo(v string) *AssumeRoleWithOIDCResponseBodyOIDCTokenInfo { - s.VerificationInfo = &v - return s -} - -type AssumeRoleWithOIDCResponse struct { - Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"` - StatusCode *int32 `json:"statusCode,omitempty" xml:"statusCode,omitempty"` - Body *AssumeRoleWithOIDCResponseBody `json:"body,omitempty" xml:"body,omitempty"` -} - -func (s AssumeRoleWithOIDCResponse) String() string { - return tea.Prettify(s) -} - -func (s AssumeRoleWithOIDCResponse) GoString() string { - return s.String() -} - -func (s *AssumeRoleWithOIDCResponse) SetHeaders(v map[string]*string) *AssumeRoleWithOIDCResponse { - s.Headers = v - return s -} - -func (s *AssumeRoleWithOIDCResponse) SetStatusCode(v int32) *AssumeRoleWithOIDCResponse { - s.StatusCode = &v - return s -} - -func (s *AssumeRoleWithOIDCResponse) SetBody(v *AssumeRoleWithOIDCResponseBody) *AssumeRoleWithOIDCResponse { - s.Body = v - return s -} - -type AssumeRoleWithSAMLRequest struct { - // The validity period of the STS token. Unit: seconds. - // - // Minimum value: 900. Maximum value: the value of the `MaxSessionDuration` parameter. Default value: 3600. - // - // You can call the CreateRole or UpdateRole operation to configure the `MaxSessionDuration` parameter. For more information, see [CreateRole](https://help.aliyun.com/document_detail/28710.html) or [UpdateRole](https://help.aliyun.com/document_detail/28712.html). - // - // example: - // - // 3600 - DurationSeconds *int64 `json:"DurationSeconds,omitempty" xml:"DurationSeconds,omitempty"` - // The policy that specifies the permissions of the returned STS token. You can use this parameter to grant the STS token fewer permissions than the permissions granted to the RAM role. - // - // - If you specify this parameter, the permissions of the returned STS token are the permissions that are included in the value of this parameter and owned by the RAM role. - // - // - If you do not specify this parameter, the returned STS token has all the permissions of the RAM role. - // - // The value must be 1 to 2,048 characters in length. - // - // example: - // - // url_encoded_policy - Policy *string `json:"Policy,omitempty" xml:"Policy,omitempty"` - // The ARN of the RAM role. - // - // The trust entity of the RAM role is a SAML IdP. For more information, see [Create a RAM role for a trusted IdP](https://help.aliyun.com/document_detail/116805.html) or [CreateRole](https://help.aliyun.com/document_detail/28710.html). - // - // Format: `acs:ram:::role/`. - // - // You can view the ARN in the RAM console or by calling operations. - // - // - For more information about how to view the ARN in the RAM console, see [How do I view the ARN of the RAM role?](https://help.aliyun.com/document_detail/39744.html). - // - // - For more information about how to view the ARN by calling operations, see [ListRoles](https://help.aliyun.com/document_detail/28713.html) or [GetRole](https://help.aliyun.com/document_detail/28711.html). - // - // example: - // - // acs:ram::123456789012****:role/adminrole - RoleArn *string `json:"RoleArn,omitempty" xml:"RoleArn,omitempty"` - // The Base64-encoded SAML assertion. - // - // The value must be 4 to 100,000 characters in length. - // - // > A complete SAML response rather than a single SAMLAssertion field must be retrieved from the external IdP. - // - // example: - // - // base64_encoded_saml_assertion - SAMLAssertion *string `json:"SAMLAssertion,omitempty" xml:"SAMLAssertion,omitempty"` - // The Alibaba Cloud Resource Name (ARN) of the SAML IdP that is created in the RAM console. - // - // Format: `acs:ram:::saml-provider/`. - // - // You can view the ARN in the RAM console or by calling operations. - // - // - For more information about how to view the ARN in the RAM console, see [How do I view the ARN of a RAM role?](https://help.aliyun.com/document_detail/116795.html) - // - // - For more information about how to view the ARN by calling operations, see [GetSAMLProvider](https://help.aliyun.com/document_detail/186833.html) or [ListSAMLProviders](https://help.aliyun.com/document_detail/186851.html). - // - // example: - // - // acs:ram::123456789012****:saml-provider/company1 - SAMLProviderArn *string `json:"SAMLProviderArn,omitempty" xml:"SAMLProviderArn,omitempty"` -} - -func (s AssumeRoleWithSAMLRequest) String() string { - return tea.Prettify(s) -} - -func (s AssumeRoleWithSAMLRequest) GoString() string { - return s.String() -} - -func (s *AssumeRoleWithSAMLRequest) SetDurationSeconds(v int64) *AssumeRoleWithSAMLRequest { - s.DurationSeconds = &v - return s -} - -func (s *AssumeRoleWithSAMLRequest) SetPolicy(v string) *AssumeRoleWithSAMLRequest { - s.Policy = &v - return s -} - -func (s *AssumeRoleWithSAMLRequest) SetRoleArn(v string) *AssumeRoleWithSAMLRequest { - s.RoleArn = &v - return s -} - -func (s *AssumeRoleWithSAMLRequest) SetSAMLAssertion(v string) *AssumeRoleWithSAMLRequest { - s.SAMLAssertion = &v - return s -} - -func (s *AssumeRoleWithSAMLRequest) SetSAMLProviderArn(v string) *AssumeRoleWithSAMLRequest { - s.SAMLProviderArn = &v - return s -} - -type AssumeRoleWithSAMLResponseBody struct { - // The temporary identity that you use to assume the RAM role. - AssumedRoleUser *AssumeRoleWithSAMLResponseBodyAssumedRoleUser `json:"AssumedRoleUser,omitempty" xml:"AssumedRoleUser,omitempty" type:"Struct"` - // The STS credentials. - Credentials *AssumeRoleWithSAMLResponseBodyCredentials `json:"Credentials,omitempty" xml:"Credentials,omitempty" type:"Struct"` - // The ID of the request. - // - // example: - // - // 6894B13B-6D71-4EF5-88FA-F32781734A7F - RequestId *string `json:"RequestId,omitempty" xml:"RequestId,omitempty"` - // The information in the SAML assertion. - SAMLAssertionInfo *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo `json:"SAMLAssertionInfo,omitempty" xml:"SAMLAssertionInfo,omitempty" type:"Struct"` - SourceIdentity *string `json:"SourceIdentity,omitempty" xml:"SourceIdentity,omitempty"` -} - -func (s AssumeRoleWithSAMLResponseBody) String() string { - return tea.Prettify(s) -} - -func (s AssumeRoleWithSAMLResponseBody) GoString() string { - return s.String() -} - -func (s *AssumeRoleWithSAMLResponseBody) SetAssumedRoleUser(v *AssumeRoleWithSAMLResponseBodyAssumedRoleUser) *AssumeRoleWithSAMLResponseBody { - s.AssumedRoleUser = v - return s -} - -func (s *AssumeRoleWithSAMLResponseBody) SetCredentials(v *AssumeRoleWithSAMLResponseBodyCredentials) *AssumeRoleWithSAMLResponseBody { - s.Credentials = v - return s -} - -func (s *AssumeRoleWithSAMLResponseBody) SetRequestId(v string) *AssumeRoleWithSAMLResponseBody { - s.RequestId = &v - return s -} - -func (s *AssumeRoleWithSAMLResponseBody) SetSAMLAssertionInfo(v *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo) *AssumeRoleWithSAMLResponseBody { - s.SAMLAssertionInfo = v - return s -} - -func (s *AssumeRoleWithSAMLResponseBody) SetSourceIdentity(v string) *AssumeRoleWithSAMLResponseBody { - s.SourceIdentity = &v - return s -} - -type AssumeRoleWithSAMLResponseBodyAssumedRoleUser struct { - // The ARN of the temporary identity that you use to assume the RAM role. - // - // example: - // - // acs:sts::123456789012****:assumed-role/AdminRole/alice - Arn *string `json:"Arn,omitempty" xml:"Arn,omitempty"` - // The ID of the temporary identity that you use to assume the RAM role. - // - // example: - // - // 34458433936495****:alice - AssumedRoleId *string `json:"AssumedRoleId,omitempty" xml:"AssumedRoleId,omitempty"` -} - -func (s AssumeRoleWithSAMLResponseBodyAssumedRoleUser) String() string { - return tea.Prettify(s) -} - -func (s AssumeRoleWithSAMLResponseBodyAssumedRoleUser) GoString() string { - return s.String() -} - -func (s *AssumeRoleWithSAMLResponseBodyAssumedRoleUser) SetArn(v string) *AssumeRoleWithSAMLResponseBodyAssumedRoleUser { - s.Arn = &v - return s -} - -func (s *AssumeRoleWithSAMLResponseBodyAssumedRoleUser) SetAssumedRoleId(v string) *AssumeRoleWithSAMLResponseBodyAssumedRoleUser { - s.AssumedRoleId = &v - return s -} - -type AssumeRoleWithSAMLResponseBodyCredentials struct { - // The AccessKey ID. - // - // example: - // - // STS.L4aBSCSJVMuKg5U1**** - AccessKeyId *string `json:"AccessKeyId,omitempty" xml:"AccessKeyId,omitempty"` - // The AccessKey secret. - // - // example: - // - // wyLTSmsyPGP1ohvvw8xYgB29dlGI8KMiH2pK**** - AccessKeySecret *string `json:"AccessKeySecret,omitempty" xml:"AccessKeySecret,omitempty"` - // The time when the STS token expires. The time is displayed in UTC. - // - // example: - // - // 2015-04-09T11:52:19Z - Expiration *string `json:"Expiration,omitempty" xml:"Expiration,omitempty"` - // The STS token. - // - // > Alibaba Cloud STS does not impose limits on the length of STS tokens. We strongly recommend that you do not specify a maximum length for STS tokens. - // - // example: - // - // ******** - SecurityToken *string `json:"SecurityToken,omitempty" xml:"SecurityToken,omitempty"` -} - -func (s AssumeRoleWithSAMLResponseBodyCredentials) String() string { - return tea.Prettify(s) -} - -func (s AssumeRoleWithSAMLResponseBodyCredentials) GoString() string { - return s.String() -} - -func (s *AssumeRoleWithSAMLResponseBodyCredentials) SetAccessKeyId(v string) *AssumeRoleWithSAMLResponseBodyCredentials { - s.AccessKeyId = &v - return s -} - -func (s *AssumeRoleWithSAMLResponseBodyCredentials) SetAccessKeySecret(v string) *AssumeRoleWithSAMLResponseBodyCredentials { - s.AccessKeySecret = &v - return s -} - -func (s *AssumeRoleWithSAMLResponseBodyCredentials) SetExpiration(v string) *AssumeRoleWithSAMLResponseBodyCredentials { - s.Expiration = &v - return s -} - -func (s *AssumeRoleWithSAMLResponseBodyCredentials) SetSecurityToken(v string) *AssumeRoleWithSAMLResponseBodyCredentials { - s.SecurityToken = &v - return s -} - -type AssumeRoleWithSAMLResponseBodySAMLAssertionInfo struct { - // The value in the `Issuer` element in the SAML assertion. - // - // example: - // - // http://example.com/adfs/services/trust - Issuer *string `json:"Issuer,omitempty" xml:"Issuer,omitempty"` - // The `Recipient` attribute of the SubjectConfirmationData sub-element. SubjectConfirmationData is a sub-element of the `Subject` element in the SAML assertion. - // - // example: - // - // https://signin.aliyun.com/saml-role/SSO - Recipient *string `json:"Recipient,omitempty" xml:"Recipient,omitempty"` - // The value in the NameID sub-element of the `Subject` element in the SAML assertion. - // - // example: - // - // alice@example.com - Subject *string `json:"Subject,omitempty" xml:"Subject,omitempty"` - // The Format attribute of the `NameID` element in the SAML assertion. If the Format attribute is prefixed with `urn:oasis:names:tc:SAML:2.0:nameid-format:`, the prefix is not included in the value of this parameter. For example, if the value of the Format attribute is urn:oasis:names:tc:SAML:2.0:nameid-format:persistent/transient, the value of this parameter is `persistent/transient`. - // - // example: - // - // persistent - SubjectType *string `json:"SubjectType,omitempty" xml:"SubjectType,omitempty"` -} - -func (s AssumeRoleWithSAMLResponseBodySAMLAssertionInfo) String() string { - return tea.Prettify(s) -} - -func (s AssumeRoleWithSAMLResponseBodySAMLAssertionInfo) GoString() string { - return s.String() -} - -func (s *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo) SetIssuer(v string) *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo { - s.Issuer = &v - return s -} - -func (s *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo) SetRecipient(v string) *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo { - s.Recipient = &v - return s -} - -func (s *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo) SetSubject(v string) *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo { - s.Subject = &v - return s -} - -func (s *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo) SetSubjectType(v string) *AssumeRoleWithSAMLResponseBodySAMLAssertionInfo { - s.SubjectType = &v - return s -} - -type AssumeRoleWithSAMLResponse struct { - Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"` - StatusCode *int32 `json:"statusCode,omitempty" xml:"statusCode,omitempty"` - Body *AssumeRoleWithSAMLResponseBody `json:"body,omitempty" xml:"body,omitempty"` -} - -func (s AssumeRoleWithSAMLResponse) String() string { - return tea.Prettify(s) -} - -func (s AssumeRoleWithSAMLResponse) GoString() string { - return s.String() -} - -func (s *AssumeRoleWithSAMLResponse) SetHeaders(v map[string]*string) *AssumeRoleWithSAMLResponse { - s.Headers = v - return s -} - -func (s *AssumeRoleWithSAMLResponse) SetStatusCode(v int32) *AssumeRoleWithSAMLResponse { - s.StatusCode = &v - return s -} - -func (s *AssumeRoleWithSAMLResponse) SetBody(v *AssumeRoleWithSAMLResponseBody) *AssumeRoleWithSAMLResponse { - s.Body = v - return s -} - -type GetCallerIdentityResponseBody struct { - // example: - // - // 196813200012**** - AccountId *string `json:"AccountId,omitempty" xml:"AccountId,omitempty"` - // example: - // - // acs:ram::196813200012****:user/admin - Arn *string `json:"Arn,omitempty" xml:"Arn,omitempty"` - // example: - // - // RAMUser - IdentityType *string `json:"IdentityType,omitempty" xml:"IdentityType,omitempty"` - // example: - // - // 28877424437521**** - PrincipalId *string `json:"PrincipalId,omitempty" xml:"PrincipalId,omitempty"` - // example: - // - // 3C87BF47-3724-5443-ADC1-5AEAD9A03EB1 - RequestId *string `json:"RequestId,omitempty" xml:"RequestId,omitempty"` - // example: - // - // 33537620082992**** - RoleId *string `json:"RoleId,omitempty" xml:"RoleId,omitempty"` - // example: - // - // 216959339000**** - UserId *string `json:"UserId,omitempty" xml:"UserId,omitempty"` -} - -func (s GetCallerIdentityResponseBody) String() string { - return tea.Prettify(s) -} - -func (s GetCallerIdentityResponseBody) GoString() string { - return s.String() -} - -func (s *GetCallerIdentityResponseBody) SetAccountId(v string) *GetCallerIdentityResponseBody { - s.AccountId = &v - return s -} - -func (s *GetCallerIdentityResponseBody) SetArn(v string) *GetCallerIdentityResponseBody { - s.Arn = &v - return s -} - -func (s *GetCallerIdentityResponseBody) SetIdentityType(v string) *GetCallerIdentityResponseBody { - s.IdentityType = &v - return s -} - -func (s *GetCallerIdentityResponseBody) SetPrincipalId(v string) *GetCallerIdentityResponseBody { - s.PrincipalId = &v - return s -} - -func (s *GetCallerIdentityResponseBody) SetRequestId(v string) *GetCallerIdentityResponseBody { - s.RequestId = &v - return s -} - -func (s *GetCallerIdentityResponseBody) SetRoleId(v string) *GetCallerIdentityResponseBody { - s.RoleId = &v - return s -} - -func (s *GetCallerIdentityResponseBody) SetUserId(v string) *GetCallerIdentityResponseBody { - s.UserId = &v - return s -} - -type GetCallerIdentityResponse struct { - Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"` - StatusCode *int32 `json:"statusCode,omitempty" xml:"statusCode,omitempty"` - Body *GetCallerIdentityResponseBody `json:"body,omitempty" xml:"body,omitempty"` -} - -func (s GetCallerIdentityResponse) String() string { - return tea.Prettify(s) -} - -func (s GetCallerIdentityResponse) GoString() string { - return s.String() -} - -func (s *GetCallerIdentityResponse) SetHeaders(v map[string]*string) *GetCallerIdentityResponse { - s.Headers = v - return s -} - -func (s *GetCallerIdentityResponse) SetStatusCode(v int32) *GetCallerIdentityResponse { - s.StatusCode = &v - return s -} - -func (s *GetCallerIdentityResponse) SetBody(v *GetCallerIdentityResponseBody) *GetCallerIdentityResponse { - s.Body = v - return s -} - type Client struct { openapi.Client + DisableSDKError *bool + EnableValidate *bool } -func NewClient(config *openapi.Config) (*Client, error) { +func NewClient(config *openapiutil.Config) (*Client, error) { client := new(Client) err := client.Init(config) return client, err } -func (client *Client) Init(config *openapi.Config) (_err error) { +func (client *Client) Init(config *openapiutil.Config) (_err error) { _err = client.Client.Init(config) if _err != nil { return _err } - client.SignatureAlgorithm = tea.String("v2") - client.EndpointRule = tea.String("regional") + client.EndpointRule = dara.String("regional") client.EndpointMap = map[string]*string{ - "ap-northeast-2-pop": tea.String("sts.aliyuncs.com"), - "cn-beijing-finance-1": tea.String("sts.aliyuncs.com"), - "cn-beijing-finance-pop": tea.String("sts.aliyuncs.com"), - "cn-beijing-gov-1": tea.String("sts.aliyuncs.com"), - "cn-beijing-nu16-b01": tea.String("sts.aliyuncs.com"), - "cn-edge-1": tea.String("sts.aliyuncs.com"), - "cn-fujian": tea.String("sts.aliyuncs.com"), - "cn-haidian-cm12-c01": tea.String("sts.aliyuncs.com"), - "cn-hangzhou-bj-b01": tea.String("sts.aliyuncs.com"), - "cn-hangzhou-finance": tea.String("sts.aliyuncs.com"), - "cn-hangzhou-internal-prod-1": tea.String("sts.aliyuncs.com"), - "cn-hangzhou-internal-test-1": tea.String("sts.aliyuncs.com"), - "cn-hangzhou-internal-test-2": tea.String("sts.aliyuncs.com"), - "cn-hangzhou-internal-test-3": tea.String("sts.aliyuncs.com"), - "cn-hangzhou-test-306": tea.String("sts.aliyuncs.com"), - "cn-hongkong-finance-pop": tea.String("sts.aliyuncs.com"), - "cn-huhehaote-nebula-1": tea.String("sts.aliyuncs.com"), - "cn-north-2-gov-1": tea.String("sts-vpc.cn-north-2-gov-1.aliyuncs.com"), - "cn-qingdao-nebula": tea.String("sts.aliyuncs.com"), - "cn-shanghai-et15-b01": tea.String("sts.aliyuncs.com"), - "cn-shanghai-et2-b01": tea.String("sts.aliyuncs.com"), - "cn-shanghai-inner": tea.String("sts.aliyuncs.com"), - "cn-shanghai-internal-test-1": tea.String("sts.aliyuncs.com"), - "cn-shenzhen-finance-1": tea.String("sts-vpc.cn-shenzhen-finance-1.aliyuncs.com"), - "cn-shenzhen-inner": tea.String("sts.aliyuncs.com"), - "cn-shenzhen-st4-d01": tea.String("sts.aliyuncs.com"), - "cn-shenzhen-su18-b01": tea.String("sts.aliyuncs.com"), - "cn-wuhan": tea.String("sts.aliyuncs.com"), - "cn-yushanfang": tea.String("sts.aliyuncs.com"), - "cn-zhangbei": tea.String("sts.aliyuncs.com"), - "cn-zhangbei-na61-b01": tea.String("sts.aliyuncs.com"), - "cn-zhangjiakou-na62-a01": tea.String("sts.aliyuncs.com"), - "cn-zhengzhou-nebula-1": tea.String("sts.aliyuncs.com"), - "eu-west-1-oxs": tea.String("sts.aliyuncs.com"), - "rus-west-1-pop": tea.String("sts.aliyuncs.com"), + "ap-northeast-2-pop": dara.String("sts.aliyuncs.com"), + "ap-south-1": dara.String("sts.aliyuncs.com"), + "ap-southeast-2": dara.String("sts.aliyuncs.com"), + "cn-beijing-finance-pop": dara.String("sts.aliyuncs.com"), + "cn-beijing-gov-1": dara.String("sts.aliyuncs.com"), + "cn-beijing-nu16-b01": dara.String("sts.aliyuncs.com"), + "cn-edge-1": dara.String("sts.aliyuncs.com"), + "cn-fujian": dara.String("sts.aliyuncs.com"), + "cn-haidian-cm12-c01": dara.String("sts.aliyuncs.com"), + "cn-hangzhou-bj-b01": dara.String("sts.aliyuncs.com"), + "cn-hangzhou-internal-prod-1": dara.String("sts.aliyuncs.com"), + "cn-hangzhou-internal-test-1": dara.String("sts.aliyuncs.com"), + "cn-hangzhou-internal-test-2": dara.String("sts.aliyuncs.com"), + "cn-hangzhou-internal-test-3": dara.String("sts.aliyuncs.com"), + "cn-hangzhou-test-306": dara.String("sts.aliyuncs.com"), + "cn-hongkong-finance-pop": dara.String("sts.aliyuncs.com"), + "cn-huhehaote-nebula-1": dara.String("sts.aliyuncs.com"), + "cn-shanghai-et15-b01": dara.String("sts.aliyuncs.com"), + "cn-shanghai-et2-b01": dara.String("sts.aliyuncs.com"), + "cn-shanghai-inner": dara.String("sts.aliyuncs.com"), + "cn-shanghai-internal-test-1": dara.String("sts.aliyuncs.com"), + "cn-shenzhen-inner": dara.String("sts.aliyuncs.com"), + "cn-shenzhen-st4-d01": dara.String("sts.aliyuncs.com"), + "cn-shenzhen-su18-b01": dara.String("sts.aliyuncs.com"), + "cn-wuhan": dara.String("sts.aliyuncs.com"), + "cn-yushanfang": dara.String("sts.aliyuncs.com"), + "cn-zhangbei": dara.String("sts.aliyuncs.com"), + "cn-zhangbei-na61-b01": dara.String("sts.aliyuncs.com"), + "cn-zhangjiakou-na62-a01": dara.String("sts.aliyuncs.com"), + "cn-zhengzhou-nebula-1": dara.String("sts.aliyuncs.com"), + "eu-west-1-oxs": dara.String("sts.aliyuncs.com"), + "rus-west-1-pop": dara.String("sts.aliyuncs.com"), } _err = client.CheckConfig(config) if _err != nil { return _err } - client.Endpoint, _err = client.GetEndpoint(tea.String("sts"), client.RegionId, client.EndpointRule, client.Network, client.Suffix, client.EndpointMap, client.Endpoint) + client.Endpoint, _err = client.GetEndpoint(dara.String("sts"), client.RegionId, client.EndpointRule, client.Network, client.Suffix, client.EndpointMap, client.Endpoint) if _err != nil { return _err } @@ -1127,17 +72,17 @@ func (client *Client) Init(config *openapi.Config) (_err error) { } func (client *Client) GetEndpoint(productId *string, regionId *string, endpointRule *string, network *string, suffix *string, endpointMap map[string]*string, endpoint *string) (_result *string, _err error) { - if !tea.BoolValue(util.Empty(endpoint)) { + if !dara.IsNil(endpoint) { _result = endpoint return _result, _err } - if !tea.BoolValue(util.IsUnset(endpointMap)) && !tea.BoolValue(util.Empty(endpointMap[tea.StringValue(regionId)])) { - _result = endpointMap[tea.StringValue(regionId)] + if !dara.IsNil(endpointMap) && !dara.IsNil(endpointMap[dara.StringValue(regionId)]) { + _result = endpointMap[dara.StringValue(regionId)] return _result, _err } - _body, _err := endpointutil.GetEndpointRules(productId, regionId, endpointRule, network, suffix) + _body, _err := openapiutil.GetEndpointRules(productId, regionId, endpointRule, network, suffix) if _err != nil { return _result, _err } @@ -1176,56 +121,58 @@ func (client *Client) GetEndpoint(productId *string, regionId *string, endpointR // @param runtime - runtime options for this request RuntimeOptions // // @return AssumeRoleResponse -func (client *Client) AssumeRoleWithOptions(request *AssumeRoleRequest, runtime *util.RuntimeOptions) (_result *AssumeRoleResponse, _err error) { - _err = util.ValidateModel(request) - if _err != nil { - return _result, _err +func (client *Client) AssumeRoleWithOptions(request *AssumeRoleRequest, runtime *dara.RuntimeOptions) (_result *AssumeRoleResponse, _err error) { + if dara.BoolValue(client.EnableValidate) == true { + _err = request.Validate() + if _err != nil { + return _result, _err + } } query := map[string]interface{}{} - if !tea.BoolValue(util.IsUnset(request.DurationSeconds)) { + if !dara.IsNil(request.DurationSeconds) { query["DurationSeconds"] = request.DurationSeconds } - if !tea.BoolValue(util.IsUnset(request.ExternalId)) { + if !dara.IsNil(request.ExternalId) { query["ExternalId"] = request.ExternalId } - if !tea.BoolValue(util.IsUnset(request.Policy)) { + if !dara.IsNil(request.Policy) { query["Policy"] = request.Policy } - if !tea.BoolValue(util.IsUnset(request.RoleArn)) { + if !dara.IsNil(request.RoleArn) { query["RoleArn"] = request.RoleArn } - if !tea.BoolValue(util.IsUnset(request.RoleSessionName)) { + if !dara.IsNil(request.RoleSessionName) { query["RoleSessionName"] = request.RoleSessionName } - if !tea.BoolValue(util.IsUnset(request.SourceIdentity)) { + if !dara.IsNil(request.SourceIdentity) { query["SourceIdentity"] = request.SourceIdentity } - req := &openapi.OpenApiRequest{ + req := &openapiutil.OpenApiRequest{ Query: openapiutil.Query(query), } - params := &openapi.Params{ - Action: tea.String("AssumeRole"), - Version: tea.String("2015-04-01"), - Protocol: tea.String("HTTPS"), - Pathname: tea.String("/"), - Method: tea.String("POST"), - AuthType: tea.String("AK"), - Style: tea.String("RPC"), - ReqBodyType: tea.String("formData"), - BodyType: tea.String("json"), + params := &openapiutil.Params{ + Action: dara.String("AssumeRole"), + Version: dara.String("2015-04-01"), + Protocol: dara.String("HTTPS"), + Pathname: dara.String("/"), + Method: dara.String("POST"), + AuthType: dara.String("AK"), + Style: dara.String("RPC"), + ReqBodyType: dara.String("formData"), + BodyType: dara.String("json"), } _result = &AssumeRoleResponse{} _body, _err := client.CallApi(params, req, runtime) if _err != nil { return _result, _err } - _err = tea.Convert(_body, &_result) + _err = dara.Convert(_body, &_result) return _result, _err } @@ -1259,7 +206,7 @@ func (client *Client) AssumeRoleWithOptions(request *AssumeRoleRequest, runtime // // @return AssumeRoleResponse func (client *Client) AssumeRole(request *AssumeRoleRequest) (_result *AssumeRoleResponse, _err error) { - runtime := &util.RuntimeOptions{} + runtime := &dara.RuntimeOptions{} _result = &AssumeRoleResponse{} _body, _err := client.AssumeRoleWithOptions(request, runtime) if _err != nil { @@ -1288,56 +235,58 @@ func (client *Client) AssumeRole(request *AssumeRoleRequest) (_result *AssumeRol // @param runtime - runtime options for this request RuntimeOptions // // @return AssumeRoleWithOIDCResponse -func (client *Client) AssumeRoleWithOIDCWithOptions(request *AssumeRoleWithOIDCRequest, runtime *util.RuntimeOptions) (_result *AssumeRoleWithOIDCResponse, _err error) { - _err = util.ValidateModel(request) - if _err != nil { - return _result, _err +func (client *Client) AssumeRoleWithOIDCWithOptions(request *AssumeRoleWithOIDCRequest, runtime *dara.RuntimeOptions) (_result *AssumeRoleWithOIDCResponse, _err error) { + if dara.BoolValue(client.EnableValidate) == true { + _err = request.Validate() + if _err != nil { + return _result, _err + } } query := map[string]interface{}{} - if !tea.BoolValue(util.IsUnset(request.DurationSeconds)) { + if !dara.IsNil(request.DurationSeconds) { query["DurationSeconds"] = request.DurationSeconds } - if !tea.BoolValue(util.IsUnset(request.OIDCProviderArn)) { + if !dara.IsNil(request.OIDCProviderArn) { query["OIDCProviderArn"] = request.OIDCProviderArn } - if !tea.BoolValue(util.IsUnset(request.OIDCToken)) { + if !dara.IsNil(request.OIDCToken) { query["OIDCToken"] = request.OIDCToken } - if !tea.BoolValue(util.IsUnset(request.Policy)) { + if !dara.IsNil(request.Policy) { query["Policy"] = request.Policy } - if !tea.BoolValue(util.IsUnset(request.RoleArn)) { + if !dara.IsNil(request.RoleArn) { query["RoleArn"] = request.RoleArn } - if !tea.BoolValue(util.IsUnset(request.RoleSessionName)) { + if !dara.IsNil(request.RoleSessionName) { query["RoleSessionName"] = request.RoleSessionName } - req := &openapi.OpenApiRequest{ + req := &openapiutil.OpenApiRequest{ Query: openapiutil.Query(query), } - params := &openapi.Params{ - Action: tea.String("AssumeRoleWithOIDC"), - Version: tea.String("2015-04-01"), - Protocol: tea.String("HTTPS"), - Pathname: tea.String("/"), - Method: tea.String("POST"), - AuthType: tea.String("Anonymous"), - Style: tea.String("RPC"), - ReqBodyType: tea.String("formData"), - BodyType: tea.String("json"), + params := &openapiutil.Params{ + Action: dara.String("AssumeRoleWithOIDC"), + Version: dara.String("2015-04-01"), + Protocol: dara.String("HTTPS"), + Pathname: dara.String("/"), + Method: dara.String("POST"), + AuthType: dara.String("Anonymous"), + Style: dara.String("RPC"), + ReqBodyType: dara.String("formData"), + BodyType: dara.String("json"), } _result = &AssumeRoleWithOIDCResponse{} - _body, _err := client.CallApi(params, req, runtime) + _body, _err := client.DoRPCRequest(params.Action, params.Version, params.Protocol, params.Method, params.AuthType, params.BodyType, req, runtime) if _err != nil { return _result, _err } - _err = tea.Convert(_body, &_result) + _err = dara.Convert(_body, &_result) return _result, _err } @@ -1359,7 +308,7 @@ func (client *Client) AssumeRoleWithOIDCWithOptions(request *AssumeRoleWithOIDCR // // @return AssumeRoleWithOIDCResponse func (client *Client) AssumeRoleWithOIDC(request *AssumeRoleWithOIDCRequest) (_result *AssumeRoleWithOIDCResponse, _err error) { - runtime := &util.RuntimeOptions{} + runtime := &dara.RuntimeOptions{} _result = &AssumeRoleWithOIDCResponse{} _body, _err := client.AssumeRoleWithOIDCWithOptions(request, runtime) if _err != nil { @@ -1388,52 +337,54 @@ func (client *Client) AssumeRoleWithOIDC(request *AssumeRoleWithOIDCRequest) (_r // @param runtime - runtime options for this request RuntimeOptions // // @return AssumeRoleWithSAMLResponse -func (client *Client) AssumeRoleWithSAMLWithOptions(request *AssumeRoleWithSAMLRequest, runtime *util.RuntimeOptions) (_result *AssumeRoleWithSAMLResponse, _err error) { - _err = util.ValidateModel(request) - if _err != nil { - return _result, _err +func (client *Client) AssumeRoleWithSAMLWithOptions(request *AssumeRoleWithSAMLRequest, runtime *dara.RuntimeOptions) (_result *AssumeRoleWithSAMLResponse, _err error) { + if dara.BoolValue(client.EnableValidate) == true { + _err = request.Validate() + if _err != nil { + return _result, _err + } } query := map[string]interface{}{} - if !tea.BoolValue(util.IsUnset(request.DurationSeconds)) { + if !dara.IsNil(request.DurationSeconds) { query["DurationSeconds"] = request.DurationSeconds } - if !tea.BoolValue(util.IsUnset(request.Policy)) { + if !dara.IsNil(request.Policy) { query["Policy"] = request.Policy } - if !tea.BoolValue(util.IsUnset(request.RoleArn)) { + if !dara.IsNil(request.RoleArn) { query["RoleArn"] = request.RoleArn } - if !tea.BoolValue(util.IsUnset(request.SAMLAssertion)) { + if !dara.IsNil(request.SAMLAssertion) { query["SAMLAssertion"] = request.SAMLAssertion } - if !tea.BoolValue(util.IsUnset(request.SAMLProviderArn)) { + if !dara.IsNil(request.SAMLProviderArn) { query["SAMLProviderArn"] = request.SAMLProviderArn } - req := &openapi.OpenApiRequest{ + req := &openapiutil.OpenApiRequest{ Query: openapiutil.Query(query), } - params := &openapi.Params{ - Action: tea.String("AssumeRoleWithSAML"), - Version: tea.String("2015-04-01"), - Protocol: tea.String("HTTPS"), - Pathname: tea.String("/"), - Method: tea.String("POST"), - AuthType: tea.String("Anonymous"), - Style: tea.String("RPC"), - ReqBodyType: tea.String("formData"), - BodyType: tea.String("json"), + params := &openapiutil.Params{ + Action: dara.String("AssumeRoleWithSAML"), + Version: dara.String("2015-04-01"), + Protocol: dara.String("HTTPS"), + Pathname: dara.String("/"), + Method: dara.String("POST"), + AuthType: dara.String("Anonymous"), + Style: dara.String("RPC"), + ReqBodyType: dara.String("formData"), + BodyType: dara.String("json"), } _result = &AssumeRoleWithSAMLResponse{} - _body, _err := client.CallApi(params, req, runtime) + _body, _err := client.DoRPCRequest(params.Action, params.Version, params.Protocol, params.Method, params.AuthType, params.BodyType, req, runtime) if _err != nil { return _result, _err } - _err = tea.Convert(_body, &_result) + _err = dara.Convert(_body, &_result) return _result, _err } @@ -1455,7 +406,7 @@ func (client *Client) AssumeRoleWithSAMLWithOptions(request *AssumeRoleWithSAMLR // // @return AssumeRoleWithSAMLResponse func (client *Client) AssumeRoleWithSAML(request *AssumeRoleWithSAMLRequest) (_result *AssumeRoleWithSAMLResponse, _err error) { - runtime := &util.RuntimeOptions{} + runtime := &dara.RuntimeOptions{} _result = &AssumeRoleWithSAMLResponse{} _body, _err := client.AssumeRoleWithSAMLWithOptions(request, runtime) if _err != nil { @@ -1474,25 +425,25 @@ func (client *Client) AssumeRoleWithSAML(request *AssumeRoleWithSAMLRequest) (_r // @param runtime - runtime options for this request RuntimeOptions // // @return GetCallerIdentityResponse -func (client *Client) GetCallerIdentityWithOptions(runtime *util.RuntimeOptions) (_result *GetCallerIdentityResponse, _err error) { - req := &openapi.OpenApiRequest{} - params := &openapi.Params{ - Action: tea.String("GetCallerIdentity"), - Version: tea.String("2015-04-01"), - Protocol: tea.String("HTTPS"), - Pathname: tea.String("/"), - Method: tea.String("POST"), - AuthType: tea.String("AK"), - Style: tea.String("RPC"), - ReqBodyType: tea.String("formData"), - BodyType: tea.String("json"), +func (client *Client) GetCallerIdentityWithOptions(runtime *dara.RuntimeOptions) (_result *GetCallerIdentityResponse, _err error) { + req := &openapiutil.OpenApiRequest{} + params := &openapiutil.Params{ + Action: dara.String("GetCallerIdentity"), + Version: dara.String("2015-04-01"), + Protocol: dara.String("HTTPS"), + Pathname: dara.String("/"), + Method: dara.String("POST"), + AuthType: dara.String("AK"), + Style: dara.String("RPC"), + ReqBodyType: dara.String("formData"), + BodyType: dara.String("json"), } _result = &GetCallerIdentityResponse{} _body, _err := client.CallApi(params, req, runtime) if _err != nil { return _result, _err } - _err = tea.Convert(_body, &_result) + _err = dara.Convert(_body, &_result) return _result, _err } @@ -1502,7 +453,7 @@ func (client *Client) GetCallerIdentityWithOptions(runtime *util.RuntimeOptions) // // @return GetCallerIdentityResponse func (client *Client) GetCallerIdentity() (_result *GetCallerIdentityResponse, _err error) { - runtime := &util.RuntimeOptions{} + runtime := &dara.RuntimeOptions{} _result = &GetCallerIdentityResponse{} _body, _err := client.GetCallerIdentityWithOptions(runtime) if _err != nil { diff --git a/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/client_context_func.go b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/client_context_func.go new file mode 100644 index 00000000..6cd10566 --- /dev/null +++ b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/client_context_func.go @@ -0,0 +1,238 @@ +// This file is auto-generated, don't edit it. Thanks. +package client + +import ( + "context" + openapiutil "github.com/alibabacloud-go/darabonba-openapi/v2/utils" + "github.com/alibabacloud-go/tea/dara" +) + +// Summary: +// +// Obtains a Security Token Service (STS) token to assume a Resource Access Management (RAM) role. +// +// Description: +// +// ### Prerequisites +// +// You cannot use an Alibaba Cloud account to call this operation. The requester of this operation can only be a RAM user or RAM role. Make sure that the AliyunSTSAssumeRoleAccess policy is attached to the requester. After this policy is attached to the requester, the requester has the management permissions on STS. +// +// If you do not attach the AliyunSTSAssumeRoleAccess policy to the requester, the following error message is returned: +// +// `You are not authorized to do this action. You should be authorized by RAM.` +// +// You can refer to the following information to troubleshoot the error: +// +// - Cause of the error: The policy that is required to assume a RAM role is not attached to the requester. To resolve this issue, attach the AliyunSTSAssumeRoleAccess policy or a custom policy to the requester. For more information, see [Can I specify the RAM role that a RAM user can assume?](https://help.aliyun.com/document_detail/39744.html) and [Grant permissions to a RAM user](https://help.aliyun.com/document_detail/116146.html). +// +// - Cause of the error: The requester is not authorized to assume the RAM role. To resolve this issue, add the requester to the Principal element in the trust policy of the RAM role For more information, see [Edit the trust policy of a RAM role](https://help.aliyun.com/document_detail/116819.html). +// +// ### Best practices +// +// An STS token is valid for a period of time after it is issued, and the number of STS tokens that can be issued within an interval is also limited. Therefore, we recommend that you configure a proper validity period for an STS token and repeatedly use the token within this period. This prevents frequent issuing of STS tokens from adversely affecting your services if a large number of requests are sent. For more information about the limit, see [Is the number of STS API requests limited?](https://help.aliyun.com/document_detail/39744.html) You can configure the `DurationSeconds` parameter to specify a validity period for an STS token. +// +// When you upload or download Object Storage Service (OSS) objects on mobile devices, a large number of STS API requests are sent. In this case, repeated use of an STS token may not meet your business requirements. To avoid the limit on STS API requests from affecting access to OSS, you can **add a signature to the URL of an OSS object**. For more information, see [Add signatures to URLs](https://help.aliyun.com/document_detail/31952.html) and [Obtain signature information from the server and upload data to OSS](https://help.aliyun.com/document_detail/31926.html). +// +// @param request - AssumeRoleRequest +// +// @param runtime - runtime options for this request RuntimeOptions +// +// @return AssumeRoleResponse +func (client *Client) AssumeRoleWithContext(ctx context.Context, request *AssumeRoleRequest, runtime *dara.RuntimeOptions) (_result *AssumeRoleResponse, _err error) { + if dara.BoolValue(client.EnableValidate) == true { + _err = request.Validate() + if _err != nil { + return _result, _err + } + } + query := map[string]interface{}{} + if !dara.IsNil(request.DurationSeconds) { + query["DurationSeconds"] = request.DurationSeconds + } + + if !dara.IsNil(request.ExternalId) { + query["ExternalId"] = request.ExternalId + } + + if !dara.IsNil(request.Policy) { + query["Policy"] = request.Policy + } + + if !dara.IsNil(request.RoleArn) { + query["RoleArn"] = request.RoleArn + } + + if !dara.IsNil(request.RoleSessionName) { + query["RoleSessionName"] = request.RoleSessionName + } + + if !dara.IsNil(request.SourceIdentity) { + query["SourceIdentity"] = request.SourceIdentity + } + + req := &openapiutil.OpenApiRequest{ + Query: openapiutil.Query(query), + } + params := &openapiutil.Params{ + Action: dara.String("AssumeRole"), + Version: dara.String("2015-04-01"), + Protocol: dara.String("HTTPS"), + Pathname: dara.String("/"), + Method: dara.String("POST"), + AuthType: dara.String("AK"), + Style: dara.String("RPC"), + ReqBodyType: dara.String("formData"), + BodyType: dara.String("json"), + } + _result = &AssumeRoleResponse{} + _body, _err := client.CallApiWithCtx(ctx, params, req, runtime) + if _err != nil { + return _result, _err + } + _err = dara.Convert(_body, &_result) + return _result, _err +} + +// Summary: +// +// Queries a Security Token Service (STS) token to assume a Resource Access Management (RAM) role during role-based single sign-on (SSO) by using OpenID Connect (OIDC). +// +// Description: +// +// ### Prerequisites +// +// - An OIDC token is obtained from an external identity provider (IdP). +// +// - An OIDC IdP is created in the RAM console. For more information, see [Create an OIDC IdP](https://help.aliyun.com/document_detail/327123.html) or [CreateOIDCProvider](https://help.aliyun.com/document_detail/327135.html). +// +// - A RAM role whose trusted entity is an OIDC IdP is created in the RAM console. For more information, see [Create a RAM role for a trusted IdP](https://help.aliyun.com/document_detail/116805.html) or [CreateRole](https://help.aliyun.com/document_detail/28710.html). +// +// @param request - AssumeRoleWithOIDCRequest +// +// @param runtime - runtime options for this request RuntimeOptions +// +// @return AssumeRoleWithOIDCResponse +func (client *Client) AssumeRoleWithOIDCWithContext(ctx context.Context, request *AssumeRoleWithOIDCRequest, runtime *dara.RuntimeOptions) (_result *AssumeRoleWithOIDCResponse, _err error) { + if dara.BoolValue(client.EnableValidate) == true { + _err = request.Validate() + if _err != nil { + return _result, _err + } + } + query := map[string]interface{}{} + if !dara.IsNil(request.DurationSeconds) { + query["DurationSeconds"] = request.DurationSeconds + } + + if !dara.IsNil(request.OIDCProviderArn) { + query["OIDCProviderArn"] = request.OIDCProviderArn + } + + if !dara.IsNil(request.OIDCToken) { + query["OIDCToken"] = request.OIDCToken + } + + if !dara.IsNil(request.Policy) { + query["Policy"] = request.Policy + } + + if !dara.IsNil(request.RoleArn) { + query["RoleArn"] = request.RoleArn + } + + if !dara.IsNil(request.RoleSessionName) { + query["RoleSessionName"] = request.RoleSessionName + } + + req := &openapiutil.OpenApiRequest{ + Query: openapiutil.Query(query), + } + params := &openapiutil.Params{ + Action: dara.String("AssumeRoleWithOIDC"), + Version: dara.String("2015-04-01"), + Protocol: dara.String("HTTPS"), + Pathname: dara.String("/"), + Method: dara.String("POST"), + AuthType: dara.String("Anonymous"), + Style: dara.String("RPC"), + ReqBodyType: dara.String("formData"), + BodyType: dara.String("json"), + } + _result = &AssumeRoleWithOIDCResponse{} + _body, _err := client.DoRPCRequestWithCtx(ctx, params.Action, params.Version, params.Protocol, params.Method, params.AuthType, params.BodyType, req, runtime) + if _err != nil { + return _result, _err + } + _err = dara.Convert(_body, &_result) + return _result, _err +} + +// Summary: +// +// Obtains a Security Token Service (STS) token to assume a Resource Access Management (RAM) role during role-based single sign-on (SSO) by using Security Assertion Markup Language (SAML). +// +// Description: +// +// ### +// +// - A SAML response is obtained from an external identity provider (IdP). +// +// - A SAML IdP is created in the RAM console. For more information, see [Create a SAML IdP](https://help.aliyun.com/document_detail/116083.html) or [CreateSAMLProvider](https://help.aliyun.com/document_detail/186846.html). +// +// - A RAM role whose trusted entity is a SAML IdP is created in the RAM console. For more information, see [Create a RAM role for a trusted IdP](https://help.aliyun.com/document_detail/116805.html) or [CreateRole](https://help.aliyun.com/document_detail/28710.html). +// +// @param request - AssumeRoleWithSAMLRequest +// +// @param runtime - runtime options for this request RuntimeOptions +// +// @return AssumeRoleWithSAMLResponse +func (client *Client) AssumeRoleWithSAMLWithContext(ctx context.Context, request *AssumeRoleWithSAMLRequest, runtime *dara.RuntimeOptions) (_result *AssumeRoleWithSAMLResponse, _err error) { + if dara.BoolValue(client.EnableValidate) == true { + _err = request.Validate() + if _err != nil { + return _result, _err + } + } + query := map[string]interface{}{} + if !dara.IsNil(request.DurationSeconds) { + query["DurationSeconds"] = request.DurationSeconds + } + + if !dara.IsNil(request.Policy) { + query["Policy"] = request.Policy + } + + if !dara.IsNil(request.RoleArn) { + query["RoleArn"] = request.RoleArn + } + + if !dara.IsNil(request.SAMLAssertion) { + query["SAMLAssertion"] = request.SAMLAssertion + } + + if !dara.IsNil(request.SAMLProviderArn) { + query["SAMLProviderArn"] = request.SAMLProviderArn + } + + req := &openapiutil.OpenApiRequest{ + Query: openapiutil.Query(query), + } + params := &openapiutil.Params{ + Action: dara.String("AssumeRoleWithSAML"), + Version: dara.String("2015-04-01"), + Protocol: dara.String("HTTPS"), + Pathname: dara.String("/"), + Method: dara.String("POST"), + AuthType: dara.String("Anonymous"), + Style: dara.String("RPC"), + ReqBodyType: dara.String("formData"), + BodyType: dara.String("json"), + } + _result = &AssumeRoleWithSAMLResponse{} + _body, _err := client.DoRPCRequestWithCtx(ctx, params.Action, params.Version, params.Protocol, params.Method, params.AuthType, params.BodyType, req, runtime) + if _err != nil { + return _result, _err + } + _err = dara.Convert(_body, &_result) + return _result, _err +} diff --git a/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/get_caller_identity_response_body_model.go b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/get_caller_identity_response_body_model.go new file mode 100644 index 00000000..5f02571e --- /dev/null +++ b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/get_caller_identity_response_body_model.go @@ -0,0 +1,132 @@ +// This file is auto-generated, don't edit it. Thanks. +package client + +import ( + "github.com/alibabacloud-go/tea/dara" +) + +type iGetCallerIdentityResponseBody interface { + dara.Model + String() string + GoString() string + SetAccountId(v string) *GetCallerIdentityResponseBody + GetAccountId() *string + SetArn(v string) *GetCallerIdentityResponseBody + GetArn() *string + SetIdentityType(v string) *GetCallerIdentityResponseBody + GetIdentityType() *string + SetPrincipalId(v string) *GetCallerIdentityResponseBody + GetPrincipalId() *string + SetRequestId(v string) *GetCallerIdentityResponseBody + GetRequestId() *string + SetRoleId(v string) *GetCallerIdentityResponseBody + GetRoleId() *string + SetUserId(v string) *GetCallerIdentityResponseBody + GetUserId() *string +} + +type GetCallerIdentityResponseBody struct { + // example: + // + // 196813200012**** + AccountId *string `json:"AccountId,omitempty" xml:"AccountId,omitempty"` + // example: + // + // acs:ram::196813200012****:user/admin + Arn *string `json:"Arn,omitempty" xml:"Arn,omitempty"` + // example: + // + // RAMUser + IdentityType *string `json:"IdentityType,omitempty" xml:"IdentityType,omitempty"` + // example: + // + // 28877424437521**** + PrincipalId *string `json:"PrincipalId,omitempty" xml:"PrincipalId,omitempty"` + // example: + // + // 3C87BF47-3724-5443-ADC1-5AEAD9A03EB1 + RequestId *string `json:"RequestId,omitempty" xml:"RequestId,omitempty"` + // example: + // + // 33537620082992**** + RoleId *string `json:"RoleId,omitempty" xml:"RoleId,omitempty"` + // example: + // + // 216959339000**** + UserId *string `json:"UserId,omitempty" xml:"UserId,omitempty"` +} + +func (s GetCallerIdentityResponseBody) String() string { + return dara.Prettify(s) +} + +func (s GetCallerIdentityResponseBody) GoString() string { + return s.String() +} + +func (s *GetCallerIdentityResponseBody) GetAccountId() *string { + return s.AccountId +} + +func (s *GetCallerIdentityResponseBody) GetArn() *string { + return s.Arn +} + +func (s *GetCallerIdentityResponseBody) GetIdentityType() *string { + return s.IdentityType +} + +func (s *GetCallerIdentityResponseBody) GetPrincipalId() *string { + return s.PrincipalId +} + +func (s *GetCallerIdentityResponseBody) GetRequestId() *string { + return s.RequestId +} + +func (s *GetCallerIdentityResponseBody) GetRoleId() *string { + return s.RoleId +} + +func (s *GetCallerIdentityResponseBody) GetUserId() *string { + return s.UserId +} + +func (s *GetCallerIdentityResponseBody) SetAccountId(v string) *GetCallerIdentityResponseBody { + s.AccountId = &v + return s +} + +func (s *GetCallerIdentityResponseBody) SetArn(v string) *GetCallerIdentityResponseBody { + s.Arn = &v + return s +} + +func (s *GetCallerIdentityResponseBody) SetIdentityType(v string) *GetCallerIdentityResponseBody { + s.IdentityType = &v + return s +} + +func (s *GetCallerIdentityResponseBody) SetPrincipalId(v string) *GetCallerIdentityResponseBody { + s.PrincipalId = &v + return s +} + +func (s *GetCallerIdentityResponseBody) SetRequestId(v string) *GetCallerIdentityResponseBody { + s.RequestId = &v + return s +} + +func (s *GetCallerIdentityResponseBody) SetRoleId(v string) *GetCallerIdentityResponseBody { + s.RoleId = &v + return s +} + +func (s *GetCallerIdentityResponseBody) SetUserId(v string) *GetCallerIdentityResponseBody { + s.UserId = &v + return s +} + +func (s *GetCallerIdentityResponseBody) Validate() error { + return dara.Validate(s) +} diff --git a/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/get_caller_identity_response_model.go b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/get_caller_identity_response_model.go new file mode 100644 index 00000000..ba032cd2 --- /dev/null +++ b/vendor/github.com/alibabacloud-go/sts-20150401/v2/client/get_caller_identity_response_model.go @@ -0,0 +1,68 @@ +// This file is auto-generated, don't edit it. Thanks. +package client + +import ( + "github.com/alibabacloud-go/tea/dara" +) + +type iGetCallerIdentityResponse interface { + dara.Model + String() string + GoString() string + SetHeaders(v map[string]*string) *GetCallerIdentityResponse + GetHeaders() map[string]*string + SetStatusCode(v int32) *GetCallerIdentityResponse + GetStatusCode() *int32 + SetBody(v *GetCallerIdentityResponseBody) *GetCallerIdentityResponse + GetBody() *GetCallerIdentityResponseBody +} + +type GetCallerIdentityResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"` + StatusCode *int32 `json:"statusCode,omitempty" xml:"statusCode,omitempty"` + Body *GetCallerIdentityResponseBody `json:"body,omitempty" xml:"body,omitempty"` +} + +func (s GetCallerIdentityResponse) String() string { + return dara.Prettify(s) +} + +func (s GetCallerIdentityResponse) GoString() string { + return s.String() +} + +func (s *GetCallerIdentityResponse) GetHeaders() map[string]*string { + return s.Headers +} + +func (s *GetCallerIdentityResponse) GetStatusCode() *int32 { + return s.StatusCode +} + +func (s *GetCallerIdentityResponse) GetBody() *GetCallerIdentityResponseBody { + return s.Body +} + +func (s *GetCallerIdentityResponse) SetHeaders(v map[string]*string) *GetCallerIdentityResponse { + s.Headers = v + return s +} + +func (s *GetCallerIdentityResponse) SetStatusCode(v int32) *GetCallerIdentityResponse { + s.StatusCode = &v + return s +} + +func (s *GetCallerIdentityResponse) SetBody(v *GetCallerIdentityResponseBody) *GetCallerIdentityResponse { + s.Body = v + return s +} + +func (s *GetCallerIdentityResponse) Validate() error { + if s.Body != nil { + if err := s.Body.Validate(); err != nil { + return err + } + } + return nil +} diff --git a/vendor/github.com/alibabacloud-go/tea/dara/core.go b/vendor/github.com/alibabacloud-go/tea/dara/core.go index b87db864..65d0033e 100644 --- a/vendor/github.com/alibabacloud-go/tea/dara/core.go +++ b/vendor/github.com/alibabacloud-go/tea/dara/core.go @@ -94,6 +94,7 @@ type RuntimeObject struct { IgnoreSSL *bool `json:"ignoreSSL" xml:"ignoreSSL"` ReadTimeout *int `json:"readTimeout" xml:"readTimeout"` ConnectTimeout *int `json:"connectTimeout" xml:"connectTimeout"` + IdleTimeout *int `json:"idleTimeout" xml:"idleTimeout"` LocalAddr *string `json:"localAddr" xml:"localAddr"` HttpProxy *string `json:"httpProxy" xml:"httpProxy"` HttpsProxy *string `json:"httpsProxy" xml:"httpsProxy"` @@ -114,7 +115,7 @@ type RuntimeObject struct { func (r *RuntimeObject) getClientTag(domain string) string { return strconv.FormatBool(BoolValue(r.IgnoreSSL)) + strconv.Itoa(IntValue(r.ReadTimeout)) + - strconv.Itoa(IntValue(r.ConnectTimeout)) + StringValue(r.LocalAddr) + StringValue(r.HttpProxy) + + strconv.Itoa(IntValue(r.ConnectTimeout)) + strconv.Itoa(IntValue(r.IdleTimeout)) + StringValue(r.LocalAddr) + StringValue(r.HttpProxy) + StringValue(r.HttpsProxy) + StringValue(r.NoProxy) + StringValue(r.Socks5Proxy) + StringValue(r.Socks5NetWork) + domain } @@ -128,6 +129,7 @@ func NewRuntimeObject(runtime map[string]interface{}) *RuntimeObject { IgnoreSSL: TransInterfaceToBool(runtime["ignoreSSL"]), ReadTimeout: TransInterfaceToInt(runtime["readTimeout"]), ConnectTimeout: TransInterfaceToInt(runtime["connectTimeout"]), + IdleTimeout: TransInterfaceToInt(runtime["idleTimeout"]), LocalAddr: TransInterfaceToString(runtime["localAddr"]), HttpProxy: TransInterfaceToString(runtime["httpProxy"]), HttpsProxy: TransInterfaceToString(runtime["httpsProxy"]), @@ -573,6 +575,9 @@ func getHttpTransport(req *Request, runtime *RuntimeObject) (*http.Transport, er trans.MaxIdleConns = IntValue(runtime.MaxIdleConns) trans.MaxIdleConnsPerHost = IntValue(runtime.MaxIdleConns) } + if runtime.IdleTimeout != nil && *runtime.IdleTimeout > 0 { + trans.IdleConnTimeout = time.Duration(IntValue(runtime.IdleTimeout)) * time.Millisecond + } return trans, nil } diff --git a/vendor/modules.txt b/vendor/modules.txt index eebc51ac..02274f35 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -21,7 +21,7 @@ github.com/alibabacloud-go/cs-20151215/v5/client # github.com/alibabacloud-go/darabonba-openapi v0.2.1 ## explicit; go 1.14 github.com/alibabacloud-go/darabonba-openapi/client -# github.com/alibabacloud-go/darabonba-openapi/v2 v2.1.12 +# github.com/alibabacloud-go/darabonba-openapi/v2 v2.1.13 ## explicit; go 1.14 github.com/alibabacloud-go/darabonba-openapi/v2/client github.com/alibabacloud-go/darabonba-openapi/v2/models @@ -41,10 +41,10 @@ github.com/alibabacloud-go/ram-20150501/v2/client # github.com/alibabacloud-go/sts-20150401 v1.1.2 ## explicit; go 1.15 github.com/alibabacloud-go/sts-20150401/client -# github.com/alibabacloud-go/sts-20150401/v2 v2.0.4 +# github.com/alibabacloud-go/sts-20150401/v2 v2.1.0 ## explicit; go 1.14 github.com/alibabacloud-go/sts-20150401/v2/client -# github.com/alibabacloud-go/tea v1.3.12 +# github.com/alibabacloud-go/tea v1.3.13 ## explicit; go 1.14 github.com/alibabacloud-go/tea/dara github.com/alibabacloud-go/tea/tea