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

  • :chain_id (String)

    The value to assign to the #chain_id property



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

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>)


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

def affected_regions
  @affected_regions
end

#announcement_typeString

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

Returns:

  • (String)


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

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)


152
153
154
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 152

def chain_id
  @chain_id
end

#environment_nameString

The name of the environment that this announcement pertains to.

Returns:

  • (String)


143
144
145
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 143

def environment_name
  @environment_name
end

#idString

[Required] The OCID of the announcement.

Returns:

  • (String)


56
57
58
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 56

def id
  @id
end

#is_bannerBOOLEAN

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

Returns:

  • (BOOLEAN)


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

def is_banner
  @is_banner
end

#lifecycle_stateString

[Required] The current lifecycle state of the announcement.

Returns:

  • (String)


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

def lifecycle_state
  @lifecycle_state
end

#platform_typeString

The platform type that this announcement pertains to.

Returns:

  • (String)


148
149
150
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 148

def platform_type
  @platform_type
end

#reference_ticket_numberString

[Required] The reference Jira ticket number.

Returns:

  • (String)


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

def reference_ticket_number
  @reference_ticket_number
end

#servicesArray<String>

[Required] Impacted Oracle Cloud Infrastructure services.

Returns:

  • (Array<String>)


110
111
112
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 110

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)


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

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)


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

def time_created
  @time_created
end

#time_one_titleString

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

Returns:

  • (String)


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

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)


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

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)


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

def time_one_value
  @time_one_value
end

#time_two_titleString

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

Returns:

  • (String)


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

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)


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

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)


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

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)


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

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)


60
61
62
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 60

def type
  @type
end

Class Method Details

.attribute_mapObject

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



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 155

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.



215
216
217
218
219
220
221
222
223
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 215

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.



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 183

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



410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 410

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



459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 459

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


439
440
441
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 439

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



448
449
450
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 448

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



492
493
494
495
496
497
498
499
500
501
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 492

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



486
487
488
# File 'lib/oci/announcements_service/models/base_announcement.rb', line 486

def to_s
  to_hash.to_s
end