class PureCloud::AnalyticsSession

Attributes

address_other[RW]
address_self[RW]
ani[RW]
callback_numbers[RW]
callback_scheduled_time[RW]

Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ

callback_user_name[RW]
cobrowse_role[RW]
cobrowse_room_id[RW]
direction[RW]
disposition_analyzer[RW]
disposition_name[RW]
dnis[RW]
edge_id[RW]
media_bridge_id[RW]
media_type[RW]
monitored_participant_id[RW]
monitored_session_id[RW]
outbound_campaign_id[RW]
outbound_contact_id[RW]
outbound_contact_list_id[RW]
remote_name_displayable[RW]
room_id[RW]
screen_share_address_self[RW]
screen_share_room_id[RW]
script_id[RW]
segments[RW]
session_id[RW]
sharing_screen[RW]
skip_enabled[RW]
timeout_seconds[RW]
video_address_self[RW]
video_room_id[RW]

Public Class Methods

attribute_map() click to toggle source

Attribute mapping from ruby-style variable name to JSON key.

# File lib/purecloud/models/analytics_session.rb, line 87
def self.attribute_map
  {
    
    :'media_type' => :'mediaType',
    
    :'session_id' => :'sessionId',
    
    :'address_other' => :'addressOther',
    
    :'address_self' => :'addressSelf',
    
    :'ani' => :'ani',
    
    :'direction' => :'direction',
    
    :'dnis' => :'dnis',
    
    :'outbound_campaign_id' => :'outboundCampaignId',
    
    :'outbound_contact_id' => :'outboundContactId',
    
    :'outbound_contact_list_id' => :'outboundContactListId',
    
    :'disposition_analyzer' => :'dispositionAnalyzer',
    
    :'disposition_name' => :'dispositionName',
    
    :'edge_id' => :'edgeId',
    
    :'remote_name_displayable' => :'remoteNameDisplayable',
    
    :'room_id' => :'roomId',
    
    :'monitored_session_id' => :'monitoredSessionId',
    
    :'monitored_participant_id' => :'monitoredParticipantId',
    
    :'callback_user_name' => :'callbackUserName',
    
    :'callback_numbers' => :'callbackNumbers',
    
    :'callback_scheduled_time' => :'callbackScheduledTime',
    
    :'script_id' => :'scriptId',
    
    :'skip_enabled' => :'skipEnabled',
    
    :'timeout_seconds' => :'timeoutSeconds',
    
    :'cobrowse_role' => :'cobrowseRole',
    
    :'cobrowse_room_id' => :'cobrowseRoomId',
    
    :'media_bridge_id' => :'mediaBridgeId',
    
    :'screen_share_address_self' => :'screenShareAddressSelf',
    
    :'sharing_screen' => :'sharingScreen',
    
    :'screen_share_room_id' => :'screenShareRoomId',
    
    :'video_room_id' => :'videoRoomId',
    
    :'video_address_self' => :'videoAddressSelf',
    
    :'segments' => :'segments'
    
  }
