Class: ApolloDeploySignalSdk::CreateContactPropertyBody

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

Overview

Schema type: CreateContactPropertyBody

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key:, type:, fallback_value: nil) ⇒ CreateContactPropertyBody

Returns a new instance of CreateContactPropertyBody.

Parameters:

  • key (String)

    , type [String], fallback_value [String, nil]



2464
2465
2466
2467
2468
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2464

def initialize(key: , type: , fallback_value: nil)
  @key = key
  @type = type
  @fallback_value = fallback_value
end

Instance Attribute Details

#fallback_valueString?

Returns:

  • (String, nil)


2461
2462
2463
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2461

def fallback_value
  @fallback_value
end

#keyString

Returns:

  • (String)


2457
2458
2459
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2457

def key
  @key
end

#typeString

Returns:

  • (String)


2459
2460
2461
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2459

def type
  @type
end

Class Method Details

.from_json(attributes) ⇒ CreateContactPropertyBody

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



2482
2483
2484
2485
2486
2487
2488
2489
2490
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2482

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

  new(
    key: attributes.key?("key") ? attributes["key"] : attributes[:key],
    type: attributes.key?("type") ? attributes["type"] : attributes[:type],
    fallback_value: attributes.key?("fallbackValue") ? attributes["fallbackValue"] : attributes[:fallback_value],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



2471
2472
2473
2474
2475
2476
2477
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2471

def to_h
  {
    key: @key,
    type: @type,
    fallback_value: @fallback_value,
  }.compact
end