lib/purecloud/models/contact.rb in purecloud-0.27.0 vs lib/purecloud/models/contact.rb in purecloud-0.28.0
- old
+ new
@@ -1,61 +1,39 @@
require 'date'
module PureCloud
class Contact
- # The globally unique identifier for the object.
- attr_accessor :id
+ attr_accessor :address
- attr_accessor :name
+ attr_accessor :display
- attr_accessor :contact_list_id
+ attr_accessor :media_type
- attr_accessor :data
+ attr_accessor :type
- attr_accessor :call_records
-
- attr_accessor :callable
-
- attr_accessor :phone_number_status
-
- # The URI for this object
- attr_accessor :self_uri
-
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
- :'id' => :'id',
+ :'address' => :'address',
- :'name' => :'name',
+ :'display' => :'display',
- :'contact_list_id' => :'contactListId',
+ :'media_type' => :'mediaType',
- :'data' => :'data',
+ :'type' => :'type'
- :'call_records' => :'callRecords',
-
- :'callable' => :'callable',
-
- :'phone_number_status' => :'phoneNumberStatus',
-
- :'self_uri' => :'selfUri'
-
}
end
# Attribute type mapping.
def self.swagger_types
{
- :'id' => :'String',
- :'name' => :'String',
- :'contact_list_id' => :'String',
- :'data' => :'Hash<String, inline_response_200>',
- :'call_records' => :'Hash<String, CallRecord>',
- :'callable' => :'BOOLEAN',
- :'phone_number_status' => :'Hash<String, PhoneNumberStatus>',
- :'self_uri' => :'String'
+ :'address' => :'String',
+ :'display' => :'String',
+ :'media_type' => :'String',
+ :'type' => :'String'
}
end
def initialize(attributes = {})
@@ -63,73 +41,63 @@
# convert string to symbol for hash key
attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
- if attributes[:'id']
- self.id = attributes[:'id']
+ if attributes[:'address']
+ self.address = attributes[:'address']
end
- if attributes[:'name']
- self.name = attributes[:'name']
+ if attributes[:'display']
+ self.display = attributes[:'display']
end
- if attributes[:'contactListId']
- self.contact_list_id = attributes[:'contactListId']
+ if attributes[:'mediaType']
+ self.media_type = attributes[:'mediaType']
end
- if attributes[:'data']
- if (value = attributes[:'data']).is_a?(Array)
- self.data = value
- end
+ if attributes[:'type']
+ self.type = attributes[:'type']
end
- if attributes[:'callRecords']
- if (value = attributes[:'callRecords']).is_a?(Array)
- self.call_records = value
- end
+ end
+
+ # Custom attribute writer method checking allowed values (enum).
+ def media_type=(media_type)
+ allowed_values = ["PHONE", "EMAIL", "SMS"]
+ if media_type && !allowed_values.include?(media_type)
+ fail "invalid value for 'media_type', must be one of #{allowed_values}"
end
-
- if attributes[:'callable']
- self.callable = attributes[:'callable']
- else
- self.callable = false
+ @media_type = media_type
+ end
+
+ # Custom attribute writer method checking allowed values (enum).
+ def type=(type)
+ allowed_values = ["PRIMARY", "WORK", "HOME", "MOBILE", "MAIN"]
+ if type && !allowed_values.include?(type)
+ fail "invalid value for 'type', must be one of #{allowed_values}"
end
-
- if attributes[:'phoneNumberStatus']
- if (value = attributes[:'phoneNumberStatus']).is_a?(Array)
- self.phone_number_status = value
- end
- end
-
- if attributes[:'selfUri']
- self.self_uri = attributes[:'selfUri']
- end
-
+ @type = type
end
# Check equality by comparing each attribute.
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
- id == o.id &&
- name == o.name &&
- contact_list_id == o.contact_list_id &&
- data == o.data &&
- call_records == o.call_records &&
- callable == o.callable &&
- phone_number_status == o.phone_number_status &&
- self_uri == o.self_uri
+ address == o.address &&
+ display == o.display &&
+ media_type == o.media_type &&
+ type == o.type
end
# @see the `==` method
def eql?(o)
self == o
end
# Calculate hash code according to all attributes.
def hash
- [id, name, contact_list_id, data, call_records, callable, phone_number_status, self_uri].hash
+ [address, display, media_type, type].hash
end
# build the object from hash
def build_from_hash(attributes)
return nil unless attributes.is_a?(Hash)