diff --git a/ChangeLog.txt b/ChangeLog.txt index f0ad9203d7..ad1583cf98 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +2023-07-11 Version: v1.62.433 +- Generated 2022-01-30 for `avatar`. +-offline add voice and industrycode + 2023-07-11 Version: v1.62.432 - Generated 2017-08-01 for `polardb`. - Support new feature. diff --git a/services/avatar/send_command.go b/services/avatar/send_command.go new file mode 100644 index 0000000000..650d1e70f9 --- /dev/null +++ b/services/avatar/send_command.go @@ -0,0 +1,108 @@ +package avatar + +//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" +) + +// SendCommand invokes the avatar.SendCommand API synchronously +func (client *Client) SendCommand(request *SendCommandRequest) (response *SendCommandResponse, err error) { + response = CreateSendCommandResponse() + err = client.DoAction(request, response) + return +} + +// SendCommandWithChan invokes the avatar.SendCommand API asynchronously +func (client *Client) SendCommandWithChan(request *SendCommandRequest) (<-chan *SendCommandResponse, <-chan error) { + responseChan := make(chan *SendCommandResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SendCommand(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SendCommandWithCallback invokes the avatar.SendCommand API asynchronously +func (client *Client) SendCommandWithCallback(request *SendCommandRequest, callback func(response *SendCommandResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SendCommandResponse + var err error + defer close(result) + response, err = client.SendCommand(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SendCommandRequest is the request struct for api SendCommand +type SendCommandRequest struct { + *requests.RpcRequest + Feedback requests.Boolean `position:"Query" name:"Feedback"` + Code string `position:"Query" name:"Code"` + UniqueCode string `position:"Query" name:"UniqueCode"` + TenantId requests.Integer `position:"Query" name:"TenantId"` + SessionId string `position:"Query" name:"SessionId"` + Content map[string]string `position:"Query" name:"Content" type:"Map"` +} + +// SendCommandResponse is the response struct for api SendCommand +type SendCommandResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Code string `json:"Code" xml:"Code"` + Message string `json:"Message" xml:"Message"` + Success bool `json:"Success" xml:"Success"` + Data Data `json:"Data" xml:"Data"` +} + +// CreateSendCommandRequest creates a request to invoke SendCommand API +func CreateSendCommandRequest() (request *SendCommandRequest) { + request = &SendCommandRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("avatar", "2022-01-30", "SendCommand", "", "") + request.Method = requests.POST + return +} + +// CreateSendCommandResponse creates a response to parse from SendCommand response +func CreateSendCommandResponse() (response *SendCommandResponse) { + response = &SendCommandResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/avatar/send_text.go b/services/avatar/send_text.go new file mode 100644 index 0000000000..5582abcc66 --- /dev/null +++ b/services/avatar/send_text.go @@ -0,0 +1,116 @@ +package avatar + +//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" +) + +// SendText invokes the avatar.SendText API synchronously +func (client *Client) SendText(request *SendTextRequest) (response *SendTextResponse, err error) { + response = CreateSendTextResponse() + err = client.DoAction(request, response) + return +} + +// SendTextWithChan invokes the avatar.SendText API asynchronously +func (client *Client) SendTextWithChan(request *SendTextRequest) (<-chan *SendTextResponse, <-chan error) { + responseChan := make(chan *SendTextResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SendText(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SendTextWithCallback invokes the avatar.SendText API asynchronously +func (client *Client) SendTextWithCallback(request *SendTextRequest, callback func(response *SendTextResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SendTextResponse + var err error + defer close(result) + response, err = client.SendText(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SendTextRequest is the request struct for api SendText +type SendTextRequest struct { + *requests.RpcRequest + Feedback requests.Boolean `position:"Query" name:"Feedback"` + UniqueCode string `position:"Query" name:"UniqueCode"` + StreamExtension SendTextStreamExtension `position:"Query" name:"StreamExtension" type:"Struct"` + TenantId requests.Integer `position:"Query" name:"TenantId"` + Interrupt requests.Boolean `position:"Query" name:"Interrupt"` + SessionId string `position:"Query" name:"SessionId"` + Text string `position:"Query" name:"Text"` +} + +// SendTextStreamExtension is a repeated param struct in SendTextRequest +type SendTextStreamExtension struct { + IsStream string `name:"IsStream"` + Index string `name:"Index"` + Position string `name:"Position"` +} + +// SendTextResponse is the response struct for api SendText +type SendTextResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Code string `json:"Code" xml:"Code"` + Message string `json:"Message" xml:"Message"` + Success bool `json:"Success" xml:"Success"` + Data Data `json:"Data" xml:"Data"` +} + +// CreateSendTextRequest creates a request to invoke SendText API +func CreateSendTextRequest() (request *SendTextRequest) { + request = &SendTextRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("avatar", "2022-01-30", "SendText", "", "") + request.Method = requests.POST + return +} + +// CreateSendTextResponse creates a response to parse from SendText response +func CreateSendTextResponse() (response *SendTextResponse) { + response = &SendTextResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/avatar/send_vaml.go b/services/avatar/send_vaml.go new file mode 100644 index 0000000000..cac15e2233 --- /dev/null +++ b/services/avatar/send_vaml.go @@ -0,0 +1,105 @@ +package avatar + +//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" +) + +// SendVaml invokes the avatar.SendVaml API synchronously +func (client *Client) SendVaml(request *SendVamlRequest) (response *SendVamlResponse, err error) { + response = CreateSendVamlResponse() + err = client.DoAction(request, response) + return +} + +// SendVamlWithChan invokes the avatar.SendVaml API asynchronously +func (client *Client) SendVamlWithChan(request *SendVamlRequest) (<-chan *SendVamlResponse, <-chan error) { + responseChan := make(chan *SendVamlResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SendVaml(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SendVamlWithCallback invokes the avatar.SendVaml API asynchronously +func (client *Client) SendVamlWithCallback(request *SendVamlRequest, callback func(response *SendVamlResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SendVamlResponse + var err error + defer close(result) + response, err = client.SendVaml(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SendVamlRequest is the request struct for api SendVaml +type SendVamlRequest struct { + *requests.RpcRequest + TenantId requests.Integer `position:"Query" name:"TenantId"` + SessionId string `position:"Query" name:"SessionId"` + Vaml string `position:"Query" name:"Vaml"` +} + +// SendVamlResponse is the response struct for api SendVaml +type SendVamlResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Code string `json:"Code" xml:"Code"` + Message string `json:"Message" xml:"Message"` + Success bool `json:"Success" xml:"Success"` + Data Data `json:"Data" xml:"Data"` +} + +// CreateSendVamlRequest creates a request to invoke SendVaml API +func CreateSendVamlRequest() (request *SendVamlRequest) { + request = &SendVamlRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("avatar", "2022-01-30", "SendVaml", "", "") + request.Method = requests.POST + return +} + +// CreateSendVamlResponse creates a response to parse from SendVaml response +func CreateSendVamlResponse() (response *SendVamlResponse) { + response = &SendVamlResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/avatar/struct_data.go b/services/avatar/struct_data.go index 3ccea6f50e..28f1c0b8fd 100644 --- a/services/avatar/struct_data.go +++ b/services/avatar/struct_data.go @@ -29,6 +29,7 @@ type Data struct { InstanceId string `json:"InstanceId" xml:"InstanceId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` Description string `json:"Description" xml:"Description"` + UniqueCode string `json:"UniqueCode" xml:"UniqueCode"` Type string `json:"Type" xml:"Type"` GrabType string `json:"GrabType" xml:"GrabType"` Token string `json:"Token" xml:"Token"`