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

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

Overview

Details of Activity Item

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

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



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/oci/cims/models/activity_item.rb', line 100

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

Instance Attribute Details

#activity_authorString

Person who updates the activity

Returns:

  • (String)


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

def activity_author
  @activity_author
end

#activity_typeString

Type of activity. eg: NOTES, UPDATE

Returns:

  • (String)


40
41
42
# File 'lib/oci/cims/models/activity_item.rb', line 40

def activity_type
  @activity_type
end

#commentsString

Comments to update as part of Activity

Returns:

  • (String)


28
29
30
# File 'lib/oci/cims/models/activity_item.rb', line 28

def comments
  @comments
end

#time_createdInteger

Epoch time when activity was created

Returns:

  • (Integer)


32
33
34
# File 'lib/oci/cims/models/activity_item.rb', line 32

def time_created
  @time_created
end

#time_updatedInteger

Epoch time when activity was updated

Returns:

  • (Integer)


36
37
38
# File 'lib/oci/cims/models/activity_item.rb', line 36

def time_updated
  @time_updated
end

Class Method Details

.attribute_mapObject

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



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/oci/cims/models/activity_item.rb', line 47

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

.swagger_typesObject

Attribute type mapping.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/oci/cims/models/activity_item.rb', line 66

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



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/oci/cims/models/activity_item.rb', line 170

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



210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# File 'lib/oci/cims/models/activity_item.rb', line 210

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


190
191
192
# File 'lib/oci/cims/models/activity_item.rb', line 190

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



199
200
201
# File 'lib/oci/cims/models/activity_item.rb', line 199

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

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



243
244
245
246
247
248
249
250
251
252
# File 'lib/oci/cims/models/activity_item.rb', line 243

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



237
238
239
# File 'lib/oci/cims/models/activity_item.rb', line 237

def to_s
  to_hash.to_s
end