Class: Verizon::DtoNotificationGroupResponseEntity

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/dto_notification_group_response_entity.rb

Overview

DtoNotificationGroupResponseEntity Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(createdon: SKIP, description: SKIP, foreignid: SKIP, groupemail: SKIP, id: SKIP, lastupdated: SKIP, name: SKIP, users: SKIP, version: SKIP, versionid: SKIP) ⇒ DtoNotificationGroupResponseEntity

Returns a new instance of DtoNotificationGroupResponseEntity.



90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/verizon/models/dto_notification_group_response_entity.rb', line 90

def initialize(createdon: SKIP, description: SKIP, foreignid: SKIP,
               groupemail: SKIP, id: SKIP, lastupdated: SKIP, name: SKIP,
               users: SKIP, version: SKIP, versionid: SKIP)
  @createdon = createdon unless createdon == SKIP
  @description = description unless description == SKIP
  @foreignid = foreignid unless foreignid == SKIP
  @groupemail = groupemail unless groupemail == SKIP
  @id = id unless id == SKIP
  @lastupdated = lastupdated unless lastupdated == SKIP
  @name = name unless name == SKIP
  @users = users unless users == SKIP
  @version = version unless version == SKIP
  @versionid = versionid unless versionid == SKIP
end

Instance Attribute Details

#createdonDateTime

Timestamp of the record

Returns:

  • (DateTime)


15
16
17
# File 'lib/verizon/models/dto_notification_group_response_entity.rb', line 15

def createdon
  @createdon
end

#descriptionString

a short description

Returns:

  • (String)


19
20
21
# File 'lib/verizon/models/dto_notification_group_response_entity.rb', line 19

def description
  @description
end

#foreignidString

UUID of the ECPD account the user belongs to

Returns:

  • (String)


23
24
25
# File 'lib/verizon/models/dto_notification_group_response_entity.rb', line 23

def foreignid
  @foreignid
end

#groupemailString

Contact email for the group

Returns:

  • (String)


27
28
29
# File 'lib/verizon/models/dto_notification_group_response_entity.rb', line 27

def groupemail
  @groupemail
end

#idString

UUID of the user record, assigned at creation

Returns:

  • (String)


31
32
33
# File 'lib/verizon/models/dto_notification_group_response_entity.rb', line 31

def id
  @id
end

#lastupdatedDateTime

Timestamp of the record

Returns:

  • (DateTime)


35
36
37
# File 'lib/verizon/models/dto_notification_group_response_entity.rb', line 35

def lastupdated
  @lastupdated
end

#nameString

User defined name of the record

Returns:

  • (String)


39
40
41
# File 'lib/verizon/models/dto_notification_group_response_entity.rb', line 39

def name
  @name
end

#usersArray[DtoUserDto]

User defined name of the record

Returns:



43
44
45
# File 'lib/verizon/models/dto_notification_group_response_entity.rb', line 43

def users
  @users
end

#versionString

The resource version

Returns:

  • (String)


47
48
49
# File 'lib/verizon/models/dto_notification_group_response_entity.rb', line 47

def version
  @version
end

#versionidString

The UUID of the resource version

Returns:

  • (String)


51
52
53
# File 'lib/verizon/models/dto_notification_group_response_entity.rb', line 51

def versionid
  @versionid
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/verizon/models/dto_notification_group_response_entity.rb', line 106

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  createdon = if hash.key?('createdon')
                (DateTimeHelper.from_rfc3339(hash['createdon']) if hash['createdon'])
              else
                SKIP
              end
  description = hash.key?('description') ? hash['description'] : SKIP
  foreignid = hash.key?('foreignid') ? hash['foreignid'] : SKIP
  groupemail = hash.key?('groupemail') ? hash['groupemail'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  lastupdated = if hash.key?('lastupdated')
                  (DateTimeHelper.from_rfc3339(hash['lastupdated']) if hash['lastupdated'])
                else
                  SKIP
                end
  name = hash.key?('name') ? hash['name'] : SKIP
  # Parameter is an array, so we need to iterate through it
  users = nil
  unless hash['users'].nil?
    users = []
    hash['users'].each do |structure|
      users << (DtoUserDto.from_hash(structure) if structure)
    end
  end

  users = SKIP unless hash.key?('users')
  version = hash.key?('version') ? hash['version'] : SKIP
  versionid = hash.key?('versionid') ? hash['versionid'] : SKIP

  # Create object from extracted values.
  DtoNotificationGroupResponseEntity.new(createdon: createdon,
                                         description: description,
                                         foreignid: foreignid,
                                         groupemail: groupemail,
                                         id: id,
                                         lastupdated: lastupdated,
                                         name: name,
                                         users: users,
                                         version: version,
                                         versionid: versionid)
end

.namesObject

A mapping from model property names to API property names.



54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/verizon/models/dto_notification_group_response_entity.rb', line 54

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['createdon'] = 'createdon'
  @_hash['description'] = 'description'
  @_hash['foreignid'] = 'foreignid'
  @_hash['groupemail'] = 'groupemail'
  @_hash['id'] = 'id'
  @_hash['lastupdated'] = 'lastupdated'
  @_hash['name'] = 'name'
  @_hash['users'] = 'users'
  @_hash['version'] = 'version'
  @_hash['versionid'] = 'versionid'
  @_hash
end

.nullablesObject

An array for nullable fields



86
87
88
# File 'lib/verizon/models/dto_notification_group_response_entity.rb', line 86

def self.nullables
  []
end

.optionalsObject

An array for optional fields



70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/verizon/models/dto_notification_group_response_entity.rb', line 70

def self.optionals
  %w[
    createdon
    description
    foreignid
    groupemail
    id
    lastupdated
    name
    users
    version
    versionid
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



168
169
170
171
172
173
174
# File 'lib/verizon/models/dto_notification_group_response_entity.rb', line 168

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} createdon: #{@createdon.inspect}, description: #{@description.inspect},"\
  " foreignid: #{@foreignid.inspect}, groupemail: #{@groupemail.inspect}, id: #{@id.inspect},"\
  " lastupdated: #{@lastupdated.inspect}, name: #{@name.inspect}, users: #{@users.inspect},"\
  " version: #{@version.inspect}, versionid: #{@versionid.inspect}>"
end

#to_custom_createdonObject



151
152
153
# File 'lib/verizon/models/dto_notification_group_response_entity.rb', line 151

def to_custom_createdon
  DateTimeHelper.to_rfc3339(createdon)
end

#to_custom_lastupdatedObject



155
156
157
# File 'lib/verizon/models/dto_notification_group_response_entity.rb', line 155

def to_custom_lastupdated
  DateTimeHelper.to_rfc3339(lastupdated)
end

#to_sObject

Provides a human-readable string representation of the object.



160
161
162
163
164
165
# File 'lib/verizon/models/dto_notification_group_response_entity.rb', line 160

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} createdon: #{@createdon}, description: #{@description}, foreignid:"\
  " #{@foreignid}, groupemail: #{@groupemail}, id: #{@id}, lastupdated: #{@lastupdated}, name:"\
  " #{@name}, users: #{@users}, version: #{@version}, versionid: #{@versionid}>"
end