浏览代码

Support tags.

sdk-team 6 年之前
父节点
当前提交
a32c5ae727

+ 4 - 0
ChangeLog.txt

@@ -1,3 +1,7 @@
+2019-11-15 Version: 1.60.247
+- Support tags.
+- Support create pre paid alikafka instance.
+
 2019-11-15 Version: 1.60.246
 - Sync cdn APIs.
 

+ 25 - 0
services/alikafka/client.go

@@ -16,6 +16,8 @@ package alikafka
 // Changes may cause incorrect behavior and will be lost if the code is regenerated.
 
 import (
+	"reflect"
+
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk"
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider"
@@ -26,10 +28,25 @@ type Client struct {
 	sdk.Client
 }
 
+// SetClientProperty Set Property by Reflect
+func SetClientProperty(client *Client, propertyName string, propertyValue interface{}) {
+	v := reflect.ValueOf(client).Elem()
+	if v.FieldByName(propertyName).IsValid() && v.FieldByName(propertyName).CanSet() {
+		v.FieldByName(propertyName).Set(reflect.ValueOf(propertyValue))
+	}
+}
+
+// SetEndpointDataToClient Set EndpointMap and ENdpointType
+func SetEndpointDataToClient(client *Client) {
+	SetClientProperty(client, "EndpointMap", GetEndpointMap())
+	SetClientProperty(client, "EndpointType", GetEndpointType())
+}
+
 // NewClient creates a sdk client with environment variables
 func NewClient() (client *Client, err error) {
 	client = &Client{}
 	err = client.Init()
+	SetEndpointDataToClient(client)
 	return
 }
 
@@ -44,6 +61,7 @@ func NewClientWithProvider(regionId string, providers ...provider.Provider) (cli
 		pc = provider.NewProviderChain(providers)
 	}
 	err = client.InitWithProviderChain(regionId, pc)
+	SetEndpointDataToClient(client)
 	return
 }
 
@@ -52,6 +70,7 @@ func NewClientWithProvider(regionId string, providers ...provider.Provider) (cli
 func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithOptions(regionId, config, credential)
+	SetEndpointDataToClient(client)
 	return
 }
 
@@ -60,6 +79,7 @@ func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.C
 func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret)
+	SetEndpointDataToClient(client)
 	return
 }
 
@@ -68,6 +88,7 @@ func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (clie
 func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken)
+	SetEndpointDataToClient(client)
 	return
 }
 
@@ -76,6 +97,7 @@ func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToke
 func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
+	SetEndpointDataToClient(client)
 	return
 }
 
@@ -84,6 +106,7 @@ func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, role
 func NewClientWithRamRoleArnAndPolicy(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithRamRoleArnAndPolicy(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy)
+	SetEndpointDataToClient(client)
 	return
 }
 
@@ -92,6 +115,7 @@ func NewClientWithRamRoleArnAndPolicy(regionId string, accessKeyId, accessKeySec
 func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithEcsRamRole(regionId, roleName)
+	SetEndpointDataToClient(client)
 	return
 }
 
@@ -100,5 +124,6 @@ func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client,
 func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)
+	SetEndpointDataToClient(client)
 	return
 }

+ 108 - 0
services/alikafka/convert_post_pay_order.go

