From f3c1a4f33b90ec360383fc72aa55d40b0902ab6f Mon Sep 17 00:00:00 2001 From: sdk-team Date: Wed, 13 Mar 2024 12:11:47 +0000 Subject: [PATCH] Generated 2020-06-01 for SWAS-OPEN. --- ChangeLog.txt | 4 + services/swas-open/create_command.go | 21 ++-- services/swas-open/create_custom_image.go | 21 ++-- services/swas-open/create_firewall_rules.go | 10 +- services/swas-open/create_snapshot.go | 13 +- .../describe_cloud_assistant_attributes.go | 105 +++++++++++++++++ services/swas-open/describe_commands.go | 19 ++- services/swas-open/list_custom_images.go | 22 ++-- services/swas-open/list_disks.go | 7 ++ services/swas-open/list_firewall_rules.go | 14 ++- services/swas-open/list_instances.go | 19 ++- services/swas-open/list_regions.go | 1 + services/swas-open/list_snapshots.go | 19 ++- services/swas-open/list_tag_resources.go | 111 ++++++++++++++++++ services/swas-open/struct_cloud_assistant.go | 21 ++++ services/swas-open/struct_command.go | 1 + services/swas-open/struct_custom_image.go | 2 + services/swas-open/struct_disk.go | 20 ++-- services/swas-open/struct_disk_tags.go | 21 ++++ ...disks.go => struct_disks_in_list_disks.go} | 4 +- .../struct_disks_in_list_instances.go | 21 ++++ services/swas-open/struct_firewall_rule.go | 1 + .../swas-open/struct_firewall_rule_ids.go | 21 ++++ services/swas-open/struct_instance.go | 2 + services/swas-open/struct_snapshot.go | 1 + services/swas-open/struct_status.go | 12 +- services/swas-open/struct_tag.go | 22 ++++ services/swas-open/struct_tag_resource.go | 24 ++++ services/swas-open/struct_tag_resources.go | 21 ++++ .../struct_tags_in_describe_commands.go | 21 ++++ .../struct_tags_in_list_custom_images.go | 21 ++++ .../swas-open/struct_tags_in_list_disks.go | 21 ++++ .../struct_tags_in_list_firewall_rules.go | 21 ++++ .../struct_tags_in_list_instances.go | 21 ++++ .../struct_tags_in_list_snapshots.go | 21 ++++ services/swas-open/tag_resources.go | 108 +++++++++++++++++ services/swas-open/untag_resources.go | 103 ++++++++++++++++ 37 files changed, 858 insertions(+), 59 deletions(-) create mode 100644 services/swas-open/describe_cloud_assistant_attributes.go create mode 100644 services/swas-open/list_tag_resources.go create mode 100644 services/swas-open/struct_cloud_assistant.go create mode 100644 services/swas-open/struct_disk_tags.go rename services/swas-open/{struct_disks.go => struct_disks_in_list_disks.go} (89%) create mode 100644 services/swas-open/struct_disks_in_list_instances.go create mode 100644 services/swas-open/struct_firewall_rule_ids.go create mode 100644 services/swas-open/struct_tag.go create mode 100644 services/swas-open/struct_tag_resource.go create mode 100644 services/swas-open/struct_tag_resources.go create mode 100644 services/swas-open/struct_tags_in_describe_commands.go create mode 100644 services/swas-open/struct_tags_in_list_custom_images.go create mode 100644 services/swas-open/struct_tags_in_list_disks.go create mode 100644 services/swas-open/struct_tags_in_list_firewall_rules.go create mode 100644 services/swas-open/struct_tags_in_list_instances.go create mode 100644 services/swas-open/struct_tags_in_list_snapshots.go create mode 100644 services/swas-open/tag_resources.go create mode 100644 services/swas-open/untag_resources.go diff --git a/ChangeLog.txt b/ChangeLog.txt index 7bd246612..3b0fd6bbf 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +2024-03-13 Version: v1.62.694 +- Generated 2020-06-01 for `SWAS-OPEN`. +undefined + 2024-03-13 Version: v1.62.693 - Generated 2019-12-30 for `facebody`. - Update QueryFaceImageTemplate. diff --git a/services/swas-open/create_command.go b/services/swas-open/create_command.go index beba56fa7..e7fce6549 100644 --- a/services/swas-open/create_command.go +++ b/services/swas-open/create_command.go @@ -71,13 +71,20 @@ func (client *Client) CreateCommandWithCallback(request *CreateCommandRequest, c // CreateCommandRequest is the request struct for api CreateCommand type CreateCommandRequest struct { *requests.RpcRequest - WorkingDir string `position:"Query" name:"WorkingDir"` - Description string `position:"Query" name:"Description"` - Type string `position:"Query" name:"Type"` - CommandContent string `position:"Query" name:"CommandContent"` - Timeout requests.Integer `position:"Query" name:"Timeout"` - Name string `position:"Query" name:"Name"` - EnableParameter requests.Boolean `position:"Query" name:"EnableParameter"` + WorkingDir string `position:"Query" name:"WorkingDir"` + Description string `position:"Query" name:"Description"` + Type string `position:"Query" name:"Type"` + CommandContent string `position:"Query" name:"CommandContent"` + Timeout requests.Integer `position:"Query" name:"Timeout"` + Tag *[]CreateCommandTag `position:"Query" name:"Tag" type:"Repeated"` + Name string `position:"Query" name:"Name"` + EnableParameter requests.Boolean `position:"Query" name:"EnableParameter"` +} + +// CreateCommandTag is a repeated param struct in CreateCommandRequest +type CreateCommandTag struct { + Key string `name:"Key"` + Value string `name:"Value"` } // CreateCommandResponse is the response struct for api CreateCommand diff --git a/services/swas-open/create_custom_image.go b/services/swas-open/create_custom_image.go index 4f044bb56..cd35f1ece 100644 --- a/services/swas-open/create_custom_image.go +++ b/services/swas-open/create_custom_image.go @@ -71,13 +71,20 @@ func (client *Client) CreateCustomImageWithCallback(request *CreateCustomImageRe // CreateCustomImageRequest is the request struct for api CreateCustomImage type CreateCustomImageRequest struct { *requests.RpcRequest - SystemSnapshotId string `position:"Query" name:"SystemSnapshotId"` - DataSnapshotId string `position:"Query" name:"DataSnapshotId"` - ClientToken string `position:"Query" name:"ClientToken"` - Description string `position:"Query" name:"Description"` - Platform string `position:"Query" name:"Platform"` - ImageName string `position:"Query" name:"ImageName"` - InstanceId string `position:"Query" name:"InstanceId"` + SystemSnapshotId string `position:"Query" name:"SystemSnapshotId"` + DataSnapshotId string `position:"Query" name:"DataSnapshotId"` + ClientToken string `position:"Query" name:"ClientToken"` + Description string `position:"Query" name:"Description"` + Platform string `position:"Query" name:"Platform"` + ImageName string `position:"Query" name:"ImageName"` + Tag *[]CreateCustomImageTag `position:"Query" name:"Tag" type:"Repeated"` + InstanceId string `position:"Query" name:"InstanceId"` +} + +// CreateCustomImageTag is a repeated param struct in CreateCustomImageRequest +type CreateCustomImageTag struct { + Key string `name:"Key"` + Value string `name:"Value"` } // CreateCustomImageResponse is the response struct for api CreateCustomImage diff --git a/services/swas-open/create_firewall_rules.go b/services/swas-open/create_firewall_rules.go index 31542204b..9e2274aef 100644 --- a/services/swas-open/create_firewall_rules.go +++ b/services/swas-open/create_firewall_rules.go @@ -74,6 +74,7 @@ type CreateFirewallRulesRequest struct { ClientToken string `position:"Query" name:"ClientToken"` InstanceId string `position:"Query" name:"InstanceId"` FirewallRules *[]CreateFirewallRulesFirewallRules `position:"Query" name:"FirewallRules" type:"Json"` + Tag *[]CreateFirewallRulesTag `position:"Query" name:"Tag" type:"Repeated"` } // CreateFirewallRulesFirewallRules is a repeated param struct in CreateFirewallRulesRequest @@ -84,10 +85,17 @@ type CreateFirewallRulesFirewallRules struct { Remark string `name:"Remark"` } +// CreateFirewallRulesTag is a repeated param struct in CreateFirewallRulesRequest +type CreateFirewallRulesTag struct { + Key string `name:"Key"` + Value string `name:"Value"` +} + // CreateFirewallRulesResponse is the response struct for api CreateFirewallRules type CreateFirewallRulesResponse struct { *responses.BaseResponse - RequestId string `json:"RequestId" xml:"RequestId"` + RequestId string `json:"RequestId" xml:"RequestId"` + FirewallRuleIds []string `json:"FirewallRuleIds" xml:"FirewallRuleIds"` } // CreateCreateFirewallRulesRequest creates a request to invoke CreateFirewallRules API diff --git a/services/swas-open/create_snapshot.go b/services/swas-open/create_snapshot.go index c7ead38f7..05b2d20dd 100644 --- a/services/swas-open/create_snapshot.go +++ b/services/swas-open/create_snapshot.go @@ -71,9 +71,16 @@ func (client *Client) CreateSnapshotWithCallback(request *CreateSnapshotRequest, // CreateSnapshotRequest is the request struct for api CreateSnapshot type CreateSnapshotRequest struct { *requests.RpcRequest - ClientToken string `position:"Query" name:"ClientToken"` - SnapshotName string `position:"Query" name:"SnapshotName"` - DiskId string `position:"Query" name:"DiskId"` + ClientToken string `position:"Query" name:"ClientToken"` + SnapshotName string `position:"Query" name:"SnapshotName"` + DiskId string `position:"Query" name:"DiskId"` + Tag *[]CreateSnapshotTag `position:"Query" name:"Tag" type:"Repeated"` +} + +// CreateSnapshotTag is a repeated param struct in CreateSnapshotRequest +type CreateSnapshotTag struct { + Key string `name:"Key"` + Value string `name:"Value"` } // CreateSnapshotResponse is the response struct for api CreateSnapshot diff --git a/services/swas-open/describe_cloud_assistant_attributes.go b/services/swas-open/describe_cloud_assistant_attributes.go new file mode 100644 index 000000000..4b4cb1369 --- /dev/null +++ b/services/swas-open/describe_cloud_assistant_attributes.go @@ -0,0 +1,105 @@ +package swas_open + +//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" +) + +// DescribeCloudAssistantAttributes invokes the swas_open.DescribeCloudAssistantAttributes API synchronously +func (client *Client) DescribeCloudAssistantAttributes(request *DescribeCloudAssistantAttributesRequest) (response *DescribeCloudAssistantAttributesResponse, err error) { + response = CreateDescribeCloudAssistantAttributesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeCloudAssistantAttributesWithChan invokes the swas_open.DescribeCloudAssistantAttributes API asynchronously +func (client *Client) DescribeCloudAssistantAttributesWithChan(request *DescribeCloudAssistantAttributesRequest) (<-chan *DescribeCloudAssistantAttributesResponse, <-chan error) { + responseChan := make(chan *DescribeCloudAssistantAttributesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeCloudAssistantAttributes(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeCloudAssistantAttributesWithCallback invokes the swas_open.DescribeCloudAssistantAttributes API asynchronously +func (client *Client) DescribeCloudAssistantAttributesWithCallback(request *DescribeCloudAssistantAttributesRequest, callback func(response *DescribeCloudAssistantAttributesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeCloudAssistantAttributesResponse + var err error + defer close(result) + response, err = client.DescribeCloudAssistantAttributes(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeCloudAssistantAttributesRequest is the request struct for api DescribeCloudAssistantAttributes +type DescribeCloudAssistantAttributesRequest struct { + *requests.RpcRequest + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + InstanceIds *[]string `position:"Query" name:"InstanceIds" type:"Json"` + PageSize requests.Integer `position:"Query" name:"PageSize"` +} + +// DescribeCloudAssistantAttributesResponse is the response struct for api DescribeCloudAssistantAttributes +type DescribeCloudAssistantAttributesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageSize int `json:"PageSize" xml:"PageSize"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + CloudAssistant []Status `json:"CloudAssistant" xml:"CloudAssistant"` +} + +// CreateDescribeCloudAssistantAttributesRequest creates a request to invoke DescribeCloudAssistantAttributes API +func CreateDescribeCloudAssistantAttributesRequest() (request *DescribeCloudAssistantAttributesRequest) { + request = &DescribeCloudAssistantAttributesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("SWAS-OPEN", "2020-06-01", "DescribeCloudAssistantAttributes", "SWAS-OPEN", "openAPI") + request.Method = requests.POST + return +} + +// CreateDescribeCloudAssistantAttributesResponse creates a response to parse from DescribeCloudAssistantAttributes response +func CreateDescribeCloudAssistantAttributesResponse() (response *DescribeCloudAssistantAttributesResponse) { + response = &DescribeCloudAssistantAttributesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/swas-open/describe_commands.go b/services/swas-open/describe_commands.go index bff0a573a..087256fc8 100644 --- a/services/swas-open/describe_commands.go +++ b/services/swas-open/describe_commands.go @@ -71,12 +71,19 @@ func (client *Client) DescribeCommandsWithCallback(request *DescribeCommandsRequ // DescribeCommandsRequest is the request struct for api DescribeCommands type DescribeCommandsRequest struct { *requests.RpcRequest - Type string `position:"Query" name:"Type"` - CommandId string `position:"Query" name:"CommandId"` - PageNumber string `position:"Query" name:"PageNumber"` - Provider string `position:"Query" name:"Provider"` - Name string `position:"Query" name:"Name"` - PageSize string `position:"Query" name:"PageSize"` + Type string `position:"Query" name:"Type"` + CommandId string `position:"Query" name:"CommandId"` + PageNumber string `position:"Query" name:"PageNumber"` + Provider string `position:"Query" name:"Provider"` + PageSize string `position:"Query" name:"PageSize"` + Tag *[]DescribeCommandsTag `position:"Query" name:"Tag" type:"Repeated"` + Name string `position:"Query" name:"Name"` +} + +// DescribeCommandsTag is a repeated param struct in DescribeCommandsRequest +type DescribeCommandsTag struct { + Key string `name:"Key"` + Value string `name:"Value"` } // DescribeCommandsResponse is the response struct for api DescribeCommands diff --git a/services/swas-open/list_custom_images.go b/services/swas-open/list_custom_images.go index bff1de07c..0a5fe0f9b 100644 --- a/services/swas-open/list_custom_images.go +++ b/services/swas-open/list_custom_images.go @@ -71,13 +71,21 @@ func (client *Client) ListCustomImagesWithCallback(request *ListCustomImagesRequ // ListCustomImagesRequest is the request struct for api ListCustomImages type ListCustomImagesRequest struct { *requests.RpcRequest - SystemSnapshotId string `position:"Query" name:"SystemSnapshotId"` - DataSnapshotId string `position:"Query" name:"DataSnapshotId"` - ClientToken string `position:"Query" name:"ClientToken"` - ImageNames string `position:"Query" name:"ImageNames"` - PageNumber requests.Integer `position:"Query" name:"PageNumber"` - PageSize requests.Integer `position:"Query" name:"PageSize"` - ImageIds string `position:"Query" name:"ImageIds"` + SystemSnapshotId string `position:"Query" name:"SystemSnapshotId"` + DataSnapshotId string `position:"Query" name:"DataSnapshotId"` + ClientToken string `position:"Query" name:"ClientToken"` + ImageNames string `position:"Query" name:"ImageNames"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + Tag *[]ListCustomImagesTag `position:"Query" name:"Tag" type:"Repeated"` + ImageIds string `position:"Query" name:"ImageIds"` +} + +// ListCustomImagesTag is a repeated param struct in ListCustomImagesRequest +type ListCustomImagesTag struct { + Key string `name:"Key"` + Value string `name:"Value"` } // ListCustomImagesResponse is the response struct for api ListCustomImages diff --git a/services/swas-open/list_disks.go b/services/swas-open/list_disks.go index cf89c32a6..00d2e2f22 100644 --- a/services/swas-open/list_disks.go +++ b/services/swas-open/list_disks.go @@ -76,6 +76,13 @@ type ListDisksRequest struct { InstanceId string `position:"Query" name:"InstanceId"` PageSize requests.Integer `position:"Query" name:"PageSize"` DiskIds string `position:"Query" name:"DiskIds"` + Tag *[]ListDisksTag `position:"Query" name:"Tag" type:"Repeated"` +} + +// ListDisksTag is a repeated param struct in ListDisksRequest +type ListDisksTag struct { + Key string `name:"Key"` + Value string `name:"Value"` } // ListDisksResponse is the response struct for api ListDisks diff --git a/services/swas-open/list_firewall_rules.go b/services/swas-open/list_firewall_rules.go index 2dfc887d0..6766e0eb8 100644 --- a/services/swas-open/list_firewall_rules.go +++ b/services/swas-open/list_firewall_rules.go @@ -71,9 +71,17 @@ func (client *Client) ListFirewallRulesWithCallback(request *ListFirewallRulesRe // ListFirewallRulesRequest is the request struct for api ListFirewallRules type ListFirewallRulesRequest struct { *requests.RpcRequest - PageNumber requests.Integer `position:"Query" name:"PageNumber"` - InstanceId string `position:"Query" name:"InstanceId"` - PageSize requests.Integer `position:"Query" name:"PageSize"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + InstanceId string `position:"Query" name:"InstanceId"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + FirewallRuleId string `position:"Query" name:"FirewallRuleId"` + Tag *[]ListFirewallRulesTag `position:"Query" name:"Tag" type:"Repeated"` +} + +// ListFirewallRulesTag is a repeated param struct in ListFirewallRulesRequest +type ListFirewallRulesTag struct { + Key string `name:"Key"` + Value string `name:"Value"` } // ListFirewallRulesResponse is the response struct for api ListFirewallRules diff --git a/services/swas-open/list_instances.go b/services/swas-open/list_instances.go index 375890cd7..423a6b2ed 100644 --- a/services/swas-open/list_instances.go +++ b/services/swas-open/list_instances.go @@ -71,12 +71,19 @@ func (client *Client) ListInstancesWithCallback(request *ListInstancesRequest, c // ListInstancesRequest is the request struct for api ListInstances type ListInstancesRequest struct { *requests.RpcRequest - PageNumber requests.Integer `position:"Query" name:"PageNumber"` - InstanceIds string `position:"Query" name:"InstanceIds"` - PageSize requests.Integer `position:"Query" name:"PageSize"` - PublicIpAddresses string `position:"Query" name:"PublicIpAddresses"` - ChargeType string `position:"Query" name:"ChargeType"` - Status string `position:"Query" name:"Status"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + PublicIpAddresses string `position:"Query" name:"PublicIpAddresses"` + Tag *[]ListInstancesTag `position:"Query" name:"Tag" type:"Repeated"` + InstanceIds string `position:"Query" name:"InstanceIds"` + ChargeType string `position:"Query" name:"ChargeType"` + Status string `position:"Query" name:"Status"` +} + +// ListInstancesTag is a repeated param struct in ListInstancesRequest +type ListInstancesTag struct { + Key string `name:"Key"` + Value string `name:"Value"` } // ListInstancesResponse is the response struct for api ListInstances diff --git a/services/swas-open/list_regions.go b/services/swas-open/list_regions.go index a9a74fbb9..a276efced 100644 --- a/services/swas-open/list_regions.go +++ b/services/swas-open/list_regions.go @@ -71,6 +71,7 @@ func (client *Client) ListRegionsWithCallback(request *ListRegionsRequest, callb // ListRegionsRequest is the request struct for api ListRegions type ListRegionsRequest struct { *requests.RpcRequest + AcceptLanguage string `position:"Query" name:"AcceptLanguage"` } // ListRegionsResponse is the response struct for api ListRegions diff --git a/services/swas-open/list_snapshots.go b/services/swas-open/list_snapshots.go index 63b431506..92a191b80 100644 --- a/services/swas-open/list_snapshots.go +++ b/services/swas-open/list_snapshots.go @@ -71,12 +71,19 @@ func (client *Client) ListSnapshotsWithCallback(request *ListSnapshotsRequest, c // ListSnapshotsRequest is the request struct for api ListSnapshots type ListSnapshotsRequest struct { *requests.RpcRequest - SnapshotIds string `position:"Query" name:"SnapshotIds"` - SourceDiskType string `position:"Query" name:"SourceDiskType"` - PageNumber requests.Integer `position:"Query" name:"PageNumber"` - InstanceId string `position:"Query" name:"InstanceId"` - PageSize requests.Integer `position:"Query" name:"PageSize"` - DiskId string `position:"Query" name:"DiskId"` + SnapshotIds string `position:"Query" name:"SnapshotIds"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + DiskId string `position:"Query" name:"DiskId"` + Tag *[]ListSnapshotsTag `position:"Query" name:"Tag" type:"Repeated"` + SourceDiskType string `position:"Query" name:"SourceDiskType"` + InstanceId string `position:"Query" name:"InstanceId"` +} + +// ListSnapshotsTag is a repeated param struct in ListSnapshotsRequest +type ListSnapshotsTag struct { + Key string `name:"Key"` + Value string `name:"Value"` } // ListSnapshotsResponse is the response struct for api ListSnapshots diff --git a/services/swas-open/list_tag_resources.go b/services/swas-open/list_tag_resources.go new file mode 100644 index 000000000..363d8972f --- /dev/null +++ b/services/swas-open/list_tag_resources.go @@ -0,0 +1,111 @@ +package swas_open + +//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 swas_open.ListTagResources API synchronously +func (client *Client) ListTagResources(request *ListTagResourcesRequest) (response *ListTagResourcesResponse, err error) { + response = CreateListTagResourcesResponse() + err = client.DoAction(request, response) + return +} + +// ListTagResourcesWithChan invokes the swas_open.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 swas_open.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 + ResourceId *[]string `position:"Query" name:"ResourceId" type:"Repeated"` + ClientToken string `position:"Query" name:"ClientToken"` + 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 { + Key string `name:"Key"` + Value string `name:"Value"` +} + +// ListTagResourcesResponse is the response struct for api ListTagResources +type ListTagResourcesResponse struct { + *responses.BaseResponse + NextToken string `json:"NextToken" xml:"NextToken"` + RequestId string `json:"RequestId" xml:"RequestId"` + 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("SWAS-OPEN", "2020-06-01", "ListTagResources", "SWAS-OPEN", "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/swas-open/struct_cloud_assistant.go b/services/swas-open/struct_cloud_assistant.go new file mode 100644 index 000000000..17c82b727 --- /dev/null +++ b/services/swas-open/struct_cloud_assistant.go @@ -0,0 +1,21 @@ +package swas_open + +//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. + +// CloudAssistant is a nested struct in swas_open response +type CloudAssistant struct { + Status []Status `json:"status" xml:"status"` +} diff --git a/services/swas-open/struct_command.go b/services/swas-open/struct_command.go index 66dc8e56c..be5c0a202 100644 --- a/services/swas-open/struct_command.go +++ b/services/swas-open/struct_command.go @@ -37,4 +37,5 @@ type Command struct { ParameterNames []string `json:"ParameterNames" xml:"ParameterNames"` ParameterDefinitions []ParameterDefinition `json:"ParameterDefinitions" xml:"ParameterDefinitions"` InvokeInstances []InvokeInstance `json:"InvokeInstances" xml:"InvokeInstances"` + Tags []Tag `json:"Tags" xml:"Tags"` } diff --git a/services/swas-open/struct_custom_image.go b/services/swas-open/struct_custom_image.go index 0c78ac624..9ac5762f0 100644 --- a/services/swas-open/struct_custom_image.go +++ b/services/swas-open/struct_custom_image.go @@ -30,4 +30,6 @@ type CustomImage struct { ImageId string `json:"ImageId" xml:"ImageId"` Status string `json:"Status" xml:"Status"` InstanceName string `json:"InstanceName" xml:"InstanceName"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + Tags []Tag `json:"Tags" xml:"Tags"` } diff --git a/services/swas-open/struct_disk.go b/services/swas-open/struct_disk.go index a3085724f..56f3eb05c 100644 --- a/services/swas-open/struct_disk.go +++ b/services/swas-open/struct_disk.go @@ -17,17 +17,19 @@ package swas_open // Disk is a nested struct in swas_open response type Disk struct { - CreationTime string `json:"CreationTime" xml:"CreationTime"` - Status string `json:"Status" xml:"Status"` + Category string `json:"Category" xml:"Category"` Device string `json:"Device" xml:"Device"` - Size int `json:"Size" xml:"Size"` - DiskName string `json:"DiskName" xml:"DiskName"` - DiskChargeType string `json:"DiskChargeType" xml:"DiskChargeType"` + Remark string `json:"Remark" xml:"Remark"` DiskType string `json:"DiskType" xml:"DiskType"` - Category string `json:"Category" xml:"Category"` + InstanceName string `json:"InstanceName" xml:"InstanceName"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` DiskId string `json:"DiskId" xml:"DiskId"` - InstanceId string `json:"InstanceId" xml:"InstanceId"` + Size int `json:"Size" xml:"Size"` RegionId string `json:"RegionId" xml:"RegionId"` - Remark string `json:"Remark" xml:"Remark"` - InstanceName string `json:"InstanceName" xml:"InstanceName"` + DiskChargeType string `json:"DiskChargeType" xml:"DiskChargeType"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` + Status string `json:"Status" xml:"Status"` + DiskName string `json:"DiskName" xml:"DiskName"` + DiskTags []Tag `json:"DiskTags" xml:"DiskTags"` + Tags []Tag `json:"Tags" xml:"Tags"` } diff --git a/services/swas-open/struct_disk_tags.go b/services/swas-open/struct_disk_tags.go new file mode 100644 index 000000000..0f0403d5a --- /dev/null +++ b/services/swas-open/struct_disk_tags.go @@ -0,0 +1,21 @@ +package swas_open + +//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. + +// DiskTags is a nested struct in swas_open response +type DiskTags struct { + Tag []Tag `json:"tag" xml:"tag"` +} diff --git a/services/swas-open/struct_disks.go b/services/swas-open/struct_disks_in_list_disks.go similarity index 89% rename from services/swas-open/struct_disks.go rename to services/swas-open/struct_disks_in_list_disks.go index f1f0f62a1..1a1e15b5c 100644 --- a/services/swas-open/struct_disks.go +++ b/services/swas-open/struct_disks_in_list_disks.go @@ -15,7 +15,7 @@ package swas_open // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// Disks is a nested struct in swas_open response -type Disks struct { +// DisksInListDisks is a nested struct in swas_open response +type DisksInListDisks struct { Disk []Disk `json:"Disk" xml:"Disk"` } diff --git a/services/swas-open/struct_disks_in_list_instances.go b/services/swas-open/struct_disks_in_list_instances.go new file mode 100644 index 000000000..179e30de3 --- /dev/null +++ b/services/swas-open/struct_disks_in_list_instances.go @@ -0,0 +1,21 @@ +package swas_open + +//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. + +// DisksInListInstances is a nested struct in swas_open response +type DisksInListInstances struct { + Disk []Disk `json:"disk" xml:"disk"` +} diff --git a/services/swas-open/struct_firewall_rule.go b/services/swas-open/struct_firewall_rule.go index c3245c1d8..2f2f99f8b 100644 --- a/services/swas-open/struct_firewall_rule.go +++ b/services/swas-open/struct_firewall_rule.go @@ -23,4 +23,5 @@ type FirewallRule struct { RuleProtocol string `json:"RuleProtocol" xml:"RuleProtocol"` Policy string `json:"Policy" xml:"Policy"` SourceCidrIp string `json:"SourceCidrIp" xml:"SourceCidrIp"` + Tags []Tag `json:"Tags" xml:"Tags"` } diff --git a/services/swas-open/struct_firewall_rule_ids.go b/services/swas-open/struct_firewall_rule_ids.go new file mode 100644 index 000000000..805f6f135 --- /dev/null +++ b/services/swas-open/struct_firewall_rule_ids.go @@ -0,0 +1,21 @@ +package swas_open + +//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. + +// FirewallRuleIds is a nested struct in swas_open response +type FirewallRuleIds struct { + FirewallRuleIds []string `json:"FirewallRuleIds" xml:"FirewallRuleIds"` +} diff --git a/services/swas-open/struct_instance.go b/services/swas-open/struct_instance.go index 5a8af7ccd..fa1e3a03c 100644 --- a/services/swas-open/struct_instance.go +++ b/services/swas-open/struct_instance.go @@ -36,4 +36,6 @@ type Instance struct { Uuid string `json:"Uuid" xml:"Uuid"` ResourceSpec ResourceSpec `json:"ResourceSpec" xml:"ResourceSpec"` Image Image `json:"Image" xml:"Image"` + Tags []Tag `json:"Tags" xml:"Tags"` + Disks []Disk `json:"Disks" xml:"Disks"` } diff --git a/services/swas-open/struct_snapshot.go b/services/swas-open/struct_snapshot.go index 2b0fbf1de..0a2c82895 100644 --- a/services/swas-open/struct_snapshot.go +++ b/services/swas-open/struct_snapshot.go @@ -28,4 +28,5 @@ type Snapshot struct { RegionId string `json:"RegionId" xml:"RegionId"` InstanceId string `json:"InstanceId" xml:"InstanceId"` RollbackTime string `json:"RollbackTime" xml:"RollbackTime"` + Tags []Tag `json:"Tags" xml:"Tags"` } diff --git a/services/swas-open/struct_status.go b/services/swas-open/struct_status.go index a8af16f4c..e5eb2fc61 100644 --- a/services/swas-open/struct_status.go +++ b/services/swas-open/struct_status.go @@ -17,6 +17,14 @@ package swas_open // Status is a nested struct in swas_open response type Status struct { - InstanceId string `json:"InstanceId" xml:"InstanceId"` - Status bool `json:"Status" xml:"Status"` + LastInvokedTime string `json:"LastInvokedTime" xml:"LastInvokedTime"` + Status bool `json:"Status" xml:"Status"` + InvocationCount int64 `json:"InvocationCount" xml:"InvocationCount"` + CloudAssistantVersion string `json:"CloudAssistantVersion" xml:"CloudAssistantVersion"` + OSType string `json:"OSType" xml:"OSType"` + CloudAssistantStatus string `json:"CloudAssistantStatus" xml:"CloudAssistantStatus"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` + LastHeartbeatTime string `json:"LastHeartbeatTime" xml:"LastHeartbeatTime"` + SupportSessionManager bool `json:"SupportSessionManager" xml:"SupportSessionManager"` + ActiveTaskCount int64 `json:"ActiveTaskCount" xml:"ActiveTaskCount"` } diff --git a/services/swas-open/struct_tag.go b/services/swas-open/struct_tag.go new file mode 100644 index 000000000..0adc27532 --- /dev/null +++ b/services/swas-open/struct_tag.go @@ -0,0 +1,22 @@ +package swas_open + +//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. + +// Tag is a nested struct in swas_open response +type Tag struct { + Key string `json:"Key" xml:"Key"` + Value string `json:"Value" xml:"Value"` +} diff --git a/services/swas-open/struct_tag_resource.go b/services/swas-open/struct_tag_resource.go new file mode 100644 index 000000000..0092a6069 --- /dev/null +++ b/services/swas-open/struct_tag_resource.go @@ -0,0 +1,24 @@ +package swas_open + +//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 swas_open response +type TagResource struct { + ResourceType string `json:"ResourceType" xml:"ResourceType"` + TagValue string `json:"TagValue" xml:"TagValue"` + ResourceId string `json:"ResourceId" xml:"ResourceId"` + TagKey string `json:"TagKey" xml:"TagKey"` +} diff --git a/services/swas-open/struct_tag_resources.go b/services/swas-open/struct_tag_resources.go new file mode 100644 index 000000000..9ec616b8d --- /dev/null +++ b/services/swas-open/struct_tag_resources.go @@ -0,0 +1,21 @@ +package swas_open + +//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 swas_open response +type TagResources struct { + TagResource []TagResource `json:"TagResource" xml:"TagResource"` +} diff --git a/services/swas-open/struct_tags_in_describe_commands.go b/services/swas-open/struct_tags_in_describe_commands.go new file mode 100644 index 000000000..fcd3ffa9e --- /dev/null +++ b/services/swas-open/struct_tags_in_describe_commands.go @@ -0,0 +1,21 @@ +package swas_open + +//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. + +// TagsInDescribeCommands is a nested struct in swas_open response +type TagsInDescribeCommands struct { + Tag []Tag `json:"tag" xml:"tag"` +} diff --git a/services/swas-open/struct_tags_in_list_custom_images.go b/services/swas-open/struct_tags_in_list_custom_images.go new file mode 100644 index 000000000..108c7a498 --- /dev/null +++ b/services/swas-open/struct_tags_in_list_custom_images.go @@ -0,0 +1,21 @@ +package swas_open + +//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. + +// TagsInListCustomImages is a nested struct in swas_open response +type TagsInListCustomImages struct { + Tag []Tag `json:"tag" xml:"tag"` +} diff --git a/services/swas-open/struct_tags_in_list_disks.go b/services/swas-open/struct_tags_in_list_disks.go new file mode 100644 index 000000000..55283e2de --- /dev/null +++ b/services/swas-open/struct_tags_in_list_disks.go @@ -0,0 +1,21 @@ +package swas_open + +//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. + +// TagsInListDisks is a nested struct in swas_open response +type TagsInListDisks struct { + Tag []Tag `json:"tag" xml:"tag"` +} diff --git a/services/swas-open/struct_tags_in_list_firewall_rules.go b/services/swas-open/struct_tags_in_list_firewall_rules.go new file mode 100644 index 000000000..533834f53 --- /dev/null +++ b/services/swas-open/struct_tags_in_list_firewall_rules.go @@ -0,0 +1,21 @@ +package swas_open + +//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. + +// TagsInListFirewallRules is a nested struct in swas_open response +type TagsInListFirewallRules struct { + Tag []Tag `json:"tag" xml:"tag"` +} diff --git a/services/swas-open/struct_tags_in_list_instances.go b/services/swas-open/struct_tags_in_list_instances.go new file mode 100644 index 000000000..a287510ed --- /dev/null +++ b/services/swas-open/struct_tags_in_list_instances.go @@ -0,0 +1,21 @@ +package swas_open + +//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. + +// TagsInListInstances is a nested struct in swas_open response +type TagsInListInstances struct { + Tag []Tag `json:"tag" xml:"tag"` +} diff --git a/services/swas-open/struct_tags_in_list_snapshots.go b/services/swas-open/struct_tags_in_list_snapshots.go new file mode 100644 index 000000000..e10593c44 --- /dev/null +++ b/services/swas-open/struct_tags_in_list_snapshots.go @@ -0,0 +1,21 @@ +package swas_open + +//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. + +// TagsInListSnapshots is a nested struct in swas_open response +type TagsInListSnapshots struct { + Tag []Tag `json:"tag" xml:"tag"` +} diff --git a/services/swas-open/tag_resources.go b/services/swas-open/tag_resources.go new file mode 100644 index 000000000..d4dfd1d08 --- /dev/null +++ b/services/swas-open/tag_resources.go @@ -0,0 +1,108 @@ +package swas_open + +//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 swas_open.TagResources API synchronously +func (client *Client) TagResources(request *TagResourcesRequest) (response *TagResourcesResponse, err error) { + response = CreateTagResourcesResponse() + err = client.DoAction(request, response) + return +} + +// TagResourcesWithChan invokes the swas_open.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 swas_open.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 + ResourceId *[]string `position:"Query" name:"ResourceId" type:"Repeated"` + ClientToken string `position:"Query" name:"ClientToken"` + 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 { + 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"` +} + +// CreateTagResourcesRequest creates a request to invoke TagResources API +func CreateTagResourcesRequest() (request *TagResourcesRequest) { + request = &TagResourcesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("SWAS-OPEN", "2020-06-01", "TagResources", "SWAS-OPEN", "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/swas-open/untag_resources.go b/services/swas-open/untag_resources.go new file mode 100644 index 000000000..3c368de76 --- /dev/null +++ b/services/swas-open/untag_resources.go @@ -0,0 +1,103 @@ +package swas_open + +//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 swas_open.UntagResources API synchronously +func (client *Client) UntagResources(request *UntagResourcesRequest) (response *UntagResourcesResponse, err error) { + response = CreateUntagResourcesResponse() + err = client.DoAction(request, response) + return +} + +// UntagResourcesWithChan invokes the swas_open.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 swas_open.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 + All requests.Boolean `position:"Query" name:"All"` + ResourceId *[]string `position:"Query" name:"ResourceId" type:"Repeated"` + ClientToken string `position:"Query" name:"ClientToken"` + 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("SWAS-OPEN", "2020-06-01", "UntagResources", "SWAS-OPEN", "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 +}