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

Direct Known Subclasses

Announcement, AnnouncementSummary

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,
  TIME_ONE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
TIME_TWO_TYPE_ENUM =
[
  TIME_TWO_TYPE_END_TIME = 'END_TIME'.freeze,
  TIME_TWO_TYPE_NEW_END_TIME = 'NEW_END_TIME'.freeze,
  TIME_TWO_TYPE_ESTIMATED_END_TIME = 'ESTIMATED_END_TIME'.freeze,
  TIME_TWO_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.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,
  ANNOUNCEMENT_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_INACTIVE = 'INACTIVE'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
PLATFORM_TYPE_ENUM =
[
  PLATFORM_TYPE_IAAS = 'IAAS'.freeze,
  PLATFORM_TYPE_SAAS = 'SAAS'.freeze,
  PLATFORM_TYPE_PAAS = 'PAAS'.freeze,
  PLATFORM_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.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

  • :chain_id (String)

    The value to assign to the #chain_id property



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
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 259

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']

  self.chain_id = attributes[:'chainId'] if attributes[:'chainId']

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

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

Instance Attribute Details

#affected_regionsArray<String>

[Required] Impacted regions.

Returns:

  • (Array<String>)


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

def affected_regions
  @affected_regions
end

#announcement_typeString

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

Returns:

  • (String)


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

def announcement_type
  @announcement_type
end

#chain_idString

The sequence of connected announcements, or announcement chain, that this announcement belongs to. Related announcements share the same chain ID.

Returns:

  • (String)


159
160
161
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 159

def chain_id
  @chain_id
end

#environment_nameString

The name of the environment that this announcement pertains to.

Returns:

  • (String)


150
151
152
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 150

def environment_name
  @environment_name
end

#idString

[Required] The OCID of the announcement.

Returns:

  • (String)


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

def id
  @id
end

#is_bannerBOOLEAN

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

Returns:

  • (BOOLEAN)


133
134
135
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 133

def is_banner
  @is_banner
end

#lifecycle_stateString

[Required] The current lifecycle state of the announcement.

Returns:

  • (String)


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

def lifecycle_state
  @lifecycle_state
end

#platform_typeString

The platform type that this announcement pertains to.

Returns:

  • (String)


155
156
157
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 155

def platform_type
  @platform_type
end

#reference_ticket_numberString

[Required] The reference Jira ticket number.

Returns:

  • (String)


71
72
73
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 71

def reference_ticket_number
  @reference_ticket_number
end

#servicesArray<String>

[Required] Impacted Oracle Cloud Infrastructure services.

Returns:

  • (Array<String>)


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

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)


77
78
79
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 77

def summary
  @summary
end

#time_createdDateTime

The date and time the announcement was created, expressed in RFC 3339 timestamp format. Example: 2019-01-01T17:43:01.389+0000

Returns:

  • (DateTime)


139
140
141
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 139

def time_created
  @time_created
end

#time_one_titleString

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

Returns:

  • (String)


83
84
85
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 83

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)


89
90
91
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 89

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)


95
96
97
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 95

def time_one_value
  @time_one_value
end

#time_two_titleString

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

Returns:

  • (String)


101
102
103
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 101

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)


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

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)


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

def time_two_value
  @time_two_value
end

#time_updatedDateTime

The date and time the announcement was last updated, expressed in RFC 3339 timestamp format. Example: 2019-01-01T17:43:01.389+0000

Returns:

  • (DateTime)


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

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)


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

def type
  @type
end

Class Method Details

.attribute_mapObject

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



162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 162

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',
    'chain_id': :'chainId'
    # 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.



222
223
224
225
226
227
228
229
230
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 222

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.



190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 190

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',
    'chain_id': :'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



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

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 &&
    chain_id == other.chain_id
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



491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 491

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


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

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



480
481
482
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 480

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, chain_id].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



524
525
526
527
528
529
530
531
532
533
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 524

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



518
519
520
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 518

def to_s
  to_hash.to_s
end