Class: ApolloDeploySignalSdk::SegmentContactResponse
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdk::SegmentContactResponse
- Defined in:
- lib/apollo_deploy_signal_sdk/types.rb
Overview
Schema type: SegmentContactResponse
Instance Attribute Summary collapse
- #contact_id ⇒ String
- #email ⇒ String
- #first_name ⇒ String?
- #last_name ⇒ String?
- #segments ⇒ Array<String>
Class Method Summary collapse
-
.from_json(attributes) ⇒ SegmentContactResponse
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(contact_id:, email:, first_name:, last_name:, segments:) ⇒ SegmentContactResponse
constructor
A new instance of SegmentContactResponse.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(contact_id:, email:, first_name:, last_name:, segments:) ⇒ SegmentContactResponse
Returns a new instance of SegmentContactResponse.
2018 2019 2020 2021 2022 2023 2024 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2018 def initialize(contact_id: , email: , first_name: , last_name: , segments: ) @contact_id = contact_id @email = email @first_name = first_name @last_name = last_name @segments = segments end |
Instance Attribute Details
#contact_id ⇒ String
2007 2008 2009 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2007 def contact_id @contact_id end |
#email ⇒ String
2009 2010 2011 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2009 def email @email end |
#first_name ⇒ String?
2011 2012 2013 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2011 def first_name @first_name end |
#last_name ⇒ String?
2013 2014 2015 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2013 def last_name @last_name end |
#segments ⇒ Array<String>
2015 2016 2017 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2015 def segments @segments end |
Class Method Details
.from_json(attributes) ⇒ SegmentContactResponse
Create an instance from a parsed JSON hash.
2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2040 def self.from_json(attributes) return nil unless attributes.is_a?(Hash) new( contact_id: attributes.key?("contactId") ? attributes["contactId"] : attributes[:contact_id], email: attributes.key?("email") ? attributes["email"] : attributes[:email], first_name: attributes.key?("firstName") ? attributes["firstName"] : attributes[:first_name], last_name: attributes.key?("lastName") ? attributes["lastName"] : attributes[:last_name], segments: attributes.key?("segments") ? attributes["segments"] : attributes[:segments], ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this object.
2027 2028 2029 2030 2031 2032 2033 2034 2035 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 2027 def to_h { contact_id: @contact_id, email: @email, first_name: @first_name, last_name: @last_name, segments: @segments, }.compact end |