Skip to content

Commit

Permalink
Generated php 2020-06-18 for Cloudauth.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdk-team committed May 7, 2021
1 parent f5f2dd7 commit 369834e
Show file tree
Hide file tree
Showing 19 changed files with 1,088 additions and 181 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2021-05-07 Version: 2.0.3
- Generated php 2020-06-18 for Cloudauth.

2021-04-27 Version: 2.0.2
- Generated php 2020-06-18 for Cloudauth.

Expand Down
204 changes: 135 additions & 69 deletions src/Cloudauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@
use AlibabaCloud\SDK\Cloudauth\V20200618\Models\ContrastSmartVerifyResponse;
use AlibabaCloud\SDK\Cloudauth\V20200618\Models\DescribeSmartVerifyRequest;
use AlibabaCloud\SDK\Cloudauth\V20200618\Models\DescribeSmartVerifyResponse;
use AlibabaCloud\SDK\Cloudauth\V20200618\Models\DescribeSmsDetailRequest;
use AlibabaCloud\SDK\Cloudauth\V20200618\Models\DescribeSmsDetailResponse;
use AlibabaCloud\SDK\Cloudauth\V20200618\Models\ElementSmartVerifyAdvanceRequest;
use AlibabaCloud\SDK\Cloudauth\V20200618\Models\ElementSmartVerifyRequest;
use AlibabaCloud\SDK\Cloudauth\V20200618\Models\ElementSmartVerifyResponse;
use AlibabaCloud\SDK\Cloudauth\V20200618\Models\InitSmartVerifyRequest;
use AlibabaCloud\SDK\Cloudauth\V20200618\Models\InitSmartVerifyResponse;
use AlibabaCloud\SDK\Cloudauth\V20200618\Models\SendSmsRequest;
use AlibabaCloud\SDK\Cloudauth\V20200618\Models\SendSmsResponse;
use AlibabaCloud\SDK\Cloudauth\V20200618\Models\VerifyBankElementAdvanceRequest;
use AlibabaCloud\SDK\Cloudauth\V20200618\Models\VerifyBankElementRequest;
use AlibabaCloud\SDK\Cloudauth\V20200618\Models\VerifyBankElementResponse;
Expand Down Expand Up @@ -136,29 +140,31 @@ public function contrastSmartVerifyAdvance($request, $runtime)
OpenApiUtilClient::convert($runtime, $ossRuntime);
$contrastSmartVerifyReq = new ContrastSmartVerifyRequest([]);
OpenApiUtilClient::convert($request, $contrastSmartVerifyReq);
$authResponse = $authClient->authorizeFileUploadWithOptions($authRequest, $runtime);
$ossConfig->accessKeyId = $authResponse->accessKeyId;
$ossConfig->endpoint = OpenApiUtilClient::getEndpoint($authResponse->endpoint, $authResponse->useAccelerate, $this->_endpointType);
$ossClient = new OSS($ossConfig);
$fileObj = new FileField([
'filename' => $authResponse->objectKey,
'content' => $request->facePicFileObject,
'contentType' => '',
]);
$ossHeader = new header([
'accessKeyId' => $authResponse->accessKeyId,
'policy' => $authResponse->encodedPolicy,
'signature' => $authResponse->signature,
'key' => $authResponse->objectKey,
'file' => $fileObj,
'successActionStatus' => '201',
]);
$uploadRequest = new PostObjectRequest([
'bucketName' => $authResponse->bucket,
'header' => $ossHeader,
]);
$ossClient->postObject($uploadRequest, $ossRuntime);
$contrastSmartVerifyReq->facePicFile = 'http://' . $authResponse->bucket . '.' . $authResponse->endpoint . '/' . $authResponse->objectKey . '';
if (!Utils::isUnset($request->facePicFileObject)) {
$authResponse = $authClient->authorizeFileUploadWithOptions($authRequest, $runtime);
$ossConfig->accessKeyId = $authResponse->accessKeyId;
$ossConfig->endpoint = OpenApiUtilClient::getEndpoint($authResponse->endpoint, $authResponse->useAccelerate, $this->_endpointType);
$ossClient = new OSS($ossConfig);
$fileObj = new FileField([
'filename' => $authResponse->objectKey,
'content' => $request->facePicFileObject,
'contentType' => '',
]);
$ossHeader = new header([
'accessKeyId' => $authResponse->accessKeyId,
'policy' => $authResponse->encodedPolicy,
'signature' => $authResponse->signature,
'key' => $authResponse->objectKey,
'file' => $fileObj,
'successActionStatus' => '201',
]);
$uploadRequest = new PostObjectRequest([
'bucketName' => $authResponse->bucket,
'header' => $ossHeader,
]);
$ossClient->postObject($uploadRequest, $ossRuntime);
$contrastSmartVerifyReq->facePicFile = 'http://' . $authResponse->bucket . '.' . $authResponse->endpoint . '/' . $authResponse->objectKey . '';
}

