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



129
130
131
132
133
134
135
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
# File 'lib/oci/cims/models/activity_item.rb', line 129

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

#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 milliseconds 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 milliseconds 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.



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/oci/cims/models/activity_item.rb', line 70

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'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/oci/cims/models/activity_item.rb', line 91

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



237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/oci/cims/models/activity_item.rb', line 237

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



279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/oci/cims/models/activity_item.rb', line 279

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


259
260
261
# File 'lib/oci/cims/models/activity_item.rb', line 259

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



268
269
270
# File 'lib/oci/cims/models/activity_item.rb', line 268

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

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



312
313
314
315
316
317
318
319
320
321
# File 'lib/oci/cims/models/activity_item.rb', line 312

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



306
307
308
# File 'lib/oci/cims/models/activity_item.rb', line 306

def to_s
  to_hash.to_s
end