Browse Source

IMM SDK Auto Released By zhengrui.lj,Version:1.60.1

Signed-off-by: sdk-team <sdk-team@alibabacloud.com>
sdk-team 6 years ago
parent
commit
fff4038c1f

+ 3 - 0
ChangeLog.txt

@@ -1,3 +1,6 @@
+2019-05-14 Version: 1.60.1
+1, Support body detect.
+
 2019-05-13 Version: 1.60.0
 2019-05-13 Version: 1.60.0
 1, Add three new apis, SaveSingleTaskForSaveArtExtension, QueryArtExtension and CancelTask.
 1, Add three new apis, SaveSingleTaskForSaveArtExtension, QueryArtExtension and CancelTask.
 
 

+ 28 - 5
services/imm/client.go

@@ -18,6 +18,7 @@ package imm
 import (
 import (
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk"
 	"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"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider"
 )
 )
 
 
 // Client is the sdk client struct, each func corresponds to an OpenAPI
 // Client is the sdk client struct, each func corresponds to an OpenAPI
@@ -32,6 +33,20 @@ func NewClient() (client *Client, err error) {
 	return
 	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)
+	return
+}
+
 // NewClientWithOptions creates a sdk client with regionId/sdkConfig/credential
 // NewClientWithOptions creates a sdk client with regionId/sdkConfig/credential
 // this is the common api to create a sdk client
 // this is the common api to create a sdk client
 func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error) {
 func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error) {
@@ -41,7 +56,7 @@ func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.C
 }
 }
 
 
 // NewClientWithAccessKey is a shortcut to create sdk client with accesskey
 // 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) {
 func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) {
 	client = &Client{}
 	client = &Client{}
 	err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret)
 	err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret)
@@ -49,7 +64,7 @@ func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (clie
 }
 }
 
 
 // NewClientWithStsToken is a shortcut to create sdk client with sts token
 // 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) {
 func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) {
 	client = &Client{}
 	client = &Client{}
 	err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken)
 	err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken)
@@ -57,15 +72,23 @@ func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToke
 }
 }
 
 
 // NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn
 // 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) {
 func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
 	client = &Client{}
 	client = &Client{}
 	err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
 	err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
 	return
 	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)
+	return
+}
+
 // NewClientWithEcsRamRole is a shortcut to create sdk client with ecs ram role
 // 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) {
 func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) {
 	client = &Client{}
 	client = &Client{}
 	err = client.InitWithEcsRamRole(regionId, roleName)
 	err = client.InitWithEcsRamRole(regionId, roleName)
@@ -73,7 +96,7 @@ func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client,
 }
 }
 
 
 // NewClientWithRsaKeyPair is a shortcut to create sdk client with rsa key pair
 // 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) {
 func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) {
 	client = &Client{}
 	client = &Client{}
 	err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)
 	err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)

+ 113 - 0
services/imm/create_merge_face_groups_job.go

