Class: OCI::Jms::Models::JreUsage

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/jms/models/jre_usage.rb

Overview

Java Runtime usage during a specified time period. A Java Runtime is identified by its vendor and version.

Constant Summary collapse

SECURITY_STATUS_ENUM =
[
  SECURITY_STATUS_EARLY_ACCESS = 'EARLY_ACCESS'.freeze,
  SECURITY_STATUS_UNKNOWN = 'UNKNOWN'.freeze,
  SECURITY_STATUS_UP_TO_DATE = 'UP_TO_DATE'.freeze,
  SECURITY_STATUS_UPDATE_REQUIRED = 'UPDATE_REQUIRED'.freeze,
  SECURITY_STATUS_UPGRADE_REQUIRED = 'UPGRADE_REQUIRED'.freeze,
  SECURITY_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ JreUsage

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
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
# File 'lib/oci/jms/models/jre_usage.rb', line 184

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

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

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

  self.managed_instance_id = attributes[:'managedInstanceId'] if attributes[:'managedInstanceId']

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

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

  self.security_status = attributes[:'securityStatus'] if attributes[:'securityStatus']

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

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

  self.release_date = attributes[:'releaseDate'] if attributes[:'releaseDate']

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

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

  self.end_of_support_life_date = attributes[:'endOfSupportLifeDate'] if attributes[:'endOfSupportLifeDate']

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

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

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

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

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

  self.days_under_security_baseline = attributes[:'daysUnderSecurityBaseline'] if attributes[:'daysUnderSecurityBaseline']

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

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

  self.operating_systems = attributes[:'operatingSystems'] if attributes[:'operatingSystems']

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

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

  self.approximate_installation_count = attributes[:'approximateInstallationCount'] if attributes[:'approximateInstallationCount']

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

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

  self.approximate_application_count = attributes[:'approximateApplicationCount'] if attributes[:'approximateApplicationCount']

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

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

  self.approximate_managed_instance_count = attributes[:'approximateManagedInstanceCount'] if attributes[:'approximateManagedInstanceCount']

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

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

  self.approximate_pending_work_request_count = attributes[:'approximatePendingWorkRequestCount'] if attributes[:'approximatePendingWorkRequestCount']

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

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

  self.time_start = attributes[:'timeStart'] if attributes[:'timeStart']

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

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

  self.time_end = attributes[:'timeEnd'] if attributes[:'timeEnd']

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

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

  self.time_first_seen = attributes[:'timeFirstSeen'] if attributes[:'timeFirstSeen']

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

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

  self.time_last_seen = attributes[:'timeLastSeen'] if attributes[:'timeLastSeen']

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

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

Instance Attribute Details

#approximate_application_countInteger

The approximate count of the applications running on this Java Runtime.

Returns:

  • (Integer)


71
72
73
# File 'lib/oci/jms/models/jre_usage.rb', line 71

def approximate_application_count
  @approximate_application_count
end

#approximate_installation_countInteger

The approximate count of installations that are installations of this Java Runtime.

Returns:

  • (Integer)


67
68
69
# File 'lib/oci/jms/models/jre_usage.rb', line 67

def approximate_installation_count
  @approximate_installation_count
end

#approximate_managed_instance_countInteger

The approximate count of the managed instances that report this Java Runtime.

Returns:

  • (Integer)


75
76
77
# File 'lib/oci/jms/models/jre_usage.rb', line 75

def approximate_managed_instance_count
  @approximate_managed_instance_count
end

#approximate_pending_work_request_countInteger

The approximate count of work requests working on this Java Runtime.

Returns:

  • (Integer)


79
80
81
# File 'lib/oci/jms/models/jre_usage.rb', line 79

def approximate_pending_work_request_count
  @approximate_pending_work_request_count
end

#days_under_security_baselineInteger

The number of days since this release has been under the security baseline.

Returns:

  • (Integer)


59
60
61
# File 'lib/oci/jms/models/jre_usage.rb', line 59

def days_under_security_baseline
  @days_under_security_baseline
end

#distributionString

[Required] The distribution of a Java Runtime is the name of the lineage of product to which it belongs, for example Java(TM) SE Runtime Environment.

Returns:

  • (String)


51
52
53
# File 'lib/oci/jms/models/jre_usage.rb', line 51

def distribution
  @distribution
end

#end_of_support_life_dateDateTime

The End of Support Life (EOSL) date of the Java Runtime (formatted according to RFC3339).

Returns:

  • (DateTime)


43
44
45
# File 'lib/oci/jms/models/jre_usage.rb', line 43

def end_of_support_life_date
  @end_of_support_life_date
end

#fleet_idString

The OCID of the related fleet.

Returns:

  • (String)


27
28
29
# File 'lib/oci/jms/models/jre_usage.rb', line 27

def fleet_id
  @fleet_id
end

#idString

The internal identifier of the Java Runtime.

Returns:

  • (String)


23
24
25
# File 'lib/oci/jms/models/jre_usage.rb', line 23

def id
  @id
end

#managed_instance_idString

The OCID of the related managed instance. This property value is present only for /listJreUsage.

Returns:

  • (String)


31
32
33
# File 'lib/oci/jms/models/jre_usage.rb', line 31

def managed_instance_id
  @managed_instance_id
end

#operating_systemsArray<OCI::Jms::Models::OperatingSystem>

The operating systems that have this Java Runtime installed.



63
64
65
# File 'lib/oci/jms/models/jre_usage.rb', line 63

def operating_systems
  @operating_systems
end

#release_dateDateTime

The release date of the Java Runtime (formatted according to RFC3339).

Returns:

  • (DateTime)


39
40
41
# File 'lib/oci/jms/models/jre_usage.rb', line 39

def release_date
  @release_date
end

#security_statusString

The security status of the Java Runtime.

Returns:

  • (String)


35
36
37
# File 'lib/oci/jms/models/jre_usage.rb', line 35

def security_status
  @security_status
end

#time_endDateTime

Upper bound of the specified time period filter. JMS provides a view of the data that is per day. The query uses only the date element of the parameter.

Returns:

  • (DateTime)


87
88
89
# File 'lib/oci/jms/models/jre_usage.rb', line 87

def time_end
  @time_end
end

#time_first_seenDateTime

The date and time the resource was first reported to JMS. This is potentially before the specified time period provided by the filters. For example, a resource can be first reported to JMS before the start of a specified time period, if it is also reported during the time period.

Returns:

  • (DateTime)


95
96
97
# File 'lib/oci/jms/models/jre_usage.rb', line 95

def time_first_seen
  @time_first_seen
end

#time_last_seenDateTime

The date and time the resource was last reported to JMS. This is potentially after the specified time period provided by the filters. For example, a resource can be last reported to JMS before the start of a specified time period, if it is also reported during the time period.

Returns:

  • (DateTime)


103
104
105
# File 'lib/oci/jms/models/jre_usage.rb', line 103

def time_last_seen
  @time_last_seen
end

#time_startDateTime

Lower bound of the specified time period filter. JMS provides a view of the data that is per day. The query uses only the date element of the parameter.

Returns:

  • (DateTime)


83
84
85
# File 'lib/oci/jms/models/jre_usage.rb', line 83

def time_start
  @time_start
end

#vendorString

[Required] The vendor of the Java Runtime.

Returns:

  • (String)


47
48
49
# File 'lib/oci/jms/models/jre_usage.rb', line 47

def vendor
  @vendor
end

#versionString

[Required] The version of the Java Runtime.

Returns:

  • (String)


55
56
57
# File 'lib/oci/jms/models/jre_usage.rb', line 55

def version
  @version
end

Class Method Details

.attribute_mapObject

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



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
# File 'lib/oci/jms/models/jre_usage.rb', line 106

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'fleet_id': :'fleetId',
    'managed_instance_id': :'managedInstanceId',
    'security_status': :'securityStatus',
    'release_date': :'releaseDate',
    'end_of_support_life_date': :'endOfSupportLifeDate',
    'vendor': :'vendor',
    'distribution': :'distribution',
    'version': :'version',
    'days_under_security_baseline': :'daysUnderSecurityBaseline',
    'operating_systems': :'operatingSystems',
    'approximate_installation_count': :'approximateInstallationCount',
    'approximate_application_count': :'approximateApplicationCount',
    'approximate_managed_instance_count': :'approximateManagedInstanceCount',
    'approximate_pending_work_request_count': :'approximatePendingWorkRequestCount',
    'time_start': :'timeStart',
    'time_end': :'timeEnd',
    'time_first_seen': :'timeFirstSeen',
    'time_last_seen': :'timeLastSeen'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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
# File 'lib/oci/jms/models/jre_usage.rb', line 133

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'fleet_id': :'String',
    'managed_instance_id': :'String',
    'security_status': :'String',
    'release_date': :'DateTime',
    'end_of_support_life_date': :'DateTime',
    'vendor': :'String',
    'distribution': :'String',
    'version': :'String',
    'days_under_security_baseline': :'Integer',
    'operating_systems': :'Array<OCI::Jms::Models::OperatingSystem>',
    'approximate_installation_count': :'Integer',
    'approximate_application_count': :'Integer',
    'approximate_managed_instance_count': :'Integer',
    'approximate_pending_work_request_count': :'Integer',
    'time_start': :'DateTime',
    'time_end': :'DateTime',
    'time_first_seen': :'DateTime',
    'time_last_seen': :'DateTime'
    # 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



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
# File 'lib/oci/jms/models/jre_usage.rb', line 309

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

  self.class == other.class &&
    id == other.id &&
    fleet_id == other.fleet_id &&
    managed_instance_id == other.managed_instance_id &&
    security_status == other.security_status &&
    release_date == other.release_date &&
    end_of_support_life_date == other.end_of_support_life_date &&
    vendor == other.vendor &&
    distribution == other.distribution &&
    version == other.version &&
    days_under_security_baseline == other.days_under_security_baseline &&
    operating_systems == other.operating_systems &&
    approximate_installation_count == other.approximate_installation_count &&
    approximate_application_count == other.approximate_application_count &&
    approximate_managed_instance_count == other.approximate_managed_instance_count &&
    approximate_pending_work_request_count == other.approximate_pending_work_request_count &&
    time_start == other.time_start &&
    time_end == other.time_end &&
    time_first_seen == other.time_first_seen &&
    time_last_seen == other.time_last_seen
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



357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/oci/jms/models/jre_usage.rb', line 357

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


337
338
339
# File 'lib/oci/jms/models/jre_usage.rb', line 337

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



346
347
348
# File 'lib/oci/jms/models/jre_usage.rb', line 346

def hash
  [id, fleet_id, managed_instance_id, security_status, release_date, end_of_support_life_date, vendor, distribution, version, days_under_security_baseline, operating_systems, approximate_installation_count, approximate_application_count, approximate_managed_instance_count, approximate_pending_work_request_count, time_start, time_end, time_first_seen, time_last_seen].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



390
391
392
393
394
395
396
397
398
399
# File 'lib/oci/jms/models/jre_usage.rb', line 390

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



384
385
386
# File 'lib/oci/jms/models/jre_usage.rb', line 384

def to_s
  to_hash.to_s
end