Ver código fonte

IMAGESEARCH SDK Auto Released By shenshi,Version:1.53.59

Signed-off-by: haowei.yao <haowei.yao@alibaba-inc.com>
haowei.yao 6 anos atrás
pai
commit
6513bff40b

+ 3 - 0
ChangeLog.txt

@@ -1,3 +1,6 @@
+2019-03-18 Version: 1.53.59
+1, Update Dependency
+
 2019-03-18 Version: 1.53.58
 1, move AssociatePerson\Tag field
 2, Optimize RealName field

+ 107 - 0
services/imagesearch/add_item.go

@@ -0,0 +1,107 @@
+package imagesearch
+
+//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"
+)
+
+// AddItem invokes the imagesearch.AddItem API synchronously
+// api document: https://help.aliyun.com/api/imagesearch/additem.html
+func (client *Client) AddItem(request *AddItemRequest) (response *AddItemResponse, err error) {
+	response = CreateAddItemResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// AddItemWithChan invokes the imagesearch.AddItem API asynchronously
+// api document: https://help.aliyun.com/api/imagesearch/additem.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) AddItemWithChan(request *AddItemRequest) (<-chan *AddItemResponse, <-chan error) {
+	responseChan := make(chan *AddItemResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.AddItem(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// AddItemWithCallback invokes the imagesearch.AddItem API asynchronously
+// api document: https://help.aliyun.com/api/imagesearch/additem.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) AddItemWithCallback(request *AddItemRequest, callback func(response *AddItemResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *AddItemResponse
+		var err error
+		defer close(result)
+		response, err = client.AddItem(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// AddItemRequest is the request struct for api AddItem
+type AddItemRequest struct {
+	*requests.RoaRequest
+	InstanceName string `position:"Query" name:"instanceName"`
+}
+
+// AddItemResponse is the response struct for api AddItem
+type AddItemResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+	Success   bool   `json:"Success" xml:"Success"`
+	Message   string `json:"Message" xml:"Message"`
+	Code      int    `json:"Code" xml:"Code"`
+}
+
+// CreateAddItemRequest creates a request to invoke AddItem API
+func CreateAddItemRequest() (request *AddItemRequest) {
+	request = &AddItemRequest{
+		RoaRequest: &requests.RoaRequest{},
+	}
+	request.InitWithApiInfo("ImageSearch", "2018-01-20", "AddItem", "/item/add", "imagesearch", "openAPI")
+	request.Method = requests.POST
+	return
+}
+
+// CreateAddItemResponse creates a response to parse from AddItem response
+func CreateAddItemResponse() (response *AddItemResponse) {
+	response = &AddItemResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 81 - 0
services/imagesearch/client.go

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

+ 107 - 0
services/imagesearch/delete_item.go

@@ -0,0 +1,107 @@
+package imagesearch
+
+//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"
+)
+
+// DeleteItem invokes the imagesearch.DeleteItem API synchronously
+// api document: https://help.aliyun.com/api/imagesearch/deleteitem.html
+func (client *Client) DeleteItem(request *DeleteItemRequest) (response *DeleteItemResponse, err error) {
+	response = CreateDeleteItemResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// DeleteItemWithChan invokes the imagesearch.DeleteItem API asynchronously
+// api document: https://help.aliyun.com/api/imagesearch/deleteitem.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DeleteItemWithChan(request *DeleteItemRequest) (<-chan *DeleteItemResponse, <-chan error) {
+	responseChan := make(chan *DeleteItemResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DeleteItem(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// DeleteItemWithCallback invokes the imagesearch.DeleteItem API asynchronously
+// api document: https://help.aliyun.com/api/imagesearch/deleteitem.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DeleteItemWithCallback(request *DeleteItemRequest, callback func(response *DeleteItemResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DeleteItemResponse
+		var err error
+		defer close(result)
+		response, err = client.DeleteItem(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// DeleteItemRequest is the request struct for api DeleteItem
+type DeleteItemRequest struct {
+	*requests.RoaRequest
+	InstanceName string `position:"Query" name:"instanceName"`
+}
+
+// DeleteItemResponse is the response struct for api DeleteItem
+type DeleteItemResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+	Success   bool   `json:"Success" xml:"Success"`
+	Message   string `json:"Message" xml:"Message"`
+	Code      int    `json:"Code" xml:"Code"`
+}
+
+// CreateDeleteItemRequest creates a request to invoke DeleteItem API
+func CreateDeleteItemRequest() (request *DeleteItemRequest) {
+	request = &DeleteItemRequest{
+		RoaRequest: &requests.RoaRequest{},
+	}
+	request.InitWithApiInfo("ImageSearch", "2018-01-20", "DeleteItem", "/item/delete", "imagesearch", "openAPI")
+	request.Method = requests.POST
+	return
+}
+
+// CreateDeleteItemResponse creates a response to parse from DeleteItem response
+func CreateDeleteItemResponse() (response *DeleteItemResponse) {
+	response = &DeleteItemResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 110 - 0
services/imagesearch/search_item.go

@@ -0,0 +1,110 @@
+package imagesearch
+
+//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"
+)
+
+// SearchItem invokes the imagesearch.SearchItem API synchronously
+// api document: https://help.aliyun.com/api/imagesearch/searchitem.html
+func (client *Client) SearchItem(request *SearchItemRequest) (response *SearchItemResponse, err error) {
+	response = CreateSearchItemResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// SearchItemWithChan invokes the imagesearch.SearchItem API asynchronously
+// api document: https://help.aliyun.com/api/imagesearch/searchitem.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) SearchItemWithChan(request *SearchItemRequest) (<-chan *SearchItemResponse, <-chan error) {
+	responseChan := make(chan *SearchItemResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.SearchItem(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// SearchItemWithCallback invokes the imagesearch.SearchItem API asynchronously
+// api document: https://help.aliyun.com/api/imagesearch/searchitem.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) SearchItemWithCallback(request *SearchItemRequest, callback func(response *SearchItemResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *SearchItemResponse
+		var err error
+		defer close(result)
+		response, err = client.SearchItem(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// SearchItemRequest is the request struct for api SearchItem
+type SearchItemRequest struct {
+	*requests.RoaRequest
+	InstanceName string `position:"Query" name:"instanceName"`
+}
+
+// SearchItemResponse is the response struct for api SearchItem
+type SearchItemResponse struct {
+	*responses.BaseResponse
+	RequestId string   `json:"RequestId" xml:"RequestId"`
+	Success   bool     `json:"Success" xml:"Success"`
+	Message   string   `json:"Message" xml:"Message"`
+	Code      int      `json:"Code" xml:"Code"`
+	Head      Head     `json:"Head" xml:"Head"`
+	PicInfo   PicInfo  `json:"PicInfo" xml:"PicInfo"`
+	Auctions  Auctions `json:"Auctions" xml:"Auctions"`
+}
+
+// CreateSearchItemRequest creates a request to invoke SearchItem API
+func CreateSearchItemRequest() (request *SearchItemRequest) {
+	request = &SearchItemRequest{
+		RoaRequest: &requests.RoaRequest{},
+	}
+	request.InitWithApiInfo("ImageSearch", "2018-01-20", "SearchItem", "/item/search", "imagesearch", "openAPI")
+	request.Method = requests.POST
+	return
+}
+
+// CreateSearchItemResponse creates a response to parse from SearchItem response
+func CreateSearchItemResponse() (response *SearchItemResponse) {
+	response = &SearchItemResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 21 - 0
services/imagesearch/struct_all_category.go

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

+ 25 - 0
services/imagesearch/struct_auction.go

@@ -0,0 +1,25 @@
+package imagesearch
+
+//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.
+
+// Auction is a nested struct in imagesearch response
+type Auction struct {
+	CustContent    string `json:"CustContent" xml:"CustContent"`
+	ItemId         string `json:"ItemId" xml:"ItemId"`
+	SortExprValues string `json:"SortExprValues" xml:"SortExprValues"`
+	CatId          string `json:"CatId" xml:"CatId"`
+	PicName        string `json:"PicName" xml:"PicName"`
+}

+ 21 - 0
services/imagesearch/struct_auctions.go

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

+ 22 - 0
services/imagesearch/struct_category.go

@@ -0,0 +1,22 @@
+package imagesearch
+
+//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.
+
+// Category is a nested struct in imagesearch response
+type Category struct {
+	Name string `json:"Name" xml:"Name"`
+	Id   string `json:"Id" xml:"Id"`
+}

+ 23 - 0
services/imagesearch/struct_head.go

@@ -0,0 +1,23 @@
+package imagesearch
+
+//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.
+
+// Head is a nested struct in imagesearch response
+type Head struct {
+	SearchTime int `json:"SearchTime" xml:"SearchTime"`
+	DocsFound  int `json:"DocsFound" xml:"DocsFound"`
+	DocsReturn int `json:"DocsReturn" xml:"DocsReturn"`
+}

+ 23 - 0
services/imagesearch/struct_pic_info.go

@@ -0,0 +1,23 @@
+package imagesearch
+
+//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.
+
+// PicInfo is a nested struct in imagesearch response
+type PicInfo struct {
+	Category    string      `json:"Category" xml:"Category"`
+	Region      string      `json:"Region" xml:"Region"`
+	AllCategory AllCategory `json:"AllCategory" xml:"AllCategory"`
+}