Skip to content

Commit aba565c

Browse files
committed
Support API CredentialRecognitionIntl.
1 parent 7a86f78 commit aba565c

File tree

6 files changed

+465
-0
lines changed

6 files changed

+465
-0
lines changed

ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2025-09-08 Version: 3.12.0
2+
- Support API CredentialRecognitionIntl.
3+
4+
15
2025-08-23 Version: 3.11.1
26
- Update API Initialize: add request parameters EditOcrResult.
37

src/Cloudauthintl.php

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\CheckResultResponse;
2626
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\CheckVerifyLogRequest;
2727
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\CheckVerifyLogResponse;
28+
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\CredentialRecognitionIntlRequest;
29+
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\CredentialRecognitionIntlResponse;
2830
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\CredentialVerifyIntlAdvanceRequest;
2931
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\CredentialVerifyIntlRequest;
3032
use AlibabaCloud\SDK\Cloudauthintl\V20220809\Models\CredentialVerifyIntlResponse;
@@ -718,6 +720,85 @@ public function checkVerifyLog($request)
718720
return $this->checkVerifyLogWithOptions($request, $runtime);
719721
}
720722

723+
/**
724+
* 凭证识别.
725+
*
726+
* @param Request - CredentialRecognitionIntlRequest
727+
* @param runtime - runtime options for this request RuntimeOptions
728+
*
729+
* @returns CredentialRecognitionIntlResponse
730+
*
731+
* @param CredentialRecognitionIntlRequest $request
732+
* @param RuntimeOptions $runtime
733+
*
734+
* @return CredentialRecognitionIntlResponse
735+
*/
736+
public function credentialRecognitionIntlWithOptions($request, $runtime)
737+
{
738+
$request->validate();
739+
$query = [];
740+
if (null !== $request->docType) {
741+
@$query['DocType'] = $request->docType;
742+
}
743+
744+
if (null !== $request->fraudCheck) {
745+
@$query['FraudCheck'] = $request->fraudCheck;
746+
}
747+
748+
if (null !== $request->ocrArea) {
749+
@$query['OcrArea'] = $request->ocrArea;
750+
}
751+
752+
if (null !== $request->productCode) {
753+
@$query['ProductCode'] = $request->productCode;
754+
}
755+
756+
$body = [];
757+
if (null !== $request->credentialOcrPictureBase64) {
758+
@$body['CredentialOcrPictureBase64'] = $request->credentialOcrPictureBase64;
759+
}
760+
761+
if (null !== $request->credentialOcrPictureUrl) {
762+
@$body['CredentialOcrPictureUrl'] = $request->credentialOcrPictureUrl;
763+
}
764+
765+
$req = new OpenApiRequest([
766+
'query' => Utils::query($query),
767+
'body' => Utils::parseToMap($body),
768+
]);
769+
$params = new Params([
770+
'action' => 'CredentialRecognitionIntl',
771+
'version' => '2022-08-09',
772+
'protocol' => 'HTTPS',
773+
'pathname' => '/',
774+
'method' => 'POST',
775+
'authType' => 'AK',
776+
'style' => 'RPC',
777+
'reqBodyType' => 'formData',
778+
'bodyType' => 'json',
779+
]);
780+
781+
return CredentialRecognitionIntlResponse::fromMap($this->callApi($params, $req, $runtime));
782+
}
783+
784+
/**
785+
* 凭证识别.
786+
*
787+
* @param Request - CredentialRecognitionIntlRequest
788+
*
789+
* @returns CredentialRecognitionIntlResponse
790+
*
791+
* @param CredentialRecognitionIntlRequest $request
792+
*
793+
* @return CredentialRecognitionIntlResponse
794+
*/
795+
public function credentialRecognitionIntl($request)
796+
{
797+
$runtime = new RuntimeOptions([]);
798+
799+
return $this->credentialRecognitionIntlWithOptions($request, $runtime);
800+
}
801+
721802
/**
722803
* Credential Verification.
723804
*
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
<?php
2+
3+
// This file is auto-generated, don't edit it. Thanks.
4+
5+
namespace AlibabaCloud\SDK\Cloudauthintl\V20220809\Models;
6+
7+
use AlibabaCloud\Dara\Model;
8+
9+
class CredentialRecognitionIntlRequest extends Model
10+
{
11+
/**
12+
* @var string
13+
*/
14+
public $credentialOcrPictureBase64;
15+
16+
/**
17+
* @var string
18+
*/
19+
public $credentialOcrPictureUrl;
20+
21+
/**
22+
* @var string
23+
*/
24+
public $docType;
25+
26+
/**
27+
* @var string
28+
*/
29+
public $fraudCheck;
30+
31+
/**
32+
* @var string
33+
*/
34+
public $ocrArea;
35+
36+
/**
37+
* @var string
38+
*/
39+
public $productCode;
40+
protected $_name = [
41+
'credentialOcrPictureBase64' => 'CredentialOcrPictureBase64',
42+
'credentialOcrPictureUrl' => 'CredentialOcrPictureUrl',
43+
'docType' => 'DocType',
44+
'fraudCheck' => 'FraudCheck',
45+
'ocrArea' => 'OcrArea',
46+
'productCode' => 'ProductCode',
47+
];
48+
49+
public function validate()
50+
{
51+
parent::validate();
52+
}
53+
54+
public function toArray($noStream = false)
55+
{
56+
$res = [];
57+
if (null !== $this->credentialOcrPictureBase64) {
58+
$res['CredentialOcrPictureBase64'] = $this->credentialOcrPictureBase64;
59+
}
60+
61+
if (null !== $this->credentialOcrPictureUrl) {
62+
$res['CredentialOcrPictureUrl'] = $this->credentialOcrPictureUrl;
63+
}
64+
65+
if (null !== $this->docType) {
66+
$res['DocType'] = $this->docType;
67+
}
68+
69+
if (null !== $this->fraudCheck) {
70+
$res['FraudCheck'] = $this->fraudCheck;
71+
}
72+
73+
if (null !== $this->ocrArea) {
74+
$res['OcrArea'] = $this->ocrArea;
75+
}
76+
77+
if (null !== $this->productCode) {
78+
$res['ProductCode'] = $this->productCode;
79+
}
80+
81+
return $res;
82+
}
83+
84+
public function toMap($noStream = false)
85+
{
86+
return $this->toArray($noStream);
87+
}
88+
89+
public static function fromMap($map = [])
90+
{
91+
$model = new self();
92+
if (isset($map['CredentialOcrPictureBase64'])) {
93+
$model->credentialOcrPictureBase64 = $map['CredentialOcrPictureBase64'];
94+
}
95+
96+
if (isset($map['CredentialOcrPictureUrl'])) {
97+
$model->credentialOcrPictureUrl = $map['CredentialOcrPictureUrl'];
98+
}
99+
100+
if (isset($map['DocType'])) {
101+
$model->docType = $map['DocType'];
102+
}
103+
104+
if (isset($map['FraudCheck'])) {
105+
$model->fraudCheck = $map['FraudCheck'];
106+
}
107+
108+
if (isset($map['OcrArea'])) {
109+
$model->ocrArea = $map['OcrArea'];
110+
}
111+
112+
if (isset($map['ProductCode'])) {
113+
$model->productCode = $map['ProductCode'];
114+
}
115+
116+
return $model;
117+
}
118+
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?php
2+
3+
// This file is auto-generated, don't edit it. Thanks.
4+
5+
namespace AlibabaCloud\SDK\Cloudauthintl\V20220809\Models;
6+
7+
use AlibabaCloud\Dara\Model;
8+
9+
class CredentialRecognitionIntlResponse extends Model
10+
{
11+
/**
12+
* @var string[]
13+
*/
14+
public $headers;
15+
16+
/**
17+
* @var int
18+
*/
19+
public $statusCode;
20+
21+
/**
22+
* @var CredentialRecognitionIntlResponseBody
23+
*/
24+
public $body;
25+
protected $_name = [
26+
'headers' => 'headers',
27+
'statusCode' => 'statusCode',
28+
'body' => 'body',
29+
];
30+
31+
public function validate()
32+
{
33+
if (\is_array($this->headers)) {
34+
Model::validateArray($this->headers);
35+
}
36+
if (null !== $this->body) {
37+
$this->body->validate();
38+
}
39+
parent::validate();
40+
}
41+
42+
public function toArray($noStream = false)
43+
{
44+
$res = [];
45+
if (null !== $this->headers) {
46+
if (\is_array($this->headers)) {
47+
$res['headers'] = [];
48+
foreach ($this->headers as $key1 => $value1) {
49+
$res['headers'][$key1] = $value1;
50+
}
51+
}
52+
}
53+
54+
if (null !== $this->statusCode) {
55+
$res['statusCode'] = $this->statusCode;
56+
}
57+
58+
if (null !== $this->body) {
59+
$res['body'] = null !== $this->body ? $this->body->toArray($noStream) : $this->body;
60+
}
61+
62+
return $res;
63+
}
64+
65+
public function toMap($noStream = false)
66+
{
67+
return $this->toArray($noStream);
68+
}
69+
70+
public static function fromMap($map = [])
71+
{
72+
$model = new self();
73+
if (isset($map['headers'])) {
74+
if (!empty($map['headers'])) {
75+
$model->headers = [];
76+
foreach ($map['headers'] as $key1 => $value1) {
77+
$model->headers[$key1] = $value1;
78+
}
79+
}
80+
}
81+
82+
if (isset($map['statusCode'])) {
83+
$model->statusCode = $map['statusCode'];
84+
}
85+
86+
if (isset($map['body'])) {
87+
$model->body = CredentialRecognitionIntlResponseBody::fromMap($map['body']);
88+
}
89+
90+
return $model;
91+
}
92+
}

0 commit comments

Comments
 (0)