Class: Appwrite::Models::Session

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, created_at:, updated_at:, user_id:, expire:, provider:, provider_uid:, provider_access_token:, provider_access_token_expiry:, provider_refresh_token:, ip:, os_code:, os_name:, os_version:, client_type:, client_code:, client_name:, client_version:, client_engine:, client_engine_version:, device_name:, device_brand:, device_model:, country_code:, country_name:, current:, factors:, secret:, mfa_updated_at:) ⇒ Session

Returns a new instance of Session.



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/appwrite/models/session.rb', line 36

def initialize(
    id:,
    created_at:,
    updated_at:,
    user_id:,
    expire:,
    provider:,
    provider_uid:,
    provider_access_token:,
    provider_access_token_expiry:,
    provider_refresh_token:,
    ip:,
    os_code:,
    os_name:,
    os_version:,
    client_type:,
    client_code:,
    client_name:,
    client_version:,
    client_engine:,
    client_engine_version:,
    device_name:,
    device_brand:,
    device_model:,
    country_code:,
    country_name:,
    current:,
    factors:,
    secret:,
    mfa_updated_at:
)
    @id = id
    @created_at = created_at
    @updated_at = updated_at
    @user_id = user_id
    @expire = expire
    @provider = provider
    @provider_uid = provider_uid
    @provider_access_token = provider_access_token
    @provider_access_token_expiry = provider_access_token_expiry
    @provider_refresh_token = provider_refresh_token
    @ip = ip
    @os_code = os_code
    @os_name = os_name
    @os_version = os_version
    @client_type = client_type
    @client_code = client_code
    @client_name = client_name
    @client_version = client_version
    @client_engine = client_engine
    @client_engine_version = client_engine_version
    @device_name = device_name
    @device_brand = device_brand
    @device_model = device_model
    @country_code = country_code
    @country_name = country_name
    @current = current
    @factors = factors
    @secret = secret
    @mfa_updated_at = mfa_updated_at
end

Instance Attribute Details

#client_codeObject (readonly)

Returns the value of attribute client_code.



21
22
23
# File 'lib/appwrite/models/session.rb', line 21

def client_code
  @client_code
end

#client_engineObject (readonly)

Returns the value of attribute client_engine.



24
25
26
# File 'lib/appwrite/models/session.rb', line 24

def client_engine
  @client_engine
end

#client_engine_versionObject (readonly)

Returns the value of attribute client_engine_version.



25
26
27
# File 'lib/appwrite/models/session.rb', line 25

def client_engine_version
  @client_engine_version
end

#client_nameObject (readonly)

Returns the value of attribute client_name.



22
23
24
# File 'lib/appwrite/models/session.rb', line 22

def client_name
  @client_name
end

#client_typeObject (readonly)

Returns the value of attribute client_type.



20
21
22
# File 'lib/appwrite/models/session.rb', line 20

def client_type
  @client_type
end

#client_versionObject (readonly)

Returns the value of attribute client_version.



23
24
25
# File 'lib/appwrite/models/session.rb', line 23

def client_version
  @client_version
end

#country_codeObject (readonly)

Returns the value of attribute country_code.



29
30
31
# File 'lib/appwrite/models/session.rb', line 29

def country_code
  @country_code
end

#country_nameObject (readonly)

Returns the value of attribute country_name.



30
31
32
# File 'lib/appwrite/models/session.rb', line 30

def country_name
  @country_name
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#currentObject (readonly)

Returns the value of attribute current.



31
32
33
# File 'lib/appwrite/models/session.rb', line 31

def current
  @current
end

#device_brandObject (readonly)

Returns the value of attribute device_brand.



27
28
29
# File 'lib/appwrite/models/session.rb', line 27

def device_brand
  @device_brand
end

#device_modelObject (readonly)

Returns the value of attribute device_model.



28
29
30
# File 'lib/appwrite/models/session.rb', line 28

def device_model
  @device_model
end

#device_nameObject (readonly)

Returns the value of attribute device_name.



26
27
28
# File 'lib/appwrite/models/session.rb', line 26

def device_name
  @device_name
end

#expireObject (readonly)

Returns the value of attribute expire.



10
11
12
# File 'lib/appwrite/models/session.rb', line 10

def expire
  @expire
end

#factorsObject (readonly)

Returns the value of attribute factors.



32
33
34
# File 'lib/appwrite/models/session.rb', line 32

def factors
  @factors
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#ipObject (readonly)

Returns the value of attribute ip.



16
17
18
# File 'lib/appwrite/models/session.rb', line 16

