Class: Appwrite::Models::Report

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, created_at:, updated_at:, app_id:, type:, title:, summary:, target_type:, target:, categories:, insights:, analyzed_at:) ⇒ Report

Returns a new instance of Report.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/appwrite/models/report.rb', line 19

def initialize(
    id:,
    created_at:,
    updated_at:,
    app_id:,
    type:,
    title:,
    summary:,
    target_type:,
    target:,
    categories:,
    insights:,
    analyzed_at: 
)
    @id = id
    @created_at = created_at
    @updated_at = updated_at
    @app_id = app_id
    @type = type
    @title = title
    @summary = summary
    @target_type = target_type
    @target = target
    @categories = categories
    @insights = insights
    @analyzed_at = analyzed_at
end

Instance Attribute Details

#analyzed_atObject (readonly)

Returns the value of attribute analyzed_at.



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

def analyzed_at
  @analyzed_at
end

#app_idObject (readonly)

Returns the value of attribute app_id.



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

def app_id
  @app_id
end

#categoriesObject (readonly)

Returns the value of attribute categories.



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

def categories
  @categories
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#insightsObject (readonly)

Returns the value of attribute insights.



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

def insights
  @insights
end

#summaryObject (readonly)

Returns the value of attribute summary.



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

def summary
  @summary
end

#targetObject (readonly)

Returns the value of attribute target.



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

def target
  @target
end

#target_typeObject (readonly)

Returns the value of attribute target_type.



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

def target_type
  @target_type
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end

Class Method Details

.from(map:) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/appwrite/models/report.rb', line 47

def self.from(map:)
    Report.new(
        id: map["$id"],
        created_at: map["$createdAt"],
        updated_at: map["$updatedAt"],
        app_id: map["appId"],
        type: map["type"],
        title: map["title"],
        summary: map["summary"],
        target_type: map["targetType"],
        target: map["target"],
        categories: map["categories"],
        insights: map["insights"].map { |it| Insight.from(map: it) },
        analyzed_at: map["analyzedAt"]
    )
end

Instance Method Details

#to_mapObject



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/appwrite/models/report.rb', line 64

def to_map
    {
        "$id": @id,
        "$createdAt": @created_at,
        "$updatedAt": @updated_at,
        "appId": @app_id,
        "type": @type,
        "title": @title,
        "summary": @summary,
        "targetType": @target_type,
        "target": @target,
        "categories": @categories,
        "insights": @insights.map { |it| it.to_map },
        "analyzedAt": @analyzed_at
    }
end