class PureCloud::OrphanRecording
Attributes
Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
The globally unique identifier for the object.
The status of the orphaned recording's conversation.
Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
The URI for this object
Public Class Methods
Attribute
mapping from ruby-style variable name to JSON key.
# File lib/purecloud/models/orphan_recording.rb, line 51 def self.attribute_map { :'id' => :'id', :'name' => :'name', :'created_time' => :'createdTime', :'recovered_time' => :'recoveredTime', :'provider_type' => :'providerType', :'media_size_bytes' => :'mediaSizeBytes', :'media_type' => :'mediaType', :'file_state' => :'fileState', :'provider_endpoint' => :'providerEndpoint', :'recording' => :'recording', :'orphan_status' => :'orphanStatus', :'self_uri' => :'selfUri' } end
# File lib/purecloud/models/orphan_recording.rb, line 100 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # 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'] end if attributes[:'name'] self.name = attributes[:'name'] end if attributes[:'createdTime'] self.created_time = attributes[:'createdTime'] end if attributes[:'recoveredTime'] self.recovered_time = attributes[:'recoveredTime'] end if attributes[:'providerType'] self.provider_type = attributes[:'providerType'] end if attributes[:'mediaSizeBytes'] self.media_size_bytes = attributes[:'mediaSizeBytes'] end if attributes[:'mediaType'] self.media_type = attributes[:'mediaType'] end if attributes[:'fileState'] self.file_state = attributes[:'fileState'] end if attributes[:'providerEndpoint'] self.provider_endpoint = attributes[:'providerEndpoint'] end if attributes[:'recording'] self.recording = attributes[:'recording'] end if attributes[:'orphanStatus'] self.orphan_status = attributes[:'orphanStatus'] end if attributes[:'selfUri'] self.self_uri = attributes[:'selfUri'] end end
Attribute
type mapping.
# File lib/purecloud/models/orphan_recording.rb, line 82 def self.swagger_types { :'id' => :'String', :'name' => :'String', :'created_time' => :'DateTime', :'recovered_time' => :'DateTime', :'provider_type' => :'String', :'media_size_bytes' => :'Integer', :'media_type' => :'String', :'file_state' => :'String', :'provider_endpoint' => :'Endpoint', :'recording' => :'Recording', :'orphan_status' => :'String', :'self_uri' => :'String' } end
Public Instance Methods
Check equality by comparing each attribute.
# File lib/purecloud/models/orphan_recording.rb, line 194 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && name == o.name && created_time == o.created_time && recovered_time == o.recovered_time && provider_type == o.provider_type && media_size_bytes == o.media_size_bytes && media_type == o.media_type && file_state == o.file_state && provider_endpoint == o.provider_endpoint && recording == o.recording && orphan_status == o.orphan_status && self_uri == o.self_uri end
# File lib/purecloud/models/orphan_recording.rb, line 241 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /^(true|t|yes|y|1)$/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model _model = Object.const_get("PureCloud").const_get(type).new _model.build_from_hash(value) end end
Method to output non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
# File lib/purecloud/models/orphan_recording.rb, line 301 def _to_hash(value) if value.is_a?(Array) value.compact.map{ |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end
build the object from hash
# File lib/purecloud/models/orphan_recording.rb, line 222 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) else #TODO show warning in debug mode end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) else # data not found in attributes(hash), not an issue as the data can be optional end end self end
@see the `==` method
# File lib/purecloud/models/orphan_recording.rb, line 212 def eql?(o) self == o end
Custom attribute writer method checking allowed values (enum).
# File lib/purecloud/models/orphan_recording.rb, line 176 def file_state=(file_state) allowed_values = ["ARCHIVED", "AVAILABLE", "DELETED", "RESTORED", "RESTORING", "UPLOADING"] if file_state && !allowed_values.include?(file_state) fail "invalid value for 'file_state', must be one of #{allowed_values}" end @file_state = file_state end
Calculate hash code according to all attributes.
# File lib/purecloud/models/orphan_recording.rb, line 217 def hash [id, name, created_time, recovered_time, provider_type, media_size_bytes, media_type, file_state, provider_endpoint, recording, orphan_status, self_uri].hash end
Custom attribute writer method checking allowed values (enum).
# File lib/purecloud/models/orphan_recording.rb, line 167 def media_type=(media_type) allowed_values = ["CALL", "CHAT", "EMAIL"] if media_type && !allowed_values.include?(media_type) fail "invalid value for 'media_type', must be one of #{allowed_values}" end @media_type = media_type end
Custom attribute writer method checking allowed values (enum).
# File lib/purecloud/models/orphan_recording.rb, line 185 def orphan_status=(orphan_status) allowed_values = ["NO_CONVERSATION", "UNKNOWN_CONVERSATION", "CONVERSATION_NOT_COMPLETE", "CONVERSATION_NOT_EVALUATED", "EVALUATED"] if orphan_status && !allowed_values.include?(orphan_status) fail "invalid value for 'orphan_status', must be one of #{allowed_values}" end @orphan_status = orphan_status end
Custom attribute writer method checking allowed values (enum).
# File lib/purecloud/models/orphan_recording.rb, line 158 def provider_type=(provider_type) allowed_values = ["EDGE", "CHAT", "EMAIL"] if provider_type && !allowed_values.include?(provider_type) fail "invalid value for 'provider_type', must be one of #{allowed_values}" end @provider_type = provider_type end
return the object in the form of hash
# File lib/purecloud/models/orphan_recording.rb, line 289 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end
# File lib/purecloud/models/orphan_recording.rb, line 279 def to_s to_hash.to_s end