Class: Zippendo::ListOrgWebhookDeliveries200ResponseDataInner

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ ListOrgWebhookDeliveries200ResponseDataInner

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
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
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 108

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Zippendo::ListOrgWebhookDeliveries200ResponseDataInner` 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 `Zippendo::ListOrgWebhookDeliveries200ResponseDataInner`. 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']
  else
    self.id = nil
  end

  if attributes.key?(:'webhook_id')
    self.webhook_id = attributes[:'webhook_id']
  else
    self.webhook_id = nil
  end

  if attributes.key?(:'event')
    self.event = attributes[:'event']
  else
    self.event = nil
  end

  if attributes.key?(:'payload')
    self.payload = attributes[:'payload']
  else
    self.payload = nil
  end

  if attributes.key?(:'status_code')
    self.status_code = attributes[:'status_code']
  else
    self.status_code = nil
  end

  if attributes.key?(:'response')
    self.response = attributes[:'response']
  else
    self.response = nil
  end

  if attributes.key?(:'duration')
    self.duration = attributes[:'duration']
  else
    self.duration = nil
  end

  if attributes.key?(:'success')
    self.success = attributes[:'success']
  else
    self.success = nil
  end

  if attributes.key?(:'attempt')
    self.attempt = attributes[:'attempt']
  else
    self.attempt = nil
  end

  if attributes.key?(:'error')
    self.error = attributes[:'error']
  else
    self.error = nil
  end

  if attributes.key?(:'created_at')
    self.created_at = attributes[:'created_at']
  else
    self.created_at = nil
  end
end

Instance Attribute Details

#attemptObject

Delivery attempt number



43
44
45
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 43

def attempt
  @attempt
end

#created_atObject

Delivery timestamp (ISO 8601)



49
50
51
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 49

def created_at
  @created_at
end

#durationObject

Request duration in milliseconds



37
38
39
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 37

def duration
  @duration
end

#errorObject

Error message if the delivery failed



46
47
48
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 46

def error
  @error
end

#eventObject

Event type that was delivered



25
26
27
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 25

def event
  @event
end

#idObject

Delivery log ID



19
20
21
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 19

def id
  @id
end

#payloadObject

JSON payload that was sent



28
29
30
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 28

def payload
  @payload
end

#responseObject

Response body returned by the endpoint



34
35
36
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 34

def response
  @response
end

#status_codeObject

HTTP status code returned by the endpoint



31
32
33
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 31

def status_code
  @status_code
end

#successObject

Whether the delivery succeeded



40
41
42
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 40

def success
  @success
end

#webhook_idObject

ID of the webhook this delivery belongs to



22
23
24
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 22

def webhook_id
  @webhook_id
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



69
70
71
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 69

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



74
75
76
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 74

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 52

def self.attribute_map
  {
    :'id' => :'id',
    :'webhook_id' => :'webhookId',
    :'event' => :'event',
    :'payload' => :'payload',
    :'status_code' => :'statusCode',
    :'response' => :'response',
    :'duration' => :'duration',
    :'success' => :'success',
    :'attempt' => :'attempt',
    :'error' => :'error',
    :'created_at' => :'createdAt'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 327

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_nullableObject

List of attributes with nullable: true



96
97
98
99
100
101
102
103
104
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 96

def self.openapi_nullable
  Set.new([
    :'payload',
    :'status_code',
    :'response',
    :'duration',
    :'error',
  ])
end

.openapi_typesObject

Attribute type mapping.



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 79

def self.openapi_types
  {
    :'id' => :'String',
    :'webhook_id' => :'String',
    :'event' => :'String',
    :'payload' => :'Object',
    :'status_code' => :'Float',
    :'response' => :'String',
    :'duration' => :'Float',
    :'success' => :'Boolean',
    :'attempt' => :'Float',
    :'error' => :'String',
    :'created_at' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 296

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      webhook_id == o.webhook_id &&
      event == o.event &&
      payload == o.payload &&
      status_code == o.status_code &&
      response == o.response &&
      duration == o.duration &&
      success == o.success &&
      attempt == o.attempt &&
      error == o.error &&
      created_at == o.created_at
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


314
315
316
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 314

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



320
321
322
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 320

def hash
  [id, webhook_id, event, payload, status_code, response, duration, success, attempt, error, created_at].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 191

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @id.nil?
    invalid_properties.push('invalid value for "id", id cannot be nil.')
  end

  if @webhook_id.nil?
    invalid_properties.push('invalid value for "webhook_id", webhook_id cannot be nil.')
  end

  if @event.nil?
    invalid_properties.push('invalid value for "event", event cannot be nil.')
  end

  if @success.nil?
    invalid_properties.push('invalid value for "success", success cannot be nil.')
  end

  if @attempt.nil?
    invalid_properties.push('invalid value for "attempt", attempt cannot be nil.')
  end

  if @created_at.nil?
    invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 349

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

Returns:

  • (Boolean)

    true if the model is valid



223
224
225
226
227
228
229
230
231
232
# File 'lib/zippendo/models/list_org_webhook_deliveries200_response_data_inner.rb', line 223

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @id.nil?
  return false if @webhook_id.nil?
  return false if @event.nil?
  return false if @success.nil?
  return false if @attempt.nil?
  return false if @created_at.nil?
  true
end