Class: ApolloDeploySignalSdk::UpdateContactBody
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdk::UpdateContactBody
- Defined in:
- lib/apollo_deploy_signal_sdk/types.rb
Overview
Schema type: UpdateContactBody
Instance Attribute Summary collapse
- #first_name ⇒ String?
- #last_name ⇒ String?
- #phone ⇒ String?
- #properties ⇒ Hash{String => String}
- #unsubscribed ⇒ Boolean?
Class Method Summary collapse
-
.from_json(attributes) ⇒ UpdateContactBody
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(first_name: nil, last_name: nil, phone: nil, unsubscribed: nil, properties: nil) ⇒ UpdateContactBody
constructor
A new instance of UpdateContactBody.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(first_name: nil, last_name: nil, phone: nil, unsubscribed: nil, properties: nil) ⇒ UpdateContactBody
Returns a new instance of UpdateContactBody.
2825 2826 2827 2828 2829 2830 2831 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2825 def initialize(first_name: nil, last_name: nil, phone: nil, unsubscribed: nil, properties: nil) @first_name = first_name @last_name = last_name @phone = phone @unsubscribed = unsubscribed @properties = properties end |
Instance Attribute Details
#first_name ⇒ String?
2814 2815 2816 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2814 def first_name @first_name end |
#last_name ⇒ String?
2816 2817 2818 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2816 def last_name @last_name end |
#phone ⇒ String?
2818 2819 2820 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2818 def phone @phone end |
#properties ⇒ Hash{String => String}
2822 2823 2824 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2822 def properties @properties end |
#unsubscribed ⇒ Boolean?
2820 2821 2822 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2820 def unsubscribed @unsubscribed end |
Class Method Details
.from_json(attributes) ⇒ UpdateContactBody
Create an instance from a parsed JSON hash.
2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2847 def self.from_json(attributes) return nil unless attributes.is_a?(Hash) new( first_name: attributes.key?("firstName") ? attributes["firstName"] : attributes[:first_name], last_name: attributes.key?("lastName") ? attributes["lastName"] : attributes[:last_name], phone: attributes.key?("phone") ? attributes["phone"] : attributes[:phone], unsubscribed: attributes.key?("unsubscribed") ? attributes["unsubscribed"] : attributes[:unsubscribed], properties: attributes.key?("properties") ? attributes["properties"] : attributes[:properties], ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this object.
2834 2835 2836 2837 2838 2839 2840 2841 2842 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2834 def to_h { first_name: @first_name, last_name: @last_name, phone: @phone, unsubscribed: @unsubscribed, properties: @properties, }.compact end |