Class: ApolloDeploySignalSdk::ContactPropertyResponse

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

Overview

Schema type: ContactPropertyResponse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object: nil, id:, key:, type:, fallback_value:, project_id:, created_at:, updated_at:) ⇒ ContactPropertyResponse

Returns a new instance of ContactPropertyResponse.

Parameters:

  • object (String) (defaults to: nil)

    , id [String], key [String], type [String], fallback_value [String, nil], project_id [String], created_at [String], updated_at [String]



2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2376

def initialize(object: nil, id: , key: , type: , fallback_value: , project_id: , created_at: , updated_at: )
  @object = object
  @id = id
  @key = key
  @type = type
  @fallback_value = fallback_value
  @project_id = project_id
  @created_at = created_at
  @updated_at = updated_at
end

Instance Attribute Details

#created_atString

Returns:

  • (String)


2371
2372
2373
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2371

def created_at
  @created_at
end

#fallback_valueString?

Returns:

  • (String, nil)


2367
2368
2369
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2367

def fallback_value
  @fallback_value
end

#idString

Returns:

  • (String)


2361
2362
2363
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2361

def id
  @id
end

#keyString

Returns:

  • (String)


2363
2364
2365
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2363

def key
  @key
end

#objectString

Returns:

  • (String)


2359
2360
2361
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2359

def object
  @object
end

#project_idString

Returns:

  • (String)


2369
2370
2371
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2369

def project_id
  @project_id
end

#typeString

Returns:

  • (String)


2365
2366
2367
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2365

def type
  @type
end

#updated_atString

Returns:

  • (String)


2373
2374
2375
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2373

def updated_at
  @updated_at
end

Class Method Details

.from_json(attributes) ⇒ ContactPropertyResponse

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2404

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],
    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],
    project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
    created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at],
    updated_at: attributes.key?("updatedAt") ? attributes["updatedAt"] : attributes[:updated_at],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2388

def to_h
  {
    object: @object,
    id: @id,
    key: @key,
    type: @type,
    fallback_value: @fallback_value,
    project_id: @project_id,
    created_at: @created_at,
    updated_at: @updated_at,
  }.compact
end