end
new(attributes = {}) click to toggle source
# File lib/purecloud/models/analytics_session.rb, line 196
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[:'mediaType']
    self.media_type = attributes[:'mediaType']
  end
  
  if attributes[:'sessionId']
    self.session_id = attributes[:'sessionId']
  end
  
  if attributes[:'addressOther']
    self.address_other = attributes[:'addressOther']
  end
  
  if attributes[:'addressSelf']
    self.address_self = attributes[:'addressSelf']
  end
  
  if attributes[:'ani']
    self.ani = attributes[:'ani']
  end
  
  if attributes[:'direction']
    self.direction = attributes[:'direction']
  end
  
  if attributes[:'dnis']
    self.dnis = attributes[:'dnis']
  end
  
  if attributes[:'outboundCampaignId']
    self.outbound_campaign_id = attributes[:'outboundCampaignId']
  end
  
  if attributes[:'outboundContactId']
    self.outbound_contact_id = attributes[:'outboundContactId']
  end
  
  if attributes[:'outboundContactListId']
    self.outbound_contact_list_id = attributes[:'outboundContactListId']
  end
  
  if attributes[:'dispositionAnalyzer']
    self.disposition_analyzer = attributes[:'dispositionAnalyzer']
  end
  
  if attributes[:'dispositionName']
    self.disposition_name = attributes[:'dispositionName']
  end
  
  if attributes[:'edgeId']
    self.edge_id = attributes[:'edgeId']
  end
  
  if attributes[:'remoteNameDisplayable']
    self.remote_name_displayable = attributes[:'remoteNameDisplayable']
  end
  
  if attributes[:'roomId']
    self.room_id = attributes[:'roomId']
  end
  
  if attributes[:'monitoredSessionId']
    self.monitored_session_id = attributes[:'monitoredSessionId']
  end
  
  if attributes[:'monitoredParticipantId']
    self.monitored_participant_id = attributes[:'monitoredParticipantId']
  end
  
  if attributes[:'callbackUserName']
    self.callback_user_name = attributes[:'callbackUserName']
  end
  
  if attributes[:'callbackNumbers']
    if (value = attributes[:'callbackNumbers']).is_a?(Array)
      self.callback_numbers = value
    end
  end
  
  if attributes[:'callbackScheduledTime']
    self.callback_scheduled_time = attributes[:'callbackScheduledTime']
  end
  
  if attributes[:'scriptId']
    self.script_id = attributes[:'scriptId']
  end
  
  if attributes[:'skipEnabled']
    self.skip_enabled = attributes[:'skipEnabled']
  end
  
  if attributes[:'timeoutSeconds']
    self.timeout_seconds = attributes[:'timeoutSeconds']
  end
  
  if attributes[:'cobrowseRole']
    self.cobrowse_role = attributes[:'cobrowseRole']
  end
  
  if attributes[:'cobrowseRoomId']
    self.cobrowse_room_id = attributes[:'cobrowseRoomId']
  end
  
  if attributes[:'mediaBridgeId']
    self.media_bridge_id = attributes[:'mediaBridgeId']
  end
  
  if attributes[:'screenShareAddressSelf']
    self.screen_share_address_self = attributes[:'screenShareAddressSelf']
  end
  
  if attributes[:'sharingScreen']
    self.sharing_screen = attributes[:'sharingScreen']
  end
  
  if attributes[:'screenShareRoomId']
    self.screen_share_room_id = attributes[:'screenShareRoomId']
  end
  
  if attributes[:'videoRoomId']
    self.video_room_id = attributes[:'videoRoomId']
  end
  
  if attributes[:'videoAddressSelf']
    self.video_address_self = attributes[:'videoAddressSelf']
  end
  
  if attributes[:'segments']
    if (value = attributes[:'segments']).is_a?(Array)
      self.segments = value
    end
  end
  
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/purecloud/models/analytics_session.rb, line 158
def self.swagger_types
  {
    :'media_type' => :'String',
    :'session_id' => :'String',
    :'address_other' => :'String',
    :'address_self' => :'String',
    :'ani' => :'String',
    :'direction' => :'String',
    :'dnis' => :'String',
    :'outbound_campaign_id' => :'String',
    :'outbound_contact_id' => :'String',
    :'outbound_contact_list_id' => :'String',
    :'disposition_analyzer' => :'String',
    :'disposition_name' => :'String',
    :'edge_id' => :'String',
    :'remote_name_displayable' => :'String',
    :'room_id' => :'String',
    :'monitored_session_id' => :'String',
    :'monitored_participant_id' => :'String',
    :'callback_user_name' => :'String',
    :'callback_numbers' => :'Array<String>',
    :'callback_scheduled_time' => :'DateTime',
    :'script_id' => :'String',
    :'skip_enabled' => :'BOOLEAN',
    :'timeout_seconds' => :'Integer',
    :'cobrowse_role' => :'String',
    :'cobrowse_room_id' => :'String',
    :'media_bridge_id' => :'String',
    :'screen_share_address_self' => :'String',
    :'sharing_screen' => :'BOOLEAN',
    :'screen_share_room_id' => :'String',
    :'video_room_id' => :'String',
    :'video_address_self' => :'String',
    :'segments' => :'Array<AnalyticsConversationSegment>'
    
  }
