Class: ApolloDeploySignalSdk::BatchSendItemResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/apollo_deploy_signal_sdk/types.rb

Overview

Schema type: BatchSendItemResponse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index:, id: nil, message_id: nil, status: nil, created_at: nil, scheduled_at: nil, error: nil) ⇒ BatchSendItemResponse

Returns a new instance of BatchSendItemResponse.

Parameters:

  • index (Integer)

    , id [String, nil], message_id [String, nil], status [String, nil], created_at [String, nil], scheduled_at [String, nil], error [String, nil]



258
259
260
261
262
263
264
265
266
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 258

def initialize(index: , id: nil, message_id: nil, status: nil, created_at: nil, scheduled_at: nil, error: nil)
  @index = index
  @id = id
  @message_id = message_id
  @status = status
  @created_at = created_at
  @scheduled_at = scheduled_at
  @error = error
end

Instance Attribute Details

#created_atString?

Returns:

  • (String, nil)


251
252
253
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 251

def created_at
  @created_at
end

#errorString?

Returns:

  • (String, nil)


255
256
257
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 255

def error
  @error
end

#idString?

Returns:

  • (String, nil)


245
246
247
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 245

def id
  @id
end

#indexInteger

Returns:

  • (Integer)


243
244
245
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 243

def index
  @index
end

#message_idString?

Returns:

  • (String, nil)


247
248
249
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 247

def message_id
  @message_id
end

#scheduled_atString?

Returns:

  • (String, nil)


253
254
255
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 253

def scheduled_at
  @scheduled_at
end

#statusString?

Returns:

  • (String, nil)


249
250
251
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 249

def status
  @status
end

Class Method Details

.from_json(attributes) ⇒ BatchSendItemResponse

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



284
285
286
287
288
289
290
291
292
293
294
295
296
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 284

def self.from_json(attributes)
  return nil unless attributes.is_a?(Hash)

  new(
    index: attributes.key?("index") ? attributes["index"] : attributes[:index],
    id: attributes.key?("id") ? attributes["id"] : attributes[:id],
    message_id: attributes.key?("messageId") ? attributes["messageId"] : attributes[:message_id],
    status: attributes.key?("status") ? attributes["status"] : attributes[:status],
    created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at],
    scheduled_at: attributes.key?("scheduledAt") ? attributes["scheduledAt"] : attributes[:scheduled_at],
    error: attributes.key?("error") ? attributes["error"] : attributes[:error],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



269
270
271
272
273
274
275
276
277
278
279
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 269

def to_h
  {
    index: @index,
    id: @id,
    message_id: @message_id,
    status: @status,
    created_at: @created_at,
    scheduled_at: @scheduled_at,
    error: @error,
  }.compact
end