Преглед изворни кода

CCS SDK Auto Released By wilson.liuw,Version:1.30.6

Signed-off-by: yixiong.jxy <yixiong.jxy@alibaba-inc.com>
yixiong.jxy пре 7 година
родитељ
комит
1f00f2a2fe

+ 3 - 0
ChangeLog.txt

@@ -1,3 +1,6 @@
+2018-09-25 Version: 1.30.6
+1, Add GetHotlineRecord and QueryHotlineRecord interface, version 1.0.0
+
 2018-09-25 Version: 1.30.5
 1, Fix bug in GetVerifyToken and SubmitMaterials API.
 

+ 81 - 0
services/ccs/client.go

@@ -0,0 +1,81 @@
+package ccs
+
+//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
+}

+ 124 - 0
services/ccs/get_hotline_record.go

@@ -0,0 +1,124 @@
+package ccs
+
+//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"
+)
+
+// GetHotlineRecord invokes the ccs.GetHotlineRecord API synchronously
+// api document: https://help.aliyun.com/api/ccs/gethotlinerecord.html
+func (client *Client) GetHotlineRecord(request *GetHotlineRecordRequest) (response *GetHotlineRecordResponse, err error) {
+	response = CreateGetHotlineRecordResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// GetHotlineRecordWithChan invokes the ccs.GetHotlineRecord API asynchronously
+// api document: https://help.aliyun.com/api/ccs/gethotlinerecord.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) GetHotlineRecordWithChan(request *GetHotlineRecordRequest) (<-chan *GetHotlineRecordResponse, <-chan error) {
+	responseChan := make(chan *GetHotlineRecordResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.GetHotlineRecord(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// GetHotlineRecordWithCallback invokes the ccs.GetHotlineRecord API asynchronously
+// api document: https://help.aliyun.com/api/ccs/gethotlinerecord.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) GetHotlineRecordWithCallback(request *GetHotlineRecordRequest, callback func(response *GetHotlineRecordResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *GetHotlineRecordResponse
+		var err error
+		defer close(result)
+		response, err = client.GetHotlineRecord(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// GetHotlineRecordRequest is the request struct for api GetHotlineRecord
+type GetHotlineRecordRequest struct {
+	*requests.RpcRequest
+	Id            string `position:"Query" name:"Id"`
+	CcsInstanceId string `position:"Query" name:"CcsInstanceId"`
+}
+
+// GetHotlineRecordResponse is the response struct for api GetHotlineRecord
+type GetHotlineRecordResponse struct {
+	*responses.BaseResponse
+	RequestId       string `json:"RequestId" xml:"RequestId"`
+	Id              string `json:"Id" xml:"Id"`
+	CallType        string `json:"CallType" xml:"CallType"`
+	VisitorId       string `json:"VisitorId" xml:"VisitorId"`
+	VisitorPhone    string `json:"VisitorPhone" xml:"VisitorPhone"`
+	VisitorProvince string `json:"VisitorProvince" xml:"VisitorProvince"`
+	SceneId         string `json:"SceneId" xml:"SceneId"`
+	AgentId         string `json:"AgentId" xml:"AgentId"`
+	AgentName       string `json:"AgentName" xml:"AgentName"`
+	CreateTime      string `json:"CreateTime" xml:"CreateTime"`
+	FinishTime      string `json:"FinishTime" xml:"FinishTime"`
+	Status          string `json:"Status" xml:"Status"`
+	Memo            string `json:"Memo" xml:"Memo"`
+	HangupType      string `json:"HangupType" xml:"HangupType"`
+	Satisfaction    string `json:"Satisfaction" xml:"Satisfaction"`
+	OutboundTaskId  string `json:"OutboundTaskId" xml:"OutboundTaskId"`
+	Categories      string `json:"Categories" xml:"Categories"`
+	CcsInstanceId   string `json:"CcsInstanceId" xml:"CcsInstanceId"`
+	TalkDuration    int    `json:"TalkDuration" xml:"TalkDuration"`
+	GroupId         string `json:"GroupId" xml:"GroupId"`
+	GroupName       string `json:"GroupName" xml:"GroupName"`
+}
+
+// CreateGetHotlineRecordRequest creates a request to invoke GetHotlineRecord API
+func CreateGetHotlineRecordRequest() (request *GetHotlineRecordRequest) {
+	request = &GetHotlineRecordRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Ccs", "2017-10-01", "GetHotlineRecord", "ccs", "openAPI")
+	return
+}
+
+// CreateGetHotlineRecordResponse creates a response to parse from GetHotlineRecord response
+func CreateGetHotlineRecordResponse() (response *GetHotlineRecordResponse) {
+	response = &GetHotlineRecordResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 122 - 0
services/ccs/query_hotline_record.go

@@ -0,0 +1,122 @@
+package ccs
+
+//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"
+)
+
+// QueryHotlineRecord invokes the ccs.QueryHotlineRecord API synchronously
+// api document: https://help.aliyun.com/api/ccs/queryhotlinerecord.html
+func (client *Client) QueryHotlineRecord(request *QueryHotlineRecordRequest) (response *QueryHotlineRecordResponse, err error) {
+	response = CreateQueryHotlineRecordResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// QueryHotlineRecordWithChan invokes the ccs.QueryHotlineRecord API asynchronously
+// api document: https://help.aliyun.com/api/ccs/queryhotlinerecord.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) QueryHotlineRecordWithChan(request *QueryHotlineRecordRequest) (<-chan *QueryHotlineRecordResponse, <-chan error) {
+	responseChan := make(chan *QueryHotlineRecordResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.QueryHotlineRecord(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// QueryHotlineRecordWithCallback invokes the ccs.QueryHotlineRecord API asynchronously
+// api document: https://help.aliyun.com/api/ccs/queryhotlinerecord.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) QueryHotlineRecordWithCallback(request *QueryHotlineRecordRequest, callback func(response *QueryHotlineRecordResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *QueryHotlineRecordResponse
+		var err error
+		defer close(result)
+		response, err = client.QueryHotlineRecord(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// QueryHotlineRecordRequest is the request struct for api QueryHotlineRecord
+type QueryHotlineRecordRequest struct {
+	*requests.RpcRequest
+	AgentId         string           `position:"Query" name:"AgentId"`
+	MaxTalkDuration requests.Integer `position:"Query" name:"MaxTalkDuration"`
+	GroupId         string           `position:"Query" name:"GroupId"`
+	EndTime         string           `position:"Query" name:"EndTime"`
+	StartTime       string           `position:"Query" name:"StartTime"`
+	PageNum         requests.Integer `position:"Query" name:"PageNum"`
+	Satisfaction    string           `position:"Query" name:"Satisfaction"`
+	MinTalkDuratoin requests.Integer `position:"Query" name:"MinTalkDuratoin"`
+	CategoryIds     string           `position:"Query" name:"CategoryIds"`
+	VisitorProvince string           `position:"Query" name:"VisitorProvince"`
+	PageSize        requests.Integer `position:"Query" name:"PageSize"`
+	CallType        string           `position:"Query" name:"CallType"`
+	CcsInstanceId   string           `position:"Query" name:"CcsInstanceId"`
+	VisitorPhone    string           `position:"Query" name:"VisitorPhone"`
+	VisitorId       string           `position:"Query" name:"VisitorId"`
+	Status          string           `position:"Query" name:"Status"`
+}
+
+// QueryHotlineRecordResponse is the response struct for api QueryHotlineRecord
+type QueryHotlineRecordResponse struct {
+	*responses.BaseResponse
+	RequestId  string  `json:"RequestId" xml:"RequestId"`
+	TotalCount int     `json:"TotalCount" xml:"TotalCount"`
+	PageNum    int     `json:"PageNum" xml:"PageNum"`
+	PageSize   int     `json:"PageSize" xml:"PageSize"`
+	Records    Records `json:"Records" xml:"Records"`
+}
+
+// CreateQueryHotlineRecordRequest creates a request to invoke QueryHotlineRecord API
+func CreateQueryHotlineRecordRequest() (request *QueryHotlineRecordRequest) {
+	request = &QueryHotlineRecordRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Ccs", "2017-10-01", "QueryHotlineRecord", "ccs", "openAPI")
+	return
+}
+
+// CreateQueryHotlineRecordResponse creates a response to parse from QueryHotlineRecord response
+func CreateQueryHotlineRecordResponse() (response *QueryHotlineRecordResponse) {
+	response = &QueryHotlineRecordResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 39 - 0
services/ccs/struct_hotline_record.go

@@ -0,0 +1,39 @@
+package ccs
+
+//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.
+
+// HotlineRecord is a nested struct in ccs response
+type HotlineRecord struct {
+	Id              string `json:"Id" xml:"Id"`
+	VisitorId       string `json:"VisitorId" xml:"VisitorId"`
+	VisitorPhone    string `json:"VisitorPhone" xml:"VisitorPhone"`
+	VisitorProvince string `json:"VisitorProvince" xml:"VisitorProvince"`
+	CallType        string `json:"CallType" xml:"CallType"`
+	AgentId         string `json:"AgentId" xml:"AgentId"`
+	AgentName       string `json:"AgentName" xml:"AgentName"`
+	GroupId         string `json:"GroupId" xml:"GroupId"`
+	GroupName       string `json:"GroupName" xml:"GroupName"`
+	CreateTime      string `json:"CreateTime" xml:"CreateTime"`
+	FinishTime      string `json:"FinishTime" xml:"FinishTime"`
+	Status          string `json:"Status" xml:"Status"`
+	Memo            string `json:"Memo" xml:"Memo"`
+	HangupType      string `json:"HangupType" xml:"HangupType"`
+	Satisfaction    string `json:"Satisfaction" xml:"Satisfaction"`
+	OutboundTaskId  string `json:"OutboundTaskId" xml:"OutboundTaskId"`
+	Categories      string `json:"Categories" xml:"Categories"`
+	CcsInstanceId   string `json:"CcsInstanceId" xml:"CcsInstanceId"`
+	TalkDuration    int    `json:"TalkDuration" xml:"TalkDuration"`
+}

+ 21 - 0
services/ccs/struct_records.go

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