def ip
  @ip
end

#mfa_updated_atObject (readonly)

Returns the value of attribute mfa_updated_at.



34
35
36
# File 'lib/appwrite/models/session.rb', line 34

def mfa_updated_at
  @mfa_updated_at
end

#os_codeObject (readonly)

Returns the value of attribute os_code.



17
18
19
# File 'lib/appwrite/models/session.rb', line 17

def os_code
  @os_code
end

#os_nameObject (readonly)

Returns the value of attribute os_name.



18
19
20
# File 'lib/appwrite/models/session.rb', line 18

def os_name
  @os_name
end

#os_versionObject (readonly)

Returns the value of attribute os_version.



19
20
21
# File 'lib/appwrite/models/session.rb', line 19

def os_version
  @os_version
end

#providerObject (readonly)

Returns the value of attribute provider.



11
12
13
# File 'lib/appwrite/models/session.rb', line 11

def provider
  @provider
end

#provider_access_tokenObject (readonly)

Returns the value of attribute provider_access_token.



13
14
15
# File 'lib/appwrite/models/session.rb', line 13

def provider_access_token
  @provider_access_token
end

#provider_access_token_expiryObject (readonly)

Returns the value of attribute provider_access_token_expiry.



14
15
16
# File 'lib/appwrite/models/session.rb', line 14

def provider_access_token_expiry
  @provider_access_token_expiry
end

#provider_refresh_tokenObject (readonly)

Returns the value of attribute provider_refresh_token.



15
16
17
# File 'lib/appwrite/models/session.rb', line 15

def provider_refresh_token
  @provider_refresh_token
end

#provider_uidObject (readonly)

Returns the value of attribute provider_uid.



12
13
14
# File 'lib/appwrite/models/session.rb', line 12

def provider_uid
  @provider_uid
end

#secretObject (readonly)

Returns the value of attribute secret.



33
34
35
# File 'lib/appwrite/models/session.rb', line 33

def secret
  @secret
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end

#user_idObject (readonly)

Returns the value of attribute user_id.



9
10
11
# File 'lib/appwrite/models/session.rb', line 9

def user_id
  @user_id
end

Class Method Details

.from(map:) ⇒ Object



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/appwrite/models/session.rb', line 98

def self.from(map:)
    Session.new(
        id: map["$id"],
        created_at: map["$createdAt"],
        updated_at: map["$updatedAt"],
        user_id: map["userId"],
        expire: map["expire"],
        provider: map["provider"],
        provider_uid: map["providerUid"],
        provider_access_token: map["providerAccessToken"],
        provider_access_token_expiry: map["providerAccessTokenExpiry"],
        provider_refresh_token: map["providerRefreshToken"],
        ip: map["ip"],
        os_code: map["osCode"],
        os_name: map["osName"],
        os_version: map["osVersion"],
        client_type: map["clientType"],
        client_code: map["clientCode"],
        client_name: map["clientName"],
        client_version: map["clientVersion"],
        client_engine: map["clientEngine"],
        client_engine_version: map["clientEngineVersion"],
        device_name: map["deviceName"],
        device_brand: map["deviceBrand"],
        device_model: map["deviceModel"],
        country_code: map["countryCode"],
        country_name: map["countryName"],
        current: map["current"],
        factors: map["factors"],
        secret: map["secret"],
        mfa_updated_at: map["mfaUpdatedAt"]
    )
end

Instance Method Details

#to_mapObject



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/appwrite/models/session.rb', line 132

def to_map
    {
        "$id": @id,
        "$createdAt": @created_at,
        "$updatedAt": @updated_at,
        "userId": @user_id,
        "expire": @expire,
        "provider": @provider,
        "providerUid": @provider_uid,
        "providerAccessToken": @provider_access_token,
        "providerAccessTokenExpiry": @provider_access_token_expiry,
        "providerRefreshToken": @provider_refresh_token,
        "ip": @ip,
        "osCode": @os_code,
        "osName": @os_name,
        "osVersion": @os_version,
        "clientType": @client_type,
        "clientCode": @client_code,
        "clientName": @client_name,
        "clientVersion": @client_version,
        "clientEngine": @client_engine,
        "clientEngineVersion": @client_engine_version,
        "deviceName": @device_name,
        "deviceBrand": @device_brand,
        "deviceModel": @device_model,
        "countryCode": @country_code,
        "countryName": @country_name,
        "current": @current,
        "factors": @factors,
        "secret": @secret,
        "mfaUpdatedAt": @mfa_updated_at
    }
end