Class: Appwrite::Models::PolicyPasswordRotation

Inherits:
Object
  • Object
show all
Defined in:
lib/appwrite/models/policy_password_rotation.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, enabled:, max_age:) ⇒ PolicyPasswordRotation

Returns a new instance of PolicyPasswordRotation.



10
11
12
13
14
15
16
17
18
# File 'lib/appwrite/models/policy_password_rotation.rb', line 10

def initialize(
    id:,
    enabled:,
    max_age:
)
    @id = id
    @enabled = enabled
    @max_age = max_age
end

Instance Attribute Details

#enabled ⇒ Object (readonly)

Returns the value of attribute enabled.



7
8
9
# File 'lib/appwrite/models/policy_password_rotation.rb', line 7

def enabled
  @enabled
end

#id ⇒ Object (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/appwrite/models/policy_password_rotation.rb', line 6

def id
  @id
end

#max_age ⇒ Object (readonly)

Returns the value of attribute max_age.



8
9
10
# File 'lib/appwrite/models/policy_password_rotation.rb', line 8

def max_age
  @max_age
end

Class Method Details

.from(map:) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/appwrite/models/policy_password_rotation.rb', line 20

def self.from(map:)
    map = { "$id" => "", "enabled" => false, "maxAge" => 31536000 }.merge(map)
    PolicyPasswordRotation.new(
        id: map["$id"],
        enabled: map["enabled"],
        max_age: map["maxAge"]
    )
end

Instance Method Details

#to_map ⇒ Object



29
30
31
32
33
34
35
# File 'lib/appwrite/models/policy_password_rotation.rb', line 29

def to_map
    {
        "$id": @id,
        "enabled": @enabled,
        "maxAge": @max_age
    }
end