Class: ApolloDeploySignalSdkRails::CreateContactBody
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdkRails::CreateContactBody
- Defined in:
- lib/apollo_deploy_signal_sdk_rails/types.rb
Overview
Schema type: CreateContactBody
Instance Attribute Summary collapse
- #email ⇒ String
- #first_name ⇒ String?
- #last_name ⇒ String?
- #phone ⇒ String?
- #properties ⇒ Hash{String => String}
- #segments ⇒ Array<SegmentRef>
- #topics ⇒ Array<TopicSubscriptionBody>
- #unsubscribed ⇒ Boolean
Class Method Summary collapse
-
.from_json(attributes) ⇒ CreateContactBody
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(email:, phone: nil, first_name: nil, last_name: nil, unsubscribed: nil, properties: nil, segments: nil, topics: nil) ⇒ CreateContactBody
constructor
A new instance of CreateContactBody.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(email:, phone: nil, first_name: nil, last_name: nil, unsubscribed: nil, properties: nil, segments: nil, topics: nil) ⇒ CreateContactBody
Returns a new instance of CreateContactBody.
2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2767 def initialize(email: , phone: nil, first_name: nil, last_name: nil, unsubscribed: nil, properties: nil, segments: nil, topics: nil) @email = email @phone = phone @first_name = first_name @last_name = last_name @unsubscribed = unsubscribed @properties = properties @segments = segments @topics = topics end |
Instance Attribute Details
#email ⇒ String
2750 2751 2752 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2750 def email @email end |
#first_name ⇒ String?
2754 2755 2756 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2754 def first_name @first_name end |
#last_name ⇒ String?
2756 2757 2758 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2756 def last_name @last_name end |
#phone ⇒ String?
2752 2753 2754 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2752 def phone @phone end |
#properties ⇒ Hash{String => String}
2760 2761 2762 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2760 def properties @properties end |
#segments ⇒ Array<SegmentRef>
2762 2763 2764 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2762 def segments @segments end |
#topics ⇒ Array<TopicSubscriptionBody>
2764 2765 2766 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2764 def topics @topics end |
#unsubscribed ⇒ Boolean
2758 2759 2760 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2758 def unsubscribed @unsubscribed end |
Class Method Details
.from_json(attributes) ⇒ CreateContactBody
Create an instance from a parsed JSON hash.
2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2795 def self.from_json(attributes) return nil unless attributes.is_a?(Hash) new( 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], segments: attributes.key?("segments") ? attributes["segments"] : attributes[:segments], topics: attributes.key?("topics") ? attributes["topics"] : attributes[:topics], ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this object.
2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2779 def to_h { email: @email, phone: @phone, first_name: @first_name, last_name: @last_name, unsubscribed: @unsubscribed, properties: @properties, segments: @segments, topics: @topics, }.compact end |