Class: OCI::AnnouncementsService::Models::BaseAnnouncement

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/announcements_service/models/base_announcement.rb

Overview

Incident information that forms the basis of an announcement. Avoid entering confidential information. This class has direct subclasses. If you are using this class as input to a service operations then you should favor using a subclass over the base class

Constant Summary collapse

TIME_ONE_TYPE_ENUM =
[
  TIME_ONE_TYPE_ACTION_REQUIRED_BY = 'ACTION_REQUIRED_BY'.freeze,
  TIME_ONE_TYPE_NEW_START_TIME = 'NEW_START_TIME'.freeze,
  TIME_ONE_TYPE_ORIGINAL_END_TIME = 'ORIGINAL_END_TIME'.freeze,
  TIME_ONE_TYPE_REPORT_DATE = 'REPORT_DATE'.freeze,
  TIME_ONE_TYPE_START_TIME = 'START_TIME'.freeze,
  TIME_ONE_TYPE_TIME_DETECTED = 'TIME_DETECTED'.freeze
].freeze
TIME_TWO_TYPE_ENUM =
[
  TIME_TWO_TYPE_END_TIME = 'END_TIME'.freeze,
  TIME_TWO_TYPE_NEW_END_TIME = 'NEW_END_TIME'.freeze
].freeze
ANNOUNCEMENT_TYPE_ENUM =
[
  ANNOUNCEMENT_TYPE_ACTION_RECOMMENDED = 'ACTION_RECOMMENDED'.freeze,
  ANNOUNCEMENT_TYPE_ACTION_REQUIRED = 'ACTION_REQUIRED'.freeze,
  ANNOUNCEMENT_TYPE_EMERGENCY_CHANGE = 'EMERGENCY_CHANGE'.freeze,
  ANNOUNCEMENT_TYPE_EMERGENCY_MAINTENANCE = 'EMERGENCY_MAINTENANCE'.freeze,
  ANNOUNCEMENT_TYPE_EMERGENCY_MAINTENANCE_COMPLETE = 'EMERGENCY_MAINTENANCE_COMPLETE'.freeze,
  ANNOUNCEMENT_TYPE_EMERGENCY_MAINTENANCE_EXTENDED = 'EMERGENCY_MAINTENANCE_EXTENDED'.freeze,
  ANNOUNCEMENT_TYPE_EMERGENCY_MAINTENANCE_RESCHEDULED = 'EMERGENCY_MAINTENANCE_RESCHEDULED'.freeze,
  ANNOUNCEMENT_TYPE_INFORMATION = 'INFORMATION'.freeze,
  ANNOUNCEMENT_TYPE_PLANNED_CHANGE = 'PLANNED_CHANGE'.freeze,
  ANNOUNCEMENT_TYPE_PLANNED_CHANGE_COMPLETE = 'PLANNED_CHANGE_COMPLETE'.freeze,
  ANNOUNCEMENT_TYPE_PLANNED_CHANGE_EXTENDED = 'PLANNED_CHANGE_EXTENDED'.freeze,
  ANNOUNCEMENT_TYPE_PLANNED_CHANGE_RESCHEDULED = 'PLANNED_CHANGE_RESCHEDULED'.freeze,
  ANNOUNCEMENT_TYPE_PRODUCTION_EVENT_NOTIFICATION = 'PRODUCTION_EVENT_NOTIFICATION'.freeze,
  ANNOUNCEMENT_TYPE_SCHEDULED_MAINTENANCE = 'SCHEDULED_MAINTENANCE'.freeze
].freeze
LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_INACTIVE = 'INACTIVE'.freeze
].freeze
PLATFORM_TYPE_ENUM =
[
  PLATFORM_TYPE_IAAS = 'IAAS'.freeze,
  PLATFORM_TYPE_SAAS = 'SAAS'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ BaseAnnouncement

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :type (String)

    The value to assign to the #type property

  • :reference_ticket_number (String)

    The value to assign to the #reference_ticket_number property

  • :summary (String)

    The value to assign to the #summary property

  • :time_one_title (String)

    The value to assign to the #time_one_title property

  • :time_one_type (String)

    The value to assign to the #time_one_type property

  • :time_one_value (DateTime)

    The value to assign to the #time_one_value property

  • :time_two_title (String)

    The value to assign to the #time_two_title property

  • :time_two_type (String)

    The value to assign to the #time_two_type property

  • :time_two_value (DateTime)

    The value to assign to the #time_two_value property

  • :services (Array<String>)

    The value to assign to the #services property

  • :affected_regions (Array<String>)

    The value to assign to the #affected_regions property

  • :announcement_type (String)

    The value to assign to the #announcement_type property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :is_banner (BOOLEAN)

    The value to assign to the #is_banner property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :time_updated (DateTime)

    The value to assign to the #time_updated property

  • :environment_name (String)

    The value to assign to the #environment_name property

  • :platform_type (String)

    The value to assign to the #platform_type property



243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 243

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.id = attributes[:'id'] if attributes[:'id']

  self.type = attributes[:'type'] if attributes[:'type']

  self.reference_ticket_number = attributes[:'referenceTicketNumber'] if attributes[:'referenceTicketNumber']

  raise 'You cannot provide both :referenceTicketNumber and :reference_ticket_number' if attributes.key?(:'referenceTicketNumber') && attributes.key?(:'reference_ticket_number')

  self.reference_ticket_number = attributes[:'reference_ticket_number'] if attributes[:'reference_ticket_number']

  self.summary = attributes[:'summary'] if attributes[:'summary']

  self.time_one_title = attributes[:'timeOneTitle'] if attributes[:'timeOneTitle']

  raise 'You cannot provide both :timeOneTitle and :time_one_title' if attributes.key?(:'timeOneTitle') && attributes.key?(:'time_one_title')

  self.time_one_title = attributes[:'time_one_title'] if attributes[:'time_one_title']

  self.time_one_type = attributes[:'timeOneType'] if attributes[:'timeOneType']

  raise 'You cannot provide both :timeOneType and :time_one_type' if attributes.key?(:'timeOneType') && attributes.key?(:'time_one_type')

  self.time_one_type = attributes[:'time_one_type'] if attributes[:'time_one_type']

  self.time_one_value = attributes[:'timeOneValue'] if attributes[:'timeOneValue']

  raise 'You cannot provide both :timeOneValue and :time_one_value' if attributes.key?(:'timeOneValue') && attributes.key?(:'time_one_value')

  self.time_one_value = attributes[:'time_one_value'] if attributes[:'time_one_value']

  self.time_two_title = attributes[:'timeTwoTitle'] if attributes[:'timeTwoTitle']

  raise 'You cannot provide both :timeTwoTitle and :time_two_title' if attributes.key?(:'timeTwoTitle') && attributes.key?(:'time_two_title')

  self.time_two_title = attributes[:'time_two_title'] if attributes[:'time_two_title']

  self.time_two_type = attributes[:'timeTwoType'] if attributes[:'timeTwoType']

  raise 'You cannot provide both :timeTwoType and :time_two_type' if attributes.key?(:'timeTwoType') && attributes.key?(:'time_two_type')

  self.time_two_type = attributes[:'time_two_type'] if attributes[:'time_two_type']

  self.time_two_value = attributes[:'timeTwoValue'] if attributes[:'timeTwoValue']

  raise 'You cannot provide both :timeTwoValue and :time_two_value' if attributes.key?(:'timeTwoValue') && attributes.key?(:'time_two_value')

  self.time_two_value = attributes[:'time_two_value'] if attributes[:'time_two_value']

  self.services = attributes[:'services'] if attributes[:'services']

  self.affected_regions = attributes[:'affectedRegions'] if attributes[:'affectedRegions']

  raise 'You cannot provide both :affectedRegions and :affected_regions' if attributes.key?(:'affectedRegions') && attributes.key?(:'affected_regions')

  self.affected_regions = attributes[:'affected_regions'] if attributes[:'affected_regions']

  self.announcement_type = attributes[:'announcementType'] if attributes[:'announcementType']

  raise 'You cannot provide both :announcementType and :announcement_type' if attributes.key?(:'announcementType') && attributes.key?(:'announcement_type')

  self.announcement_type = attributes[:'announcement_type'] if attributes[:'announcement_type']

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

  raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')

  self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']

  self.is_banner = attributes[:'isBanner'] unless attributes[:'isBanner'].nil?

  raise 'You cannot provide both :isBanner and :is_banner' if attributes.key?(:'isBanner') && attributes.key?(:'is_banner')

  self.is_banner = attributes[:'is_banner'] unless attributes[:'is_banner'].nil?

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

  raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')

  self.time_created = attributes[:'time_created'] if attributes[:'time_created']

  self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']

  raise 'You cannot provide both :timeUpdated and :time_updated' if attributes.key?(:'timeUpdated') && attributes.key?(:'time_updated')

  self.time_updated = attributes[:'time_updated'] if attributes[:'time_updated']

  self.environment_name = attributes[:'environmentName'] if attributes[:'environmentName']

  raise 'You cannot provide both :environmentName and :environment_name' if attributes.key?(:'environmentName') && attributes.key?(:'environment_name')

  self.environment_name = attributes[:'environment_name'] if attributes[:'environment_name']

  self.platform_type = attributes[:'platformType'] if attributes[:'platformType']

  raise 'You cannot provide both :platformType and :platform_type' if attributes.key?(:'platformType') && attributes.key?(:'platform_type')

  self.platform_type = attributes[:'platform_type'] if attributes[:'platform_type']
end

Instance Attribute Details

#affected_regionsArray<String>

**[Required]** Impacted regions.

Returns:

  • (Array<String>)


112
113
114
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 112

def affected_regions
  @affected_regions
end

#announcement_typeString

**[Required]** The type of announcement. An announcement's type signals its severity.

Returns:

  • (String)


116
117
118
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 116

def announcement_type
  @announcement_type
end

#environment_nameString

The name of the environment that this announcement pertains to.

Returns:

  • (String)


141
142
143
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 141

def environment_name
  @environment_name
end

#idString

**[Required]** The OCID of the announcement.

Returns:

  • (String)


54
55
56
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 54

def id
  @id
end

#is_bannerBOOLEAN

**[Required]** Whether the announcement is displayed as a banner in the console.

Returns:

  • (BOOLEAN)


124
125
126
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 124

def is_banner
  @is_banner
end

#lifecycle_stateString

**[Required]** The current lifecycle state of the announcement.

Returns:

  • (String)


120
121
122
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 120

def lifecycle_state
  @lifecycle_state
end

#platform_typeString

The platform type that this announcement pertains to.

Returns:

  • (String)


146
147
148
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 146

def platform_type
  @platform_type
end

#reference_ticket_numberString

**[Required]** The reference Jira ticket number.

Returns:

  • (String)


62
63
64
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 62

def reference_ticket_number
  @reference_ticket_number
end

#servicesArray<String>

**[Required]** Impacted Oracle Cloud Infrastructure services.

Returns:

  • (Array<String>)


108
109
110
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 108

def services
  @services
end

#summaryString

**[Required]** A summary of the issue. A summary might appear in the console banner view of the announcement or in an email subject line. Avoid entering confidential information.

Returns:

  • (String)


68
69
70
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 68

def summary
  @summary
end

#time_createdDateTime

The date and time the announcement was created, expressed in [RFC 3339](tools.ietf.org/html/rfc3339) timestamp format. Example: `2019-01-01T17:43:01.389+0000`

Returns:

  • (DateTime)


130
131
132
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 130

def time_created
  @time_created
end

#time_one_titleString

The label associated with an initial time value. Example: `Time Started`

Returns:

  • (String)


74
75
76
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 74

def time_one_title
  @time_one_title
end

#time_one_typeString

The type of a time associated with an initial time value. If the `timeOneTitle` attribute is present, then the `timeOneTitle` attribute contains a label of `timeOneType` in English. Example: `START_TIME`

Returns:

  • (String)


80
81
82
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 80

def time_one_type
  @time_one_type
end

#time_one_valueDateTime

The actual value of the first time value for the event. Typically, this denotes the time an event started, but the meaning can vary, depending on the announcement type. The `timeOneType` attribute describes the meaning.

Returns:

  • (DateTime)


86
87
88
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 86

def time_one_value
  @time_one_value
end

#time_two_titleString

The label associated with a second time value. Example: `Time Ended`

Returns:

  • (String)


92
93
94
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 92

def time_two_title
  @time_two_title
end

#time_two_typeString

The type of a time associated with second time value. If the `timeTwoTitle` attribute is present, then the `timeTwoTitle` attribute contains a label of `timeTwoType` in English. Example: `END_TIME`

Returns:

  • (String)


98
99
100
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 98

def time_two_type
  @time_two_type
end

#time_two_valueDateTime

The actual value of the second time value. Typically, this denotes the time an event ended, but the meaning can vary, depending on the announcement type. The `timeTwoType` attribute describes the meaning.

Returns:

  • (DateTime)


104
105
106
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 104

def time_two_value
  @time_two_value
end

#time_updatedDateTime

The date and time the announcement was last updated, expressed in [RFC 3339](tools.ietf.org/html/rfc3339) timestamp format. Example: `2019-01-01T17:43:01.389+0000`

Returns:

  • (DateTime)


136
137
138
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 136

def time_updated
  @time_updated
end

#typeString

**[Required]** The entity type, which is either an announcement or the summary representation of an announcement.

Returns:

  • (String)


58
59
60
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 58

def type
  @type
end

Class Method Details

.attribute_mapObject

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



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 149

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'type': :'type',
    'reference_ticket_number': :'referenceTicketNumber',
    'summary': :'summary',
    'time_one_title': :'timeOneTitle',
    'time_one_type': :'timeOneType',
    'time_one_value': :'timeOneValue',
    'time_two_title': :'timeTwoTitle',
    'time_two_type': :'timeTwoType',
    'time_two_value': :'timeTwoValue',
    'services': :'services',
    'affected_regions': :'affectedRegions',
    'announcement_type': :'announcementType',
    'lifecycle_state': :'lifecycleState',
    'is_banner': :'isBanner',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'environment_name': :'environmentName',
    'platform_type': :'platformType'
    # rubocop:enable Style/SymbolLiteral
  }
