Browse Source

Support Defect Face API.

sdk-team 6 years ago
parent
commit
85515b24ff

+ 3 - 0
ChangeLog.txt

@@ -1,3 +1,6 @@
+2019-08-12 Version: 1.60.96
+- Support Defect Face API.
+
 2019-08-08 Version: 1.60.95
 - Supported DryRun for Vpc and VSwitch.
 

+ 103 - 0
services/green/add_similarity_library.go

@@ -0,0 +1,103 @@
+package green
+
+//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"
+)
+
+// AddSimilarityLibrary invokes the green.AddSimilarityLibrary API synchronously
+// api document: https://help.aliyun.com/api/green/addsimilaritylibrary.html
+func (client *Client) AddSimilarityLibrary(request *AddSimilarityLibraryRequest) (response *AddSimilarityLibraryResponse, err error) {
+	response = CreateAddSimilarityLibraryResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// AddSimilarityLibraryWithChan invokes the green.AddSimilarityLibrary API asynchronously
+// api document: https://help.aliyun.com/api/green/addsimilaritylibrary.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) AddSimilarityLibraryWithChan(request *AddSimilarityLibraryRequest) (<-chan *AddSimilarityLibraryResponse, <-chan error) {
+	responseChan := make(chan *AddSimilarityLibraryResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.AddSimilarityLibrary(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// AddSimilarityLibraryWithCallback invokes the green.AddSimilarityLibrary API asynchronously
+// api document: https://help.aliyun.com/api/green/addsimilaritylibrary.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) AddSimilarityLibraryWithCallback(request *AddSimilarityLibraryRequest, callback func(response *AddSimilarityLibraryResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *AddSimilarityLibraryResponse
+		var err error
+		defer close(result)
+		response, err = client.AddSimilarityLibrary(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// AddSimilarityLibraryRequest is the request struct for api AddSimilarityLibrary
+type AddSimilarityLibraryRequest struct {
+	*requests.RoaRequest
+	ClientInfo string `position:"Query" name:"ClientInfo"`
+}
+
+// AddSimilarityLibraryResponse is the response struct for api AddSimilarityLibrary
+type AddSimilarityLibraryResponse struct {
+	*responses.BaseResponse
+}
+
+// CreateAddSimilarityLibraryRequest creates a request to invoke AddSimilarityLibrary API
+func CreateAddSimilarityLibraryRequest() (request *AddSimilarityLibraryRequest) {
+	request = &AddSimilarityLibraryRequest{
+		RoaRequest: &requests.RoaRequest{},
+	}
+	request.InitWithApiInfo("Green", "2018-05-09", "AddSimilarityLibrary", "/green/similarity/library/add", "green", "openAPI")
+	request.Method = requests.POST
+	return
+}
+
+// CreateAddSimilarityLibraryResponse creates a response to parse from AddSimilarityLibrary response
+func CreateAddSimilarityLibraryResponse() (response *AddSimilarityLibraryResponse) {
+	response = &AddSimilarityLibraryResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 53 - 5
services/green/client.go

@@ -16,8 +16,11 @@ package green
 // Changes may cause incorrect behavior and will be lost if the code is regenerated.
 
 import (
+	"reflect"
+
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk"
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider"
 )
 
 // Client is the sdk client struct, each func corresponds to an OpenAPI
@@ -25,10 +28,40 @@ type Client struct {
 	sdk.Client
 }
 
+// SetClientProperty Set Property by Reflect
+func SetClientProperty(client *Client, propertyName string, propertyValue interface{}) {
+	v := reflect.ValueOf(client).Elem()
+	if v.FieldByName(propertyName).IsValid() && v.FieldByName(propertyName).CanSet() {
+		v.FieldByName(propertyName).Set(reflect.ValueOf(propertyValue))
+	}
+}
+
+// SetEndpointDataToClient Set EndpointMap and ENdpointType
+func SetEndpointDataToClient(client *Client) {
+	SetClientProperty(client, "EndpointMap", GetEndpointMap())
+	SetClientProperty(client, "EndpointType", GetEndpointType())
+}
+
 // NewClient creates a sdk client with environment variables
 func NewClient() (client *Client, err error) {
 	client = &Client{}
 	err = client.Init()
+	SetEndpointDataToClient(client)
+	return
+}
+
+// NewClientWithProvider creates a sdk client with providers
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
+func NewClientWithProvider(regionId string, providers ...provider.Provider) (client *Client, err error) {
+	client = &Client{}
+	var pc provider.Provider
+	if len(providers) == 0 {
+		pc = provider.DefaultChain
+	} else {
+		pc = provider.NewProviderChain(providers)
+	}
+	err = client.InitWithProviderChain(regionId, pc)
+	SetEndpointDataToClient(client)
 	return
 }
 
@@ -37,45 +70,60 @@ func NewClient() (client *Client, err error) {
 func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithOptions(regionId, config, credential)
+	SetEndpointDataToClient(client)
 	return
 }
 
 // NewClientWithAccessKey is a shortcut to create sdk client with accesskey
-// usage: https://help.aliyun.com/document_detail/66217.html
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
 func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret)
+	SetEndpointDataToClient(client)
 	return
 }
 
 // NewClientWithStsToken is a shortcut to create sdk client with sts token
-// usage: https://help.aliyun.com/document_detail/66222.html
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
 func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken)
+	SetEndpointDataToClient(client)
 	return
 }
 
 // NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn
-// usage: https://help.aliyun.com/document_detail/66222.html
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
 func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
+	SetEndpointDataToClient(client)
+	return
+}
+
+// NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn and policy
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
+func NewClientWithRamRoleArnAndPolicy(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithRamRoleArnAndPolicy(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy)
+	SetEndpointDataToClient(client)
 	return
 }
 
 // NewClientWithEcsRamRole is a shortcut to create sdk client with ecs ram role