end

Public Instance Methods

==(o) click to toggle source

Check equality by comparing each attribute.

# File lib/purecloud/models/analytics_session.rb, line 356
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      media_type == o.media_type &&
      session_id == o.session_id &&
      address_other == o.address_other &&
      address_self == o.address_self &&
      ani == o.ani &&
      direction == o.direction &&
      dnis == o.dnis &&
      outbound_campaign_id == o.outbound_campaign_id &&
      outbound_contact_id == o.outbound_contact_id &&
      outbound_contact_list_id == o.outbound_contact_list_id &&
      disposition_analyzer == o.disposition_analyzer &&
      disposition_name == o.disposition_name &&
      edge_id == o.edge_id &&
      remote_name_displayable == o.remote_name_displayable &&
      room_id == o.room_id &&
      monitored_session_id == o.monitored_session_id &&
      monitored_participant_id == o.monitored_participant_id &&
      callback_user_name == o.callback_user_name &&
      callback_numbers == o.callback_numbers &&
      callback_scheduled_time == o.callback_scheduled_time &&
      script_id == o.script_id &&
      skip_enabled == o.skip_enabled &&
      timeout_seconds == o.timeout_seconds &&
      cobrowse_role == o.cobrowse_role &&
      cobrowse_room_id == o.cobrowse_room_id &&
      media_bridge_id == o.media_bridge_id &&
      screen_share_address_self == o.screen_share_address_self &&
      sharing_screen == o.sharing_screen &&
      screen_share_room_id == o.screen_share_room_id &&
      video_room_id == o.video_room_id &&
      video_address_self == o.video_address_self &&
      segments == o.segments
end
_deserialize(type, value) click to toggle source
# File lib/purecloud/models/analytics_session.rb, line 423
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
_to_hash(value) click to toggle source

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/analytics_session.rb, line 483
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_from_hash(attributes) click to toggle source

build the object from hash

# File lib/purecloud/models/analytics_session.rb, line 404
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
direction=(direction) click to toggle source

Custom attribute writer method checking allowed values (enum).

# File lib/purecloud/models/analytics_session.rb, line 347
def direction=(direction)
  allowed_values = ["inbound", "outbound"]
  if direction && !allowed_values.include?(direction)
    fail "invalid value for 'direction', must be one of #{allowed_values}"
  end
  @direction = direction
end
eql?(o) click to toggle source

@see the `==` method

# File lib/purecloud/models/analytics_session.rb, line 394
def eql?(o)
  self == o
end
hash() click to toggle source

Calculate hash code according to all attributes.

# File lib/purecloud/models/analytics_session.rb, line 399
def hash
  [media_type, session_id, address_other, address_self, ani, direction, dnis, outbound_campaign_id, outbound_contact_id, outbound_contact_list_id, disposition_analyzer, disposition_name, edge_id, remote_name_displayable, room_id, monitored_session_id, monitored_participant_id, callback_user_name, callback_numbers, callback_scheduled_time, script_id, skip_enabled, timeout_seconds, cobrowse_role, cobrowse_room_id, media_bridge_id, screen_share_address_self, sharing_screen, screen_share_room_id, video_room_id, video_address_self, segments].hash
end
media_type=(media_type) click to toggle source

Custom attribute writer method checking allowed values (enum).

# File lib/purecloud/models/analytics_session.rb, line 338
def media_type=(media_type)
  allowed_values = ["voice", "chat", "email", "callback", "cobrowse", "video", "screenshare"]
  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
to_body() click to toggle source

to_body is an alias to to_body (backward compatibility))

# File lib/purecloud/models/analytics_session.rb, line 466
def to_body
  to_hash
end
to_hash() click to toggle source

return the object in the form of hash

# File lib/purecloud/models/analytics_session.rb, line 471
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
to_s() click to toggle source
# File lib/purecloud/models/analytics_session.rb, line 461
def to_s
  to_hash.to_s
end