Class: PasswordLoginResponse
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- PasswordLoginResponse
- Defined in:
- lib/schemas.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.from_dynamic!(d) ⇒ Object
1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 |
# File 'lib/schemas.rb', line 1627 def self.from_dynamic!(d) d = Types::Hash[d] new( authenticated: d.fetch("authenticated"), captcha: d["captcha"] ? CAPTCHAResponse.from_dynamic!(d["captcha"]) : nil, force_password_reset: d.fetch("forcePasswordReset"), reset_master_password: d.fetch("resetMasterPassword"), two_factor: d["twoFactor"] ? TwoFactorProviders.from_dynamic!(d["twoFactor"]) : nil, ) end |
.from_json!(json) ⇒ Object
1638 1639 1640 |
# File 'lib/schemas.rb', line 1638 def self.from_json!(json) from_dynamic!(JSON.parse(json)) end |
Instance Method Details
#to_dynamic ⇒ Object
1642 1643 1644 1645 1646 1647 1648 1649 1650 |
# File 'lib/schemas.rb', line 1642 def to_dynamic { "authenticated" => authenticated, "captcha" => captcha&.to_dynamic, "forcePasswordReset" => force_password_reset, "resetMasterPassword" => reset_master_password, "twoFactor" => two_factor&.to_dynamic, } end |
#to_json(options = nil) ⇒ Object
1652 1653 1654 |
# File 'lib/schemas.rb', line 1652 def to_json( = nil) JSON.generate(to_dynamic, ) end |