Class: OCI::OsManagement::Models::UpdateScheduledJobDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/os_management/models/update_scheduled_job_details.rb

Overview

Information for updating a Scheduled Job

Constant Summary collapse

SCHEDULE_TYPE_ENUM =
[
  SCHEDULE_TYPE_ONETIME = 'ONETIME'.freeze,
  SCHEDULE_TYPE_RECURRING = 'RECURRING'.freeze
].freeze
INTERVAL_TYPE_ENUM =
[
  INTERVAL_TYPE_HOUR = 'HOUR'.freeze,
  INTERVAL_TYPE_DAY = 'DAY'.freeze,
  INTERVAL_TYPE_WEEK = 'WEEK'.freeze,
  INTERVAL_TYPE_MONTH = 'MONTH'.freeze
].freeze
OPERATION_TYPE_ENUM =
[
  OPERATION_TYPE_INSTALL = 'INSTALL'.freeze,
  OPERATION_TYPE_UPDATE = 'UPDATE'.freeze,
  OPERATION_TYPE_REMOVE = 'REMOVE'.freeze,
  OPERATION_TYPE_UPDATEALL = 'UPDATEALL'.freeze
].freeze
UPDATE_TYPE_ENUM =
[
  UPDATE_TYPE_SECURITY = 'SECURITY'.freeze,
  UPDATE_TYPE_BUGFIX = 'BUGFIX'.freeze,
  UPDATE_TYPE_ENHANCEMENT = 'ENHANCEMENT'.freeze,
  UPDATE_TYPE_ALL = 'ALL'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ UpdateScheduledJobDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :display_name (String)

    The value to assign to the #display_name property

  • :description (String)

    The value to assign to the #description property

  • :schedule_type (String)

    The value to assign to the #schedule_type property

  • :time_next_execution (DateTime)

    The value to assign to the #time_next_execution property

  • :interval_type (String)

    The value to assign to the #interval_type property

  • :interval_value (String)

    The value to assign to the #interval_value property

  • :operation_type (String)

    The value to assign to the #operation_type property

  • :update_type (String)

    The value to assign to the #update_type property

  • :package_names (Array<OCI::OsManagement::Models::PackageName>)

    The value to assign to the #package_names property

  • :update_names (Array<String>)

    The value to assign to the #update_names property

  • :freeform_tags (Hash<String, String>)

    The value to assign to the #freeform_tags property

  • :defined_tags (Hash<String, Hash<String, Object>>)

    The value to assign to the #defined_tags property



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
177
178
179
180
181
182
183
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
# File 'lib/oci/os_management/models/update_scheduled_job_details.rb', line 148

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

  self.schedule_type = attributes[:'scheduleType'] if attributes[:'scheduleType']

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

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

  self.time_next_execution = attributes[:'timeNextExecution'] if attributes[:'timeNextExecution']

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

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

  self.interval_type = attributes[:'intervalType'] if attributes[:'intervalType']

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

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

  self.interval_value = attributes[:'intervalValue'] if attributes[:'intervalValue']

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

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

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

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

  self.update_type = attributes[:'update_type'] if attributes[:'update_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.update_names = attributes[:'updateNames'] if attributes[:'updateNames']

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

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

  self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

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

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

  self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

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

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

Instance Attribute Details

#defined_tagsHash<String, Hash<String, Object>>

Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {\"foo-namespace\": {\"bar-key\": \"value\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


88
89
90
# File 'lib/oci/os_management/models/update_scheduled_job_details.rb', line 88

def defined_tags
  @defined_tags
end

#descriptionString

Details describing the Scheduled Job.

Returns:

  • (String)


42
43
44
# File 'lib/oci/os_management/models/update_scheduled_job_details.rb', line 42

def description
  @description
end

#display_nameString

Scheduled Job name

Returns:

  • (String)


38
39
40
# File 'lib/oci/os_management/models/update_scheduled_job_details.rb', line 38

def display_name
  @display_name
end

#freeform_tagsHash<String, String>

Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {\"bar-key\": \"value\"}

Returns:

  • (Hash<String, String>)


82
83
84
# File 'lib/oci/os_management/models/update_scheduled_job_details.rb', line 82

def freeform_tags
  @freeform_tags
end

#interval_typeString

the interval period for a recurring Scheduled Job (only if schedule type is RECURRING)

Returns:

  • (String)


54
55
56
# File 'lib/oci/os_management/models/update_scheduled_job_details.rb', line 54

def interval_type
  @interval_type
end

#interval_valueString

the value for the interval period for a recurring Scheduled Job (only if schedule type is RECURRING)

Returns:

  • (String)


58
59
60
# File 'lib/oci/os_management/models/update_scheduled_job_details.rb', line 58

def interval_value
  @interval_value
end

#operation_typeString

the type of operation this Scheduled Job performs

Returns:

  • (String)


62
63
64
# File 'lib/oci/os_management/models/update_scheduled_job_details.rb', line 62

def operation_type
  @operation_type
end

#package_namesArray<OCI::OsManagement::Models::PackageName>

the id of the package (only if operation type is INSTALL/UPDATE/REMOVE)



70
71
72
# File 'lib/oci/os_management/models/update_scheduled_job_details.rb', line 70

def package_names
  @package_names
end

#schedule_typeString

the type of scheduling this Scheduled Job follows

Returns:

  • (String)


46
47
48
# File 'lib/oci/os_management/models/update_scheduled_job_details.rb', line 46

def schedule_type
  @schedule_type
end

#time_next_executionDateTime

the desired time for the next execution of this Scheduled Job

Returns:

  • (DateTime)


50
51
52
# File 'lib/oci/os_management/models/update_scheduled_job_details.rb', line 50

def time_next_execution
  @time_next_execution
end

#update_namesArray<String>

The unique names of the Windows Updates (only if operation type is INSTALL). This is only applicable when the osFamily is for Windows managed instances.

Returns:

  • (Array<String>)


76
77
78
# File 'lib/oci/os_management/models/update_scheduled_job_details.rb', line 76

def update_names
  @update_names
end

#update_typeString

Type of the update (only if operation type is UPDATEALL)

Returns:

  • (String)


66
67
68
# File 'lib/oci/os_management/models/update_scheduled_job_details.rb', line 66

def update_type
  @update_type
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'displayName',
    'description': :'description',
    'schedule_type': :'scheduleType',
    'time_next_execution': :'timeNextExecution',
    'interval_type': :'intervalType',
    'interval_value': :'intervalValue',
    'operation_type': :'operationType',
    'update_type': :'updateType',
    'package_names': :'packageNames',
    'update_names': :'updateNames',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/oci/os_management/models/update_scheduled_job_details.rb', line 111

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'String',
    'description': :'String',
    'schedule_type': :'String',
    'time_next_execution': :'DateTime',
    'interval_type': :'String',
    'interval_value': :'String',
    'operation_type': :'String',
    'update_type': :'String',
    'package_names': :'Array<OCI::OsManagement::Models::PackageName>',
    'update_names': :'Array<String>',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>'
    # 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



262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# File 'lib/oci/os_management/models/update_scheduled_job_details.rb', line 262

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

  self.class == other.class &&
    display_name == other.display_name &&
    description == other.description &&
    schedule_type == other.schedule_type &&
    time_next_execution == other.time_next_execution &&
    interval_type == other.interval_type &&
    interval_value == other.interval_value &&
    operation_type == other.operation_type &&
    update_type == other.update_type &&
    package_names == other.package_names &&
    update_names == other.update_names &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags
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



303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# File 'lib/oci/os_management/models/update_scheduled_job_details.rb', line 303

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


283
284
285
# File 'lib/oci/os_management/models/update_scheduled_job_details.rb', line 283

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



292
293
294
# File 'lib/oci/os_management/models/update_scheduled_job_details.rb', line 292

def hash
  [display_name, description, schedule_type, time_next_execution, interval_type, interval_value, operation_type, update_type, package_names, update_names, freeform_tags, defined_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



336
337
338
339
340
341
342
343
344
345
# File 'lib/oci/os_management/models/update_scheduled_job_details.rb', line 336

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



330
331
332
# File 'lib/oci/os_management/models/update_scheduled_job_details.rb', line 330

def to_s
  to_hash.to_s
end