Class: Files::EventDeliveryAttempt
- Inherits:
-
Object
- Object
- Files::EventDeliveryAttempt
- Defined in:
- lib/files.com/models/event_delivery_attempt.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
-
.find(id, params = {}, options = {}) ⇒ Object
Parameters: id (required) - int64 - Event Delivery Attempt ID.
- .get(id, params = {}, options = {}) ⇒ Object
-
.list(params = {}, options = {}) ⇒ Object
Parameters: cursor - string - Used for pagination.
Instance Method Summary collapse
-
#attempt_number ⇒ Object
int64 - Number of delivery attempts made.
-
#created_at ⇒ Object
date-time - Delivery Attempt create date/time.
-
#delivered_at ⇒ Object
date-time - Successful delivery date/time.
-
#error_message ⇒ Object
string - Delivery error message, if applicable.
-
#event_record_id ⇒ Object
int64 - Event Record ID.
-
#event_subscription_id ⇒ Object
int64 - Event Subscription ID.
-
#event_target_id ⇒ Object
int64 - Event Target ID.
-
#id ⇒ Object
int64 - Event Delivery Attempt ID.
-
#initialize(attributes = {}, options = {}) ⇒ EventDeliveryAttempt
constructor
A new instance of EventDeliveryAttempt.
-
#last_attempted_at ⇒ Object
date-time - Most recent attempt date/time.
-
#latency_ms ⇒ Object
int64 - Delivery latency in milliseconds.
-
#next_attempt_at ⇒ Object
date-time - Next scheduled attempt date/time.
-
#response_body ⇒ Object
string - Delivery response body, if applicable.
-
#response_code ⇒ Object
int64 - HTTP response code, if applicable.
-
#status ⇒ Object
string - Delivery status.
-
#workspace_id ⇒ Object
int64 - Workspace ID.
Constructor Details
#initialize(attributes = {}, options = {}) ⇒ EventDeliveryAttempt
Returns a new instance of EventDeliveryAttempt.
7 8 9 10 |
# File 'lib/files.com/models/event_delivery_attempt.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/event_delivery_attempt.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/event_delivery_attempt.rb', line 5 def @options end |
Class Method Details
.all(params = {}, options = {}) ⇒ Object
103 104 105 |
# File 'lib/files.com/models/event_delivery_attempt.rb', line 103 def self.all(params = {}, = {}) list(params, ) end |
.find(id, params = {}, options = {}) ⇒ Object
Parameters:
id (required) - int64 - Event Delivery Attempt ID.
109 110 111 112 113 114 115 116 117 |
# File 'lib/files.com/models/event_delivery_attempt.rb', line 109 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("/event_delivery_attempts/#{params[:id]}", :get, params, ) EventDeliveryAttempt.new(response.data, ) end |
.get(id, params = {}, options = {}) ⇒ Object
119 120 121 |
# File 'lib/files.com/models/event_delivery_attempt.rb', line 119 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 `status`, `event_record_id`, `event_target_id` or `workspace_id`.
filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `status`, `workspace_id`, `event_record_id` or `event_target_id`. Valid field combinations are `[ workspace_id, status ]`, `[ workspace_id, event_record_id ]` or `[ workspace_id, event_target_id ]`.
92 93 94 95 96 97 98 99 100 101 |
# File 'lib/files.com/models/event_delivery_attempt.rb', line 92 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(EventDeliveryAttempt, params) do Api.send_request("/event_delivery_attempts", :get, params, ) end end |
Instance Method Details
#attempt_number ⇒ Object
int64 - Number of delivery attempts made.
43 44 45 |
# File 'lib/files.com/models/event_delivery_attempt.rb', line 43 def attempt_number @attributes[:attempt_number] end |
#created_at ⇒ Object
date-time - Delivery Attempt create date/time.
83 84 85 |
# File 'lib/files.com/models/event_delivery_attempt.rb', line 83 def created_at @attributes[:created_at] end |
#delivered_at ⇒ Object
date-time - Successful delivery date/time.
68 69 70 |
# File 'lib/files.com/models/event_delivery_attempt.rb', line 68 def delivered_at @attributes[:delivered_at] end |
#error_message ⇒ Object
string - Delivery error message, if applicable.
53 54 55 |
# File 'lib/files.com/models/event_delivery_attempt.rb', line 53 def @attributes[:error_message] end |
#event_record_id ⇒ Object
int64 - Event Record ID
18 19 20 |
# File 'lib/files.com/models/event_delivery_attempt.rb', line 18 def event_record_id @attributes[:event_record_id] end |
#event_subscription_id ⇒ Object
int64 - Event Subscription ID
23 24 25 |
# File 'lib/files.com/models/event_delivery_attempt.rb', line 23 def event_subscription_id @attributes[:event_subscription_id] end |
#event_target_id ⇒ Object
int64 - Event Target ID
28 29 30 |
# File 'lib/files.com/models/event_delivery_attempt.rb', line 28 def event_target_id @attributes[:event_target_id] end |
#id ⇒ Object
int64 - Event Delivery Attempt ID
13 14 15 |
# File 'lib/files.com/models/event_delivery_attempt.rb', line 13 def id @attributes[:id] end |
#last_attempted_at ⇒ Object
date-time - Most recent attempt date/time.
73 74 75 |
# File 'lib/files.com/models/event_delivery_attempt.rb', line 73 def last_attempted_at @attributes[:last_attempted_at] end |
#latency_ms ⇒ Object
int64 - Delivery latency in milliseconds.
63 64 65 |
# File 'lib/files.com/models/event_delivery_attempt.rb', line 63 def latency_ms @attributes[:latency_ms] end |
#next_attempt_at ⇒ Object
date-time - Next scheduled attempt date/time.
78 79 80 |
# File 'lib/files.com/models/event_delivery_attempt.rb', line 78 def next_attempt_at @attributes[:next_attempt_at] end |
#response_body ⇒ Object
string - Delivery response body, if applicable.
58 59 60 |
# File 'lib/files.com/models/event_delivery_attempt.rb', line 58 def response_body @attributes[:response_body] end |
#response_code ⇒ Object
int64 - HTTP response code, if applicable.
48 49 50 |
# File 'lib/files.com/models/event_delivery_attempt.rb', line 48 def response_code @attributes[:response_code] end |
#status ⇒ Object
string - Delivery status.
38 39 40 |
# File 'lib/files.com/models/event_delivery_attempt.rb', line 38 def status @attributes[:status] end |
#workspace_id ⇒ Object
int64 - Workspace ID. 0 means the default workspace or site-wide.
33 34 35 |
# File 'lib/files.com/models/event_delivery_attempt.rb', line 33 def workspace_id @attributes[:workspace_id] end |