From b4f980e2a800c5d509e572ad72369deda34978e0 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Thu, 4 May 2023 07:51:09 +0000 Subject: [PATCH] Generated 2018-05-10 for Cdn. --- ChangeLog.txt | 4 + .../cdn/set_cdn_domain_ssl_certificate.go | 108 ++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 services/cdn/set_cdn_domain_ssl_certificate.go diff --git a/ChangeLog.txt b/ChangeLog.txt index ff292e65e5..b5a0255bf3 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +2023-05-04 Version: v1.62.304 +- Generated 2018-05-10 for `Cdn`. +- Add SetCdnDomainSSLCertificate. + 2023-05-04 Version: v1.62.303 - Generated 2017-05-25 for `Dyplsapi`. - Add new API. diff --git a/services/cdn/set_cdn_domain_ssl_certificate.go b/services/cdn/set_cdn_domain_ssl_certificate.go new file mode 100644 index 0000000000..3ae3bcf492 --- /dev/null +++ b/services/cdn/set_cdn_domain_ssl_certificate.go @@ -0,0 +1,108 @@ +package cdn + +//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" +) + +// SetCdnDomainSSLCertificate invokes the cdn.SetCdnDomainSSLCertificate API synchronously +func (client *Client) SetCdnDomainSSLCertificate(request *SetCdnDomainSSLCertificateRequest) (response *SetCdnDomainSSLCertificateResponse, err error) { + response = CreateSetCdnDomainSSLCertificateResponse() + err = client.DoAction(request, response) + return +} + +// SetCdnDomainSSLCertificateWithChan invokes the cdn.SetCdnDomainSSLCertificate API asynchronously +func (client *Client) SetCdnDomainSSLCertificateWithChan(request *SetCdnDomainSSLCertificateRequest) (<-chan *SetCdnDomainSSLCertificateResponse, <-chan error) { + responseChan := make(chan *SetCdnDomainSSLCertificateResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SetCdnDomainSSLCertificate(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SetCdnDomainSSLCertificateWithCallback invokes the cdn.SetCdnDomainSSLCertificate API asynchronously +func (client *Client) SetCdnDomainSSLCertificateWithCallback(request *SetCdnDomainSSLCertificateRequest, callback func(response *SetCdnDomainSSLCertificateResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SetCdnDomainSSLCertificateResponse + var err error + defer close(result) + response, err = client.SetCdnDomainSSLCertificate(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SetCdnDomainSSLCertificateRequest is the request struct for api SetCdnDomainSSLCertificate +type SetCdnDomainSSLCertificateRequest struct { + *requests.RpcRequest + SSLProtocol string `position:"Query" name:"SSLProtocol"` + CertId requests.Integer `position:"Query" name:"CertId"` + SecurityToken string `position:"Query" name:"SecurityToken"` + CertType string `position:"Query" name:"CertType"` + SSLPri string `position:"Query" name:"SSLPri"` + CertRegion string `position:"Query" name:"CertRegion"` + CertName string `position:"Query" name:"CertName"` + DomainName string `position:"Query" name:"DomainName"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + SSLPub string `position:"Query" name:"SSLPub"` +} + +// SetCdnDomainSSLCertificateResponse is the response struct for api SetCdnDomainSSLCertificate +type SetCdnDomainSSLCertificateResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateSetCdnDomainSSLCertificateRequest creates a request to invoke SetCdnDomainSSLCertificate API +func CreateSetCdnDomainSSLCertificateRequest() (request *SetCdnDomainSSLCertificateRequest) { + request = &SetCdnDomainSSLCertificateRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Cdn", "2018-05-10", "SetCdnDomainSSLCertificate", "", "") + request.Method = requests.POST + return +} + +// CreateSetCdnDomainSSLCertificateResponse creates a response to parse from SetCdnDomainSSLCertificate response +func CreateSetCdnDomainSSLCertificateResponse() (response *SetCdnDomainSSLCertificateResponse) { + response = &SetCdnDomainSSLCertificateResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +}