Class: Files::Expectation
- Inherits:
-
Object
- Object
- Files::Expectation
- Defined in:
- lib/files.com/models/expectation.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
- .all(params = {}, options = {}) ⇒ Object
-
.create(params = {}, options = {}) ⇒ Object
Parameters: name - string - Expectation name.
- .delete(id, params = {}, options = {}) ⇒ Object
- .destroy(id, params = {}, options = {}) ⇒ Object
-
.find(id, params = {}, options = {}) ⇒ Object
Parameters: id (required) - int64 - Expectation ID.
- .get(id, params = {}, options = {}) ⇒ Object
-
.list(params = {}, options = {}) ⇒ Object
Parameters: cursor - string - Used for pagination.
-
.trigger_evaluation(id, params = {}, options = {}) ⇒ Object
Manually open an Expectation window.
-
.update(id, params = {}, options = {}) ⇒ Object
Parameters: name - string - Expectation name.
Instance Method Summary collapse
-
#created_at ⇒ Object
date-time - Creation time.
-
#criteria ⇒ Object
object - Structured criteria v1 definition for the expectation.
- #criteria=(value) ⇒ Object
- #delete(params = {}) ⇒ Object
-
#description ⇒ Object
string - Expectation description.
- #description=(value) ⇒ Object
- #destroy(params = {}) ⇒ Object
-
#disabled ⇒ Object
boolean - If true, the expectation is disabled.
- #disabled=(value) ⇒ Object
-
#exclude_pattern ⇒ Object
string - Optional source exclusion glob.
- #exclude_pattern=(value) ⇒ Object
-
#expectations_version ⇒ Object
int64 - Criteria schema version for this expectation.
- #expectations_version=(value) ⇒ Object
-
#holiday_region ⇒ Object
string - Optional holiday region used by schedule-driven expectations.
- #holiday_region=(value) ⇒ Object
-
#id ⇒ Object
int64 - Expectation ID.
- #id=(value) ⇒ Object
-
#inactivity_interval ⇒ Object
int64 - How many quiet seconds are required before final closure.
- #inactivity_interval=(value) ⇒ Object
-
#initialize(attributes = {}, options = {}) ⇒ Expectation
constructor
A new instance of Expectation.
-
#interval ⇒ Object
string - If trigger is ‘daily`, this specifies how often to run the expectation.
- #interval=(value) ⇒ Object
-
#last_evaluated_at ⇒ Object
date-time - Last time this expectation was evaluated.
- #last_evaluated_at=(value) ⇒ Object
-
#last_failure_at ⇒ Object
date-time - Last time this expectation closed with a failure result.
- #last_failure_at=(value) ⇒ Object
-
#last_result ⇒ Object
string - Most recent terminal result for this expectation.
- #last_result=(value) ⇒ Object
-
#last_success_at ⇒ Object
date-time - Last time this expectation closed successfully.
- #last_success_at=(value) ⇒ Object
-
#late_acceptance_interval ⇒ Object
int64 - How many seconds a schedule-driven window may remain eligible to close as late.
- #late_acceptance_interval=(value) ⇒ Object
-
#lookback_interval ⇒ Object
int64 - How many seconds before the due boundary the window starts.
- #lookback_interval=(value) ⇒ Object
-
#max_open_interval ⇒ Object
int64 - Hard-stop duration in seconds for unscheduled expectations.
- #max_open_interval=(value) ⇒ Object
-
#name ⇒ Object
string - Expectation name.
- #name=(value) ⇒ Object
-
#path ⇒ Object
string - Path scope for the expectation.
- #path=(value) ⇒ Object
-
#recurring_day ⇒ Object
int64 - If trigger is ‘daily`, this selects the day number inside the chosen interval.
- #recurring_day=(value) ⇒ Object
- #save ⇒ Object
-
#schedule_days_of_week ⇒ Object
array(int64) - If trigger is ‘custom_schedule`, the 0-based weekdays used by the schedule.
- #schedule_days_of_week=(value) ⇒ Object
-
#schedule_time_zone ⇒ Object
string - Time zone used by the expectation schedule.
- #schedule_time_zone=(value) ⇒ Object
-
#schedule_times_of_day ⇒ Object
array(string) - Times of day in HH:MM format for schedule-driven expectations.
- #schedule_times_of_day=(value) ⇒ Object
-
#source ⇒ Object
string - Source glob used to select candidate files.
- #source=(value) ⇒ Object
-
#trigger ⇒ Object
string - How this expectation opens windows.
- #trigger=(value) ⇒ Object
-
#trigger_evaluation(params = {}) ⇒ Object
Manually open an Expectation window.
-
#update(params = {}) ⇒ Object
Parameters: name - string - Expectation name.
-
#updated_at ⇒ Object
date-time - Last update time.
-
#workspace_id ⇒ Object
int64 - Workspace ID.
- #workspace_id=(value) ⇒ Object
Constructor Details
#initialize(attributes = {}, options = {}) ⇒ Expectation
Returns a new instance of Expectation.
7 8 9 10 |
# File 'lib/files.com/models/expectation.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.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.rb', line 5 def @options end |
Class Method Details
.all(params = {}, options = {}) ⇒ Object
347 348 349 |
# File 'lib/files.com/models/expectation.rb', line 347 def self.all(params = {}, = {}) list(params, ) end |
.create(params = {}, options = {}) ⇒ Object
Parameters:
name - string - Expectation name.
description - string - Expectation description.
path - string - Path scope for the expectation. Supports workspace-relative presentation.
source - string - Source glob used to select candidate files.
exclude_pattern - string - Optional source exclusion glob.
disabled - boolean - If true, the expectation is disabled.
trigger - string - How this expectation opens windows.
interval - string - If trigger is `daily`, this specifies how often to run the expectation.
recurring_day - int64 - If trigger is `daily`, this selects the day number inside the chosen interval.
schedule_days_of_week - array(int64) - If trigger is `custom_schedule`, the 0-based weekdays used by the schedule.
schedule_times_of_day - array(string) - Times of day in HH:MM format for schedule-driven expectations.
schedule_time_zone - string - Time zone used by the expectation schedule.
holiday_region - string - Optional holiday region used by schedule-driven expectations.
lookback_interval - int64 - How many seconds before the due boundary the window starts.
late_acceptance_interval - int64 - How many seconds a schedule-driven window may remain eligible to close as late.
inactivity_interval - int64 - How many quiet seconds are required before final closure.
max_open_interval - int64 - Hard-stop duration in seconds for unscheduled expectations.
criteria - object - Structured criteria v1 definition for the expectation.
workspace_id - int64 - Workspace ID. `0` means the default workspace.
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 |
# File 'lib/files.com/models/expectation.rb', line 387 def self.create(params = {}, = {}) raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String) raise InvalidParameterError.new("Bad parameter: description must be an String") if params[:description] and !params[:description].is_a?(String) raise InvalidParameterError.new("Bad parameter: path must be an String") if params[:path] and !params[:path].is_a?(String) raise InvalidParameterError.new("Bad parameter: source must be an String") if params[:source] and !params[:source].is_a?(String) raise InvalidParameterError.new("Bad parameter: exclude_pattern must be an String") if params[:exclude_pattern] and !params[:exclude_pattern].is_a?(String) raise InvalidParameterError.new("Bad parameter: trigger must be an String") if params[:trigger] and !params[:trigger].is_a?(String) raise InvalidParameterError.new("Bad parameter: interval must be an String") if params[:interval] and !params[:interval].is_a?(String) raise InvalidParameterError.new("Bad parameter: recurring_day must be an Integer") if params[:recurring_day] and !params[:recurring_day].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: schedule_days_of_week must be an Array") if params[:schedule_days_of_week] and !params[:schedule_days_of_week].is_a?(Array) raise InvalidParameterError.new("Bad parameter: schedule_times_of_day must be an Array") if params[:schedule_times_of_day] and !params[:schedule_times_of_day].is_a?(Array) raise InvalidParameterError.new("Bad parameter: schedule_time_zone must be an String") if params[:schedule_time_zone] and !params[:schedule_time_zone].is_a?(String) raise InvalidParameterError.new("Bad parameter: holiday_region must be an String") if params[:holiday_region] and !params[:holiday_region].is_a?(String) raise InvalidParameterError.new("Bad parameter: lookback_interval must be an Integer") if params[:lookback_interval] and !params[:lookback_interval].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: late_acceptance_interval must be an Integer") if params[:late_acceptance_interval] and !params[:late_acceptance_interval].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: inactivity_interval must be an Integer") if params[:inactivity_interval] and !params[:inactivity_interval].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: max_open_interval must be an Integer") if params[:max_open_interval] and !params[:max_open_interval].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: criteria must be an Hash") if params[:criteria] and !params[:criteria].is_a?(Hash) raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer) response, = Api.send_request("/expectations", :post, params, ) Expectation.new(response.data, ) end |
.delete(id, params = {}, options = {}) ⇒ Object
470 471 472 473 474 475 476 477 478 |
# File 'lib/files.com/models/expectation.rb', line 470 def self.delete(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] Api.send_request("/expectations/#{params[:id]}", :delete, params, ) nil end |
.destroy(id, params = {}, options = {}) ⇒ Object
480 481 482 483 |
# File 'lib/files.com/models/expectation.rb', line 480 def self.destroy(id, params = {}, = {}) delete(id, params, ) nil end |
.find(id, params = {}, options = {}) ⇒ Object
Parameters:
id (required) - int64 - Expectation ID.
353 354 355 356 357 358 359 360 361 |
# File 'lib/files.com/models/expectation.rb', line 353 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("/expectations/#{params[:id]}", :get, params, ) Expectation.new(response.data, ) end |
.get(id, params = {}, options = {}) ⇒ Object
363 364 365 |
# File 'lib/files.com/models/expectation.rb', line 363 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`, `name` or `disabled`.
filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `disabled` and `workspace_id`. Valid field combinations are `[ workspace_id, disabled ]`.
336 337 338 339 340 341 342 343 344 345 |
# File 'lib/files.com/models/expectation.rb', line 336 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(Expectation, params) do Api.send_request("/expectations", :get, params, ) end end |
.trigger_evaluation(id, params = {}, options = {}) ⇒ Object
Manually open an Expectation window
412 413 414 415 416 417 418 419 420 |
# File 'lib/files.com/models/expectation.rb', line 412 def self.trigger_evaluation(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("/expectations/#{params[:id]}/trigger_evaluation", :post, params, ) ExpectationEvaluation.new(response.data, ) end |
.update(id, params = {}, options = {}) ⇒ Object
Parameters:
name - string - Expectation name.
description - string - Expectation description.
path - string - Path scope for the expectation. Supports workspace-relative presentation.
source - string - Source glob used to select candidate files.
exclude_pattern - string - Optional source exclusion glob.
disabled - boolean - If true, the expectation is disabled.
trigger - string - How this expectation opens windows.
interval - string - If trigger is `daily`, this specifies how often to run the expectation.
recurring_day - int64 - If trigger is `daily`, this selects the day number inside the chosen interval.
schedule_days_of_week - array(int64) - If trigger is `custom_schedule`, the 0-based weekdays used by the schedule.
schedule_times_of_day - array(string) - Times of day in HH:MM format for schedule-driven expectations.
schedule_time_zone - string - Time zone used by the expectation schedule.
holiday_region - string - Optional holiday region used by schedule-driven expectations.
lookback_interval - int64 - How many seconds before the due boundary the window starts.
late_acceptance_interval - int64 - How many seconds a schedule-driven window may remain eligible to close as late.
inactivity_interval - int64 - How many quiet seconds are required before final closure.
max_open_interval - int64 - Hard-stop duration in seconds for unscheduled expectations.
criteria - object - Structured criteria v1 definition for the expectation.
workspace_id - int64 - Workspace ID. `0` means the default workspace.
442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 |
# File 'lib/files.com/models/expectation.rb', line 442 def self.update(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: name must be an String") if params[:name] and !params[:name].is_a?(String) raise InvalidParameterError.new("Bad parameter: description must be an String") if params[:description] and !params[:description].is_a?(String) raise InvalidParameterError.new("Bad parameter: path must be an String") if params[:path] and !params[:path].is_a?(String) raise InvalidParameterError.new("Bad parameter: source must be an String") if params[:source] and !params[:source].is_a?(String) raise InvalidParameterError.new("Bad parameter: exclude_pattern must be an String") if params[:exclude_pattern] and !params[:exclude_pattern].is_a?(String) raise InvalidParameterError.new("Bad parameter: trigger must be an String") if params[:trigger] and !params[:trigger].is_a?(String) raise InvalidParameterError.new("Bad parameter: interval must be an String") if params[:interval] and !params[:interval].is_a?(String) raise InvalidParameterError.new("Bad parameter: recurring_day must be an Integer") if params[:recurring_day] and !params[:recurring_day].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: schedule_days_of_week must be an Array") if params[:schedule_days_of_week] and !params[:schedule_days_of_week].is_a?(Array) raise InvalidParameterError.new("Bad parameter: schedule_times_of_day must be an Array") if params[:schedule_times_of_day] and !params[:schedule_times_of_day].is_a?(Array) raise InvalidParameterError.new("Bad parameter: schedule_time_zone must be an String") if params[:schedule_time_zone] and !params[:schedule_time_zone].is_a?(String) raise InvalidParameterError.new("Bad parameter: holiday_region must be an String") if params[:holiday_region] and !params[:holiday_region].is_a?(String) raise InvalidParameterError.new("Bad parameter: lookback_interval must be an Integer") if params[:lookback_interval] and !params[:lookback_interval].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: late_acceptance_interval must be an Integer") if params[:late_acceptance_interval] and !params[:late_acceptance_interval].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: inactivity_interval must be an Integer") if params[:inactivity_interval] and !params[:inactivity_interval].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: max_open_interval must be an Integer") if params[:max_open_interval] and !params[:max_open_interval].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: criteria must be an Hash") if params[:criteria] and !params[:criteria].is_a?(Hash) raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] response, = Api.send_request("/expectations/#{params[:id]}", :patch, params, ) Expectation.new(response.data, ) end |
Instance Method Details
#created_at ⇒ Object
date-time - Creation time.
238 239 240 |
# File 'lib/files.com/models/expectation.rb', line 238 def created_at @attributes[:created_at] end |
#criteria ⇒ Object
object - Structured criteria v1 definition for the expectation.
193 194 195 |
# File 'lib/files.com/models/expectation.rb', line 193 def criteria @attributes[:criteria] end |
#criteria=(value) ⇒ Object
197 198 199 |
# File 'lib/files.com/models/expectation.rb', line 197 def criteria=(value) @attributes[:criteria] = value end |
#delete(params = {}) ⇒ Object
305 306 307 308 309 310 311 312 313 |
# File 'lib/files.com/models/expectation.rb', line 305 def delete(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("/expectations/#{@attributes[:id]}", :delete, params, @options) end |
#description ⇒ Object
string - Expectation description.
40 41 42 |
# File 'lib/files.com/models/expectation.rb', line 40 def description @attributes[:description] end |
#description=(value) ⇒ Object
44 45 46 |
# File 'lib/files.com/models/expectation.rb', line 44 def description=(value) @attributes[:description] = value end |
#destroy(params = {}) ⇒ Object
315 316 317 318 |
# File 'lib/files.com/models/expectation.rb', line 315 def destroy(params = {}) delete(params) nil end |
#disabled ⇒ Object
boolean - If true, the expectation is disabled.
76 77 78 |
# File 'lib/files.com/models/expectation.rb', line 76 def disabled @attributes[:disabled] end |
#disabled=(value) ⇒ Object
80 81 82 |
# File 'lib/files.com/models/expectation.rb', line 80 def disabled=(value) @attributes[:disabled] = value end |
#exclude_pattern ⇒ Object
string - Optional source exclusion glob.
67 68 69 |
# File 'lib/files.com/models/expectation.rb', line 67 def exclude_pattern @attributes[:exclude_pattern] end |
#exclude_pattern=(value) ⇒ Object
71 72 73 |
# File 'lib/files.com/models/expectation.rb', line 71 def exclude_pattern=(value) @attributes[:exclude_pattern] = value end |
#expectations_version ⇒ Object
int64 - Criteria schema version for this expectation.
85 86 87 |
# File 'lib/files.com/models/expectation.rb', line 85 def expectations_version @attributes[:expectations_version] end |
#expectations_version=(value) ⇒ Object
89 90 91 |
# File 'lib/files.com/models/expectation.rb', line 89 def expectations_version=(value) @attributes[:expectations_version] = value end |
#holiday_region ⇒ Object
string - Optional holiday region used by schedule-driven expectations.
148 149 150 |
# File 'lib/files.com/models/expectation.rb', line 148 def holiday_region @attributes[:holiday_region] end |
#holiday_region=(value) ⇒ Object
152 153 154 |
# File 'lib/files.com/models/expectation.rb', line 152 def holiday_region=(value) @attributes[:holiday_region] = value end |
#id ⇒ Object
int64 - Expectation ID
13 14 15 |
# File 'lib/files.com/models/expectation.rb', line 13 def id @attributes[:id] end |
#id=(value) ⇒ Object
17 18 19 |
# File 'lib/files.com/models/expectation.rb', line 17 def id=(value) @attributes[:id] = value end |
#inactivity_interval ⇒ Object
int64 - How many quiet seconds are required before final closure.
175 176 177 |
# File 'lib/files.com/models/expectation.rb', line 175 def inactivity_interval @attributes[:inactivity_interval] end |
#inactivity_interval=(value) ⇒ Object
179 180 181 |
# File 'lib/files.com/models/expectation.rb', line 179 def inactivity_interval=(value) @attributes[:inactivity_interval] = value end |
#interval ⇒ Object
string - If trigger is ‘daily`, this specifies how often to run the expectation.
103 104 105 |
# File 'lib/files.com/models/expectation.rb', line 103 def interval @attributes[:interval] end |
#interval=(value) ⇒ Object
107 108 109 |
# File 'lib/files.com/models/expectation.rb', line 107 def interval=(value) @attributes[:interval] = value end |
#last_evaluated_at ⇒ Object
date-time - Last time this expectation was evaluated.
202 203 204 |
# File 'lib/files.com/models/expectation.rb', line 202 def last_evaluated_at @attributes[:last_evaluated_at] end |
#last_evaluated_at=(value) ⇒ Object
206 207 208 |
# File 'lib/files.com/models/expectation.rb', line 206 def last_evaluated_at=(value) @attributes[:last_evaluated_at] = value end |
#last_failure_at ⇒ Object
date-time - Last time this expectation closed with a failure result.
220 221 222 |
# File 'lib/files.com/models/expectation.rb', line 220 def last_failure_at @attributes[:last_failure_at] end |
#last_failure_at=(value) ⇒ Object
224 225 226 |
# File 'lib/files.com/models/expectation.rb', line 224 def last_failure_at=(value) @attributes[:last_failure_at] = value end |
#last_result ⇒ Object
string - Most recent terminal result for this expectation.
229 230 231 |
# File 'lib/files.com/models/expectation.rb', line 229 def last_result @attributes[:last_result] end |
#last_result=(value) ⇒ Object
233 234 235 |
# File 'lib/files.com/models/expectation.rb', line 233 def last_result=(value) @attributes[:last_result] = value end |
#last_success_at ⇒ Object
date-time - Last time this expectation closed successfully.
211 212 213 |
# File 'lib/files.com/models/expectation.rb', line 211 def last_success_at @attributes[:last_success_at] end |
#last_success_at=(value) ⇒ Object
215 216 217 |
# File 'lib/files.com/models/expectation.rb', line 215 def last_success_at=(value) @attributes[:last_success_at] = value end |
#late_acceptance_interval ⇒ Object
int64 - How many seconds a schedule-driven window may remain eligible to close as late.
166 167 168 |
# File 'lib/files.com/models/expectation.rb', line 166 def late_acceptance_interval @attributes[:late_acceptance_interval] end |
#late_acceptance_interval=(value) ⇒ Object
170 171 172 |
# File 'lib/files.com/models/expectation.rb', line 170 def late_acceptance_interval=(value) @attributes[:late_acceptance_interval] = value end |
#lookback_interval ⇒ Object
int64 - How many seconds before the due boundary the window starts.
157 158 159 |
# File 'lib/files.com/models/expectation.rb', line 157 def lookback_interval @attributes[:lookback_interval] end |
#lookback_interval=(value) ⇒ Object
161 162 163 |
# File 'lib/files.com/models/expectation.rb', line 161 def lookback_interval=(value) @attributes[:lookback_interval] = value end |
#max_open_interval ⇒ Object
int64 - Hard-stop duration in seconds for unscheduled expectations.
184 185 186 |
# File 'lib/files.com/models/expectation.rb', line 184 def max_open_interval @attributes[:max_open_interval] end |
#max_open_interval=(value) ⇒ Object
188 189 190 |
# File 'lib/files.com/models/expectation.rb', line 188 def max_open_interval=(value) @attributes[:max_open_interval] = value end |
#name ⇒ Object
string - Expectation name.
31 32 33 |
# File 'lib/files.com/models/expectation.rb', line 31 def name @attributes[:name] end |
#name=(value) ⇒ Object
35 36 37 |
# File 'lib/files.com/models/expectation.rb', line 35 def name=(value) @attributes[:name] = value end |
#path ⇒ Object
string - Path scope for the expectation. Supports workspace-relative presentation. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
49 50 51 |
# File 'lib/files.com/models/expectation.rb', line 49 def path @attributes[:path] end |
#path=(value) ⇒ Object
53 54 55 |
# File 'lib/files.com/models/expectation.rb', line 53 def path=(value) @attributes[:path] = value end |
#recurring_day ⇒ Object
int64 - If trigger is ‘daily`, this selects the day number inside the chosen interval.
112 113 114 |
# File 'lib/files.com/models/expectation.rb', line 112 def recurring_day @attributes[:recurring_day] end |
#recurring_day=(value) ⇒ Object
116 117 118 |
# File 'lib/files.com/models/expectation.rb', line 116 def recurring_day=(value) @attributes[:recurring_day] = value end |
#save ⇒ Object
320 321 322 323 324 325 326 327 328 329 |
# File 'lib/files.com/models/expectation.rb', line 320 def save if @attributes[:id] new_obj = update(@attributes) else new_obj = Expectation.create(@attributes, @options) end @attributes = new_obj.attributes true end |
#schedule_days_of_week ⇒ Object
array(int64) - If trigger is ‘custom_schedule`, the 0-based weekdays used by the schedule.
121 122 123 |
# File 'lib/files.com/models/expectation.rb', line 121 def schedule_days_of_week @attributes[:schedule_days_of_week] end |
#schedule_days_of_week=(value) ⇒ Object
125 126 127 |
# File 'lib/files.com/models/expectation.rb', line 125 def schedule_days_of_week=(value) @attributes[:schedule_days_of_week] = value end |
#schedule_time_zone ⇒ Object
string - Time zone used by the expectation schedule.
139 140 141 |
# File 'lib/files.com/models/expectation.rb', line 139 def schedule_time_zone @attributes[:schedule_time_zone] end |
#schedule_time_zone=(value) ⇒ Object
143 144 145 |
# File 'lib/files.com/models/expectation.rb', line 143 def schedule_time_zone=(value) @attributes[:schedule_time_zone] = value end |
#schedule_times_of_day ⇒ Object
array(string) - Times of day in HH:MM format for schedule-driven expectations.
130 131 132 |
# File 'lib/files.com/models/expectation.rb', line 130 def schedule_times_of_day @attributes[:schedule_times_of_day] end |
#schedule_times_of_day=(value) ⇒ Object
134 135 136 |
# File 'lib/files.com/models/expectation.rb', line 134 def schedule_times_of_day=(value) @attributes[:schedule_times_of_day] = value end |
#source ⇒ Object
string - Source glob used to select candidate files.
58 59 60 |
# File 'lib/files.com/models/expectation.rb', line 58 def source @attributes[:source] end |
#source=(value) ⇒ Object
62 63 64 |
# File 'lib/files.com/models/expectation.rb', line 62 def source=(value) @attributes[:source] = value end |
#trigger ⇒ Object
string - How this expectation opens windows.
94 95 96 |
# File 'lib/files.com/models/expectation.rb', line 94 def trigger @attributes[:trigger] end |
#trigger=(value) ⇒ Object
98 99 100 |
# File 'lib/files.com/models/expectation.rb', line 98 def trigger=(value) @attributes[:trigger] = value end |
#trigger_evaluation(params = {}) ⇒ Object
Manually open an Expectation window
248 249 250 251 252 253 254 255 256 |
# File 'lib/files.com/models/expectation.rb', line 248 def trigger_evaluation(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("/expectations/#{@attributes[:id]}/trigger_evaluation", :post, params, @options) end |
#update(params = {}) ⇒ Object
Parameters:
name - string - Expectation name.
description - string - Expectation description.
path - string - Path scope for the expectation. Supports workspace-relative presentation.
source - string - Source glob used to select candidate files.
exclude_pattern - string - Optional source exclusion glob.
disabled - boolean - If true, the expectation is disabled.
trigger - string - How this expectation opens windows.
interval - string - If trigger is `daily`, this specifies how often to run the expectation.
recurring_day - int64 - If trigger is `daily`, this selects the day number inside the chosen interval.
schedule_days_of_week - array(int64) - If trigger is `custom_schedule`, the 0-based weekdays used by the schedule.
schedule_times_of_day - array(string) - Times of day in HH:MM format for schedule-driven expectations.
schedule_time_zone - string - Time zone used by the expectation schedule.
holiday_region - string - Optional holiday region used by schedule-driven expectations.
lookback_interval - int64 - How many seconds before the due boundary the window starts.
late_acceptance_interval - int64 - How many seconds a schedule-driven window may remain eligible to close as late.
inactivity_interval - int64 - How many quiet seconds are required before final closure.
max_open_interval - int64 - Hard-stop duration in seconds for unscheduled expectations.
criteria - object - Structured criteria v1 definition for the expectation.
workspace_id - int64 - Workspace ID. `0` means the default workspace.
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 |
# File 'lib/files.com/models/expectation.rb', line 278 def update(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: name must be an String") if params[:name] and !params[:name].is_a?(String) raise InvalidParameterError.new("Bad parameter: description must be an String") if params[:description] and !params[:description].is_a?(String) raise InvalidParameterError.new("Bad parameter: path must be an String") if params[:path] and !params[:path].is_a?(String) raise InvalidParameterError.new("Bad parameter: source must be an String") if params[:source] and !params[:source].is_a?(String) raise InvalidParameterError.new("Bad parameter: exclude_pattern must be an String") if params[:exclude_pattern] and !params[:exclude_pattern].is_a?(String) raise InvalidParameterError.new("Bad parameter: trigger must be an String") if params[:trigger] and !params[:trigger].is_a?(String) raise InvalidParameterError.new("Bad parameter: interval must be an String") if params[:interval] and !params[:interval].is_a?(String) raise InvalidParameterError.new("Bad parameter: recurring_day must be an Integer") if params[:recurring_day] and !params[:recurring_day].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: schedule_days_of_week must be an Array") if params[:schedule_days_of_week] and !params[:schedule_days_of_week].is_a?(Array) raise InvalidParameterError.new("Bad parameter: schedule_times_of_day must be an Array") if params[:schedule_times_of_day] and !params[:schedule_times_of_day].is_a?(Array) raise InvalidParameterError.new("Bad parameter: schedule_time_zone must be an String") if params[:schedule_time_zone] and !params[:schedule_time_zone].is_a?(String) raise InvalidParameterError.new("Bad parameter: holiday_region must be an String") if params[:holiday_region] and !params[:holiday_region].is_a?(String) raise InvalidParameterError.new("Bad parameter: lookback_interval must be an Integer") if params[:lookback_interval] and !params[:lookback_interval].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: late_acceptance_interval must be an Integer") if params[:late_acceptance_interval] and !params[:late_acceptance_interval].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: inactivity_interval must be an Integer") if params[:inactivity_interval] and !params[:inactivity_interval].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: max_open_interval must be an Integer") if params[:max_open_interval] and !params[:max_open_interval].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] Api.send_request("/expectations/#{@attributes[:id]}", :patch, params, @options) end |
#updated_at ⇒ Object
date-time - Last update time.
243 244 245 |
# File 'lib/files.com/models/expectation.rb', line 243 def updated_at @attributes[:updated_at] end |
#workspace_id ⇒ Object
int64 - Workspace ID. ‘0` means the default workspace.
22 23 24 |
# File 'lib/files.com/models/expectation.rb', line 22 def workspace_id @attributes[:workspace_id] end |
#workspace_id=(value) ⇒ Object
26 27 28 |
# File 'lib/files.com/models/expectation.rb', line 26 def workspace_id=(value) @attributes[:workspace_id] = value end |