Class: OCI::Mysql::Models::CreateMaintenanceDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/mysql/models/create_maintenance_details.rb

Overview

The Maintenance Policy for the DB System or Read Replica that this model is included in.

Constant Summary collapse

VERSION_PREFERENCE_ENUM =
[
  VERSION_PREFERENCE_OLDEST = 'OLDEST'.freeze,
  VERSION_PREFERENCE_SECOND_NEWEST = 'SECOND_NEWEST'.freeze,
  VERSION_PREFERENCE_NEWEST = 'NEWEST'.freeze
].freeze
VERSION_TRACK_PREFERENCE_ENUM =
[
  VERSION_TRACK_PREFERENCE_LONG_TERM_SUPPORT = 'LONG_TERM_SUPPORT'.freeze,
  VERSION_TRACK_PREFERENCE_INNOVATION = 'INNOVATION'.freeze,
  VERSION_TRACK_PREFERENCE_FOLLOW = 'FOLLOW'.freeze
].freeze
MAINTENANCE_SCHEDULE_TYPE_ENUM =
[
  MAINTENANCE_SCHEDULE_TYPE_EARLY = 'EARLY'.freeze,
  MAINTENANCE_SCHEDULE_TYPE_REGULAR = 'REGULAR'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CreateMaintenanceDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/oci/mysql/models/create_maintenance_details.rb', line 110

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

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

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

  self.version_preference = attributes[:'versionPreference'] if attributes[:'versionPreference']
  self.version_preference = "OLDEST" if version_preference.nil? && !attributes.key?(:'versionPreference') # rubocop:disable Style/StringLiterals

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

  self.version_preference = attributes[:'version_preference'] if attributes[:'version_preference']
  self.version_preference = "OLDEST" if version_preference.nil? && !attributes.key?(:'versionPreference') && !attributes.key?(:'version_preference') # rubocop:disable Style/StringLiterals

  self.version_track_preference = attributes[:'versionTrackPreference'] if attributes[:'versionTrackPreference']
  self.version_track_preference = "FOLLOW" if version_track_preference.nil? && !attributes.key?(:'versionTrackPreference') # rubocop:disable Style/StringLiterals

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

  self.version_track_preference = attributes[:'version_track_preference'] if attributes[:'version_track_preference']
  self.version_track_preference = "FOLLOW" if version_track_preference.nil? && !attributes.key?(:'versionTrackPreference') && !attributes.key?(:'version_track_preference') # rubocop:disable Style/StringLiterals

  self.maintenance_schedule_type = attributes[:'maintenanceScheduleType'] if attributes[:'maintenanceScheduleType']
  self.maintenance_schedule_type = "REGULAR" if maintenance_schedule_type.nil? && !attributes.key?(:'maintenanceScheduleType') # rubocop:disable Style/StringLiterals

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

  self.maintenance_schedule_type = attributes[:'maintenance_schedule_type'] if attributes[:'maintenance_schedule_type']
  self.maintenance_schedule_type = "REGULAR" if maintenance_schedule_type.nil? && !attributes.key?(:'maintenanceScheduleType') && !attributes.key?(:'maintenance_schedule_type') # rubocop:disable Style/StringLiterals

  self.maintenance_disabled_windows = attributes[:'maintenanceDisabledWindows'] if attributes[:'maintenanceDisabledWindows']

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

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

Instance Attribute Details

#maintenance_disabled_windowsArray<OCI::Mysql::Models::MaintenanceDisabledWindow>

Time window during which downtime-inducing maintenance shall not be performed. Downtime-free maintenance may be performed to apply required security patches. At most one configured window is supported.



71
72
73
# File 'lib/oci/mysql/models/create_maintenance_details.rb', line 71

def maintenance_disabled_windows
  @maintenance_disabled_windows
end

#maintenance_schedule_typeString

The maintenance schedule type of the DB system. Defaults to REGULAR. EARLY: Maintenance schedule follows a cycle where upgrades are performed when versions become deprecated. REGULAR: Maintenance schedule follows the normal cycle where upgrades are performed when versions become unavailable.

Returns:

  • (String)


64
65
66
# File 'lib/oci/mysql/models/create_maintenance_details.rb', line 64

def maintenance_schedule_type
  @maintenance_schedule_type
end

#version_preferenceString

The preferred version to target when performing an automatic MySQL upgrade. Defaults to OLDEST.

OLDEST: Choose the oldest available MySQL version based on the current version of the DB System. SECOND_NEWEST: Choose the MySQL version before the newest for auto-upgrade. NEWEST: Choose the latest and greatest MySQL version available for auto-upgrade.

Returns:

  • (String)


49
50
51
# File 'lib/oci/mysql/models/create_maintenance_details.rb', line 49

def version_preference
  @version_preference
end

#version_track_preferenceString

The preferred version track to target when performing an automatic MySQL upgrade. Defaults to FOLLOW. LONG_TERM_SUPPORT: No MySQL database behavior changes. INNOVATION: Provides access to the latest features and all bug fixes. FOLLOW: Follows the track of the current MySQL version.

Returns:

  • (String)


57
58
59
# File 'lib/oci/mysql/models/create_maintenance_details.rb', line 57

def version_track_preference
  @version_track_preference
end

#window_start_timeString

[Required] The start of the 2 hour maintenance window.

This string is of the format: "day-of-week time-of-day".

"day-of-week" is a case-insensitive string like "mon", "tue", &c.

"time-of-day" is the "Time" portion of an RFC3339-formatted timestamp. Any second or sub-second time data will be truncated to zero.

If you set the read replica maintenance window to "" or if not specified, the read replica is set same as the DB system maintenance window.

Returns:

  • (String)


40
41
42
# File 'lib/oci/mysql/models/create_maintenance_details.rb', line 40

def window_start_time
  @window_start_time
end

Class Method Details

.attribute_mapObject

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



74
75
76
77
78
79
80
81
82
83
84
# File 'lib/oci/mysql/models/create_maintenance_details.rb', line 74

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'window_start_time': :'windowStartTime',
    'version_preference': :'versionPreference',
    'version_track_preference': :'versionTrackPreference',
    'maintenance_schedule_type': :'maintenanceScheduleType',
    'maintenance_disabled_windows': :'maintenanceDisabledWindows'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



87
88
89
90
91
92
93
94
95
96
97
# File 'lib/oci/mysql/models/create_maintenance_details.rb', line 87

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'window_start_time': :'String',
    'version_preference': :'String',
    'version_track_preference': :'String',
    'maintenance_schedule_type': :'String',
    'maintenance_disabled_windows': :'Array<OCI::Mysql::Models::MaintenanceDisabledWindow>'
    # 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



184
185
186
187
188
189
190
191
192
193
# File 'lib/oci/mysql/models/create_maintenance_details.rb', line 184

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

  self.class == other.class &&
    window_start_time == other.window_start_time &&
    version_preference == other.version_preference &&
    version_track_preference == other.version_track_preference &&
    maintenance_schedule_type == other.maintenance_schedule_type &&
    maintenance_disabled_windows == other.maintenance_disabled_windows
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



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/oci/mysql/models/create_maintenance_details.rb', line 218

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


198
199
200
# File 'lib/oci/mysql/models/create_maintenance_details.rb', line 198

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



207
208
209
# File 'lib/oci/mysql/models/create_maintenance_details.rb', line 207

def hash
  [window_start_time, version_preference, version_track_preference, maintenance_schedule_type, maintenance_disabled_windows].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



251
252
253
254
255
256
257
258
259
260
# File 'lib/oci/mysql/models/create_maintenance_details.rb', line 251

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



245
246
247
# File 'lib/oci/mysql/models/create_maintenance_details.rb', line 245

def to_s
  to_hash.to_s
end