فهرست منبع

First version.

sdk-team 6 سال پیش
والد
کامیت
2170253912

+ 3 - 0
ChangeLog.txt

@@ -1,3 +1,6 @@
+2019-11-21 Version: 1.60.254
+- First version.
+
 2019-11-20 Version: 1.60.253
 - Add new pop api.
 

+ 108 - 0
services/imageenhan/change_image_size.go

@@ -0,0 +1,108 @@
+package imageenhan
+
+//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"
+)
+
+// ChangeImageSize invokes the imageenhan.ChangeImageSize API synchronously
+// api document: https://help.aliyun.com/api/imageenhan/changeimagesize.html
+func (client *Client) ChangeImageSize(request *ChangeImageSizeRequest) (response *ChangeImageSizeResponse, err error) {
+	response = CreateChangeImageSizeResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ChangeImageSizeWithChan invokes the imageenhan.ChangeImageSize API asynchronously
+// api document: https://help.aliyun.com/api/imageenhan/changeimagesize.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ChangeImageSizeWithChan(request *ChangeImageSizeRequest) (<-chan *ChangeImageSizeResponse, <-chan error) {
+	responseChan := make(chan *ChangeImageSizeResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ChangeImageSize(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// ChangeImageSizeWithCallback invokes the imageenhan.ChangeImageSize API asynchronously
+// api document: https://help.aliyun.com/api/imageenhan/changeimagesize.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ChangeImageSizeWithCallback(request *ChangeImageSizeRequest, callback func(response *ChangeImageSizeResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ChangeImageSizeResponse
+		var err error
+		defer close(result)
+		response, err = client.ChangeImageSize(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// ChangeImageSizeRequest is the request struct for api ChangeImageSize
+type ChangeImageSizeRequest struct {
+	*requests.RpcRequest
+	Url    string           `position:"Body" name:"Url"`
+	Width  requests.Integer `position:"Body" name:"Width"`
+	Height requests.Integer `position:"Body" name:"Height"`
+}
+
+// ChangeImageSizeResponse is the response struct for api ChangeImageSize
+type ChangeImageSizeResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+	Code      string `json:"Code" xml:"Code"`
+	Message   string `json:"Message" xml:"Message"`
+	Data      Data   `json:"Data" xml:"Data"`
+}
+
+// CreateChangeImageSizeRequest creates a request to invoke ChangeImageSize API
+func CreateChangeImageSizeRequest() (request *ChangeImageSizeRequest) {
+	request = &ChangeImageSizeRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("imageenhan", "2019-09-30", "ChangeImageSize", "", "")
+	return
+}
+
+// CreateChangeImageSizeResponse creates a response to parse from ChangeImageSize response
+func CreateChangeImageSizeResponse() (response *ChangeImageSizeResponse) {
+	response = &ChangeImageSizeResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 129 - 0
services/imageenhan/client.go

@@ -0,0 +1,129 @@
+package imageenhan
+
+//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 (
+	"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
+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
+}
+
+// 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)
+	SetEndpointDataToClient(client)
+	return
+}
+
+// NewClientWithAccessKey is a shortcut to create sdk client with accesskey
+// 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://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://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://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
+// 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
+}

+ 20 - 0
services/imageenhan/endpoint.go

@@ -0,0 +1,20 @@
+package imageenhan
+
+// 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{}
+	}
+	return EndpointMap
+}
+
+// GetEndpointType Get Endpoint Type Value
+func GetEndpointType() string {
+	return EndpointType
+}

+ 107 - 0
services/imageenhan/extend_image_style.go