@@ -0,0 +1,108 @@
+package alikafka
+
+//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"
+)
+
+// ConvertPostPayOrder invokes the alikafka.ConvertPostPayOrder API synchronously
+// api document: https://help.aliyun.com/api/alikafka/convertpostpayorder.html
+func (client *Client) ConvertPostPayOrder(request *ConvertPostPayOrderRequest) (response *ConvertPostPayOrderResponse, err error) {
+	response = CreateConvertPostPayOrderResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ConvertPostPayOrderWithChan invokes the alikafka.ConvertPostPayOrder API asynchronously
+// api document: https://help.aliyun.com/api/alikafka/convertpostpayorder.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ConvertPostPayOrderWithChan(request *ConvertPostPayOrderRequest) (<-chan *ConvertPostPayOrderResponse, <-chan error) {
+	responseChan := make(chan *ConvertPostPayOrderResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ConvertPostPayOrder(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// ConvertPostPayOrderWithCallback invokes the alikafka.ConvertPostPayOrder API asynchronously
+// api document: https://help.aliyun.com/api/alikafka/convertpostpayorder.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ConvertPostPayOrderWithCallback(request *ConvertPostPayOrderRequest, callback func(response *ConvertPostPayOrderResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ConvertPostPayOrderResponse
+		var err error
+		defer close(result)
+		response, err = client.ConvertPostPayOrder(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// ConvertPostPayOrderRequest is the request struct for api ConvertPostPayOrder
+type ConvertPostPayOrderRequest struct {
+	*requests.RpcRequest
+	Duration   requests.Integer `position:"Query" name:"Duration"`
+	InstanceId string           `position:"Query" name:"InstanceId"`
+}
+
+// ConvertPostPayOrderResponse is the response struct for api ConvertPostPayOrder
+type ConvertPostPayOrderResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+	Success   bool   `json:"Success" xml:"Success"`
+	Code      int    `json:"Code" xml:"Code"`
+	Message   string `json:"Message" xml:"Message"`
+	OrderId   string `json:"OrderId" xml:"OrderId"`
+}
+
+// CreateConvertPostPayOrderRequest creates a request to invoke ConvertPostPayOrder API
+func CreateConvertPostPayOrderRequest() (request *ConvertPostPayOrderRequest) {
+	request = &ConvertPostPayOrderRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("alikafka", "2019-09-16", "ConvertPostPayOrder", "alikafka", "openAPI")
+	return
+}
+
+// CreateConvertPostPayOrderResponse creates a response to parse from ConvertPostPayOrder response
+func CreateConvertPostPayOrderResponse() (response *ConvertPostPayOrderResponse) {
+	response = &ConvertPostPayOrderResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 2 - 0
services/alikafka/create_post_pay_order.go

@@ -76,11 +76,13 @@ func (client *Client) CreatePostPayOrderWithCallback(request *CreatePostPayOrder
 // CreatePostPayOrderRequest is the request struct for api CreatePostPayOrder
 type CreatePostPayOrderRequest struct {
 	*requests.RpcRequest
+	PaidType   requests.Integer `position:"Query" name:"PaidType"`
 	DiskSize   requests.Integer `position:"Query" name:"DiskSize"`
 	IoMax      requests.Integer `position:"Query" name:"IoMax"`
 	DiskType   string           `position:"Query" name:"DiskType"`
 	TopicQuota requests.Integer `position:"Query" name:"TopicQuota"`
 	EipMax     requests.Integer `position:"Query" name:"EipMax"`
+	SpecType   string           `position:"Query" name:"SpecType"`
 	DeployType requests.Integer `position:"Query" name:"DeployType"`
 }
 

+ 114 - 0
services/alikafka/list_tag_resources.go

@@ -0,0 +1,114 @@
+package alikafka
+
+//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"
+)
+
+// ListTagResources invokes the alikafka.ListTagResources API synchronously
+// api document: https://help.aliyun.com/api/alikafka/listtagresources.html
+func (client *Client) ListTagResources(request *ListTagResourcesRequest) (response *ListTagResourcesResponse, err error) {
+	response = CreateListTagResourcesResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ListTagResourcesWithChan invokes the alikafka.ListTagResources API asynchronously
+// api document: https://help.aliyun.com/api/alikafka/listtagresources.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ListTagResourcesWithChan(request *ListTagResourcesRequest) (<-chan *ListTagResourcesResponse, <-chan error) {
+	responseChan := make(chan *ListTagResourcesResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ListTagResources(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// ListTagResourcesWithCallback invokes the alikafka.ListTagResources API asynchronously
+// api document: https://help.aliyun.com/api/alikafka/listtagresources.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ListTagResourcesWithCallback(request *ListTagResourcesRequest, callback func(response *ListTagResourcesResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ListTagResourcesResponse
+		var err error
+		defer close(result)
+		response, err = client.ListTagResources(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// ListTagResourcesRequest is the request struct for api ListTagResources
+type ListTagResourcesRequest struct {
+	*requests.RpcRequest
+	ResourceId   *[]string              `position:"Query" name:"ResourceId"  type:"Repeated"`
+	ResourceType string                 `position:"Query" name:"ResourceType"`
+	NextToken    string                 `position:"Query" name:"NextToken"`
+	Tag          *[]ListTagResourcesTag `position:"Query" name:"Tag"  type:"Repeated"`
+}
+
+// ListTagResourcesTag is a repeated param struct in ListTagResourcesRequest
+type ListTagResourcesTag struct {
+	Value string `name:"Value"`
+	Key   string `name:"Key"`
+}
+
+// ListTagResourcesResponse is the response struct for api ListTagResources
+type ListTagResourcesResponse struct {
+	*responses.BaseResponse
+	RequestId    string       `json:"RequestId" xml:"RequestId"`
+	NextToken    string       `json:"NextToken" xml:"NextToken"`
+	TagResources TagResources `json:"TagResources" xml:"TagResources"`
+}
+
+// CreateListTagResourcesRequest creates a request to invoke ListTagResources API
+func CreateListTagResourcesRequest() (request *ListTagResourcesRequest) {
+	request = &ListTagResourcesRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("alikafka", "2019-09-16", "ListTagResources", "alikafka", "openAPI")
+	return
+}
+
+// CreateListTagResourcesResponse creates a response to parse from ListTagResources response
+func CreateListTagResourcesResponse() (response *ListTagResourcesResponse) {
+	response = &ListTagResourcesResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 4 - 3
services/alikafka/struct_consumer_vo.go

@@ -17,7 +17,8 @@ package alikafka
 
 // ConsumerVO is a nested struct in alikafka response
 type ConsumerVO struct {
-	RegionId   string `json:"RegionId" xml:"RegionId"`
-	InstanceId string `json:"InstanceId" xml:"InstanceId"`
-	ConsumerId string `json:"ConsumerId" xml:"ConsumerId"`
+	RegionId   string                `json:"RegionId" xml:"RegionId"`
+	InstanceId string                `json:"InstanceId" xml:"InstanceId"`
+	ConsumerId string                `json:"ConsumerId" xml:"ConsumerId"`
+	Tags       TagsInGetConsumerList `json:"Tags" xml:"Tags"`
 }

+ 3 - 0
services/alikafka/struct_instance_vo.go

@@ -35,5 +35,8 @@ type InstanceVO struct {
 	MsgRetain                int                      `json:"MsgRetain" xml:"MsgRetain"`
 	TopicNumLimit            int                      `json:"TopicNumLimit" xml:"TopicNumLimit"`
 	ZoneId                   string                   `json:"ZoneId" xml:"ZoneId"`
+	PaidType                 int                      `json:"PaidType" xml:"PaidType"`
+	SpecType                 string                   `json:"SpecType" xml:"SpecType"`
 	UpgradeServiceDetailInfo UpgradeServiceDetailInfo `json:"UpgradeServiceDetailInfo" xml:"UpgradeServiceDetailInfo"`
+	Tags                     TagsInGetInstanceList    `json:"Tags" xml:"Tags"`
 }

+ 24 - 0
services/alikafka/struct_tag_resource.go

@@ -0,0 +1,24 @@
+package alikafka
+
+//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.
+
+// TagResource is a nested struct in alikafka response
+type TagResource struct {
+	TagKey       string `json:"TagKey" xml:"TagKey"`
+	TagValue     string `json:"TagValue" xml:"TagValue"`
+	ResourceType string `json:"ResourceType" xml:"ResourceType"`
+	ResourceId   string `json:"ResourceId" xml:"ResourceId"`
+}

+ 21 - 0
services/alikafka/struct_tag_resources.go

@@ -0,0 +1,21 @@
+package alikafka
+
+//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.
+
+// TagResources is a nested struct in alikafka response
+type TagResources struct {
+	TagResource []TagResource `json:"TagResource" xml:"TagResource"`
+}

+ 22 - 0
services/alikafka/struct_tag_vo.go

@@ -0,0 +1,22 @@
+package alikafka
+
+//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.
+
+// TagVO is a nested struct in alikafka response
+type TagVO struct {
+	Key   string `json:"Key" xml:"Key"`
+	Value string `json:"Value" xml:"Value"`
+}

+ 21 - 0
services/alikafka/struct_tags_in_get_consumer_list.go

@@ -0,0 +1,21 @@
+package alikafka
+
+//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.
+
+// TagsInGetConsumerList is a nested struct in alikafka response
+type TagsInGetConsumerList struct {
+	TagVO []TagVO `json:"TagVO" xml:"TagVO"`
+}

+ 21 - 0
services/alikafka/struct_tags_in_get_instance_list.go

@@ -0,0 +1,21 @@
+package alikafka
+
+//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.
+
+// TagsInGetInstanceList is a nested struct in alikafka response
+type TagsInGetInstanceList struct {
+	TagVO []TagVO `json:"TagVO" xml:"TagVO"`
+}

+ 21 - 0
services/alikafka/struct_tags_in_get_topic_list.go

@@ -0,0 +1,21 @@
+package alikafka
+
+//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.
+
+// TagsInGetTopicList is a nested struct in alikafka response
+type TagsInGetTopicList struct {
+	TagVO []TagVO `json:"TagVO" xml:"TagVO"`
+}

+ 11 - 10
services/alikafka/struct_topic_vo.go

@@ -17,14 +17,15 @@ package alikafka
 
 // TopicVO is a nested struct in alikafka response
 type TopicVO struct {
-	Topic        string `json:"Topic" xml:"Topic"`
-	CreateTime   int64  `json:"CreateTime" xml:"CreateTime"`
-	Remark       string `json:"Remark" xml:"Remark"`
-	Status       int    `json:"Status" xml:"Status"`
-	InstanceId   string `json:"InstanceId" xml:"InstanceId"`
-	RegionId     string `json:"RegionId" xml:"RegionId"`
-	StatusName   string `json:"StatusName" xml:"StatusName"`
-	CompactTopic bool   `json:"CompactTopic" xml:"CompactTopic"`
-	LocalTopic   bool   `json:"LocalTopic" xml:"LocalTopic"`
-	PartitionNum int    `json:"PartitionNum" xml:"PartitionNum"`
+	Topic        string             `json:"Topic" xml:"Topic"`
+	CreateTime   int64              `json:"CreateTime" xml:"CreateTime"`
+	Remark       string             `json:"Remark" xml:"Remark"`
+	Status       int                `json:"Status" xml:"Status"`
+	InstanceId   string             `json:"InstanceId" xml:"InstanceId"`
+	RegionId     string             `json:"RegionId" xml:"RegionId"`
+	StatusName   string             `json:"StatusName" xml:"StatusName"`
+	CompactTopic bool               `json:"CompactTopic" xml:"CompactTopic"`
+	LocalTopic   bool               `json:"LocalTopic" xml:"LocalTopic"`
+	PartitionNum int                `json:"PartitionNum" xml:"PartitionNum"`
+	Tags         TagsInGetTopicList `json:"Tags" xml:"Tags"`
 }

+ 111 - 0
services/alikafka/tag_resources.go

@@ -0,0 +1,111 @@
+package alikafka
+
+//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"
+)
+
+// TagResources invokes the alikafka.TagResources API synchronously
+// api document: https://help.aliyun.com/api/alikafka/tagresources.html
+func (client *Client) TagResources(request *TagResourcesRequest) (response *TagResourcesResponse, err error) {
+	response = CreateTagResourcesResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// TagResourcesWithChan invokes the alikafka.TagResources API asynchronously
+// api document: https://help.aliyun.com/api/alikafka/tagresources.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) TagResourcesWithChan(request *TagResourcesRequest) (<-chan *TagResourcesResponse, <-chan error) {
+	responseChan := make(chan *TagResourcesResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.TagResources(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// TagResourcesWithCallback invokes the alikafka.TagResources API asynchronously
+// api document: https://help.aliyun.com/api/alikafka/tagresources.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) TagResourcesWithCallback(request *TagResourcesRequest, callback func(response *TagResourcesResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *TagResourcesResponse
+		var err error
+		defer close(result)
+		response, err = client.TagResources(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// TagResourcesRequest is the request struct for api TagResources
+type TagResourcesRequest struct {
+	*requests.RpcRequest
+	ResourceId   *[]string          `position:"Query" name:"ResourceId"  type:"Repeated"`
+	ResourceType string             `position:"Query" name:"ResourceType"`
+	Tag          *[]TagResourcesTag `position:"Query" name:"Tag"  type:"Repeated"`
+}
+
+// TagResourcesTag is a repeated param struct in TagResourcesRequest
+type TagResourcesTag struct {
+	Value string `name:"Value"`
+	Key   string `name:"Key"`
+}
+
+// TagResourcesResponse is the response struct for api TagResources
+type TagResourcesResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateTagResourcesRequest creates a request to invoke TagResources API
+func CreateTagResourcesRequest() (request *TagResourcesRequest) {
+	request = &TagResourcesRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("alikafka", "2019-09-16", "TagResources", "alikafka", "openAPI")
+	return
+}
+
+// CreateTagResourcesResponse creates a response to parse from TagResources response
+func CreateTagResourcesResponse() (response *TagResourcesResponse) {
+	response = &TagResourcesResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 106 - 0
services/alikafka/untag_resources.go

@@ -0,0 +1,106 @@
+package alikafka
+
+//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"
+)
+
+// UntagResources invokes the alikafka.UntagResources API synchronously
+// api document: https://help.aliyun.com/api/alikafka/untagresources.html
+func (client *Client) UntagResources(request *UntagResourcesRequest) (response *UntagResourcesResponse, err error) {
+	response = CreateUntagResourcesResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// UntagResourcesWithChan invokes the alikafka.UntagResources API asynchronously
+// api document: https://help.aliyun.com/api/alikafka/untagresources.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) UntagResourcesWithChan(request *UntagResourcesRequest) (<-chan *UntagResourcesResponse, <-chan error) {
+	responseChan := make(chan *UntagResourcesResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.UntagResources(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// UntagResourcesWithCallback invokes the alikafka.UntagResources API asynchronously
+// api document: https://help.aliyun.com/api/alikafka/untagresources.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) UntagResourcesWithCallback(request *UntagResourcesRequest, callback func(response *UntagResourcesResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *UntagResourcesResponse
+		var err error
+		defer close(result)
+		response, err = client.UntagResources(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// UntagResourcesRequest is the request struct for api UntagResources
+type UntagResourcesRequest struct {
+	*requests.RpcRequest
+	All          requests.Boolean `position:"Query" name:"All"`
+	ResourceId   *[]string        `position:"Query" name:"ResourceId"  type:"Repeated"`
+	ResourceType string           `position:"Query" name:"ResourceType"`
+	TagKey       *[]string        `position:"Query" name:"TagKey"  type:"Repeated"`
+}
+
+// UntagResourcesResponse is the response struct for api UntagResources
+type UntagResourcesResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateUntagResourcesRequest creates a request to invoke UntagResources API
+func CreateUntagResourcesRequest() (request *UntagResourcesRequest) {
+	request = &UntagResourcesRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("alikafka", "2019-09-16", "UntagResources", "alikafka", "openAPI")
+	return
+}
+
+// CreateUntagResourcesResponse creates a response to parse from UntagResources response
+func CreateUntagResourcesResponse() (response *UntagResourcesResponse) {
+	response = &UntagResourcesResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 1 - 0
services/alikafka/upgrade_post_pay_order.go

@@ -80,6 +80,7 @@ type UpgradePostPayOrderRequest struct {
 	IoMax      requests.Integer `position:"Query" name:"IoMax"`
 	TopicQuota requests.Integer `position:"Query" name:"TopicQuota"`
 	EipMax     requests.Integer `position:"Query" name:"EipMax"`
+	SpecType   string           `position:"Query" name:"SpecType"`
 	InstanceId string           `position:"Query" name:"InstanceId"`
 }