-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sdk: rolling update for 0.22.4 (#399)
- Loading branch information
1 parent
ff40a83
commit f4c2ebc
Showing
23 changed files
with
598 additions
and
404 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Code is generated by ucloud-model, DO NOT EDIT IT. | ||
|
||
package sts | ||
|
||
import ( | ||
"github.com/ucloud/ucloud-sdk-go/ucloud/request" | ||
"github.com/ucloud/ucloud-sdk-go/ucloud/response" | ||
) | ||
|
||
// STS API Schema | ||
|
||
// AssumeRoleRequest is request schema for AssumeRole action | ||
type AssumeRoleRequest struct { | ||
request.CommonBase | ||
|
||
// Token有效期。 | ||
DurationSeconds *int `required:"false"` | ||
|
||
// 为STS Token额外添加的一个权限策略,进一步限制STS Token的权限。 | ||
Policy *string `required:"false"` | ||
|
||
// 角色会话名称。 | ||
RoleSessionName *string `required:"true"` | ||
|
||
// 要扮演的RAM角色URN。 | ||
RoleUrn *string `required:"true"` | ||
} | ||
|
||
// AssumeRoleResponse is response schema for AssumeRole action | ||
type AssumeRoleResponse struct { | ||
response.CommonBase | ||
|
||
// 访问凭证。 | ||
Credentials Credentials | ||
} | ||
|
||
// NewAssumeRoleRequest will create request of AssumeRole action. | ||
func (c *STSClient) NewAssumeRoleRequest() *AssumeRoleRequest { | ||
req := &AssumeRoleRequest{} | ||
|
||
// setup request with client config | ||
c.Client.SetupRequest(req) | ||
|
||
// setup retryable with default retry policy (retry for non-create action and common error) | ||
req.SetRetryable(true) | ||
return req | ||
} | ||
|
||
/* | ||
API: AssumeRole | ||
获取扮演角色的临时身份凭证 | ||
*/ | ||
func (c *STSClient) AssumeRole(req *AssumeRoleRequest) (*AssumeRoleResponse, error) { | ||
var err error | ||
var res AssumeRoleResponse | ||
|
||
reqCopier := *req | ||
|
||
err = c.Client.InvokeAction("AssumeRole", &reqCopier, &res) | ||
if err != nil { | ||
return &res, err | ||
} | ||
|
||
return &res, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Code is generated by ucloud-model, DO NOT EDIT IT. | ||
|
||
package sts | ||
|
||
import ( | ||
"github.com/ucloud/ucloud-sdk-go/ucloud" | ||
"github.com/ucloud/ucloud-sdk-go/ucloud/auth" | ||
) | ||
|
||
// STSClient is the client of STS | ||
type STSClient struct { | ||
*ucloud.Client | ||
} | ||
|
||
// NewClient will return a instance of STSClient | ||
func NewClient(config *ucloud.Config, credential *auth.Credential) *STSClient { | ||
meta := ucloud.ClientMeta{Product: "STS"} | ||
client := ucloud.NewClientWithMeta(config, credential, meta) | ||
return &STSClient{ | ||
client, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Code is generated by ucloud-model, DO NOT EDIT IT. | ||
|
||
/* | ||
Package sts include resources of ucloud sts product | ||
See also | ||
- API: https://docs.ucloud.cn/api/sts-api/index | ||
- Product: https://www.ucloud.cn/site/product/sts.html | ||
for detail. | ||
*/ | ||
package sts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Code is generated by ucloud-model, DO NOT EDIT IT. | ||
|
||
package sts | ||
|
||
/* | ||
Credentials - | ||
*/ | ||
type Credentials struct { | ||
|
||
// 密钥ID。 | ||
AccessKeyId string | ||
|
||
// 密钥Secret。 | ||
AccessKeySecret string | ||
|
||
// Token到期失效时间(UTC时间)。 | ||
Expiration string | ||
|
||
// 安全令牌。 | ||
SecurityToken string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.