return $this->contrastSmartVerifyWithOptions($contrastSmartVerifyReq, $runtime);
}
Expand Down Expand Up @@ -191,6 +197,34 @@ public function describeSmartVerify($request)
return $this->describeSmartVerifyWithOptions($request, $runtime);
}

/**
* @param DescribeSmsDetailRequest $request
* @param RuntimeOptions $runtime
*
* @return DescribeSmsDetailResponse
*/
public function describeSmsDetailWithOptions($request, $runtime)
{
Utils::validateModel($request);
$req = new OpenApiRequest([
'body' => Utils::toMap($request),
]);

return DescribeSmsDetailResponse::fromMap($this->doRPCRequest('DescribeSmsDetail', '2020-06-18', 'HTTPS', 'POST', 'AK', 'json', $req, $runtime));
}

/**
* @param DescribeSmsDetailRequest $request
*
* @return DescribeSmsDetailResponse
*/
public function describeSmsDetail($request)
{
$runtime = new RuntimeOptions([]);

return $this->describeSmsDetailWithOptions($request, $runtime);
}

/**
* @param ElementSmartVerifyRequest $request
* @param RuntimeOptions $runtime
Expand Down Expand Up @@ -262,29 +296,31 @@ public function elementSmartVerifyAdvance($request, $runtime)
OpenApiUtilClient::convert($runtime, $ossRuntime);
$elementSmartVerifyReq = new ElementSmartVerifyRequest([]);
OpenApiUtilClient::convert($request, $elementSmartVerifyReq);
$authResponse = $authClient->authorizeFileUploadWithOptions($authRequest, $runtime);
$ossConfig->accessKeyId = $authResponse->accessKeyId;
$ossConfig->endpoint = OpenApiUtilClient::getEndpoint($authResponse->endpoint, $authResponse->useAccelerate, $this->_endpointType);
$ossClient = new OSS($ossConfig);
$fileObj = new FileField([
'filename' => $authResponse->objectKey,
'content' => $request->certFileObject,
'contentType' => '',
]);
$ossHeader = new header([
'accessKeyId' => $authResponse->accessKeyId,
'policy' => $authResponse->encodedPolicy,
'signature' => $authResponse->signature,
'key' => $authResponse->objectKey,
'file' => $fileObj,
'successActionStatus' => '201',
]);
$uploadRequest = new PostObjectRequest([
'bucketName' => $authResponse->bucket,
'header' => $ossHeader,
]);
$ossClient->postObject($uploadRequest, $ossRuntime);
$elementSmartVerifyReq->certFile = 'http://' . $authResponse->bucket . '.' . $authResponse->endpoint . '/' . $authResponse->objectKey . '';
if (!Utils::isUnset($request->certFileObject)) {
$authResponse = $authClient->authorizeFileUploadWithOptions($authRequest, $runtime);
$ossConfig->accessKeyId = $authResponse->accessKeyId;
$ossConfig->endpoint = OpenApiUtilClient::getEndpoint($authResponse->endpoint, $authResponse->useAccelerate, $this->_endpointType);
$ossClient = new OSS($ossConfig);
$fileObj = new FileField([
'filename' => $authResponse->objectKey,
'content' => $request->certFileObject,
'contentType' => '',
]);
$ossHeader = new header([
'accessKeyId' => $authResponse->accessKeyId,
'policy' => $authResponse->encodedPolicy,
'signature' => $authResponse->signature,
'key' => $authResponse->objectKey,
'file' => $fileObj,
'successActionStatus' => '201',
]);
$uploadRequest = new PostObjectRequest([
'bucketName' => $authResponse->bucket,
'header' => $ossHeader,
]);
$ossClient->postObject($uploadRequest, $ossRuntime);
$elementSmartVerifyReq->certFile = 'http://' . $authResponse->bucket . '.' . $authResponse->endpoint . '/' . $authResponse->objectKey . '';
}

return $this->elementSmartVerifyWithOptions($elementSmartVerifyReq, $runtime);
}
Expand Down Expand Up @@ -317,6 +353,34 @@ public function initSmartVerify($request)
return $this->initSmartVerifyWithOptions($request, $runtime);
}

/**
* @param SendSmsRequest $request
* @param RuntimeOptions $runtime
*
* @return SendSmsResponse
*/
public function sendSmsWithOptions($request, $runtime)
{
Utils::validateModel($request);
$req = new OpenApiRequest([
'body' => Utils::toMap($request),
]);

return SendSmsResponse::fromMap($this->doRPCRequest('SendSms', '2020-06-18', 'HTTPS', 'POST', 'AK', 'json', $req, $runtime));
}

/**
* @param SendSmsRequest $request
*
* @return SendSmsResponse
*/
public function sendSms($request)
{
$runtime = new RuntimeOptions([]);

return $this->sendSmsWithOptions($request, $runtime);
}

