فهرست منبع

CAS SDK Auto Released By lihai.zhang,Version:1.50.8

Signed-off-by: haowei.yao <haowei.yao@alibaba-inc.com>
haowei.yao 6 سال پیش
والد
کامیت
27c21f853d

+ 4 - 0
ChangeLog.txt

@@ -1,3 +1,7 @@
+2019-01-15 Version: 1.50.8
+1, Go Lang API release
+2, Support UploadCertificate,CertficateList function;
+
 2019-01-15 Version: 1.50.7
 1, Add new apis called AddTranscodeTemplateGroup, UpdateTranscodeTemplateGroup, ListTranscodeTemplateGroup, GetTranscodeTemplateGroup, SetDefaultTranscodeTemplateGroup ,DeleteTranscodeTemplateGroup and DeleteTranscodeTemplates which support transcode template feature.
 2, Add new apis called AddAITemplate, DeleteAITemplate, UpdateAITemplate, GetAITemplate, ListAITemplate, GetDefaultAITemplate and SetDefaultAITemplate which support AI template feature.

+ 81 - 0
services/cas/client.go

@@ -0,0 +1,81 @@
+package cas
+
+//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"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+)
+
+// Client is the sdk client struct, each func corresponds to an OpenAPI
+type Client struct {
+	sdk.Client
+}
+
+// NewClient creates a sdk client with environment variables
+func NewClient() (client *Client, err error) {
+	client = &Client{}
+	err = client.Init()
+	return
+}
+
+// NewClientWithOptions creates a sdk client with regionId/sdkConfig/credential
+// this is the common api to create a sdk client
+func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithOptions(regionId, config, credential)
+	return
+}
+
+// NewClientWithAccessKey is a shortcut to create sdk client with accesskey
+// usage: https://help.aliyun.com/document_detail/66217.html
+func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret)
+	return
+}
+
+// NewClientWithStsToken is a shortcut to create sdk client with sts token
+// usage: https://help.aliyun.com/document_detail/66222.html
+func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken)
+	return
+}
+
+// NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn
+// usage: https://help.aliyun.com/document_detail/66222.html
+func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
+	return
+}
+
+// NewClientWithEcsRamRole is a shortcut to create sdk client with ecs ram role
+// usage: https://help.aliyun.com/document_detail/66223.html
+func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithEcsRamRole(regionId, roleName)
+	return
+}
+
+// NewClientWithRsaKeyPair is a shortcut to create sdk client with rsa key pair
+// attention: rsa key pair auth is only Japan regions available
+func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)
+	return
+}

+ 108 - 0
services/cas/create_user_certificate.go

