package ros //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" ) // GetChangeSet invokes the ros.GetChangeSet API synchronously // api document: https://help.aliyun.com/api/ros/getchangeset.html func (client *Client) GetChangeSet(request *GetChangeSetRequest) (response *GetChangeSetResponse, err error) { response = CreateGetChangeSetResponse() err = client.DoAction(request, response) return } // GetChangeSetWithChan invokes the ros.GetChangeSet API asynchronously // api document: https://help.aliyun.com/api/ros/getchangeset.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetChangeSetWithChan(request *GetChangeSetRequest) (<-chan *GetChangeSetResponse, <-chan error) { responseChan := make(chan *GetChangeSetResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.GetChangeSet(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // GetChangeSetWithCallback invokes the ros.GetChangeSet API asynchronously // api document: https://help.aliyun.com/api/ros/getchangeset.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetChangeSetWithCallback(request *GetChangeSetRequest, callback func(response *GetChangeSetResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *GetChangeSetResponse var err error defer close(result) response, err = client.GetChangeSet(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // GetChangeSetRequest is the request struct for api GetChangeSet type GetChangeSetRequest struct { *requests.RpcRequest ChangeSetId string `position:"Query" name:"ChangeSetId"` ShowTemplate requests.Boolean `position:"Query" name:"ShowTemplate"` } // GetChangeSetResponse is the response struct for api GetChangeSet type GetChangeSetResponse struct { *responses.BaseResponse ChangeSetId string `json:"ChangeSetId" xml:"ChangeSetId"` ChangeSetName string `json:"ChangeSetName" xml:"ChangeSetName"` ChangeSetType string `json:"ChangeSetType" xml:"ChangeSetType"` CreateTime string `json:"CreateTime" xml:"CreateTime"` Description string `json:"Description" xml:"Description"` DisableRollback bool `json:"DisableRollback" xml:"DisableRollback"` ExecutionStatus string `json:"ExecutionStatus" xml:"ExecutionStatus"` RegionId string `json:"RegionId" xml:"RegionId"` RequestId string `json:"RequestId" xml:"RequestId"` StackId string `json:"StackId" xml:"StackId"` StackName string `json:"StackName" xml:"StackName"` Status string `json:"Status" xml:"Status"` TemplateBody string `json:"TemplateBody" xml:"TemplateBody"` TimeoutInMinutes int `json:"TimeoutInMinutes" xml:"TimeoutInMinutes"` Changes []string `json:"Changes" xml:"Changes"` Parameters []Parameter `json:"Parameters" xml:"Parameters"` } // CreateGetChangeSetRequest creates a request to invoke GetChangeSet API func CreateGetChangeSetRequest() (request *GetChangeSetRequest) { request = &GetChangeSetRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("ROS", "2019-09-10", "GetChangeSet", "ROS", "openAPI") return } // CreateGetChangeSetResponse creates a response to parse from GetChangeSet response func CreateGetChangeSetResponse() (response *GetChangeSetResponse) { response = &GetChangeSetResponse{ BaseResponse: &responses.BaseResponse{}, } return }