@@ -0,0 +1,113 @@
+package imm
+
+//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"
+)
+
+// CreateMergeFaceGroupsJob invokes the imm.CreateMergeFaceGroupsJob API synchronously
+// api document: https://help.aliyun.com/api/imm/createmergefacegroupsjob.html
+func (client *Client) CreateMergeFaceGroupsJob(request *CreateMergeFaceGroupsJobRequest) (response *CreateMergeFaceGroupsJobResponse, err error) {
+	response = CreateCreateMergeFaceGroupsJobResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// CreateMergeFaceGroupsJobWithChan invokes the imm.CreateMergeFaceGroupsJob API asynchronously
+// api document: https://help.aliyun.com/api/imm/createmergefacegroupsjob.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) CreateMergeFaceGroupsJobWithChan(request *CreateMergeFaceGroupsJobRequest) (<-chan *CreateMergeFaceGroupsJobResponse, <-chan error) {
+	responseChan := make(chan *CreateMergeFaceGroupsJobResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.CreateMergeFaceGroupsJob(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// CreateMergeFaceGroupsJobWithCallback invokes the imm.CreateMergeFaceGroupsJob API asynchronously
+// api document: https://help.aliyun.com/api/imm/createmergefacegroupsjob.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) CreateMergeFaceGroupsJobWithCallback(request *CreateMergeFaceGroupsJobRequest, callback func(response *CreateMergeFaceGroupsJobResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *CreateMergeFaceGroupsJobResponse
+		var err error
+		defer close(result)
+		response, err = client.CreateMergeFaceGroupsJob(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// CreateMergeFaceGroupsJobRequest is the request struct for api CreateMergeFaceGroupsJob
+type CreateMergeFaceGroupsJobRequest struct {
+	*requests.RpcRequest
+	GroupIdFrom     string `position:"Query" name:"GroupIdFrom"`
+	GroupIdTo       string `position:"Query" name:"GroupIdTo"`
+	NotifyTopicName string `position:"Query" name:"NotifyTopicName"`
+	NotifyEndpoint  string `position:"Query" name:"NotifyEndpoint"`
+	Project         string `position:"Query" name:"Project"`
+	SetId           string `position:"Query" name:"SetId"`
+}
+
+// CreateMergeFaceGroupsJobResponse is the response struct for api CreateMergeFaceGroupsJob
+type CreateMergeFaceGroupsJobResponse struct {
+	*responses.BaseResponse
+	RequestId   string `json:"RequestId" xml:"RequestId"`
+	JobId       string `json:"JobId" xml:"JobId"`
+	SetId       string `json:"SetId" xml:"SetId"`
+	JobType     string `json:"JobType" xml:"JobType"`
+	GroupIdTo   string `json:"GroupIdTo" xml:"GroupIdTo"`
+	GroupIdFrom string `json:"GroupIdFrom" xml:"GroupIdFrom"`
+}
+
+// CreateCreateMergeFaceGroupsJobRequest creates a request to invoke CreateMergeFaceGroupsJob API
+func CreateCreateMergeFaceGroupsJobRequest() (request *CreateMergeFaceGroupsJobRequest) {
+	request = &CreateMergeFaceGroupsJobRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("imm", "2017-09-06", "CreateMergeFaceGroupsJob", "imm", "openAPI")
+	return
+}
+
+// CreateCreateMergeFaceGroupsJobResponse creates a response to parse from CreateMergeFaceGroupsJob response
+func CreateCreateMergeFaceGroupsJobResponse() (response *CreateMergeFaceGroupsJobResponse) {
+	response = &CreateMergeFaceGroupsJobResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 106 - 0
services/imm/detect_image_bodies.go

@@ -0,0 +1,106 @@
+package imm
+
+//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"
+)
+
+// DetectImageBodies invokes the imm.DetectImageBodies API synchronously
+// api document: https://help.aliyun.com/api/imm/detectimagebodies.html
+func (client *Client) DetectImageBodies(request *DetectImageBodiesRequest) (response *DetectImageBodiesResponse, err error) {
+	response = CreateDetectImageBodiesResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// DetectImageBodiesWithChan invokes the imm.DetectImageBodies API asynchronously
+// api document: https://help.aliyun.com/api/imm/detectimagebodies.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DetectImageBodiesWithChan(request *DetectImageBodiesRequest) (<-chan *DetectImageBodiesResponse, <-chan error) {
+	responseChan := make(chan *DetectImageBodiesResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DetectImageBodies(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// DetectImageBodiesWithCallback invokes the imm.DetectImageBodies API asynchronously
+// api document: https://help.aliyun.com/api/imm/detectimagebodies.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DetectImageBodiesWithCallback(request *DetectImageBodiesRequest, callback func(response *DetectImageBodiesResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DetectImageBodiesResponse
+		var err error
+		defer close(result)
+		response, err = client.DetectImageBodies(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// DetectImageBodiesRequest is the request struct for api DetectImageBodies
+type DetectImageBodiesRequest struct {
+	*requests.RpcRequest
+	ImageUri string `position:"Query" name:"ImageUri"`
+	Project  string `position:"Query" name:"Project"`
+}
+
+// DetectImageBodiesResponse is the response struct for api DetectImageBodies
+type DetectImageBodiesResponse struct {
+	*responses.BaseResponse
+	RequestId string       `json:"RequestId" xml:"RequestId"`
+	ImageUri  string       `json:"ImageUri" xml:"ImageUri"`
+	Bodies    []BodiesItem `json:"Bodies" xml:"Bodies"`
+}
+
+// CreateDetectImageBodiesRequest creates a request to invoke DetectImageBodies API
+func CreateDetectImageBodiesRequest() (request *DetectImageBodiesRequest) {
+	request = &DetectImageBodiesRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("imm", "2017-09-06", "DetectImageBodies", "imm", "openAPI")
+	return
+}
+
+// CreateDetectImageBodiesResponse creates a response to parse from DetectImageBodies response
+func CreateDetectImageBodiesResponse() (response *DetectImageBodiesResponse) {
+	response = &DetectImageBodiesResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 21 - 0
services/imm/struct_bodies.go

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

+ 22 - 0
services/imm/struct_bodies_item.go

@@ -0,0 +1,22 @@
+package imm
+
+//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.
+
+// BodiesItem is a nested struct in imm response
+type BodiesItem struct {
+	BodyConfidence float64      `json:"BodyConfidence" xml:"BodyConfidence"`
+	BodyBoundary   BodyBoundary `json:"BodyBoundary" xml:"BodyBoundary"`
+}

+ 24 - 0
services/imm/struct_body_boundary.go

@@ -0,0 +1,24 @@
+package imm
+
+//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.
+
+// BodyBoundary is a nested struct in imm response
+type BodyBoundary struct {
+	Left   int `json:"Left" xml:"Left"`
+	Top    int `json:"Top" xml:"Top"`
+	Width  int `json:"Width" xml:"Width"`
+	Height int `json:"Height" xml:"Height"`
+}