@@ -0,0 +1,108 @@
+package cas
+
+//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"
+)
+
+// CreateUserCertificate invokes the cas.CreateUserCertificate API synchronously
+// api document: https://help.aliyun.com/api/cas/createusercertificate.html
+func (client *Client) CreateUserCertificate(request *CreateUserCertificateRequest) (response *CreateUserCertificateResponse, err error) {
+	response = CreateCreateUserCertificateResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// CreateUserCertificateWithChan invokes the cas.CreateUserCertificate API asynchronously
+// api document: https://help.aliyun.com/api/cas/createusercertificate.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) CreateUserCertificateWithChan(request *CreateUserCertificateRequest) (<-chan *CreateUserCertificateResponse, <-chan error) {
+	responseChan := make(chan *CreateUserCertificateResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.CreateUserCertificate(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// CreateUserCertificateWithCallback invokes the cas.CreateUserCertificate API asynchronously
+// api document: https://help.aliyun.com/api/cas/createusercertificate.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) CreateUserCertificateWithCallback(request *CreateUserCertificateRequest, callback func(response *CreateUserCertificateResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *CreateUserCertificateResponse
+		var err error
+		defer close(result)
+		response, err = client.CreateUserCertificate(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// CreateUserCertificateRequest is the request struct for api CreateUserCertificate
+type CreateUserCertificateRequest struct {
+	*requests.RpcRequest
+	SourceIp string `position:"Query" name:"SourceIp"`
+	Name     string `position:"Query" name:"Name"`
+	Cert     string `position:"Query" name:"Cert"`
+	Lang     string `position:"Query" name:"Lang"`
+	Key      string `position:"Query" name:"Key"`
+}
+
+// CreateUserCertificateResponse is the response struct for api CreateUserCertificate
+type CreateUserCertificateResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+	CertId   requests.Integer `json:"CertId" xml:"CertId"`
+}
+
+// CreateCreateUserCertificateRequest creates a request to invoke CreateUserCertificate API
+func CreateCreateUserCertificateRequest() (request *CreateUserCertificateRequest) {
+	request = &CreateUserCertificateRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("cas", "2018-07-13", "CreateUserCertificate", "cas", "openAPI")
+	return
+}
+
+// CreateCreateUserCertificateResponse creates a response to parse from CreateUserCertificate response
+func CreateCreateUserCertificateResponse() (response *CreateUserCertificateResponse) {
+	response = &CreateUserCertificateResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 105 - 0
services/cas/delete_user_certificate.go

@@ -0,0 +1,105 @@
+package cas
+
+//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"
+)
+
+// DeleteUserCertificate invokes the cas.DeleteUserCertificate API synchronously
+// api document: https://help.aliyun.com/api/cas/deleteusercertificate.html
+func (client *Client) DeleteUserCertificate(request *DeleteUserCertificateRequest) (response *DeleteUserCertificateResponse, err error) {
+	response = CreateDeleteUserCertificateResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// DeleteUserCertificateWithChan invokes the cas.DeleteUserCertificate API asynchronously
+// api document: https://help.aliyun.com/api/cas/deleteusercertificate.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DeleteUserCertificateWithChan(request *DeleteUserCertificateRequest) (<-chan *DeleteUserCertificateResponse, <-chan error) {
+	responseChan := make(chan *DeleteUserCertificateResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DeleteUserCertificate(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// DeleteUserCertificateWithCallback invokes the cas.DeleteUserCertificate API asynchronously
+// api document: https://help.aliyun.com/api/cas/deleteusercertificate.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DeleteUserCertificateWithCallback(request *DeleteUserCertificateRequest, callback func(response *DeleteUserCertificateResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DeleteUserCertificateResponse
+		var err error
+		defer close(result)
+		response, err = client.DeleteUserCertificate(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// DeleteUserCertificateRequest is the request struct for api DeleteUserCertificate
+type DeleteUserCertificateRequest struct {
+	*requests.RpcRequest
+	SourceIp string           `position:"Query" name:"SourceIp"`
+	CertId   requests.Integer `position:"Query" name:"CertId"`
+	Lang     string           `position:"Query" name:"Lang"`
+}
+
+// DeleteUserCertificateResponse is the response struct for api DeleteUserCertificate
+type DeleteUserCertificateResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateDeleteUserCertificateRequest creates a request to invoke DeleteUserCertificate API
+func CreateDeleteUserCertificateRequest() (request *DeleteUserCertificateRequest) {
+	request = &DeleteUserCertificateRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("cas", "2018-07-13", "DeleteUserCertificate", "cas", "openAPI")
+	return
+}
+
+// CreateDeleteUserCertificateResponse creates a response to parse from DeleteUserCertificate response
+func CreateDeleteUserCertificateResponse() (response *DeleteUserCertificateResponse) {
+	response = &DeleteUserCertificateResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 127 - 0
services/cas/describe_user_certificate_list.go

@@ -0,0 +1,127 @@
+package cas
+
+//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"
+)
+
+// DescribeUserCertificateList invokes the cas.DescribeUserCertificateList API synchronously
+// api document: https://help.aliyun.com/api/cas/describeusercertificatelist.html
+func (client *Client) DescribeUserCertificateList(request *DescribeUserCertificateListRequest) (response *DescribeUserCertificateListResponse, err error) {
+	response = CreateDescribeUserCertificateListResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// DescribeUserCertificateListWithChan invokes the cas.DescribeUserCertificateList API asynchronously
+// api document: https://help.aliyun.com/api/cas/describeusercertificatelist.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeUserCertificateListWithChan(request *DescribeUserCertificateListRequest) (<-chan *DescribeUserCertificateListResponse, <-chan error) {
+	responseChan := make(chan *DescribeUserCertificateListResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DescribeUserCertificateList(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// DescribeUserCertificateListWithCallback invokes the cas.DescribeUserCertificateList API asynchronously
+// api document: https://help.aliyun.com/api/cas/describeusercertificatelist.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeUserCertificateListWithCallback(request *DescribeUserCertificateListRequest, callback func(response *DescribeUserCertificateListResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DescribeUserCertificateListResponse
+		var err error
+		defer close(result)
+		response, err = client.DescribeUserCertificateList(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// DescribeUserCertificateListRequest is the request struct for api DescribeUserCertificateList
+type DescribeUserCertificateListRequest struct {
+	*requests.RpcRequest
+	SourceIp    string           `position:"Query" name:"SourceIp"`
+	ShowSize    requests.Integer `position:"Query" name:"ShowSize"`
+	CurrentPage requests.Integer `position:"Query" name:"CurrentPage"`
+	Lang        string           `position:"Query" name:"Lang"`
+}
+
+type Certificate struct {
+	Id			int		`json:"id" xml:"id"`
+	Name		string	`json:"name" xml:"name"`
+	Common		string	`json:"common" xml:"common"`
+	Fingerprint string	`json:"fingerprint" xml:"fingerprint"`
+	Issuer		string	`json:"issuer" xml:"issuer"`
+	OrgName		string	`json:"orgName" xml:"orgName"`
+	Province	string	`json:"province" xml:"province"`
+	City		string	`json:"city" xml:"city"`
+	Country		string	`json:"country" xml:"country"`
+	StartDate	string	`json:"startDate" xml:"startDate"`
+	EndDate		string	`json:"endDate" xml:"endDate"`
+	Sans		string	`json:"sans" xml:"sans"`
+	Expired		bool	`json:"expired" xml:"expired"`
+	BuyInAliyun	bool	`json:"buyInAliyun" xml:"buyInAliyun"`
+}
+
+// DescribeUserCertificateListResponse is the response struct for api DescribeUserCertificateList
+type DescribeUserCertificateListResponse struct {
+	*responses.BaseResponse
+	RequestId       string			`json:"RequestId" xml:"RequestId"`
+	TotalCount      int				`json:"TotalCount" xml:"TotalCount"`
+	ShowSize        int				`json:"ShowSize" xml:"ShowSize"`
+	CurrentPage     int				`json:"CurrentPage" xml:"CurrentPage"`
+	CertificateList []Certificate	`json:"CertificateList" xml:"CertificateList"`
+}
+
+// CreateDescribeUserCertificateListRequest creates a request to invoke DescribeUserCertificateList API
+func CreateDescribeUserCertificateListRequest() (request *DescribeUserCertificateListRequest) {
+	request = &DescribeUserCertificateListRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("cas", "2018-07-13", "DescribeUserCertificateList", "cas", "openAPI")
+	return
+}
+
+// CreateDescribeUserCertificateListResponse creates a response to parse from DescribeUserCertificateList response
+func CreateDescribeUserCertificateListResponse() (response *DescribeUserCertificateListResponse) {
+	response = &DescribeUserCertificateListResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 21 - 0
services/cas/struct_certificate_list.go

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

+ 25 - 0
services/cas/struct_order.go

@@ -0,0 +1,25 @@
+package cas
+
+//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.
+
+// Order is a nested struct in cas response
+type Order struct {
+	Id         int    `json:"Id" xml:"Id"`
+	InstanceId string `json:"InstanceId" xml:"InstanceId"`
+	Source     string `json:"Source" xml:"Source"`
+	Status     string `json:"Status" xml:"Status"`
+	CertType   string `json:"CertType" xml:"CertType"`
+}

+ 21 - 0
services/cas/struct_order_list.go

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