-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
11 changed files
with
186 additions
and
56 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?php | ||
|
||
namespace AsyncAws\CognitoIdentityProvider\ValueObject; | ||
|
||
/** | ||
* User preferences for multi-factor authentication with email messages. Activates or deactivates email MFA and sets it | ||
* as the preferred MFA method when multiple methods are available. To activate this setting, advanced security features | ||
* [^1] must be active in your user pool. | ||
* | ||
* [^1]: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-settings-advanced-security.html | ||
*/ | ||
final class EmailMfaSettingsType | ||
{ | ||
/** | ||
* Specifies whether email message MFA is active for a user. When the value of this parameter is `Enabled`, the user | ||
* will be prompted for MFA during all sign-in attempts, unless device tracking is turned on and the device has been | ||
* trusted. | ||
* | ||
* @var bool|null | ||
*/ | ||
private $enabled; | ||
|
||
/** | ||
* Specifies whether email message MFA is the user's preferred method. | ||
* | ||
* @var bool|null | ||
*/ | ||
private $preferredMfa; | ||
|
||
/** | ||
* @param array{ | ||
* Enabled?: null|bool, | ||
* PreferredMfa?: null|bool, | ||
* } $input | ||
*/ | ||
public function __construct(array $input) | ||
{ | ||
$this->enabled = $input['Enabled'] ?? null; | ||
$this->preferredMfa = $input['PreferredMfa'] ?? null; | ||
} | ||
|
||
/** | ||
* @param array{ | ||
* Enabled?: null|bool, | ||
* PreferredMfa?: null|bool, | ||
* }|EmailMfaSettingsType $input | ||
*/ | ||
public static function create($input): self | ||
{ | ||
return $input instanceof self ? $input : new self($input); | ||
} | ||
|
||
public function getEnabled(): ?bool | ||
{ | ||
return $this->enabled; | ||
} | ||
|
||
public function getPreferredMfa(): ?bool | ||
{ | ||
return $this->preferredMfa; | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
public function requestBody(): array | ||
{ | ||
$payload = []; | ||
if (null !== $v = $this->enabled) { | ||
$payload['Enabled'] = (bool) $v; | ||
} | ||
if (null !== $v = $this->preferredMfa) { | ||
$payload['PreferredMfa'] = (bool) $v; | ||
} | ||
|
||
return $payload; | ||
} | ||
} |
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