end

.get_subtype(object_hash) ⇒ Object

Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.



207
208
209
210
211
212
213
214
215
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 207

def self.get_subtype(object_hash)
  type = object_hash[:'type'] # rubocop:disable Style/SymbolLiteral

  return 'OCI::AnnouncementsService::Models::AnnouncementSummary' if type == 'AnnouncementSummary'
  return 'OCI::AnnouncementsService::Models::Announcement' if type == 'Announcement'

  # TODO: Log a warning when the subtype is not found.
  'OCI::AnnouncementsService::Models::BaseAnnouncement'
end

.swagger_typesObject

Attribute type mapping.



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 176

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'type': :'String',
    'reference_ticket_number': :'String',
    'summary': :'String',
    'time_one_title': :'String',
    'time_one_type': :'String',
    'time_one_value': :'DateTime',
    'time_two_title': :'String',
    'time_two_type': :'String',
    'time_two_value': :'DateTime',
    'services': :'Array<String>',
    'affected_regions': :'Array<String>',
    'announcement_type': :'String',
    'lifecycle_state': :'String',
    'is_banner': :'BOOLEAN',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'environment_name': :'String',
    'platform_type': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 395

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    id == other.id &&
    type == other.type &&
    reference_ticket_number == other.reference_ticket_number &&
    summary == other.summary &&
    time_one_title == other.time_one_title &&
    time_one_type == other.time_one_type &&
    time_one_value == other.time_one_value &&
    time_two_title == other.time_two_title &&
    time_two_type == other.time_two_type &&
    time_two_value == other.time_two_value &&
    services == other.services &&
    affected_regions == other.affected_regions &&
    announcement_type == other.announcement_type &&
    lifecycle_state == other.lifecycle_state &&
    is_banner == other.is_banner &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    environment_name == other.environment_name &&
    platform_type == other.platform_type
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 443

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
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


423
424
425
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 423

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



432
433
434
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 432

def hash
  [id, type, reference_ticket_number, summary, time_one_title, time_one_type, time_one_value, time_two_title, time_two_type, time_two_value, services, affected_regions, announcement_type, lifecycle_state, is_banner, time_created, time_updated, environment_name, platform_type].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



476
477
478
479
480
481
482
483
484
485
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 476

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



470
471
472
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 470

def to_s
  to_hash.to_s
end