Class: ApolloDeploySignalSdkRails::EmailTimelineItem

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

Overview

Schema type: EmailTimelineItem

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, type:, provider_event_id:, payload:, occurred_at:, created_at:) ⇒ EmailTimelineItem

Returns a new instance of EmailTimelineItem.

Parameters:

  • id (String)

    , type [String], provider_event_id [String, nil], payload [Hash=> String, nil], occurred_at [String], created_at [String]



4234
4235
4236
4237
4238
4239
4240
4241
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4234

def initialize(id: , type: , provider_event_id: , payload: , occurred_at: , created_at: )
  @id = id
  @type = type
  @provider_event_id = provider_event_id
  @payload = payload
  @occurred_at = occurred_at
  @created_at = created_at
end

Instance Attribute Details

#created_atString

Returns:

  • (String)


4231
4232
4233
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4231

def created_at
  @created_at
end

#idString

Returns:

  • (String)


4221
4222
4223
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4221

def id
  @id
end

#occurred_atString

Returns:

  • (String)


4229
4230
4231
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4229

def occurred_at
  @occurred_at
end

#payloadHash{String => String, nil}

Returns:

  • (Hash{String => String, nil})


4227
4228
4229
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4227

def payload
  @payload
end

#provider_event_idString?

Returns:

  • (String, nil)


4225
4226
4227
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4225

def provider_event_id
  @provider_event_id
end

#typeString

Returns:

  • (String)


4223
4224
4225
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4223

def type
  @type
end

Class Method Details

.from_json(attributes) ⇒ EmailTimelineItem

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4258

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

  new(
    id: attributes.key?("id") ? attributes["id"] : attributes[:id],
    type: attributes.key?("type") ? attributes["type"] : attributes[:type],
    provider_event_id: attributes.key?("providerEventId") ? attributes["providerEventId"] : attributes[:provider_event_id],
    payload: attributes.key?("payload") ? attributes["payload"] : attributes[:payload],
    occurred_at: attributes.key?("occurredAt") ? attributes["occurredAt"] : attributes[:occurred_at],
    created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4244

def to_h
  {
    id: @id,
    type: @type,
    provider_event_id: @provider_event_id,
    payload: @payload,
    occurred_at: @occurred_at,
    created_at: @created_at,
  }.compact
end