Class: ApolloDeploySignalSdkRails::ContactResponse

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

Overview

Schema type: ContactResponse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object: nil, id:, email:, phone: nil, first_name:, last_name:, unsubscribed:, properties:, profile_image_url:, project_id:, segments:, topics:, created_at:, updated_at:) ⇒ ContactResponse

Returns a new instance of ContactResponse.

Parameters:

  • object (String) (defaults to: nil)

    , id [String], email [String], phone [String, nil], first_name [String, nil], last_name [String, nil], unsubscribed [Boolean], properties [Hash=> String], profile_image_url [String, nil], project_id [String], segments [Array], topics [Array], created_at [String], updated_at [String]



2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2588

def initialize(object: nil, id: , email: , phone: nil, first_name: , last_name: , unsubscribed: , properties: , profile_image_url: , project_id: , segments: , topics: , created_at: , updated_at: )
  @object = object
  @id = id
  @email = email
  @phone = phone
  @first_name = first_name
  @last_name = last_name
  @unsubscribed = unsubscribed
  @properties = properties
  @profile_image_url = profile_image_url
  @project_id = project_id
  @segments = segments
  @topics = topics
  @created_at = created_at
  @updated_at = updated_at
end

Instance Attribute Details

#created_atString

Returns:

  • (String)


2583
2584
2585
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2583

def created_at
  @created_at
end

#emailString

Returns:

  • (String)


2563
2564
2565
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2563

def email
  @email
end

#first_nameString?

Returns:

  • (String, nil)


2567
2568
2569
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2567

def first_name
  @first_name
end

#idString

Returns:

  • (String)


2561
2562
2563
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2561

def id
  @id
end

#last_nameString?

Returns:

  • (String, nil)


2569
2570
2571
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2569

def last_name
  @last_name
end

#objectString

Returns:

  • (String)


2559
2560
2561
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2559

def object
  @object
end

#phoneString?

Returns:

  • (String, nil)


2565
2566
2567
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2565

def phone
  @phone
end

#profile_image_urlString?

Returns:

  • (String, nil)


2575
2576
2577
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2575

def profile_image_url
  @profile_image_url
end

#project_idString

Returns:

  • (String)


2577
2578
2579
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2577

def project_id
  @project_id
end

#propertiesHash{String => String}

Returns:

  • (Hash{String => String})


2573
2574
2575
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2573

def properties
  @properties
end

#segmentsArray<String>

Returns:

  • (Array<String>)


2579
2580
2581
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2579

def segments
  @segments
end

#topicsArray<TopicSubscriptionResponse>

Returns:



2581
2582
2583
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2581

def topics
  @topics
end

#unsubscribedBoolean

Returns:

  • (Boolean)


2571
2572
2573
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2571

def unsubscribed
  @unsubscribed
end

#updated_atString

Returns:

  • (String)


2585
2586
2587
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2585

def updated_at
  @updated_at
end

Class Method Details

.from_json(attributes) ⇒ ContactResponse

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2628

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],
    email: attributes.key?("email") ? attributes["email"] : attributes[:email],
    phone: attributes.key?("phone") ? attributes["phone"] : attributes[:phone],
    first_name: attributes.key?("firstName") ? attributes["firstName"] : attributes[:first_name],
    last_name: attributes.key?("lastName") ? attributes["lastName"] : attributes[:last_name],
    unsubscribed: attributes.key?("unsubscribed") ? attributes["unsubscribed"] : attributes[:unsubscribed],
    properties: attributes.key?("properties") ? attributes["properties"] : attributes[:properties],
    profile_image_url: attributes.key?("profileImageUrl") ? attributes["profileImageUrl"] : attributes[:profile_image_url],
    project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
    segments: attributes.key?("segments") ? attributes["segments"] : attributes[:segments],
    topics: attributes.key?("topics") ? attributes["topics"] : attributes[:topics],
    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



2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2606

def to_h
  {
    object: @object,
    id: @id,
    email: @email,
    phone: @phone,
    first_name: @first_name,
    last_name: @last_name,
    unsubscribed: @unsubscribed,
    properties: @properties,
    profile_image_url: @profile_image_url,
    project_id: @project_id,
    segments: @segments,
    topics: @topics,
    created_at: @created_at,
    updated_at: @updated_at,
  }.compact
end