Class: OCI::Cims::Models::ActivityItem

Inherits:
Item
  • Object
show all
Defined in:
lib/oci/cims/models/activity_item.rb

Overview

Details about the ActivityItem object.

Constant Summary collapse

ACTIVITY_TYPE_ENUM =
[
  ACTIVITY_TYPE_NOTES = 'NOTES'.freeze,
  ACTIVITY_TYPE_PROBLEM_DESCRIPTION = 'PROBLEM_DESCRIPTION'.freeze,
  ACTIVITY_TYPE_UPDATE = 'UPDATE'.freeze,
  ACTIVITY_TYPE_CLOSE = 'CLOSE'.freeze,
  ACTIVITY_TYPE_REOPEN = 'REOPEN'.freeze,
  ACTIVITY_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ACTIVITY_AUTHOR_ENUM =
[
  ACTIVITY_AUTHOR_CUSTOMER = 'CUSTOMER'.freeze,
  ACTIVITY_AUTHOR_ORACLE = 'ORACLE'.freeze,
  ACTIVITY_AUTHOR_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ITEM_TYPE_ENUM =
[
  ITEM_TYPE_ATTACHMENTS = 'ATTACHMENTS'.freeze,
  ITEM_TYPE_COMMENTS = 'COMMENTS'.freeze,
  ITEM_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ITEM_STATUS_ENUM =
[
  ITEM_STATUS_PROCESSING = 'PROCESSING'.freeze,
  ITEM_STATUS_ATTACHED = 'ATTACHED'.freeze,
  ITEM_STATUS_REMOVED = 'REMOVED'.freeze,
  ITEM_STATUS_FAILED = 'FAILED'.freeze,
  ITEM_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Attributes inherited from Item

#category, #issue_type, #item_key, #name, #sub_category, #type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Item

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ ActivityItem

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



136
137
138
139
140
141
142
143
144
145
146
147
148
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/oci/cims/models/activity_item.rb', line 136

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

  attributes['type'] = 'activity'

  super(attributes)

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

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

  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.activity_type = attributes[:'activityType'] if attributes[:'activityType']

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

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

  self.activity_author = attributes[:'activityAuthor'] if attributes[:'activityAuthor']

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

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

  self.item_type = attributes[:'itemType'] if attributes[:'itemType']

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

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

  self.item_status = attributes[:'itemStatus'] if attributes[:'itemStatus']

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

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

  self.attachment_id = attributes[:'attachmentID'] if attributes[:'attachmentID']

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

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

Instance Attribute Details

#activity_authorString

This attribute is required.

Returns:

  • (String)


60
61
62
# File 'lib/oci/cims/models/activity_item.rb', line 60

def activity_author
  @activity_author
end

#activity_typeString

[Required] The type of activity occuring on the support ticket.

Returns:

  • (String)


56
57
58
# File 'lib/oci/cims/models/activity_item.rb', line 56

def activity_type
  @activity_type
end

#attachment_idString

attachmentID for the ItemType Attachments only for Alloy realm.

Returns:

  • (String)


71
72
73
# File 'lib/oci/cims/models/activity_item.rb', line 71

def attachment_id
  @attachment_id
end

#commentsString

[Required] Comments added with the activity on the support ticket.

Returns:

  • (String)


44
45
46
# File 'lib/oci/cims/models/activity_item.rb', line 44

def comments
  @comments
end

#item_statusString

Who updates the activity on the support ticket.

Returns:

  • (String)


67
68
69
# File 'lib/oci/cims/models/activity_item.rb', line 67

def item_status
  @item_status
end

#item_typeString

Returns:

  • (String)


63
64
65
# File 'lib/oci/cims/models/activity_item.rb', line 63

def item_type
  @item_type
end

#time_createdInteger

[Required] The time when the activity was created, in seconds since epoch time.

Returns:

  • (Integer)


48
49
50
# File 'lib/oci/cims/models/activity_item.rb', line 48

def time_created
  @time_created
end

#time_updatedInteger

[Required] The time when the activity was updated, in seconds since epoch time.

Returns:

  • (Integer)


52
53
54
# File 'lib/oci/cims/models/activity_item.rb', line 52

def time_updated
  @time_updated
end

Class Method Details

.attribute_mapObject

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



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/oci/cims/models/activity_item.rb', line 74

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'item_key': :'itemKey',
    'name': :'name',
    'type': :'type',
    'category': :'category',
    'sub_category': :'subCategory',
    'issue_type': :'issueType',
    'comments': :'comments',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'activity_type': :'activityType',
    'activity_author': :'activityAuthor',
    'item_type': :'itemType',
    'item_status': :'itemStatus',
    'attachment_id': :'attachmentID'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/oci/cims/models/activity_item.rb', line 96

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'item_key': :'String',
    'name': :'String',
    'type': :'String',
    'category': :'OCI::Cims::Models::Category',
    'sub_category': :'OCI::Cims::Models::SubCategory',
    'issue_type': :'OCI::Cims::Models::IssueType',
    'comments': :'String',
    'time_created': :'Integer',
    'time_updated': :'Integer',
    'activity_type': :'String',
    'activity_author': :'String',
    'item_type': :'String',
    'item_status': :'String',
    'attachment_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



250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/oci/cims/models/activity_item.rb', line 250

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

  self.class == other.class &&
    item_key == other.item_key &&
    name == other.name &&
    type == other.type &&
    category == other.category &&
    sub_category == other.sub_category &&
    issue_type == other.issue_type &&
    comments == other.comments &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    activity_type == other.activity_type &&
    activity_author == other.activity_author &&
    item_type == other.item_type &&
    item_status == other.item_status &&
    attachment_id == other.attachment_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



293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
# File 'lib/oci/cims/models/activity_item.rb', line 293

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


273
274
275
# File 'lib/oci/cims/models/activity_item.rb', line 273

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



282
283
284
# File 'lib/oci/cims/models/activity_item.rb', line 282

def hash
  [item_key, name, type, category, sub_category, issue_type, comments, time_created, time_updated, activity_type, activity_author, item_type, item_status, attachment_id].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



326
327
328
329
330
331
332
333
334
335
# File 'lib/oci/cims/models/activity_item.rb', line 326

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



320
321
322
# File 'lib/oci/cims/models/activity_item.rb', line 320

def to_s
  to_hash.to_s
end