|
|
@@ -20,24 +20,24 @@ import (
|
|
|
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
|
|
|
)
|
|
|
|
|
|
-// Search invokes the green.Search API synchronously
|
|
|
-// api document: https://help.aliyun.com/api/green/search.html
|
|
|
-func (client *Client) Search(request *SearchRequest) (response *SearchResponse, err error) {
|
|
|
- response = CreateSearchResponse()
|
|
|
+// SearchPerson invokes the green.SearchPerson API synchronously
|
|
|
+// api document: https://help.aliyun.com/api/green/searchperson.html
|
|
|
+func (client *Client) SearchPerson(request *SearchPersonRequest) (response *SearchPersonResponse, err error) {
|
|
|
+ response = CreateSearchPersonResponse()
|
|
|
err = client.DoAction(request, response)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// SearchWithChan invokes the green.Search API asynchronously
|
|
|
-// api document: https://help.aliyun.com/api/green/search.html
|
|
|
+// SearchPersonWithChan invokes the green.SearchPerson API asynchronously
|
|
|
+// api document: https://help.aliyun.com/api/green/searchperson.html
|
|
|
// asynchronous document: https://help.aliyun.com/document_detail/66220.html
|
|
|
-func (client *Client) SearchWithChan(request *SearchRequest) (<-chan *SearchResponse, <-chan error) {
|
|
|
- responseChan := make(chan *SearchResponse, 1)
|
|
|
+func (client *Client) SearchPersonWithChan(request *SearchPersonRequest) (<-chan *SearchPersonResponse, <-chan error) {
|
|
|
+ responseChan := make(chan *SearchPersonResponse, 1)
|
|
|
errChan := make(chan error, 1)
|
|
|
err := client.AddAsyncTask(func() {
|
|
|
defer close(responseChan)
|
|
|
defer close(errChan)
|
|
|
- response, err := client.Search(request)
|
|
|
+ response, err := client.SearchPerson(request)
|
|
|
if err != nil {
|
|
|
errChan <- err
|
|
|
} else {
|
|
|
@@ -52,16 +52,16 @@ func (client *Client) SearchWithChan(request *SearchRequest) (<-chan *SearchResp
|
|
|
return responseChan, errChan
|
|
|
}
|
|
|
|
|
|
-// SearchWithCallback invokes the green.Search API asynchronously
|
|
|
-// api document: https://help.aliyun.com/api/green/search.html
|
|
|
+// SearchPersonWithCallback invokes the green.SearchPerson API asynchronously
|
|
|
+// api document: https://help.aliyun.com/api/green/searchperson.html
|
|
|
// asynchronous document: https://help.aliyun.com/document_detail/66220.html
|
|
|
-func (client *Client) SearchWithCallback(request *SearchRequest, callback func(response *SearchResponse, err error)) <-chan int {
|
|
|
+func (client *Client) SearchPersonWithCallback(request *SearchPersonRequest, callback func(response *SearchPersonResponse, err error)) <-chan int {
|
|
|
result := make(chan int, 1)
|
|
|
err := client.AddAsyncTask(func() {
|
|
|
- var response *SearchResponse
|
|
|
+ var response *SearchPersonResponse
|
|
|
var err error
|
|
|
defer close(result)
|
|
|
- response, err = client.Search(request)
|
|
|
+ response, err = client.SearchPerson(request)
|
|
|
callback(response, err)
|
|
|
result <- 1
|
|
|
})
|
|
|
@@ -73,30 +73,30 @@ func (client *Client) SearchWithCallback(request *SearchRequest, callback func(r
|
|
|
return result
|
|
|
}
|
|
|
|
|
|
-// SearchRequest is the request struct for api Search
|
|
|
-type SearchRequest struct {
|
|
|
+// SearchPersonRequest is the request struct for api SearchPerson
|
|
|
+type SearchPersonRequest struct {
|
|
|
*requests.RoaRequest
|
|
|
ClientInfo string `position:"Query" name:"ClientInfo"`
|
|
|
}
|
|
|
|
|
|
-// SearchResponse is the response struct for api Search
|
|
|
-type SearchResponse struct {
|
|
|
+// SearchPersonResponse is the response struct for api SearchPerson
|
|
|
+type SearchPersonResponse struct {
|
|
|
*responses.BaseResponse
|
|
|
}
|
|
|
|
|
|
-// CreateSearchRequest creates a request to invoke Search API
|
|
|
-func CreateSearchRequest() (request *SearchRequest) {
|
|
|
- request = &SearchRequest{
|
|
|
+// CreateSearchPersonRequest creates a request to invoke SearchPerson API
|
|
|
+func CreateSearchPersonRequest() (request *SearchPersonRequest) {
|
|
|
+ request = &SearchPersonRequest{
|
|
|
RoaRequest: &requests.RoaRequest{},
|
|
|
}
|
|
|
- request.InitWithApiInfo("Green", "2017-08-25", "Search", "/green/sface/search", "green", "openAPI")
|
|
|
+ request.InitWithApiInfo("Green", "2018-05-09", "SearchPerson", "/green/sface/search", "green", "openAPI")
|
|
|
request.Method = requests.POST
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// CreateSearchResponse creates a response to parse from Search response
|
|
|
-func CreateSearchResponse() (response *SearchResponse) {
|
|
|
- response = &SearchResponse{
|
|
|
+// CreateSearchPersonResponse creates a response to parse from SearchPerson response
|
|
|
+func CreateSearchPersonResponse() (response *SearchPersonResponse) {
|
|
|
+ response = &SearchPersonResponse{
|
|
|
BaseResponse: &responses.BaseResponse{},
|
|
|
}
|
|
|
return
|