Class: OCI::OsManagementHub::Models::ScheduledJobOperation

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

Overview

Defines an operation in a scheduled job.

Constant Summary collapse

OPERATION_TYPE_ENUM =
[
  OPERATION_TYPE_INSTALL_PACKAGES = 'INSTALL_PACKAGES'.freeze,
  OPERATION_TYPE_UPDATE_PACKAGES = 'UPDATE_PACKAGES'.freeze,
  OPERATION_TYPE_REMOVE_PACKAGES = 'REMOVE_PACKAGES'.freeze,
  OPERATION_TYPE_UPDATE_ALL = 'UPDATE_ALL'.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_USERSPACE = 'UPDATE_KSPLICE_USERSPACE'.freeze,
  OPERATION_TYPE_UPDATE_KSPLICE_KERNEL = 'UPDATE_KSPLICE_KERNEL'.freeze,
  OPERATION_TYPE_MANAGE_MODULE_STREAMS = 'MANAGE_MODULE_STREAMS'.freeze,
  OPERATION_TYPE_SWITCH_MODULE_STREAM = 'SWITCH_MODULE_STREAM'.freeze,
  OPERATION_TYPE_ATTACH_SOFTWARE_SOURCES = 'ATTACH_SOFTWARE_SOURCES'.freeze,
  OPERATION_TYPE_DETACH_SOFTWARE_SOURCES = 'DETACH_SOFTWARE_SOURCES'.freeze,
  OPERATION_TYPE_SYNC_MANAGEMENT_STATION_MIRROR = 'SYNC_MANAGEMENT_STATION_MIRROR'.freeze,
  OPERATION_TYPE_PROMOTE_LIFECYCLE = 'PROMOTE_LIFECYCLE'.freeze,
  OPERATION_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ScheduledJobOperation

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 87

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

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

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

  self.switch_module_streams_details = attributes[:'switchModuleStreamsDetails'] if attributes[:'switchModuleStreamsDetails']

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

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

  self.software_source_ids = attributes[:'softwareSourceIds'] if attributes[:'softwareSourceIds']

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

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

Instance Attribute Details

#manage_module_streams_detailsOCI::OsManagementHub::Models::ManageModuleStreamsInScheduledJobDetails



41
42
43
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 41

def manage_module_streams_details
  @manage_module_streams_details
end

#operation_typeString

[Required] The type of operation this scheduled job performs.

Returns:

  • (String)


34
35
36
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 34

def operation_type
  @operation_type
end

#package_namesArray<String>

The names of the target packages (only if operation type is INSTALL_PACKAGES/UPDATE_PACKAGES/REMOVE_PACKAGES).

Returns:

  • (Array<String>)


38
39
40
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 38

def package_names
  @package_names
end

#software_source_idsArray<String>

The OCIDs for the software sources (only if operation type is ATTACH_SOFTWARE_SOURCES/DETACH_SOFTWARE_SOURCES).

Returns:

  • (Array<String>)


48
49
50
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 48

def software_source_ids
  @software_source_ids
end

#switch_module_streams_detailsOCI::OsManagementHub::Models::ModuleStreamDetails



44
45
46
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 44

def switch_module_streams_details
  @switch_module_streams_details
end

Class Method Details

.attribute_mapObject

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



51
52
53
54
55
56
57
58
59
60
61
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 51

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'operation_type': :'operationType',
    'package_names': :'packageNames',
    'manage_module_streams_details': :'manageModuleStreamsDetails',
    'switch_module_streams_details': :'switchModuleStreamsDetails',
    'software_source_ids': :'softwareSourceIds'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



64
65
66
67
68
69
70
71
72
73
74
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 64

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'operation_type': :'String',
    'package_names': :'Array<String>',
    'manage_module_streams_details': :'OCI::OsManagementHub::Models::ManageModuleStreamsInScheduledJobDetails',
    'switch_module_streams_details': :'OCI::OsManagementHub::Models::ModuleStreamDetails',
    'software_source_ids': :'Array<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



144
145
146
147
148
149
150
151
152
153
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 144

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

  self.class == other.class &&
    operation_type == other.operation_type &&
    package_names == other.package_names &&
    manage_module_streams_details == other.manage_module_streams_details &&
    switch_module_streams_details == other.switch_module_streams_details &&
    software_source_ids == other.software_source_ids
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



178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 178

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


158
159
160
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 158

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



167
168
169
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 167

def hash
  [operation_type, package_names, manage_module_streams_details, switch_module_streams_details, software_source_ids].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



211
212
213
214
215
216
217
218
219
220
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 211

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



205
206
207
# File 'lib/oci/os_management_hub/models/scheduled_job_operation.rb', line 205

def to_s
  to_hash.to_s
end