Class: Appwrite::Models::ActivityEvent

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, actor_type:, actor_id:, actor_email:, actor_name:, resource_parent:, resource_type:, resource_id:, resource:, event:, user_agent:, ip:, mode:, country:, time:, project_id:, team_id:, hostname:) ⇒ ActivityEvent

Returns a new instance of ActivityEvent.



25
26
27
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
# File 'lib/appwrite/models/activity_event.rb', line 25

def initialize(
    id:,
    actor_type:,
    actor_id:,
    actor_email:,
    actor_name:,
    resource_parent:,
    resource_type:,
    resource_id:,
    resource:,
    event:,
    user_agent:,
    ip:,
    mode:,
    country:,
    time:,
    project_id:,
    team_id:,
    hostname:
)
    @id = id
    @actor_type = actor_type
    @actor_id = actor_id
    @actor_email = actor_email
    @actor_name = actor_name
    @resource_parent = resource_parent
    @resource_type = resource_type
    @resource_id = resource_id
    @resource = resource
    @event = event
    @user_agent = user_agent
    @ip = ip
    @mode = mode
    @country = country
    @time = time
    @project_id = project_id
    @team_id = team_id
    @hostname = hostname
end

Instance Attribute Details

#actor_emailObject (readonly)

Returns the value of attribute actor_email.



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

def actor_email
  @actor_email
end

#actor_idObject (readonly)

Returns the value of attribute actor_id.



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

def actor_id
  @actor_id
end

#actor_nameObject (readonly)

Returns the value of attribute actor_name.



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

def actor_name
  @actor_name
end

#actor_typeObject (readonly)

Returns the value of attribute actor_type.



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

def actor_type
  @actor_type
end

#countryObject (readonly)

Returns the value of attribute country.



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

def country
  @country
end

#eventObject (readonly)

Returns the value of attribute event.



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

def event
  @event
end

#hostnameObject (readonly)

Returns the value of attribute hostname.



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

def hostname
  @hostname
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#ipObject (readonly)

Returns the value of attribute ip.



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

def ip
  @ip
end

#modeObject (readonly)

Returns the value of attribute mode.



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

def mode
  @mode
end

#project_idObject (readonly)

Returns the value of attribute project_id.



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

def project_id
  @project_id
end

#resourceObject (readonly)

Returns the value of attribute resource.



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

def resource
  @resource
end

#resource_idObject (readonly)

Returns the value of attribute resource_id.



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

def resource_id
  @resource_id
end

#resource_parentObject (readonly)

Returns the value of attribute resource_parent.



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

def resource_parent
  @resource_parent
end

#resource_typeObject (readonly)

Returns the value of attribute resource_type.



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

def resource_type
  @resource_type
end

#team_idObject (readonly)

Returns the value of attribute team_id.



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

def team_id
  @team_id
end

#timeObject (readonly)

Returns the value of attribute time.



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

def time
  @time
end

#user_agentObject (readonly)

Returns the value of attribute user_agent.



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

def user_agent
  @user_agent
end

Class Method Details

.from(map:) ⇒ Object



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/appwrite/models/activity_event.rb', line 65

def self.from(map:)
    ActivityEvent.new(
        id: map["$id"],
        actor_type: map["actorType"],
        actor_id: map["actorId"],
        actor_email: map["actorEmail"],
        actor_name: map["actorName"],
        resource_parent: map["resourceParent"],
        resource_type: map["resourceType"],
        resource_id: map["resourceId"],
        resource: map["resource"],
        event: map["event"],
        user_agent: map["userAgent"],
        ip: map["ip"],
        mode: map["mode"],
        country: map["country"],
        time: map["time"],
        project_id: map["projectId"],
        team_id: map["teamId"],
        hostname: map["hostname"]
    )
end

Instance Method Details

#to_mapObject



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/appwrite/models/activity_event.rb', line 88

def to_map
    {
        "$id": @id,
        "actorType": @actor_type,
        "actorId": @actor_id,
        "actorEmail": @actor_email,
        "actorName": @actor_name,
        "resourceParent": @resource_parent,
        "resourceType": @resource_type,
        "resourceId": @resource_id,
        "resource": @resource,
        "event": @event,
        "userAgent": @user_agent,
        "ip": @ip,
        "mode": @mode,
        "country": @country,
        "time": @time,
        "projectId": @project_id,
        "teamId": @team_id,
        "hostname": @hostname
    }
end