-// usage: https://help.aliyun.com/document_detail/66223.html
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
 func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithEcsRamRole(regionId, roleName)
+	SetEndpointDataToClient(client)
 	return
 }
 
 // NewClientWithRsaKeyPair is a shortcut to create sdk client with rsa key pair
-// attention: rsa key pair auth is only Japan regions available
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
 func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)
+	SetEndpointDataToClient(client)
 	return
 }

+ 103 - 0
services/green/delete_similarity_library.go

@@ -0,0 +1,103 @@
+package green
+
+//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"
+)
+
+// DeleteSimilarityLibrary invokes the green.DeleteSimilarityLibrary API synchronously
+// api document: https://help.aliyun.com/api/green/deletesimilaritylibrary.html
+func (client *Client) DeleteSimilarityLibrary(request *DeleteSimilarityLibraryRequest) (response *DeleteSimilarityLibraryResponse, err error) {
+	response = CreateDeleteSimilarityLibraryResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// DeleteSimilarityLibraryWithChan invokes the green.DeleteSimilarityLibrary API asynchronously
+// api document: https://help.aliyun.com/api/green/deletesimilaritylibrary.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DeleteSimilarityLibraryWithChan(request *DeleteSimilarityLibraryRequest) (<-chan *DeleteSimilarityLibraryResponse, <-chan error) {
+	responseChan := make(chan *DeleteSimilarityLibraryResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DeleteSimilarityLibrary(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// DeleteSimilarityLibraryWithCallback invokes the green.DeleteSimilarityLibrary API asynchronously
+// api document: https://help.aliyun.com/api/green/deletesimilaritylibrary.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DeleteSimilarityLibraryWithCallback(request *DeleteSimilarityLibraryRequest, callback func(response *DeleteSimilarityLibraryResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DeleteSimilarityLibraryResponse
+		var err error
+		defer close(result)
+		response, err = client.DeleteSimilarityLibrary(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// DeleteSimilarityLibraryRequest is the request struct for api DeleteSimilarityLibrary
+type DeleteSimilarityLibraryRequest struct {
+	*requests.RoaRequest
+	ClientInfo string `position:"Query" name:"ClientInfo"`
+}
+
+// DeleteSimilarityLibraryResponse is the response struct for api DeleteSimilarityLibrary
+type DeleteSimilarityLibraryResponse struct {
+	*responses.BaseResponse
+}
+
+// CreateDeleteSimilarityLibraryRequest creates a request to invoke DeleteSimilarityLibrary API
+func CreateDeleteSimilarityLibraryRequest() (request *DeleteSimilarityLibraryRequest) {
+	request = &DeleteSimilarityLibraryRequest{
+		RoaRequest: &requests.RoaRequest{},
+	}
+	request.InitWithApiInfo("Green", "2018-05-09", "DeleteSimilarityLibrary", "/green/similarity/library/delete", "green", "openAPI")
+	request.Method = requests.POST
+	return
+}
+
+// CreateDeleteSimilarityLibraryResponse creates a response to parse from DeleteSimilarityLibrary response
+func CreateDeleteSimilarityLibraryResponse() (response *DeleteSimilarityLibraryResponse) {
+	response = &DeleteSimilarityLibraryResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 103 - 0
services/green/detect_face.go

@@ -0,0 +1,103 @@
+package green
+
+//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"
+)
+
+// DetectFace invokes the green.DetectFace API synchronously
+// api document: https://help.aliyun.com/api/green/detectface.html
+func (client *Client) DetectFace(request *DetectFaceRequest) (response *DetectFaceResponse, err error) {
+	response = CreateDetectFaceResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// DetectFaceWithChan invokes the green.DetectFace API asynchronously
+// api document: https://help.aliyun.com/api/green/detectface.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DetectFaceWithChan(request *DetectFaceRequest) (<-chan *DetectFaceResponse, <-chan error) {
+	responseChan := make(chan *DetectFaceResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DetectFace(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// DetectFaceWithCallback invokes the green.DetectFace API asynchronously
+// api document: https://help.aliyun.com/api/green/detectface.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DetectFaceWithCallback(request *DetectFaceRequest, callback func(response *DetectFaceResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DetectFaceResponse
+		var err error
+		defer close(result)
+		response, err = client.DetectFace(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// DetectFaceRequest is the request struct for api DetectFace
+type DetectFaceRequest struct {
+	*requests.RoaRequest
+	ClientInfo string `position:"Query" name:"ClientInfo"`
+}
+
+// DetectFaceResponse is the response struct for api DetectFace
+type DetectFaceResponse struct {
+	*responses.BaseResponse
+}
+
+// CreateDetectFaceRequest creates a request to invoke DetectFace API
+func CreateDetectFaceRequest() (request *DetectFaceRequest) {
+	request = &DetectFaceRequest{
+		RoaRequest: &requests.RoaRequest{},
+	}
+	request.InitWithApiInfo("Green", "2018-05-09", "DetectFace", "/green/face/detect", "green", "openAPI")
+	request.Method = requests.POST
+	return
+}
+
+// CreateDetectFaceResponse creates a response to parse from DetectFace response
+func CreateDetectFaceResponse() (response *DetectFaceResponse) {
+	response = &DetectFaceResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 35 - 0
services/green/endpoint.go

@@ -0,0 +1,35 @@
+package green
+
+// EndpointMap Endpoint Data
+var EndpointMap map[string]string
+
+// EndpointType regional or central
+var EndpointType = "regional"
+
+// GetEndpointMap Get Endpoint Data Map
+func GetEndpointMap() map[string]string {
+	if EndpointMap == nil {
+		EndpointMap = map[string]string{
+			"ap-south-1":     "green.ap-southeast-1.aliyuncs.com",
+			"eu-west-1":      "green.ap-southeast-1.aliyuncs.com",
+			"ap-northeast-1": "green.ap-southeast-1.aliyuncs.com",
+			"me-east-1":      "green.ap-southeast-1.aliyuncs.com",
+			"cn-chengdu":     "green.aliyuncs.com",
+			"cn-qingdao":     "green.aliyuncs.com",
+			"cn-hongkong":    "green.aliyuncs.com",
+			"ap-southeast-2": "green.ap-southeast-1.aliyuncs.com",
+			"ap-southeast-3": "green.ap-southeast-1.aliyuncs.com",
+			"eu-central-1":   "green.ap-southeast-1.aliyuncs.com",
+			"cn-huhehaote":   "green.aliyuncs.com",
+			"ap-southeast-5": "green.ap-southeast-1.aliyuncs.com",
+			"us-east-1":      "green.ap-southeast-1.aliyuncs.com",
+			"cn-zhangjiakou": "green.aliyuncs.com",
+		}
+	}
+	return EndpointMap
+}
+
+// GetEndpointType Get Endpoint Type Value
+func GetEndpointType() string {
+	return EndpointType
+}

+ 103 - 0
services/green/get_similarity_image.go

@@ -0,0 +1,103 @@
+package green
+
+//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"
+)
+
+// GetSimilarityImage invokes the green.GetSimilarityImage API synchronously
+// api document: https://help.aliyun.com/api/green/getsimilarityimage.html
+func (client *Client) GetSimilarityImage(request *GetSimilarityImageRequest) (response *GetSimilarityImageResponse, err error) {
+	response = CreateGetSimilarityImageResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// GetSimilarityImageWithChan invokes the green.GetSimilarityImage API asynchronously
+// api document: https://help.aliyun.com/api/green/getsimilarityimage.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) GetSimilarityImageWithChan(request *GetSimilarityImageRequest) (<-chan *GetSimilarityImageResponse, <-chan error) {
+	responseChan := make(chan *GetSimilarityImageResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.GetSimilarityImage(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// GetSimilarityImageWithCallback invokes the green.GetSimilarityImage API asynchronously
+// api document: https://help.aliyun.com/api/green/getsimilarityimage.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) GetSimilarityImageWithCallback(request *GetSimilarityImageRequest, callback func(response *GetSimilarityImageResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *GetSimilarityImageResponse
+		var err error
+		defer close(result)
+		response, err = client.GetSimilarityImage(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// GetSimilarityImageRequest is the request struct for api GetSimilarityImage
+type GetSimilarityImageRequest struct {
+	*requests.RoaRequest
+	ClientInfo string `position:"Query" name:"ClientInfo"`
+}
+
+// GetSimilarityImageResponse is the response struct for api GetSimilarityImage
+type GetSimilarityImageResponse struct {
+	*responses.BaseResponse
+}
+
+// CreateGetSimilarityImageRequest creates a request to invoke GetSimilarityImage API
+func CreateGetSimilarityImageRequest() (request *GetSimilarityImageRequest) {
+	request = &GetSimilarityImageRequest{
+		RoaRequest: &requests.RoaRequest{},
+	}
+	request.InitWithApiInfo("Green", "2018-05-09", "GetSimilarityImage", "/green/similarity/image/get", "green", "openAPI")
+	request.Method = requests.POST
+	return
+}
+
+// CreateGetSimilarityImageResponse creates a response to parse from GetSimilarityImage response
+func CreateGetSimilarityImageResponse() (response *GetSimilarityImageResponse) {
+	response = &GetSimilarityImageResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 103 - 0
services/green/get_similarity_library.go

@@ -0,0 +1,103 @@
+package green
+
+//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"
+)
+
+// GetSimilarityLibrary invokes the green.GetSimilarityLibrary API synchronously
+// api document: https://help.aliyun.com/api/green/getsimilaritylibrary.html
+func (client *Client) GetSimilarityLibrary(request *GetSimilarityLibraryRequest) (response *GetSimilarityLibraryResponse, err error) {
+	response = CreateGetSimilarityLibraryResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// GetSimilarityLibraryWithChan invokes the green.GetSimilarityLibrary API asynchronously
+// api document: https://help.aliyun.com/api/green/getsimilaritylibrary.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) GetSimilarityLibraryWithChan(request *GetSimilarityLibraryRequest) (<-chan *GetSimilarityLibraryResponse, <-chan error) {
+	responseChan := make(chan *GetSimilarityLibraryResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.GetSimilarityLibrary(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// GetSimilarityLibraryWithCallback invokes the green.GetSimilarityLibrary API asynchronously
+// api document: https://help.aliyun.com/api/green/getsimilaritylibrary.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) GetSimilarityLibraryWithCallback(request *GetSimilarityLibraryRequest, callback func(response *GetSimilarityLibraryResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *GetSimilarityLibraryResponse
+		var err error
+		defer close(result)
+		response, err = client.GetSimilarityLibrary(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// GetSimilarityLibraryRequest is the request struct for api GetSimilarityLibrary
+type GetSimilarityLibraryRequest struct {
+	*requests.RoaRequest
+	ClientInfo string `position:"Query" name:"ClientInfo"`
+}
+
+// GetSimilarityLibraryResponse is the response struct for api GetSimilarityLibrary
+type GetSimilarityLibraryResponse struct {
+	*responses.BaseResponse
+}
+
+// CreateGetSimilarityLibraryRequest creates a request to invoke GetSimilarityLibrary API
+func CreateGetSimilarityLibraryRequest() (request *GetSimilarityLibraryRequest) {
+	request = &GetSimilarityLibraryRequest{
+		RoaRequest: &requests.RoaRequest{},
+	}
+	request.InitWithApiInfo("Green", "2018-05-09", "GetSimilarityLibrary", "/green/similarity/library/get", "green", "openAPI")
+	request.Method = requests.POST
+	return
+}
+
+// CreateGetSimilarityLibraryResponse creates a response to parse from GetSimilarityLibrary response
+func CreateGetSimilarityLibraryResponse() (response *GetSimilarityLibraryResponse) {
+	response = &GetSimilarityLibraryResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 103 - 0
services/green/list_similarity_images.go

@@ -0,0 +1,103 @@
+package green
+
+//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"
+)
+
+// ListSimilarityImages invokes the green.ListSimilarityImages API synchronously
+// api document: https://help.aliyun.com/api/green/listsimilarityimages.html
+func (client *Client) ListSimilarityImages(request *ListSimilarityImagesRequest) (response *ListSimilarityImagesResponse, err error) {
+	response = CreateListSimilarityImagesResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ListSimilarityImagesWithChan invokes the green.ListSimilarityImages API asynchronously
+// api document: https://help.aliyun.com/api/green/listsimilarityimages.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ListSimilarityImagesWithChan(request *ListSimilarityImagesRequest) (<-chan *ListSimilarityImagesResponse, <-chan error) {
+	responseChan := make(chan *ListSimilarityImagesResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ListSimilarityImages(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// ListSimilarityImagesWithCallback invokes the green.ListSimilarityImages API asynchronously
+// api document: https://help.aliyun.com/api/green/listsimilarityimages.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ListSimilarityImagesWithCallback(request *ListSimilarityImagesRequest, callback func(response *ListSimilarityImagesResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ListSimilarityImagesResponse
+		var err error
+		defer close(result)
+		response, err = client.ListSimilarityImages(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// ListSimilarityImagesRequest is the request struct for api ListSimilarityImages
+type ListSimilarityImagesRequest struct {
+	*requests.RoaRequest
+	ClientInfo string `position:"Query" name:"ClientInfo"`
+}
+
+// ListSimilarityImagesResponse is the response struct for api ListSimilarityImages
+type ListSimilarityImagesResponse struct {
+	*responses.BaseResponse
+}
+
+// CreateListSimilarityImagesRequest creates a request to invoke ListSimilarityImages API
+func CreateListSimilarityImagesRequest() (request *ListSimilarityImagesRequest) {
+	request = &ListSimilarityImagesRequest{
+		RoaRequest: &requests.RoaRequest{},
+	}
+	request.InitWithApiInfo("Green", "2018-05-09", "ListSimilarityImages", "/green/similarity/image/list", "green", "openAPI")
+	request.Method = requests.POST
+	return
+}
+
+// CreateListSimilarityImagesResponse creates a response to parse from ListSimilarityImages response
+func CreateListSimilarityImagesResponse() (response *ListSimilarityImagesResponse) {
+	response = &ListSimilarityImagesResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 103 - 0
services/green/list_similarity_libraries.go

@@ -0,0 +1,103 @@
+package green
+
+//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"
+)
+
+// ListSimilarityLibraries invokes the green.ListSimilarityLibraries API synchronously
+// api document: https://help.aliyun.com/api/green/listsimilaritylibraries.html
+func (client *Client) ListSimilarityLibraries(request *ListSimilarityLibrariesRequest) (response *ListSimilarityLibrariesResponse, err error) {
+	response = CreateListSimilarityLibrariesResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ListSimilarityLibrariesWithChan invokes the green.ListSimilarityLibraries API asynchronously
+// api document: https://help.aliyun.com/api/green/listsimilaritylibraries.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ListSimilarityLibrariesWithChan(request *ListSimilarityLibrariesRequest) (<-chan *ListSimilarityLibrariesResponse, <-chan error) {
+	responseChan := make(chan *ListSimilarityLibrariesResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ListSimilarityLibraries(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// ListSimilarityLibrariesWithCallback invokes the green.ListSimilarityLibraries API asynchronously
+// api document: https://help.aliyun.com/api/green/listsimilaritylibraries.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ListSimilarityLibrariesWithCallback(request *ListSimilarityLibrariesRequest, callback func(response *ListSimilarityLibrariesResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ListSimilarityLibrariesResponse
+		var err error
+		defer close(result)
+		response, err = client.ListSimilarityLibraries(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// ListSimilarityLibrariesRequest is the request struct for api ListSimilarityLibraries
+type ListSimilarityLibrariesRequest struct {
+	*requests.RoaRequest
+	ClientInfo string `position:"Query" name:"ClientInfo"`
+}
+
+// ListSimilarityLibrariesResponse is the response struct for api ListSimilarityLibraries
+type ListSimilarityLibrariesResponse struct {
+	*responses.BaseResponse
+}
+
+// CreateListSimilarityLibrariesRequest creates a request to invoke ListSimilarityLibraries API
+func CreateListSimilarityLibrariesRequest() (request *ListSimilarityLibrariesRequest) {
+	request = &ListSimilarityLibrariesRequest{
+		RoaRequest: &requests.RoaRequest{},
+	}
+	request.InitWithApiInfo("Green", "2018-05-09", "ListSimilarityLibraries", "/green/similarity/library/list", "green", "openAPI")
+	request.Method = requests.POST
+	return
+}
+
+// CreateListSimilarityLibrariesResponse creates a response to parse from ListSimilarityLibraries response
+func CreateListSimilarityLibrariesResponse() (response *ListSimilarityLibrariesResponse) {
+	response = &ListSimilarityLibrariesResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}