Prechádzať zdrojové kódy

Generated 2016-01-20 for Kms.

sdk-team 6 rokov pred
rodič
commit
c5f1048fc9

+ 3 - 0
ChangeLog.txt

@@ -1,3 +1,6 @@
+2019-10-08 Version: 1.60.183
+- Generated 2016-01-20 for `Kms`.
+
 2019-09-29 Version: 1.60.182
 - Generated 2015-01-01 for `R-kvstore`.
 

+ 6 - 4
services/kms/create_key.go

@@ -76,10 +76,12 @@ func (client *Client) CreateKeyWithCallback(request *CreateKeyRequest, callback
 // CreateKeyRequest is the request struct for api CreateKey
 type CreateKeyRequest struct {
 	*requests.RpcRequest
-	ProtectionLevel string `position:"Query" name:"ProtectionLevel"`
-	KeyUsage        string `position:"Query" name:"KeyUsage"`
-	Origin          string `position:"Query" name:"Origin"`
-	Description     string `position:"Query" name:"Description"`
+	ProtectionLevel         string           `position:"Query" name:"ProtectionLevel"`
+	KeyUsage                string           `position:"Query" name:"KeyUsage"`
+	Origin                  string           `position:"Query" name:"Origin"`
+	Description             string           `position:"Query" name:"Description"`
+	RotationInterval        string           `position:"Query" name:"RotationInterval"`
+	EnableAutomaticRotation requests.Boolean `position:"Query" name:"EnableAutomaticRotation"`
 }
 
 // CreateKeyResponse is the response struct for api CreateKey

+ 4 - 3
services/kms/decrypt.go

@@ -83,9 +83,10 @@ type DecryptRequest struct {
 // DecryptResponse is the response struct for api Decrypt
 type DecryptResponse struct {
 	*responses.BaseResponse
-	Plaintext string `json:"Plaintext" xml:"Plaintext"`
-	KeyId     string `json:"KeyId" xml:"KeyId"`
-	RequestId string `json:"RequestId" xml:"RequestId"`
+	Plaintext    string `json:"Plaintext" xml:"Plaintext"`
+	KeyId        string `json:"KeyId" xml:"KeyId"`
+	RequestId    string `json:"RequestId" xml:"RequestId"`
+	KeyVersionId string `json:"KeyVersionId" xml:"KeyVersionId"`
 }
 
 // CreateDecryptRequest creates a request to invoke Decrypt API

+ 105 - 0
services/kms/describe_key_version.go

@@ -0,0 +1,105 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeKeyVersion invokes the kms.DescribeKeyVersion API synchronously
+// api document: https://help.aliyun.com/api/kms/describekeyversion.html
+func (client *Client) DescribeKeyVersion(request *DescribeKeyVersionRequest) (response *DescribeKeyVersionResponse, err error) {
+	response = CreateDescribeKeyVersionResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// DescribeKeyVersionWithChan invokes the kms.DescribeKeyVersion API asynchronously
+// api document: https://help.aliyun.com/api/kms/describekeyversion.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeKeyVersionWithChan(request *DescribeKeyVersionRequest) (<-chan *DescribeKeyVersionResponse, <-chan error) {
+	responseChan := make(chan *DescribeKeyVersionResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DescribeKeyVersion(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// DescribeKeyVersionWithCallback invokes the kms.DescribeKeyVersion API asynchronously
+// api document: https://help.aliyun.com/api/kms/describekeyversion.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeKeyVersionWithCallback(request *DescribeKeyVersionRequest, callback func(response *DescribeKeyVersionResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DescribeKeyVersionResponse
+		var err error
+		defer close(result)
+		response, err = client.DescribeKeyVersion(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// DescribeKeyVersionRequest is the request struct for api DescribeKeyVersion
+type DescribeKeyVersionRequest struct {
+	*requests.RpcRequest
+	KeyVersionId string `position:"Query" name:"KeyVersionId"`
+	KeyId        string `position:"Query" name:"KeyId"`
+}
+
+// DescribeKeyVersionResponse is the response struct for api DescribeKeyVersion
+type DescribeKeyVersionResponse struct {
+	*responses.BaseResponse
+	RequestId  string     `json:"RequestId" xml:"RequestId"`
+	KeyVersion KeyVersion `json:"KeyVersion" xml:"KeyVersion"`
+}
+
+// CreateDescribeKeyVersionRequest creates a request to invoke DescribeKeyVersion API
+func CreateDescribeKeyVersionRequest() (request *DescribeKeyVersionRequest) {
+	request = &DescribeKeyVersionRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "DescribeKeyVersion", "kms", "openAPI")
+	return
+}
+
+// CreateDescribeKeyVersionResponse creates a response to parse from DescribeKeyVersion response
+func CreateDescribeKeyVersionResponse() (response *DescribeKeyVersionResponse) {
+	response = &DescribeKeyVersionResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 1 - 0
services/kms/encrypt.go

@@ -87,6 +87,7 @@ type EncryptResponse struct {
 	CiphertextBlob string `json:"CiphertextBlob" xml:"CiphertextBlob"`
 	KeyId          string `json:"KeyId" xml:"KeyId"`
 	RequestId      string `json:"RequestId" xml:"RequestId"`
+	KeyVersionId   string `json:"KeyVersionId" xml:"KeyVersionId"`
 }
 
 // CreateEncryptRequest creates a request to invoke Encrypt API

+ 1 - 0
services/kms/generate_data_key.go

@@ -89,6 +89,7 @@ type GenerateDataKeyResponse struct {
 	KeyId          string `json:"KeyId" xml:"KeyId"`
 	Plaintext      string `json:"Plaintext" xml:"Plaintext"`
 	RequestId      string `json:"RequestId" xml:"RequestId"`
+	KeyVersionId   string `json:"KeyVersionId" xml:"KeyVersionId"`
 }
 
 // CreateGenerateDataKeyRequest creates a request to invoke GenerateDataKey API

+ 109 - 0
services/kms/generate_data_key_without_plaintext.go

@@ -0,0 +1,109 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// GenerateDataKeyWithoutPlaintext invokes the kms.GenerateDataKeyWithoutPlaintext API synchronously
+// api document: https://help.aliyun.com/api/kms/generatedatakeywithoutplaintext.html
+func (client *Client) GenerateDataKeyWithoutPlaintext(request *GenerateDataKeyWithoutPlaintextRequest) (response *GenerateDataKeyWithoutPlaintextResponse, err error) {
+	response = CreateGenerateDataKeyWithoutPlaintextResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// GenerateDataKeyWithoutPlaintextWithChan invokes the kms.GenerateDataKeyWithoutPlaintext API asynchronously
+// api document: https://help.aliyun.com/api/kms/generatedatakeywithoutplaintext.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) GenerateDataKeyWithoutPlaintextWithChan(request *GenerateDataKeyWithoutPlaintextRequest) (<-chan *GenerateDataKeyWithoutPlaintextResponse, <-chan error) {
+	responseChan := make(chan *GenerateDataKeyWithoutPlaintextResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.GenerateDataKeyWithoutPlaintext(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// GenerateDataKeyWithoutPlaintextWithCallback invokes the kms.GenerateDataKeyWithoutPlaintext API asynchronously
+// api document: https://help.aliyun.com/api/kms/generatedatakeywithoutplaintext.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) GenerateDataKeyWithoutPlaintextWithCallback(request *GenerateDataKeyWithoutPlaintextRequest, callback func(response *GenerateDataKeyWithoutPlaintextResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *GenerateDataKeyWithoutPlaintextResponse
+		var err error
+		defer close(result)
+		response, err = client.GenerateDataKeyWithoutPlaintext(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// GenerateDataKeyWithoutPlaintextRequest is the request struct for api GenerateDataKeyWithoutPlaintext
+type GenerateDataKeyWithoutPlaintextRequest struct {
+	*requests.RpcRequest
+	EncryptionContext string           `position:"Query" name:"EncryptionContext"`
+	KeyId             string           `position:"Query" name:"KeyId"`
+	KeySpec           string           `position:"Query" name:"KeySpec"`
+	NumberOfBytes     requests.Integer `position:"Query" name:"NumberOfBytes"`
+}
+
+// GenerateDataKeyWithoutPlaintextResponse is the response struct for api GenerateDataKeyWithoutPlaintext
+type GenerateDataKeyWithoutPlaintextResponse struct {
+	*responses.BaseResponse
+	CiphertextBlob string `json:"CiphertextBlob" xml:"CiphertextBlob"`
+	KeyId          string `json:"KeyId" xml:"KeyId"`
+	RequestId      string `json:"RequestId" xml:"RequestId"`
+	KeyVersionId   string `json:"KeyVersionId" xml:"KeyVersionId"`
+}
+
+// CreateGenerateDataKeyWithoutPlaintextRequest creates a request to invoke GenerateDataKeyWithoutPlaintext API
+func CreateGenerateDataKeyWithoutPlaintextRequest() (request *GenerateDataKeyWithoutPlaintextRequest) {
+	request = &GenerateDataKeyWithoutPlaintextRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "GenerateDataKeyWithoutPlaintext", "kms", "openAPI")
+	return
+}
+
+// CreateGenerateDataKeyWithoutPlaintextResponse creates a response to parse from GenerateDataKeyWithoutPlaintext response
+func CreateGenerateDataKeyWithoutPlaintextResponse() (response *GenerateDataKeyWithoutPlaintextResponse) {
+	response = &GenerateDataKeyWithoutPlaintextResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 109 - 0
services/kms/list_key_versions.go

@@ -0,0 +1,109 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// ListKeyVersions invokes the kms.ListKeyVersions API synchronously
+// api document: https://help.aliyun.com/api/kms/listkeyversions.html
+func (client *Client) ListKeyVersions(request *ListKeyVersionsRequest) (response *ListKeyVersionsResponse, err error) {
+	response = CreateListKeyVersionsResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ListKeyVersionsWithChan invokes the kms.ListKeyVersions API asynchronously
+// api document: https://help.aliyun.com/api/kms/listkeyversions.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ListKeyVersionsWithChan(request *ListKeyVersionsRequest) (<-chan *ListKeyVersionsResponse, <-chan error) {
+	responseChan := make(chan *ListKeyVersionsResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ListKeyVersions(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// ListKeyVersionsWithCallback invokes the kms.ListKeyVersions API asynchronously
+// api document: https://help.aliyun.com/api/kms/listkeyversions.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ListKeyVersionsWithCallback(request *ListKeyVersionsRequest, callback func(response *ListKeyVersionsResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ListKeyVersionsResponse
+		var err error
+		defer close(result)
+		response, err = client.ListKeyVersions(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// ListKeyVersionsRequest is the request struct for api ListKeyVersions
+type ListKeyVersionsRequest struct {
+	*requests.RpcRequest
+	PageSize   requests.Integer `position:"Query" name:"PageSize"`
+	KeyId      string           `position:"Query" name:"KeyId"`
+	PageNumber requests.Integer `position:"Query" name:"PageNumber"`
+}
+
+// ListKeyVersionsResponse is the response struct for api ListKeyVersions
+type ListKeyVersionsResponse struct {
+	*responses.BaseResponse
+	RequestId   string      `json:"RequestId" xml:"RequestId"`
+	TotalCount  int         `json:"TotalCount" xml:"TotalCount"`
+	PageNumber  int         `json:"PageNumber" xml:"PageNumber"`
+	PageSize    int         `json:"PageSize" xml:"PageSize"`
+	KeyVersions KeyVersions `json:"KeyVersions" xml:"KeyVersions"`
+}
+
+// CreateListKeyVersionsRequest creates a request to invoke ListKeyVersions API
+func CreateListKeyVersionsRequest() (request *ListKeyVersionsRequest) {
+	request = &ListKeyVersionsRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "ListKeyVersions", "kms", "openAPI")
+	return
+}
+
+// CreateListKeyVersionsResponse creates a response to parse from ListKeyVersions response
+func CreateListKeyVersionsResponse() (response *ListKeyVersionsResponse) {
+	response = &ListKeyVersionsResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 8 - 3
services/kms/struct_key_metadata.go

@@ -17,15 +17,20 @@ package kms
 
 // KeyMetadata is a nested struct in kms response
 type KeyMetadata struct {
+	NextRotationDate   string `json:"NextRotationDate" xml:"NextRotationDate"`
 	ProtectionLevel    string `json:"ProtectionLevel" xml:"ProtectionLevel"`
+	KeyUsage           string `json:"KeyUsage" xml:"KeyUsage"`
+	DeleteDate         string `json:"DeleteDate" xml:"DeleteDate"`
+	AutomaticRotation  string `json:"AutomaticRotation" xml:"AutomaticRotation"`
+	LastRotationDate   string `json:"LastRotationDate" xml:"LastRotationDate"`
+	MaterialExpireTime string `json:"MaterialExpireTime" xml:"MaterialExpireTime"`
+	RotationInterval   string `json:"RotationInterval" xml:"RotationInterval"`
+	PrimaryKeyVersion  string `json:"PrimaryKeyVersion" xml:"PrimaryKeyVersion"`
 	Arn                string `json:"Arn" xml:"Arn"`
 	KeyState           string `json:"KeyState" xml:"KeyState"`
 	CreationDate       string `json:"CreationDate" xml:"CreationDate"`
-	KeyUsage           string `json:"KeyUsage" xml:"KeyUsage"`
-	DeleteDate         string `json:"DeleteDate" xml:"DeleteDate"`
 	Creator            string `json:"Creator" xml:"Creator"`
 	Origin             string `json:"Origin" xml:"Origin"`
 	Description        string `json:"Description" xml:"Description"`
 	KeyId              string `json:"KeyId" xml:"KeyId"`
-	MaterialExpireTime string `json:"MaterialExpireTime" xml:"MaterialExpireTime"`
 }

+ 23 - 0
services/kms/struct_key_version.go

@@ -0,0 +1,23 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// KeyVersion is a nested struct in kms response
+type KeyVersion struct {
+	CreationDate string `json:"CreationDate" xml:"CreationDate"`
+	KeyVersionId string `json:"KeyVersionId" xml:"KeyVersionId"`
+	KeyId        string `json:"KeyId" xml:"KeyId"`
+}

+ 21 - 0
services/kms/struct_key_versions.go

@@ -0,0 +1,21 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// KeyVersions is a nested struct in kms response
+type KeyVersions struct {
+	KeyVersion []KeyVersion `json:"KeyVersion" xml:"KeyVersion"`
+}

+ 104 - 0
services/kms/update_key_description.go

@@ -0,0 +1,104 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// UpdateKeyDescription invokes the kms.UpdateKeyDescription API synchronously
+// api document: https://help.aliyun.com/api/kms/updatekeydescription.html
+func (client *Client) UpdateKeyDescription(request *UpdateKeyDescriptionRequest) (response *UpdateKeyDescriptionResponse, err error) {
+	response = CreateUpdateKeyDescriptionResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// UpdateKeyDescriptionWithChan invokes the kms.UpdateKeyDescription API asynchronously
+// api document: https://help.aliyun.com/api/kms/updatekeydescription.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) UpdateKeyDescriptionWithChan(request *UpdateKeyDescriptionRequest) (<-chan *UpdateKeyDescriptionResponse, <-chan error) {
+	responseChan := make(chan *UpdateKeyDescriptionResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.UpdateKeyDescription(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// UpdateKeyDescriptionWithCallback invokes the kms.UpdateKeyDescription API asynchronously
+// api document: https://help.aliyun.com/api/kms/updatekeydescription.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) UpdateKeyDescriptionWithCallback(request *UpdateKeyDescriptionRequest, callback func(response *UpdateKeyDescriptionResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *UpdateKeyDescriptionResponse
+		var err error
+		defer close(result)
+		response, err = client.UpdateKeyDescription(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// UpdateKeyDescriptionRequest is the request struct for api UpdateKeyDescription
+type UpdateKeyDescriptionRequest struct {
+	*requests.RpcRequest
+	KeyId       string `position:"Query" name:"KeyId"`
+	Description string `position:"Query" name:"Description"`
+}
+
+// UpdateKeyDescriptionResponse is the response struct for api UpdateKeyDescription
+type UpdateKeyDescriptionResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateUpdateKeyDescriptionRequest creates a request to invoke UpdateKeyDescription API
+func CreateUpdateKeyDescriptionRequest() (request *UpdateKeyDescriptionRequest) {
+	request = &UpdateKeyDescriptionRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "UpdateKeyDescription", "kms", "openAPI")
+	return
+}
+
+// CreateUpdateKeyDescriptionResponse creates a response to parse from UpdateKeyDescription response
+func CreateUpdateKeyDescriptionResponse() (response *UpdateKeyDescriptionResponse) {
+	response = &UpdateKeyDescriptionResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 105 - 0
services/kms/update_rotation_policy.go

@@ -0,0 +1,105 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// UpdateRotationPolicy invokes the kms.UpdateRotationPolicy API synchronously
+// api document: https://help.aliyun.com/api/kms/updaterotationpolicy.html
+func (client *Client) UpdateRotationPolicy(request *UpdateRotationPolicyRequest) (response *UpdateRotationPolicyResponse, err error) {
+	response = CreateUpdateRotationPolicyResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// UpdateRotationPolicyWithChan invokes the kms.UpdateRotationPolicy API asynchronously
+// api document: https://help.aliyun.com/api/kms/updaterotationpolicy.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) UpdateRotationPolicyWithChan(request *UpdateRotationPolicyRequest) (<-chan *UpdateRotationPolicyResponse, <-chan error) {
+	responseChan := make(chan *UpdateRotationPolicyResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.UpdateRotationPolicy(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// UpdateRotationPolicyWithCallback invokes the kms.UpdateRotationPolicy API asynchronously
+// api document: https://help.aliyun.com/api/kms/updaterotationpolicy.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) UpdateRotationPolicyWithCallback(request *UpdateRotationPolicyRequest, callback func(response *UpdateRotationPolicyResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *UpdateRotationPolicyResponse
+		var err error
+		defer close(result)
+		response, err = client.UpdateRotationPolicy(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// UpdateRotationPolicyRequest is the request struct for api UpdateRotationPolicy
+type UpdateRotationPolicyRequest struct {
+	*requests.RpcRequest
+	KeyId                   string           `position:"Query" name:"KeyId"`
+	RotationInterval        string           `position:"Query" name:"RotationInterval"`
+	EnableAutomaticRotation requests.Boolean `position:"Query" name:"EnableAutomaticRotation"`
+}
+
+// UpdateRotationPolicyResponse is the response struct for api UpdateRotationPolicy
+type UpdateRotationPolicyResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateUpdateRotationPolicyRequest creates a request to invoke UpdateRotationPolicy API
+func CreateUpdateRotationPolicyRequest() (request *UpdateRotationPolicyRequest) {
+	request = &UpdateRotationPolicyRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "UpdateRotationPolicy", "kms", "openAPI")
+	return
+}
+
+// CreateUpdateRotationPolicyResponse creates a response to parse from UpdateRotationPolicy response
+func CreateUpdateRotationPolicyResponse() (response *UpdateRotationPolicyResponse) {
+	response = &UpdateRotationPolicyResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}