Class: Appwrite::Models::Log

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event:, user_id:, user_email:, user_name:, mode:, ip:, time:, 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:) ⇒ Log

Returns a new instance of Log.



28
29
30
31
32
33
34
35
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
# File 'lib/appwrite/models/log.rb', line 28

def initialize(
    event:,
    user_id:,
    user_email:,
    user_name:,
    mode:,
    ip:,
    time:,
    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:
)
    @event = event
    @user_id = user_id
    @user_email = user_email
    @user_name = user_name
    @mode = mode
    @ip = ip
    @time = time
    @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
end

Instance Attribute Details

#client_codeObject (readonly)

Returns the value of attribute client_code.



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

def client_code
  @client_code
end

#client_engineObject (readonly)

Returns the value of attribute client_engine.



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

def client_engine
  @client_engine
end

#client_engine_versionObject (readonly)

Returns the value of attribute client_engine_version.



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

def client_engine_version
  @client_engine_version
end

#client_nameObject (readonly)

Returns the value of attribute client_name.



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

def client_name
  @client_name
end

#client_typeObject (readonly)

Returns the value of attribute client_type.



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

def client_type
  @client_type
end

#client_versionObject (readonly)

Returns the value of attribute client_version.



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

def client_version
  @client_version
end

#country_codeObject (readonly)

Returns the value of attribute country_code.



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

def country_code
  @country_code
end

#country_nameObject (readonly)

Returns the value of attribute country_name.



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

def country_name
  @country_name
end

#device_brandObject (readonly)

Returns the value of attribute device_brand.



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

def device_brand
  @device_brand
end

#device_modelObject (readonly)

Returns the value of attribute device_model.



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

def device_model
  @device_model
end

#device_nameObject (readonly)

Returns the value of attribute device_name.



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

def device_name
  @device_name
end

#eventObject (readonly)

Returns the value of attribute event.



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

def event
  @event
end

#ipObject (readonly)

Returns the value of attribute ip.



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

def ip
  @ip
end

#modeObject (readonly)

Returns the value of attribute mode.



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

def mode
  @mode
end

#os_codeObject (readonly)

Returns the value of attribute os_code.



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

def os_code
  @os_code
end

#os_nameObject (readonly)

Returns the value of attribute os_name.



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

def os_name
  @os_name
end

#os_versionObject (readonly)

Returns the value of attribute os_version.



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

def os_version
  @os_version
end

#timeObject (readonly)

Returns the value of attribute time.



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

def time
  @time
end

#user_emailObject (readonly)

Returns the value of attribute user_email.



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

def user_email
  @user_email
end

#user_idObject (readonly)

Returns the value of attribute user_id.



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

def user_id
  @user_id
end

#user_nameObject (readonly)

Returns the value of attribute user_name.



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

def user_name
  @user_name
end

Class Method Details

.from(map:) ⇒ Object



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/appwrite/models/log.rb', line 74

def self.from(map:)
    Log.new(
        event: map["event"],
        user_id: map["userId"],
        user_email: map["userEmail"],
        user_name: map["userName"],
        mode: map["mode"],
        ip: map["ip"],
        time: map["time"],
        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"]
    )
end

Instance Method Details

#to_mapObject



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
# File 'lib/appwrite/models/log.rb', line 100

def to_map
    {
        "event": @event,
        "userId": @user_id,
        "userEmail": @user_email,
        "userName": @user_name,
        "mode": @mode,
        "ip": @ip,
        "time": @time,
        "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
    }
end