Class: OCI::OsManagementHub::Models::WorkRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/os_management_hub/models/work_request.rb

Overview

Describes a work request.

Constant Summary collapse

OPERATION_TYPE_ENUM =
[
  OPERATION_TYPE_INSTALL_PACKAGES = 'INSTALL_PACKAGES'.freeze,
  OPERATION_TYPE_REMOVE_PACKAGES = 'REMOVE_PACKAGES'.freeze,
  OPERATION_TYPE_UPDATE_PACKAGES = 'UPDATE_PACKAGES'.freeze,
  OPERATION_TYPE_UPDATE_ALL_PACKAGES = 'UPDATE_ALL_PACKAGES'.freeze,
  OPERATION_TYPE_UPDATE_SECURITY = 'UPDATE_SECURITY'.freeze,
  OPERATION_TYPE_UPDATE_BUGFIX = 'UPDATE_BUGFIX'.freeze,
  OPERATION_TYPE_UPDATE_ENHANCEMENT = 'UPDATE_ENHANCEMENT'.freeze,
  OPERATION_TYPE_UPDATE_OTHER = 'UPDATE_OTHER'.freeze,
  OPERATION_TYPE_UPDATE_KSPLICE_KERNEL = 'UPDATE_KSPLICE_KERNEL'.freeze,
  OPERATION_TYPE_UPDATE_KSPLICE_USERSPACE = 'UPDATE_KSPLICE_USERSPACE'.freeze,
  OPERATION_TYPE_ENABLE_MODULE_STREAMS = 'ENABLE_MODULE_STREAMS'.freeze,
  OPERATION_TYPE_DISABLE_MODULE_STREAMS = 'DISABLE_MODULE_STREAMS'.freeze,
  OPERATION_TYPE_SWITCH_MODULE_STREAM = 'SWITCH_MODULE_STREAM'.freeze,
  OPERATION_TYPE_INSTALL_MODULE_PROFILES = 'INSTALL_MODULE_PROFILES'.freeze,
  OPERATION_TYPE_REMOVE_MODULE_PROFILES = 'REMOVE_MODULE_PROFILES'.freeze,
  OPERATION_TYPE_SET_SOFTWARE_SOURCES = 'SET_SOFTWARE_SOURCES'.freeze,
  OPERATION_TYPE_LIST_PACKAGES = 'LIST_PACKAGES'.freeze,
  OPERATION_TYPE_SET_MANAGEMENT_STATION_CONFIG = 'SET_MANAGEMENT_STATION_CONFIG'.freeze,
  OPERATION_TYPE_SYNC_MANAGEMENT_STATION_MIRROR = 'SYNC_MANAGEMENT_STATION_MIRROR'.freeze,
  OPERATION_TYPE_UPDATE_MANAGEMENT_STATION_SOFTWARE = 'UPDATE_MANAGEMENT_STATION_SOFTWARE'.freeze,
  OPERATION_TYPE_UPDATE = 'UPDATE'.freeze,
  OPERATION_TYPE_MODULE_ACTIONS = 'MODULE_ACTIONS'.freeze,
  OPERATION_TYPE_LIFECYCLE_PROMOTION = 'LIFECYCLE_PROMOTION'.freeze,
  OPERATION_TYPE_CREATE_SOFTWARE_SOURCE = 'CREATE_SOFTWARE_SOURCE'.freeze,
  OPERATION_TYPE_UPDATE_SOFTWARE_SOURCE = 'UPDATE_SOFTWARE_SOURCE'.freeze,
  OPERATION_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
STATUS_ENUM =
[
  STATUS_ACCEPTED = 'ACCEPTED'.freeze,
  STATUS_IN_PROGRESS = 'IN_PROGRESS'.freeze,
  STATUS_FAILED = 'FAILED'.freeze,
  STATUS_SUCCEEDED = 'SUCCEEDED'.freeze,
  STATUS_CANCELING = 'CANCELING'.freeze,
  STATUS_CANCELED = 'CANCELED'.freeze,
  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 = {}) ⇒ WorkRequest

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
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
# File 'lib/oci/os_management_hub/models/work_request.rb', line 218

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

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

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

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

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

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

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

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

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

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

  self.parent_id = attributes[:'parentId'] if attributes[:'parentId']

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

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

  self.children_id = attributes[:'childrenId'] if attributes[:'childrenId']

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

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

  self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']

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

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

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

  self.package_names = attributes[:'packageNames'] if attributes[:'packageNames']

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

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

  self.module_specs = attributes[:'moduleSpecs'] if attributes[:'moduleSpecs']

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

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

  self.percent_complete = attributes[:'percentComplete'] if attributes[:'percentComplete']

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

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

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

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

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

  self.time_finished = attributes[:'timeFinished'] if attributes[:'timeFinished']

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

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

  self.initiator_id = attributes[:'initiatorId'] if attributes[:'initiatorId']

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

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

  self.management_station = attributes[:'managementStation'] if attributes[:'managementStation']

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

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

Instance Attribute Details

#children_idArray<String>

The list of OCIDs for the child work requests.

Returns:

  • (Array<String>)


81
82
83
# File 'lib/oci/os_management_hub/models/work_request.rb', line 81

def children_id
  @children_id
end

#compartment_idString

[Required] The OCID of the compartment that contains the work request. Work requests should be scoped to the same compartment as the resource it affects. If the work request affects multiple resources, and those resources are not in the same compartment, it is up to the service team to pick the primary resource whose compartment should be used.

Returns:

  • (String)


89
90
91
# File 'lib/oci/os_management_hub/models/work_request.rb', line 89

def compartment_id
  @compartment_id
end

#descriptionString

A short description about the work request.

Returns:

  • (String)


65
66
67
# File 'lib/oci/os_management_hub/models/work_request.rb', line 65

def description
  @description
end

#display_nameString

A short display name for the work request.

Returns:

  • (String)


69
70
71
# File 'lib/oci/os_management_hub/models/work_request.rb', line 69

def display_name
  @display_name
end

#idString

[Required] The OCID of the work request.

Returns:

  • (String)


61
62
63
# File 'lib/oci/os_management_hub/models/work_request.rb', line 61

def id
  @id
end

#initiator_idString

The OCID of the resource that initiated the work request.

Returns:

  • (String)


134
135
136
# File 'lib/oci/os_management_hub/models/work_request.rb', line 134

def initiator_id
  @initiator_id
end

#management_stationOCI::OsManagementHub::Models::WorkRequestManagementStationDetails



137
138
139
# File 'lib/oci/os_management_hub/models/work_request.rb', line 137

def management_station
  @management_station
end

#messageString

A progress or error message, if there is any.

Returns:

  • (String)


73
74
75
# File 'lib/oci/os_management_hub/models/work_request.rb', line 73

def message
  @message
end

#module_specsArray<OCI::OsManagementHub::Models::ModuleSpecDetails>

The list of appstream modules being operated on.



101
102
103
# File 'lib/oci/os_management_hub/models/work_request.rb', line 101

def module_specs
  @module_specs
end

#operation_typeString

[Required] Type of the work request.

Returns:

  • (String)


53
54
55
# File 'lib/oci/os_management_hub/models/work_request.rb', line 53

def operation_type
  @operation_type
end

#package_namesArray<String>

A list of package names to be installed/updated/removed.

Returns:

  • (Array<String>)


97
98
99
# File 'lib/oci/os_management_hub/models/work_request.rb', line 97

def package_names
  @package_names
end

#parent_idString

The OCID of the parent work request, if there is any.

Returns:

  • (String)


77
78
79
# File 'lib/oci/os_management_hub/models/work_request.rb', line 77

def parent_id
  @parent_id
end

#percent_completeFloat

[Required] The percentage complete of the operation tracked by this work request.

Returns:

  • (Float)


105
106
107
# File 'lib/oci/os_management_hub/models/work_request.rb', line 105

def percent_complete
  @percent_complete
end

#resourcesArray<OCI::OsManagementHub::Models::WorkRequestResource>

[Required] The list of OCIDs for the resources affected by the work request.



93
94
95
# File 'lib/oci/os_management_hub/models/work_request.rb', line 93

def resources
  @resources
end

#statusString

[Required] Status of the work request.

Returns:

  • (String)


57
58
59
# File 'lib/oci/os_management_hub/models/work_request.rb', line 57

def status
  @status
end

#time_createdDateTime

[Required] The date and time the work request was created - as described in RFC 3339, section 14.29.

Returns:

  • (DateTime)


111
112
113
# File 'lib/oci/os_management_hub/models/work_request.rb', line 111

def time_created
  @time_created
end

#time_finishedDateTime

The date and time the work request was finished - as described in RFC 3339.

Returns:

  • (DateTime)


130
131
132
# File 'lib/oci/os_management_hub/models/work_request.rb', line 130

def time_finished
  @time_finished
end

#time_startedDateTime

The date and time the work request was started - as described in RFC 3339, section 14.29.

Returns:

  • (DateTime)


124
125
126
# File 'lib/oci/os_management_hub/models/work_request.rb', line 124

def time_started
  @time_started
end

#time_updatedDateTime

The date and time the work request was created - as described in RFC 3339, section 14.29.

Returns:

  • (DateTime)


117
118
119
# File 'lib/oci/os_management_hub/models/work_request.rb', line 117

def time_updated
  @time_updated
end

Class Method Details

.attribute_mapObject

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



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
# File 'lib/oci/os_management_hub/models/work_request.rb', line 140

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'operation_type': :'operationType',
    'status': :'status',
    'id': :'id',
    'description': :'description',
    'display_name': :'displayName',
    'message': :'message',
    'parent_id': :'parentId',
    'children_id': :'childrenId',
    'compartment_id': :'compartmentId',
    'resources': :'resources',
    'package_names': :'packageNames',
    'module_specs': :'moduleSpecs',
    'percent_complete': :'percentComplete',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'time_started': :'timeStarted',
    'time_finished': :'timeFinished',
    'initiator_id': :'initiatorId',
    'management_station': :'managementStation'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/oci/os_management_hub/models/work_request.rb', line 167

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'operation_type': :'String',
    'status': :'String',
    'id': :'String',
    'description': :'String',
    'display_name': :'String',
    'message': :'String',
    'parent_id': :'String',
    'children_id': :'Array<String>',
    'compartment_id': :'String',
    'resources': :'Array<OCI::OsManagementHub::Models::WorkRequestResource>',
    'package_names': :'Array<String>',
    'module_specs': :'Array<OCI::OsManagementHub::Models::ModuleSpecDetails>',
    'percent_complete': :'Float',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'time_started': :'DateTime',
    'time_finished': :'DateTime',
    'initiator_id': :'String',
    'management_station': :'OCI::OsManagementHub::Models::WorkRequestManagementStationDetails'
    # 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



352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
# File 'lib/oci/os_management_hub/models/work_request.rb', line 352

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

  self.class == other.class &&
    operation_type == other.operation_type &&
    status == other.status &&
    id == other.id &&
    description == other.description &&
    display_name == other.display_name &&
    message == other.message &&
    parent_id == other.parent_id &&
    children_id == other.children_id &&
    compartment_id == other.compartment_id &&
    resources == other.resources &&
    package_names == other.package_names &&
    module_specs == other.module_specs &&
    percent_complete == other.percent_complete &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    time_started == other.time_started &&
    time_finished == other.time_finished &&
    initiator_id == other.initiator_id &&
    management_station == other.management_station
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



400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/oci/os_management_hub/models/work_request.rb', line 400

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


380
381
382
# File 'lib/oci/os_management_hub/models/work_request.rb', line 380

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



389
390
391
# File 'lib/oci/os_management_hub/models/work_request.rb', line 389

def hash
  [operation_type, status, id, description, display_name, message, parent_id, children_id, compartment_id, resources, package_names, module_specs, percent_complete, time_created, time_updated, time_started, time_finished, initiator_id, management_station].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



433
434
435
436
437
438
439
440
441
442
# File 'lib/oci/os_management_hub/models/work_request.rb', line 433

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



427
428
429
# File 'lib/oci/os_management_hub/models/work_request.rb', line 427

def to_s
  to_hash.to_s
end