Class: Files::ExpectationIncident
- Inherits:
-
Object
- Object
- Files::ExpectationIncident
- Defined in:
- lib/files.com/models/expectation_incident.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
-
.acknowledge(id, params = {}, options = {}) ⇒ Object
Acknowledge an expectation incident.
- .all(params = {}, options = {}) ⇒ Object
-
.find(id, params = {}, options = {}) ⇒ Object
Parameters: id (required) - int64 - Expectation Incident ID.
- .get(id, params = {}, options = {}) ⇒ Object
-
.list(params = {}, options = {}) ⇒ Object
Parameters: cursor - string - Used for pagination.
-
.resolve(id, params = {}, options = {}) ⇒ Object
Resolve an expectation incident.
-
.snooze(id, params = {}, options = {}) ⇒ Object
Snooze an expectation incident until a specified time.
Instance Method Summary collapse
-
#acknowledge(params = {}) ⇒ Object
Acknowledge an expectation incident.
-
#acknowledged_at ⇒ Object
date-time - When the incident was acknowledged.
-
#created_at ⇒ Object
date-time - Creation time.
-
#expectation_id ⇒ Object
int64 - Expectation ID.
-
#id ⇒ Object
int64 - Expectation Incident ID.
-
#initialize(attributes = {}, options = {}) ⇒ ExpectationIncident
constructor
A new instance of ExpectationIncident.
-
#last_evaluation_id ⇒ Object
int64 - Most recent evaluation linked to the incident.
-
#last_failed_at ⇒ Object
date-time - When the most recent failing evaluation contributing to the incident occurred.
-
#opened_at ⇒ Object
date-time - When the incident was opened.
-
#opened_by_evaluation_id ⇒ Object
int64 - Evaluation that first opened the incident.
-
#resolve(params = {}) ⇒ Object
Resolve an expectation incident.
-
#resolved_at ⇒ Object
date-time - When the incident was resolved.
-
#resolved_by_evaluation_id ⇒ Object
int64 - Evaluation that resolved the incident.
-
#snooze(params = {}) ⇒ Object
Snooze an expectation incident until a specified time.
-
#snoozed_until ⇒ Object
date-time - When the current snooze expires.
-
#status ⇒ Object
string - Incident status.
-
#summary ⇒ Object
object - Compact incident summary payload.
-
#updated_at ⇒ Object
date-time - Last update time.
-
#workspace_id ⇒ Object
int64 - Workspace ID.
Constructor Details
#initialize(attributes = {}, options = {}) ⇒ ExpectationIncident
Returns a new instance of ExpectationIncident.
7 8 9 10 |
# File 'lib/files.com/models/expectation_incident.rb', line 7 def initialize(attributes = {}, = {}) @attributes = attributes || {} @options = || {} end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/files.com/models/expectation_incident.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/expectation_incident.rb', line 5 def @options end |
Class Method Details
.acknowledge(id, params = {}, options = {}) ⇒ Object
Acknowledge an expectation incident
189 190 191 192 193 194 195 196 197 |
# File 'lib/files.com/models/expectation_incident.rb', line 189 def self.acknowledge(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] response, = Api.send_request("/expectation_incidents/#{params[:id]}/acknowledge", :post, params, ) ExpectationIncident.new(response.data, ) end |
.all(params = {}, options = {}) ⇒ Object
141 142 143 |
# File 'lib/files.com/models/expectation_incident.rb', line 141 def self.all(params = {}, = {}) list(params, ) end |
.find(id, params = {}, options = {}) ⇒ Object
Parameters:
id (required) - int64 - Expectation Incident ID.
147 148 149 150 151 152 153 154 155 |
# File 'lib/files.com/models/expectation_incident.rb', line 147 def self.find(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] response, = Api.send_request("/expectation_incidents/#{params[:id]}", :get, params, ) ExpectationIncident.new(response.data, ) end |
.get(id, params = {}, options = {}) ⇒ Object
157 158 159 |
# File 'lib/files.com/models/expectation_incident.rb', line 157 def self.get(id, params = {}, = {}) find(id, params, ) end |
.list(params = {}, options = {}) ⇒ Object
Parameters:
cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `workspace_id`, `created_at` or `expectation_id`.
filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `expectation_id` and `workspace_id`. Valid field combinations are `[ workspace_id, expectation_id ]`.
130 131 132 133 134 135 136 137 138 139 |
# File 'lib/files.com/models/expectation_incident.rb', line 130 def self.list(params = {}, = {}) raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String) raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash) raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash) List.new(ExpectationIncident, params) do Api.send_request("/expectation_incidents", :get, params, ) end end |
.resolve(id, params = {}, options = {}) ⇒ Object
Resolve an expectation incident
162 163 164 165 166 167 168 169 170 |
# File 'lib/files.com/models/expectation_incident.rb', line 162 def self.resolve(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] response, = Api.send_request("/expectation_incidents/#{params[:id]}/resolve", :post, params, ) ExpectationIncident.new(response.data, ) end |
.snooze(id, params = {}, options = {}) ⇒ Object
Snooze an expectation incident until a specified time
Parameters:
snoozed_until (required) - string - Time until which the incident should remain snoozed.
176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/files.com/models/expectation_incident.rb', line 176 def self.snooze(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: snoozed_until must be an String") if params[:snoozed_until] and !params[:snoozed_until].is_a?(String) raise MissingParameterError.new("Parameter missing: id") unless params[:id] raise MissingParameterError.new("Parameter missing: snoozed_until") unless params[:snoozed_until] response, = Api.send_request("/expectation_incidents/#{params[:id]}/snooze", :post, params, ) ExpectationIncident.new(response.data, ) end |
Instance Method Details
#acknowledge(params = {}) ⇒ Object
Acknowledge an expectation incident
115 116 117 118 119 120 121 122 123 |
# File 'lib/files.com/models/expectation_incident.rb', line 115 def acknowledge(params = {}) params ||= {} params[:id] = @attributes[:id] raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id] raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] Api.send_request("/expectation_incidents/#{@attributes[:id]}/acknowledge", :post, params, @options) end |
#acknowledged_at ⇒ Object
date-time - When the incident was acknowledged.
43 44 45 |
# File 'lib/files.com/models/expectation_incident.rb', line 43 def acknowledged_at @attributes[:acknowledged_at] end |
#created_at ⇒ Object
date-time - Creation time.
78 79 80 |
# File 'lib/files.com/models/expectation_incident.rb', line 78 def created_at @attributes[:created_at] end |
#expectation_id ⇒ Object
int64 - Expectation ID.
23 24 25 |
# File 'lib/files.com/models/expectation_incident.rb', line 23 def expectation_id @attributes[:expectation_id] end |
#id ⇒ Object
int64 - Expectation Incident ID
13 14 15 |
# File 'lib/files.com/models/expectation_incident.rb', line 13 def id @attributes[:id] end |
#last_evaluation_id ⇒ Object
int64 - Most recent evaluation linked to the incident.
63 64 65 |
# File 'lib/files.com/models/expectation_incident.rb', line 63 def last_evaluation_id @attributes[:last_evaluation_id] end |
#last_failed_at ⇒ Object
date-time - When the most recent failing evaluation contributing to the incident occurred.
38 39 40 |
# File 'lib/files.com/models/expectation_incident.rb', line 38 def last_failed_at @attributes[:last_failed_at] end |
#opened_at ⇒ Object
date-time - When the incident was opened.
33 34 35 |
# File 'lib/files.com/models/expectation_incident.rb', line 33 def opened_at @attributes[:opened_at] end |
#opened_by_evaluation_id ⇒ Object
int64 - Evaluation that first opened the incident.
58 59 60 |
# File 'lib/files.com/models/expectation_incident.rb', line 58 def opened_by_evaluation_id @attributes[:opened_by_evaluation_id] end |
#resolve(params = {}) ⇒ Object
Resolve an expectation incident
88 89 90 91 92 93 94 95 96 |
# File 'lib/files.com/models/expectation_incident.rb', line 88 def resolve(params = {}) params ||= {} params[:id] = @attributes[:id] raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id] raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] Api.send_request("/expectation_incidents/#{@attributes[:id]}/resolve", :post, params, @options) end |
#resolved_at ⇒ Object
date-time - When the incident was resolved.
53 54 55 |
# File 'lib/files.com/models/expectation_incident.rb', line 53 def resolved_at @attributes[:resolved_at] end |
#resolved_by_evaluation_id ⇒ Object
int64 - Evaluation that resolved the incident.
68 69 70 |
# File 'lib/files.com/models/expectation_incident.rb', line 68 def resolved_by_evaluation_id @attributes[:resolved_by_evaluation_id] end |
#snooze(params = {}) ⇒ Object
Snooze an expectation incident until a specified time
Parameters:
snoozed_until (required) - string - Time until which the incident should remain snoozed.
102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/files.com/models/expectation_incident.rb', line 102 def snooze(params = {}) params ||= {} params[:id] = @attributes[:id] raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id] raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: snoozed_until must be an String") if params[:snoozed_until] and !params[:snoozed_until].is_a?(String) raise MissingParameterError.new("Parameter missing: id") unless params[:id] raise MissingParameterError.new("Parameter missing: snoozed_until") unless params[:snoozed_until] Api.send_request("/expectation_incidents/#{@attributes[:id]}/snooze", :post, params, @options) end |
#snoozed_until ⇒ Object
date-time - When the current snooze expires.
48 49 50 |
# File 'lib/files.com/models/expectation_incident.rb', line 48 def snoozed_until @attributes[:snoozed_until] end |
#status ⇒ Object
string - Incident status.
28 29 30 |
# File 'lib/files.com/models/expectation_incident.rb', line 28 def status @attributes[:status] end |
#summary ⇒ Object
object - Compact incident summary payload.
73 74 75 |
# File 'lib/files.com/models/expectation_incident.rb', line 73 def summary @attributes[:summary] end |
#updated_at ⇒ Object
date-time - Last update time.
83 84 85 |
# File 'lib/files.com/models/expectation_incident.rb', line 83 def updated_at @attributes[:updated_at] end |
#workspace_id ⇒ Object
int64 - Workspace ID. ‘0` means the default workspace.
18 19 20 |
# File 'lib/files.com/models/expectation_incident.rb', line 18 def workspace_id @attributes[:workspace_id] end |