From 93525f8e16cc437f8ad4a5d05b9b13514e770c9b Mon Sep 17 00:00:00 2001 From: sdk-team Date: Tue, 30 May 2023 08:00:05 +0000 Subject: [PATCH] Generated 2022-01-01 for VpcPeer. --- ChangeLog.txt | 6 + .../vpcpeer/accept_vpc_peer_connection.go | 1 + .../vpcpeer/create_vpc_peer_connection.go | 1 + services/vpcpeer/list_tag_resources.go | 112 ++++++++++++++++++ services/vpcpeer/list_vpc_peer_connections.go | 15 +-- services/vpcpeer/struct_tag_resources.go | 21 ++++ .../vpcpeer/struct_tag_result_model_list.go | 25 ++++ services/vpcpeer/tag_resources.go | 109 +++++++++++++++++ services/vpcpeer/un_tag_resources.go | 104 ++++++++++++++++ 9 files changed, 387 insertions(+), 7 deletions(-) create mode 100644 services/vpcpeer/list_tag_resources.go create mode 100644 services/vpcpeer/struct_tag_resources.go create mode 100644 services/vpcpeer/struct_tag_result_model_list.go create mode 100644 services/vpcpeer/tag_resources.go create mode 100644 services/vpcpeer/un_tag_resources.go diff --git a/ChangeLog.txt b/ChangeLog.txt index aba195c530..dda201a9f8 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,9 @@ +2023-05-30 Version: v1.62.352 +- Generated 2022-01-01 for `VpcPeer`. +- Adapt timeout. +- Adapt rpc timeout. +- VpcPeer Support ResourceGroup. + 2023-05-30 Version: v1.62.351 - Generated 2019-01-01 for `Cms`. - Add batch create once task. diff --git a/services/vpcpeer/accept_vpc_peer_connection.go b/services/vpcpeer/accept_vpc_peer_connection.go index f0a0634074..a0f6c4ecc1 100644 --- a/services/vpcpeer/accept_vpc_peer_connection.go +++ b/services/vpcpeer/accept_vpc_peer_connection.go @@ -73,6 +73,7 @@ type AcceptVpcPeerConnectionRequest struct { *requests.RpcRequest ClientToken string `position:"Body" name:"ClientToken"` Channel string `position:"Body" name:"Channel"` + ResourceGroupId string `position:"Body" name:"ResourceGroupId"` RequestContent string `position:"Body" name:"RequestContent"` DryRun requests.Boolean `position:"Body" name:"DryRun"` ResourceOwnerAccount string `position:"Body" name:"ResourceOwnerAccount"` diff --git a/services/vpcpeer/create_vpc_peer_connection.go b/services/vpcpeer/create_vpc_peer_connection.go index 929b8becb9..d4ee841225 100644 --- a/services/vpcpeer/create_vpc_peer_connection.go +++ b/services/vpcpeer/create_vpc_peer_connection.go @@ -75,6 +75,7 @@ type CreateVpcPeerConnectionRequest struct { Channel string `position:"Body" name:"Channel"` Description string `position:"Body" name:"Description"` AcceptingAliUid requests.Integer `position:"Body" name:"AcceptingAliUid"` + ResourceGroupId string `position:"Body" name:"ResourceGroupId"` AcceptingRegionId string `position:"Body" name:"AcceptingRegionId"` DryRun requests.Boolean `position:"Body" name:"DryRun"` AcceptingVpcId string `position:"Body" name:"AcceptingVpcId"` diff --git a/services/vpcpeer/list_tag_resources.go b/services/vpcpeer/list_tag_resources.go new file mode 100644 index 0000000000..db6489623e --- /dev/null +++ b/services/vpcpeer/list_tag_resources.go @@ -0,0 +1,112 @@ +package vpcpeer + +//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 vpcpeer.ListTagResources API synchronously +func (client *Client) ListTagResources(request *ListTagResourcesRequest) (response *ListTagResourcesResponse, err error) { + response = CreateListTagResourcesResponse() + err = client.DoAction(request, response) + return +} + +// ListTagResourcesWithChan invokes the vpcpeer.ListTagResources API asynchronously +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 vpcpeer.ListTagResources API asynchronously +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 + NextToken string `position:"Query" name:"NextToken"` + Tag *[]ListTagResourcesTag `position:"Query" name:"Tag" type:"Repeated"` + ResourceId *[]string `position:"Query" name:"ResourceId" type:"Repeated"` + ResourceType string `position:"Query" name:"ResourceType"` + MaxResults requests.Integer `position:"Query" name:"MaxResults"` +} + +// ListTagResourcesTag is a repeated param struct in ListTagResourcesRequest +type ListTagResourcesTag struct { + Key string `name:"Key"` + Value string `name:"Value"` +} + +// 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"` + MaxResults int `json:"MaxResults" xml:"MaxResults"` + TagResources []TagResultModelList `json:"TagResources" xml:"TagResources"` +} + +// CreateListTagResourcesRequest creates a request to invoke ListTagResources API +func CreateListTagResourcesRequest() (request *ListTagResourcesRequest) { + request = &ListTagResourcesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("VpcPeer", "2022-01-01", "ListTagResources", "vpcpeer", "openAPI") + request.Method = requests.POST + return +} + +// CreateListTagResourcesResponse creates a response to parse from ListTagResources response +func CreateListTagResourcesResponse() (response *ListTagResourcesResponse) { + response = &ListTagResourcesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/vpcpeer/list_vpc_peer_connections.go b/services/vpcpeer/list_vpc_peer_connections.go index 3edb06b825..ddf1da648c 100644 --- a/services/vpcpeer/list_vpc_peer_connections.go +++ b/services/vpcpeer/list_vpc_peer_connections.go @@ -71,13 +71,14 @@ func (client *Client) ListVpcPeerConnectionsWithCallback(request *ListVpcPeerCon // ListVpcPeerConnectionsRequest is the request struct for api ListVpcPeerConnections type ListVpcPeerConnectionsRequest struct { *requests.RpcRequest - Channel string `position:"Body" name:"Channel"` - NextToken string `position:"Body" name:"NextToken"` - Tags *[]ListVpcPeerConnectionsTags `position:"Query" name:"Tags" type:"Repeated"` - InstanceId string `position:"Body" name:"InstanceId"` - VpcId *[]string `position:"Body" name:"VpcId" type:"Repeated"` - Name string `position:"Body" name:"Name"` - MaxResults requests.Integer `position:"Body" name:"MaxResults"` + Channel string `position:"Body" name:"Channel"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + NextToken string `position:"Body" name:"NextToken"` + Tags *[]ListVpcPeerConnectionsTags `position:"Query" name:"Tags" type:"Repeated"` + InstanceId string `position:"Body" name:"InstanceId"` + VpcId *[]string `position:"Body" name:"VpcId" type:"Repeated"` + Name string `position:"Body" name:"Name"` + MaxResults requests.Integer `position:"Body" name:"MaxResults"` } // ListVpcPeerConnectionsTags is a repeated param struct in ListVpcPeerConnectionsRequest diff --git a/services/vpcpeer/struct_tag_resources.go b/services/vpcpeer/struct_tag_resources.go new file mode 100644 index 0000000000..c680b790c5 --- /dev/null +++ b/services/vpcpeer/struct_tag_resources.go @@ -0,0 +1,21 @@ +package vpcpeer + +//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 vpcpeer response +type TagResources struct { + TagResultModelList []TagResultModelList `json:"TagResultModelList" xml:"TagResultModelList"` +} diff --git a/services/vpcpeer/struct_tag_result_model_list.go b/services/vpcpeer/struct_tag_result_model_list.go new file mode 100644 index 0000000000..3689d79230 --- /dev/null +++ b/services/vpcpeer/struct_tag_result_model_list.go @@ -0,0 +1,25 @@ +package vpcpeer + +//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. + +// TagResultModelList is a nested struct in vpcpeer response +type TagResultModelList struct { + ResourceId string `json:"ResourceId" xml:"ResourceId"` + ResourceType string `json:"ResourceType" xml:"ResourceType"` + RegionNo string `json:"RegionNo" xml:"RegionNo"` + TagKey string `json:"TagKey" xml:"TagKey"` + TagValue string `json:"TagValue" xml:"TagValue"` +} diff --git a/services/vpcpeer/tag_resources.go b/services/vpcpeer/tag_resources.go new file mode 100644 index 0000000000..255c71a948 --- /dev/null +++ b/services/vpcpeer/tag_resources.go @@ -0,0 +1,109 @@ +package vpcpeer + +//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 vpcpeer.TagResources API synchronously +func (client *Client) TagResources(request *TagResourcesRequest) (response *TagResourcesResponse, err error) { + response = CreateTagResourcesResponse() + err = client.DoAction(request, response) + return +} + +// TagResourcesWithChan invokes the vpcpeer.TagResources API asynchronously +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 vpcpeer.TagResources API asynchronously +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 + ClientToken string `position:"Query" name:"ClientToken"` + Tag *[]TagResourcesTag `position:"Query" name:"Tag" type:"Repeated"` + ResourceId *[]string `position:"Query" name:"ResourceId" type:"Repeated"` + ResourceType string `position:"Query" name:"ResourceType"` +} + +// TagResourcesTag is a repeated param struct in TagResourcesRequest +type TagResourcesTag struct { + Key string `name:"Key"` + Value string `name:"Value"` +} + +// TagResourcesResponse is the response struct for api TagResources +type TagResourcesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Success bool `json:"Success" xml:"Success"` +} + +// CreateTagResourcesRequest creates a request to invoke TagResources API +func CreateTagResourcesRequest() (request *TagResourcesRequest) { + request = &TagResourcesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("VpcPeer", "2022-01-01", "TagResources", "vpcpeer", "openAPI") + request.Method = requests.POST + return +} + +// CreateTagResourcesResponse creates a response to parse from TagResources response +func CreateTagResourcesResponse() (response *TagResourcesResponse) { + response = &TagResourcesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/vpcpeer/un_tag_resources.go b/services/vpcpeer/un_tag_resources.go new file mode 100644 index 0000000000..4c603422da --- /dev/null +++ b/services/vpcpeer/un_tag_resources.go @@ -0,0 +1,104 @@ +package vpcpeer + +//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 vpcpeer.UnTagResources API synchronously +func (client *Client) UnTagResources(request *UnTagResourcesRequest) (response *UnTagResourcesResponse, err error) { + response = CreateUnTagResourcesResponse() + err = client.DoAction(request, response) + return +} + +// UnTagResourcesWithChan invokes the vpcpeer.UnTagResources API asynchronously +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 vpcpeer.UnTagResources API asynchronously +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 + ClientToken string `position:"Query" name:"ClientToken"` + 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"` + Success bool `json:"Success" xml:"Success"` +} + +// CreateUnTagResourcesRequest creates a request to invoke UnTagResources API +func CreateUnTagResourcesRequest() (request *UnTagResourcesRequest) { + request = &UnTagResourcesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("VpcPeer", "2022-01-01", "UnTagResources", "vpcpeer", "openAPI") + request.Method = requests.POST + return +} + +// CreateUnTagResourcesResponse creates a response to parse from UnTagResources response +func CreateUnTagResourcesResponse() (response *UnTagResourcesResponse) { + response = &UnTagResourcesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +}