Class: ApolloDeploySignalSdkRails::ContactResponse
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdkRails::ContactResponse
- Defined in:
- lib/apollo_deploy_signal_sdk_rails/types.rb
Overview
Schema type: ContactResponse
Instance Attribute Summary collapse
- #created_at ⇒ String
- #email ⇒ String
- #first_name ⇒ String?
- #id ⇒ String
- #last_name ⇒ String?
- #object ⇒ String
- #phone ⇒ String?
- #profile_image_url ⇒ String?
- #project_id ⇒ String
- #properties ⇒ Hash{String => String}
- #segments ⇒ Array<String>
- #topics ⇒ Array<TopicSubscriptionResponse>
- #unsubscribed ⇒ Boolean
- #updated_at ⇒ String
Class Method Summary collapse
-
.from_json(attributes) ⇒ ContactResponse
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#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
constructor
A new instance of ContactResponse.
-
#to_h ⇒ Hash
A hash representation of this object.
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.
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_at ⇒ String
2583 2584 2585 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2583 def created_at @created_at end |
#email ⇒ String
2563 2564 2565 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2563 def email @email end |
#first_name ⇒ String?
2567 2568 2569 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2567 def first_name @first_name end |
#id ⇒ String
2561 2562 2563 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2561 def id @id end |
#last_name ⇒ String?
2569 2570 2571 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2569 def last_name @last_name end |
#object ⇒ String
2559 2560 2561 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2559 def object @object end |
#phone ⇒ String?
2565 2566 2567 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2565 def phone @phone end |
#profile_image_url ⇒ String?
2575 2576 2577 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2575 def profile_image_url @profile_image_url end |
#project_id ⇒ String
2577 2578 2579 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2577 def project_id @project_id end |
#properties ⇒ Hash{String => String}
2573 2574 2575 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2573 def properties @properties end |
#segments ⇒ Array<String>
2579 2580 2581 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2579 def segments @segments end |
#topics ⇒ Array<TopicSubscriptionResponse>
2581 2582 2583 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2581 def topics @topics end |
#unsubscribed ⇒ Boolean
2571 2572 2573 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2571 def unsubscribed @unsubscribed end |
#updated_at ⇒ 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.
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_h ⇒ Hash
Returns 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 |