Class: ApolloDeploySignalSdkRails::ActivityResponse

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

Overview

Schema type: ActivityResponse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object: nil, id:, type:, reference_id: nil, reference_name: nil, metadata: nil, occurred_at:) ⇒ ActivityResponse

Returns a new instance of ActivityResponse.

Parameters:

  • object (String) (defaults to: nil)

    , id [String], type [String], reference_id [String, nil], reference_name [String, nil], metadata [ActivityMetadataResponse, nil], occurred_at [String]



2994
2995
2996
2997
2998
2999
3000
3001
3002
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2994

def initialize(object: nil, id: , type: , reference_id: nil, reference_name: nil, metadata: nil, occurred_at: )
  @object = object
  @id = id
  @type = type
  @reference_id = reference_id
  @reference_name = reference_name
  @metadata = 
  @occurred_at = occurred_at
end

Instance Attribute Details

#idString

Returns:

  • (String)


2981
2982
2983
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2981

def id
  @id
end

#metadataActivityMetadataResponse?

Returns:



2989
2990
2991
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2989

def 
  @metadata
end

#objectString

Returns:

  • (String)


2979
2980
2981
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2979

def object
  @object
end

#occurred_atString

Returns:

  • (String)


2991
2992
2993
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2991

def occurred_at
  @occurred_at
end

#reference_idString?

Returns:

  • (String, nil)


2985
2986
2987
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2985

def reference_id
  @reference_id
end

#reference_nameString?

Returns:

  • (String, nil)


2987
2988
2989
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2987

def reference_name
  @reference_name
end

#typeString

Returns:

  • (String)


2983
2984
2985
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2983

def type
  @type
end

Class Method Details

.from_json(attributes) ⇒ ActivityResponse

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3020

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

  new(
    object: attributes.key?("object") ? attributes["object"] : attributes[:object],
    id: attributes.key?("id") ? attributes["id"] : attributes[:id],
    type: attributes.key?("type") ? attributes["type"] : attributes[:type],
    reference_id: attributes.key?("referenceId") ? attributes["referenceId"] : attributes[:reference_id],
    reference_name: attributes.key?("referenceName") ? attributes["referenceName"] : attributes[:reference_name],
    metadata: attributes.key?("metadata") ? attributes["metadata"] : attributes[:metadata],
    occurred_at: attributes.key?("occurredAt") ? attributes["occurredAt"] : attributes[:occurred_at],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3005

def to_h
  {
    object: @object,
    id: @id,
    type: @type,
    reference_id: @reference_id,
    reference_name: @reference_name,
    metadata: @metadata,
    occurred_at: @occurred_at,
  }.compact
end