Class: Appwrite::Models::Subscriber

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, created_at:, updated_at:, target_id:, target:, user_id:, user_name:, topic_id:, provider_type:) ⇒ Subscriber

Returns a new instance of Subscriber.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/appwrite/models/subscriber.rb', line 16

def initialize(
    id:,
    created_at:,
    updated_at:,
    target_id:,
    target:,
    user_id:,
    user_name:,
    topic_id:,
    provider_type:
)
    @id = id
    @created_at = created_at
    @updated_at = updated_at
    @target_id = target_id
    @target = target
    @user_id = user_id
    @user_name = user_name
    @topic_id = topic_id
    @provider_type = provider_type
end

Instance Attribute Details

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#provider_typeObject (readonly)

Returns the value of attribute provider_type.



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

def provider_type
  @provider_type
end

#targetObject (readonly)

Returns the value of attribute target.



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

def target
  @target
end

#target_idObject (readonly)

Returns the value of attribute target_id.



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

def target_id
  @target_id
end

#topic_idObject (readonly)

Returns the value of attribute topic_id.



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

def topic_id
  @topic_id
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end

#user_idObject (readonly)

Returns the value of attribute user_id.



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

def user_id
  @user_id
end

#user_nameObject (readonly)

Returns the value of attribute user_name.



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

def user_name
  @user_name
end

Class Method Details

.from(map:) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/appwrite/models/subscriber.rb', line 38

def self.from(map:)
    Subscriber.new(
        id: map["$id"],
        created_at: map["$createdAt"],
        updated_at: map["$updatedAt"],
        target_id: map["targetId"],
        target: Target.from(map: map["target"]),
        user_id: map["userId"],
        user_name: map["userName"],
        topic_id: map["topicId"],
        provider_type: map["providerType"]
    )
end

Instance Method Details

#to_mapObject



52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/appwrite/models/subscriber.rb', line 52

def to_map
    {
        "$id": @id,
        "$createdAt": @created_at,
        "$updatedAt": @updated_at,
        "targetId": @target_id,
        "target": @target.to_map,
        "userId": @user_id,
        "userName": @user_name,
        "topicId": @topic_id,
        "providerType": @provider_type
    }
end