Class: Late::WebhookLog
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Late::WebhookLog
- Defined in:
- lib/late-sdk/models/webhook_log.rb
Overview
Webhook delivery log entry
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#_id ⇒ Object
Returns the value of attribute _id.
-
#attempt_number ⇒ Object
Delivery attempt number (max 3 retries).
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#error_message ⇒ Object
Error message if delivery failed.
-
#event ⇒ Object
Returns the value of attribute event.
-
#request_payload ⇒ Object
Payload sent to webhook endpoint.
-
#response_body ⇒ Object
Response body from webhook endpoint (truncated to 10KB).
-
#response_time ⇒ Object
Response time in milliseconds.
-
#status ⇒ Object
Returns the value of attribute status.
-
#status_code ⇒ Object
HTTP status code from webhook endpoint.
-
#url ⇒ Object
Returns the value of attribute url.
-
#webhook_id ⇒ Object
ID of the webhook that was triggered.
-
#webhook_name ⇒ Object
Name of the webhook that was triggered.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ WebhookLog
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ WebhookLog
Initializes the object
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
# File 'lib/late-sdk/models/webhook_log.rb', line 131 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Late::WebhookLog` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Late::WebhookLog`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'_id') self._id = attributes[:'_id'] end if attributes.key?(:'webhook_id') self.webhook_id = attributes[:'webhook_id'] end if attributes.key?(:'webhook_name') self.webhook_name = attributes[:'webhook_name'] end if attributes.key?(:'event') self.event = attributes[:'event'] end if attributes.key?(:'url') self.url = attributes[:'url'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'status_code') self.status_code = attributes[:'status_code'] end if attributes.key?(:'request_payload') self.request_payload = attributes[:'request_payload'] end if attributes.key?(:'response_body') self.response_body = attributes[:'response_body'] end if attributes.key?(:'error_message') self. = attributes[:'error_message'] end if attributes.key?(:'attempt_number') self.attempt_number = attributes[:'attempt_number'] end if attributes.key?(:'response_time') self.response_time = attributes[:'response_time'] end if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] end end |
Instance Attribute Details
#_id ⇒ Object
Returns the value of attribute _id.
19 20 21 |
# File 'lib/late-sdk/models/webhook_log.rb', line 19 def _id @_id end |
#attempt_number ⇒ Object
Delivery attempt number (max 3 retries)
46 47 48 |
# File 'lib/late-sdk/models/webhook_log.rb', line 46 def attempt_number @attempt_number end |
#created_at ⇒ Object
Returns the value of attribute created_at.
51 52 53 |
# File 'lib/late-sdk/models/webhook_log.rb', line 51 def created_at @created_at end |
#error_message ⇒ Object
Error message if delivery failed
43 44 45 |
# File 'lib/late-sdk/models/webhook_log.rb', line 43 def @error_message end |
#event ⇒ Object
Returns the value of attribute event.
27 28 29 |
# File 'lib/late-sdk/models/webhook_log.rb', line 27 def event @event end |
#request_payload ⇒ Object
Payload sent to webhook endpoint
37 38 39 |
# File 'lib/late-sdk/models/webhook_log.rb', line 37 def request_payload @request_payload end |
#response_body ⇒ Object
Response body from webhook endpoint (truncated to 10KB)
40 41 42 |
# File 'lib/late-sdk/models/webhook_log.rb', line 40 def response_body @response_body end |
#response_time ⇒ Object
Response time in milliseconds
49 50 51 |
# File 'lib/late-sdk/models/webhook_log.rb', line 49 def response_time @response_time end |
#status ⇒ Object
Returns the value of attribute status.
31 32 33 |
# File 'lib/late-sdk/models/webhook_log.rb', line 31 def status @status end |
#status_code ⇒ Object
HTTP status code from webhook endpoint
34 35 36 |
# File 'lib/late-sdk/models/webhook_log.rb', line 34 def status_code @status_code end |
#url ⇒ Object
Returns the value of attribute url.
29 30 31 |
# File 'lib/late-sdk/models/webhook_log.rb', line 29 def url @url end |
#webhook_id ⇒ Object
ID of the webhook that was triggered
22 23 24 |
# File 'lib/late-sdk/models/webhook_log.rb', line 22 def webhook_id @webhook_id end |
#webhook_name ⇒ Object
Name of the webhook that was triggered
25 26 27 |
# File 'lib/late-sdk/models/webhook_log.rb', line 25 def webhook_name @webhook_name end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
95 96 97 |
# File 'lib/late-sdk/models/webhook_log.rb', line 95 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
100 101 102 |
# File 'lib/late-sdk/models/webhook_log.rb', line 100 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/late-sdk/models/webhook_log.rb', line 76 def self.attribute_map { :'_id' => :'_id', :'webhook_id' => :'webhookId', :'webhook_name' => :'webhookName', :'event' => :'event', :'url' => :'url', :'status' => :'status', :'status_code' => :'statusCode', :'request_payload' => :'requestPayload', :'response_body' => :'responseBody', :'error_message' => :'errorMessage', :'attempt_number' => :'attemptNumber', :'response_time' => :'responseTime', :'created_at' => :'createdAt' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 |
# File 'lib/late-sdk/models/webhook_log.rb', line 272 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
124 125 126 127 |
# File 'lib/late-sdk/models/webhook_log.rb', line 124 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/late-sdk/models/webhook_log.rb', line 105 def self.openapi_types { :'_id' => :'String', :'webhook_id' => :'String', :'webhook_name' => :'String', :'event' => :'String', :'url' => :'String', :'status' => :'String', :'status_code' => :'Integer', :'request_payload' => :'Object', :'response_body' => :'String', :'error_message' => :'String', :'attempt_number' => :'Integer', :'response_time' => :'Integer', :'created_at' => :'Time' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/late-sdk/models/webhook_log.rb', line 239 def ==(o) return true if self.equal?(o) self.class == o.class && _id == o._id && webhook_id == o.webhook_id && webhook_name == o.webhook_name && event == o.event && url == o.url && status == o.status && status_code == o.status_code && request_payload == o.request_payload && response_body == o.response_body && == o. && attempt_number == o.attempt_number && response_time == o.response_time && created_at == o.created_at end |
#eql?(o) ⇒ Boolean
259 260 261 |
# File 'lib/late-sdk/models/webhook_log.rb', line 259 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
265 266 267 |
# File 'lib/late-sdk/models/webhook_log.rb', line 265 def hash [_id, webhook_id, webhook_name, event, url, status, status_code, request_payload, response_body, , attempt_number, response_time, created_at].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
200 201 202 203 204 |
# File 'lib/late-sdk/models/webhook_log.rb', line 200 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/late-sdk/models/webhook_log.rb', line 294 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
208 209 210 211 212 213 214 215 |
# File 'lib/late-sdk/models/webhook_log.rb', line 208 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' event_validator = EnumAttributeValidator.new('String', ["post.scheduled", "post.published", "post.failed", "post.partial", "post.cancelled", "post.recycled", "account.connected", "account.disconnected", "message.received", "message.sent", "comment.received", "webhook.test"]) return false unless event_validator.valid?(@event) status_validator = EnumAttributeValidator.new('String', ["success", "failed"]) return false unless status_validator.valid?(@status) true end |