@@ -0,0 +1,107 @@
+package imageenhan
+
+//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"
+)
+
+// ExtendImageStyle invokes the imageenhan.ExtendImageStyle API synchronously
+// api document: https://help.aliyun.com/api/imageenhan/extendimagestyle.html
+func (client *Client) ExtendImageStyle(request *ExtendImageStyleRequest) (response *ExtendImageStyleResponse, err error) {
+	response = CreateExtendImageStyleResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ExtendImageStyleWithChan invokes the imageenhan.ExtendImageStyle API asynchronously
+// api document: https://help.aliyun.com/api/imageenhan/extendimagestyle.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ExtendImageStyleWithChan(request *ExtendImageStyleRequest) (<-chan *ExtendImageStyleResponse, <-chan error) {
+	responseChan := make(chan *ExtendImageStyleResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ExtendImageStyle(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// ExtendImageStyleWithCallback invokes the imageenhan.ExtendImageStyle API asynchronously
+// api document: https://help.aliyun.com/api/imageenhan/extendimagestyle.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ExtendImageStyleWithCallback(request *ExtendImageStyleRequest, callback func(response *ExtendImageStyleResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ExtendImageStyleResponse
+		var err error
+		defer close(result)
+		response, err = client.ExtendImageStyle(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// ExtendImageStyleRequest is the request struct for api ExtendImageStyle
+type ExtendImageStyleRequest struct {
+	*requests.RpcRequest
+	MajorUrl string `position:"Body" name:"MajorUrl"`
+	StyleUrl string `position:"Body" name:"StyleUrl"`
+}
+
+// ExtendImageStyleResponse is the response struct for api ExtendImageStyle
+type ExtendImageStyleResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+	Code      string `json:"Code" xml:"Code"`
+	Message   string `json:"Message" xml:"Message"`
+	Data      Data   `json:"Data" xml:"Data"`
+}
+
+// CreateExtendImageStyleRequest creates a request to invoke ExtendImageStyle API
+func CreateExtendImageStyleRequest() (request *ExtendImageStyleRequest) {
+	request = &ExtendImageStyleRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("imageenhan", "2019-09-30", "ExtendImageStyle", "", "")
+	return
+}
+
+// CreateExtendImageStyleResponse creates a response to parse from ExtendImageStyle response
+func CreateExtendImageStyleResponse() (response *ExtendImageStyleResponse) {
+	response = &ExtendImageStyleResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 106 - 0
services/imageenhan/make_super_resolution_image.go

@@ -0,0 +1,106 @@
+package imageenhan
+
+//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"
+)
+
+// MakeSuperResolutionImage invokes the imageenhan.MakeSuperResolutionImage API synchronously
+// api document: https://help.aliyun.com/api/imageenhan/makesuperresolutionimage.html
+func (client *Client) MakeSuperResolutionImage(request *MakeSuperResolutionImageRequest) (response *MakeSuperResolutionImageResponse, err error) {
+	response = CreateMakeSuperResolutionImageResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// MakeSuperResolutionImageWithChan invokes the imageenhan.MakeSuperResolutionImage API asynchronously
+// api document: https://help.aliyun.com/api/imageenhan/makesuperresolutionimage.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) MakeSuperResolutionImageWithChan(request *MakeSuperResolutionImageRequest) (<-chan *MakeSuperResolutionImageResponse, <-chan error) {
+	responseChan := make(chan *MakeSuperResolutionImageResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.MakeSuperResolutionImage(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// MakeSuperResolutionImageWithCallback invokes the imageenhan.MakeSuperResolutionImage API asynchronously
+// api document: https://help.aliyun.com/api/imageenhan/makesuperresolutionimage.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) MakeSuperResolutionImageWithCallback(request *MakeSuperResolutionImageRequest, callback func(response *MakeSuperResolutionImageResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *MakeSuperResolutionImageResponse
+		var err error
+		defer close(result)
+		response, err = client.MakeSuperResolutionImage(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// MakeSuperResolutionImageRequest is the request struct for api MakeSuperResolutionImage
+type MakeSuperResolutionImageRequest struct {
+	*requests.RpcRequest
+	Url string `position:"Body" name:"Url"`
+}
+
+// MakeSuperResolutionImageResponse is the response struct for api MakeSuperResolutionImage
+type MakeSuperResolutionImageResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+	Code      string `json:"Code" xml:"Code"`
+	Message   string `json:"Message" xml:"Message"`
+	Data      Data   `json:"Data" xml:"Data"`
+}
+
+// CreateMakeSuperResolutionImageRequest creates a request to invoke MakeSuperResolutionImage API
+func CreateMakeSuperResolutionImageRequest() (request *MakeSuperResolutionImageRequest) {
+	request = &MakeSuperResolutionImageRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("imageenhan", "2019-09-30", "MakeSuperResolutionImage", "", "")
+	return
+}
+
+// CreateMakeSuperResolutionImageResponse creates a response to parse from MakeSuperResolutionImage response
+func CreateMakeSuperResolutionImageResponse() (response *MakeSuperResolutionImageResponse) {
+	response = &MakeSuperResolutionImageResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 115 - 0
services/imageenhan/recolor_image.go

@@ -0,0 +1,115 @@
+package imageenhan
+
+//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"
+)
+
+// RecolorImage invokes the imageenhan.RecolorImage API synchronously
+// api document: https://help.aliyun.com/api/imageenhan/recolorimage.html
+func (client *Client) RecolorImage(request *RecolorImageRequest) (response *RecolorImageResponse, err error) {
+	response = CreateRecolorImageResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// RecolorImageWithChan invokes the imageenhan.RecolorImage API asynchronously
+// api document: https://help.aliyun.com/api/imageenhan/recolorimage.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) RecolorImageWithChan(request *RecolorImageRequest) (<-chan *RecolorImageResponse, <-chan error) {
+	responseChan := make(chan *RecolorImageResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.RecolorImage(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// RecolorImageWithCallback invokes the imageenhan.RecolorImage API asynchronously
+// api document: https://help.aliyun.com/api/imageenhan/recolorimage.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) RecolorImageWithCallback(request *RecolorImageRequest, callback func(response *RecolorImageResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *RecolorImageResponse
+		var err error
+		defer close(result)
+		response, err = client.RecolorImage(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// RecolorImageRequest is the request struct for api RecolorImage
+type RecolorImageRequest struct {
+	*requests.RpcRequest
+	ColorTemplate *[]RecolorImageColorTemplate `position:"Body" name:"ColorTemplate"  type:"Repeated"`
+	Url           string                       `position:"Body" name:"Url"`
+	Mode          string                       `position:"Body" name:"Mode"`
+	ColorCount    requests.Integer             `position:"Body" name:"ColorCount"`
+	RefUrl        string                       `position:"Body" name:"RefUrl"`
+}
+
+// RecolorImageColorTemplate is a repeated param struct in RecolorImageRequest
+type RecolorImageColorTemplate struct {
+	Color string `name:"Color"`
+}
+
+// RecolorImageResponse is the response struct for api RecolorImage
+type RecolorImageResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+	Code      string `json:"Code" xml:"Code"`
+	Message   string `json:"Message" xml:"Message"`
+	Data      Data   `json:"Data" xml:"Data"`
+}
+
+// CreateRecolorImageRequest creates a request to invoke RecolorImage API
+func CreateRecolorImageRequest() (request *RecolorImageRequest) {
+	request = &RecolorImageRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("imageenhan", "2019-09-30", "RecolorImage", "", "")
+	return
+}
+
+// CreateRecolorImageResponse creates a response to parse from RecolorImage response
+func CreateRecolorImageResponse() (response *RecolorImageResponse) {
+	response = &RecolorImageResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 106 - 0
services/imageenhan/segment_image.go

@@ -0,0 +1,106 @@
+package imageenhan
+
+//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"
+)
+
+// SegmentImage invokes the imageenhan.SegmentImage API synchronously
+// api document: https://help.aliyun.com/api/imageenhan/segmentimage.html
+func (client *Client) SegmentImage(request *SegmentImageRequest) (response *SegmentImageResponse, err error) {
+	response = CreateSegmentImageResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// SegmentImageWithChan invokes the imageenhan.SegmentImage API asynchronously
+// api document: https://help.aliyun.com/api/imageenhan/segmentimage.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) SegmentImageWithChan(request *SegmentImageRequest) (<-chan *SegmentImageResponse, <-chan error) {
+	responseChan := make(chan *SegmentImageResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.SegmentImage(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// SegmentImageWithCallback invokes the imageenhan.SegmentImage API asynchronously
+// api document: https://help.aliyun.com/api/imageenhan/segmentimage.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) SegmentImageWithCallback(request *SegmentImageRequest, callback func(response *SegmentImageResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *SegmentImageResponse
+		var err error
+		defer close(result)
+		response, err = client.SegmentImage(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// SegmentImageRequest is the request struct for api SegmentImage
+type SegmentImageRequest struct {
+	*requests.RpcRequest
+	Url string `position:"Body" name:"Url"`
+}
+
+// SegmentImageResponse is the response struct for api SegmentImage
+type SegmentImageResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+	Code      string `json:"Code" xml:"Code"`
+	Message   string `json:"Message" xml:"Message"`
+	Data      Data   `json:"Data" xml:"Data"`
+}
+
+// CreateSegmentImageRequest creates a request to invoke SegmentImage API
+func CreateSegmentImageRequest() (request *SegmentImageRequest) {
+	request = &SegmentImageRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("imageenhan", "2019-09-30", "SegmentImage", "", "")
+	return
+}
+
+// CreateSegmentImageResponse creates a response to parse from SegmentImage response
+func CreateSegmentImageResponse() (response *SegmentImageResponse) {
+	response = &SegmentImageResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 23 - 0
services/imageenhan/struct_data.go

@@ -0,0 +1,23 @@
+package imageenhan
+
+//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.
+
+// Data is a nested struct in imageenhan response
+type Data struct {
+	MajorUrl  string   `json:"MajorUrl" xml:"MajorUrl"`
+	Url       string   `json:"Url" xml:"Url"`
+	ImageList []string `json:"ImageList" xml:"ImageList"`
+}

+ 21 - 0
services/imageenhan/struct_image_list.go

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