-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
462c949
commit 6054424
Showing
7 changed files
with
237 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?php | ||
|
||
namespace AlibabaCloud\Credentials\Credential; | ||
|
||
use AlibabaCloud\Credentials\Providers\Credentials; | ||
|
||
class RefreshResult | ||
{ | ||
public function __construct($credentials = [], $staleTime = null, $prefetchTime = null) | ||
{ | ||
$this->credentials = $credentials; | ||
$this->staleTime = $staleTime ? $staleTime : PHP_INT_MAX; | ||
$this->prefetchTime = $prefetchTime ? $prefetchTime : PHP_INT_MAX; | ||
} | ||
public function validate() | ||
{ | ||
} | ||
public function toMap() | ||
{ | ||
$res = []; | ||
if (null !== $this->staleTime) { | ||
$res['staleTime'] = $this->staleTime; | ||
} | ||
if (null !== $this->prefetchTime) { | ||
$res['prefetchTime'] = $this->prefetchTime; | ||
} | ||
if (null !== $this->credentials) { | ||
$res['credentials'] = $this->credentials; | ||
} | ||
return $res; | ||
} | ||
/** | ||
* @param array $map | ||
* @return RefreshResult | ||
*/ | ||
public static function fromMap($map = []) | ||
{ | ||
$model = new self(); | ||
if (isset($map['staleTime'])) { | ||
$model->staleTime = $map['staleTime']; | ||
} | ||
if (isset($map['prefetchTime'])) { | ||
$model->staleTime = $map['prefetchTime']; | ||
} | ||
if (isset($map['credentials'])) { | ||
$model->staleTime = $map['credentials']; | ||
} | ||
return $model; | ||
} | ||
/** | ||
* @description staleTime | ||
* @var int | ||
*/ | ||
public $staleTime; | ||
|
||
/** | ||
* @description prefetchTime | ||
* @var int | ||
*/ | ||
public $prefetchTime; | ||
|
||
/** | ||
* @description credentials | ||
* @var Credentials | ||
*/ | ||
public $credentials; | ||
|
||
|
||
/** | ||
* @return Credentials | ||
*/ | ||
public function credentials() | ||
{ | ||
return $this->credentials; | ||
} | ||
|
||
/** | ||
* @var int | ||
*/ | ||
public function staleTime() | ||
{ | ||
return $this->staleTime; | ||
} | ||
|
||
/** | ||
* @var int | ||
*/ | ||
public function prefetchTime() | ||
{ | ||
return $this->prefetchTime; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.