Class: Appwrite::Models::Insight

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, created_at:, updated_at:, report_id:, type:, severity:, status:, resource_type:, resource_id:, parent_resource_type:, parent_resource_id:, title:, summary:, ctas:, analyzed_at:, dismissed_at:, dismissed_by:) ⇒ Insight

Returns a new instance of Insight.



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

def initialize(
    id:,
    created_at:,
    updated_at:,
    report_id:,
    type:,
    severity:,
    status:,
    resource_type:,
    resource_id:,
    parent_resource_type:,
    parent_resource_id:,
    title:,
    summary:,
    ctas:,
    analyzed_at: ,
    dismissed_at: ,
    dismissed_by: 
)
    @id = id
    @created_at = created_at
    @updated_at = updated_at
    @report_id = report_id
    @type = type
    @severity = severity
    @status = status
    @resource_type = resource_type
    @resource_id = resource_id
    @parent_resource_type = parent_resource_type
    @parent_resource_id = parent_resource_id
    @title = title
    @summary = summary
    @ctas = ctas
    @analyzed_at = analyzed_at
    @dismissed_at = dismissed_at
    @dismissed_by = dismissed_by
end

Instance Attribute Details

#analyzed_atObject (readonly)

Returns the value of attribute analyzed_at.



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

def analyzed_at
  @analyzed_at
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#ctasObject (readonly)

Returns the value of attribute ctas.



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

def ctas
  @ctas
end

#dismissed_atObject (readonly)

Returns the value of attribute dismissed_at.



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

def dismissed_at
  @dismissed_at
end

#dismissed_byObject (readonly)

Returns the value of attribute dismissed_by.



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

def dismissed_by
  @dismissed_by
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#parent_resource_idObject (readonly)

Returns the value of attribute parent_resource_id.



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

def parent_resource_id
  @parent_resource_id
end

#parent_resource_typeObject (readonly)

Returns the value of attribute parent_resource_type.



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

def parent_resource_type
  @parent_resource_type
end

#report_idObject (readonly)

Returns the value of attribute report_id.



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

def report_id
  @report_id
end

#resource_idObject (readonly)

Returns the value of attribute resource_id.



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

def resource_id
  @resource_id
end

#resource_typeObject (readonly)

Returns the value of attribute resource_type.



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

def resource_type
  @resource_type
end

#severityObject (readonly)

Returns the value of attribute severity.



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

def severity
  @severity
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

#summaryObject (readonly)

Returns the value of attribute summary.



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

def summary
  @summary
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end

Class Method Details

.from(map:) ⇒ Object



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/appwrite/models/insight.rb', line 62

def self.from(map:)
    Insight.new(
        id: map["$id"],
        created_at: map["$createdAt"],
        updated_at: map["$updatedAt"],
        report_id: map["reportId"],
        type: map["type"],
        severity: map["severity"],
        status: map["status"],
        resource_type: map["resourceType"],
        resource_id: map["resourceId"],
        parent_resource_type: map["parentResourceType"],
        parent_resource_id: map["parentResourceId"],
        title: map["title"],
        summary: map["summary"],
        ctas: map["ctas"].map { |it| InsightCTA.from(map: it) },
        analyzed_at: map["analyzedAt"],
        dismissed_at: map["dismissedAt"],
        dismissed_by: map["dismissedBy"]
    )
end

Instance Method Details

#to_mapObject



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/appwrite/models/insight.rb', line 84

def to_map
    {
        "$id": @id,
        "$createdAt": @created_at,
        "$updatedAt": @updated_at,
        "reportId": @report_id,
        "type": @type,
        "severity": @severity,
        "status": @status,
        "resourceType": @resource_type,
        "resourceId": @resource_id,
        "parentResourceType": @parent_resource_type,
        "parentResourceId": @parent_resource_id,
        "title": @title,
        "summary": @summary,
        "ctas": @ctas.map { |it| it.to_map },
        "analyzedAt": @analyzed_at,
        "dismissedAt": @dismissed_at,
        "dismissedBy": @dismissed_by
    }
end