/**
* @param VerifyBankElementRequest $request
* @param RuntimeOptions $runtime
Expand Down Expand Up @@ -388,29 +452,31 @@ public function verifyBankElementAdvance($request, $runtime)
OpenApiUtilClient::convert($runtime, $ossRuntime);
$verifyBankElementReq = new VerifyBankElementRequest([]);
OpenApiUtilClient::convert($request, $verifyBankElementReq);
$authResponse = $authClient->authorizeFileUploadWithOptions($authRequest, $runtime);
$ossConfig->accessKeyId = $authResponse->accessKeyId;
$ossConfig->endpoint = OpenApiUtilClient::getEndpoint($authResponse->endpoint, $authResponse->useAccelerate, $this->_endpointType);
$ossClient = new OSS($ossConfig);
$fileObj = new FileField([
'filename' => $authResponse->objectKey,
'content' => $request->bankCardFileObject,
'contentType' => '',
]);
$ossHeader = new header([
'accessKeyId' => $authResponse->accessKeyId,
'policy' => $authResponse->encodedPolicy,
'signature' => $authResponse->signature,
'key' => $authResponse->objectKey,
'file' => $fileObj,
'successActionStatus' => '201',
]);
$uploadRequest = new PostObjectRequest([
'bucketName' => $authResponse->bucket,
'header' => $ossHeader,
]);
$ossClient->postObject($uploadRequest, $ossRuntime);
$verifyBankElementReq->bankCardFile = 'http://' . $authResponse->bucket . '.' . $authResponse->endpoint . '/' . $authResponse->objectKey . '';
if (!Utils::isUnset($request->bankCardFileObject)) {
$authResponse = $authClient->authorizeFileUploadWithOptions($authRequest, $runtime);
$ossConfig->accessKeyId = $authResponse->accessKeyId;
$ossConfig->endpoint = OpenApiUtilClient::getEndpoint($authResponse->endpoint, $authResponse->useAccelerate, $this->_endpointType);
$ossClient = new OSS($ossConfig);
$fileObj = new FileField([
'filename' => $authResponse->objectKey,
'content' => $request->bankCardFileObject,
'contentType' => '',
]);
$ossHeader = new header([
'accessKeyId' => $authResponse->accessKeyId,
'policy' => $authResponse->encodedPolicy,
'signature' => $authResponse->signature,
'key' => $authResponse->objectKey,
'file' => $fileObj,
'successActionStatus' => '201',
]);
$uploadRequest = new PostObjectRequest([
'bucketName' => $authResponse->bucket,
'header' => $ossHeader,
]);
$ossClient->postObject($uploadRequest, $ossRuntime);
$verifyBankElementReq->bankCardFile = 'http://' . $authResponse->bucket . '.' . $authResponse->endpoint . '/' . $authResponse->objectKey . '';
}

return $this->verifyBankElementWithOptions($verifyBankElementReq, $runtime);
}
Expand Down
28 changes: 14 additions & 14 deletions src/Models/ContrastSmartVerifyResponseBody.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
class ContrastSmartVerifyResponseBody extends Model
{
/**
* @var resultObject
* @var string
*/
public $resultObject;
public $code;

/**
* @var string
Expand All @@ -25,14 +25,14 @@ class ContrastSmartVerifyResponseBody extends Model
public $requestId;

/**
* @var string
* @var resultObject
*/
public $code;
public $resultObject;
protected $_name = [
'resultObject' => 'ResultObject',
'code' => 'Code',
'message' => 'Message',
'requestId' => 'RequestId',
'code' => 'Code',
'resultObject' => 'ResultObject',
];

public function validate()
Expand All @@ -42,17 +42,17 @@ public function validate()
public function toMap()
{
$res = [];
if (null !== $this->resultObject) {
$res['ResultObject'] = null !== $this->resultObject ? $this->resultObject->toMap() : null;
if (null !== $this->code) {
$res['Code'] = $this->code;
}
if (null !== $this->message) {
$res['Message'] = $this->message;
}
if (null !== $this->requestId) {
$res['RequestId'] = $this->requestId;
}
if (null !== $this->code) {
$res['Code'] = $this->code;
if (null !== $this->resultObject) {
$res['ResultObject'] = null !== $this->resultObject ? $this->resultObject->toMap() : null;
}

return $res;
Expand All @@ -66,17 +66,17 @@ public function toMap()
public static function fromMap($map = [])
{
$model = new self();
if (isset($map['ResultObject'])) {
$model->resultObject = resultObject::fromMap($map['ResultObject']);
if (isset($map['Code'])) {
$model->code = $map['Code'];
}
if (isset($map['Message'])) {
$model->message = $map['Message'];
}
if (isset($map['RequestId'])) {
$model->requestId = $map['RequestId'];
}
if (isset($map['Code'])) {
$model->code = $map['Code'];
if (isset($map['ResultObject'])) {
$model->resultObject = resultObject::fromMap($map['ResultObject']);
}

return $model;
Expand Down

0 comments on commit 369834e

Please sign in to comment.