Class: OCI::Opensearch::Models::MaintenanceDetails
- Inherits:
-
Object
- Object
- OCI::Opensearch::Models::MaintenanceDetails
- Defined in:
- lib/oci/opensearch/models/maintenance_details.rb
Overview
Details for the maintenance activity.
Constant Summary collapse
- STATE_ENUM =
[ STATE_SCHEDULED = 'SCHEDULED'.freeze, STATE_RESCHEDULED = 'RESCHEDULED'.freeze, STATE_TO_BE_SCHEDULED = 'TO_BE_SCHEDULED'.freeze, STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#end_time ⇒ DateTime
End time of the maintenance activity.
-
#notification_email_ids ⇒ Array<String>
The Email Ids given the by customer to get notified about maintenance activities.
-
#start_time ⇒ DateTime
Start time of the maintenance activity.
-
#state ⇒ String
[Required] State of the maintenance activity.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ MaintenanceDetails
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ MaintenanceDetails
Initializes the object
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/oci/opensearch/models/maintenance_details.rb', line 69 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.state = attributes[:'state'] if attributes[:'state'] self.state = "TO_BE_SCHEDULED" if state.nil? && !attributes.key?(:'state') # rubocop:disable Style/StringLiterals self.start_time = attributes[:'startTime'] if attributes[:'startTime'] raise 'You cannot provide both :startTime and :start_time' if attributes.key?(:'startTime') && attributes.key?(:'start_time') self.start_time = attributes[:'start_time'] if attributes[:'start_time'] self.end_time = attributes[:'endTime'] if attributes[:'endTime'] raise 'You cannot provide both :endTime and :end_time' if attributes.key?(:'endTime') && attributes.key?(:'end_time') self.end_time = attributes[:'end_time'] if attributes[:'end_time'] self.notification_email_ids = attributes[:'notificationEmailIds'] if attributes[:'notificationEmailIds'] raise 'You cannot provide both :notificationEmailIds and :notification_email_ids' if attributes.key?(:'notificationEmailIds') && attributes.key?(:'notification_email_ids') self.notification_email_ids = attributes[:'notification_email_ids'] if attributes[:'notification_email_ids'] end |
Instance Attribute Details
#end_time ⇒ DateTime
End time of the maintenance activity
29 30 31 |
# File 'lib/oci/opensearch/models/maintenance_details.rb', line 29 def end_time @end_time end |
#notification_email_ids ⇒ Array<String>
The Email Ids given the by customer to get notified about maintenance activities
33 34 35 |
# File 'lib/oci/opensearch/models/maintenance_details.rb', line 33 def notification_email_ids @notification_email_ids end |
#start_time ⇒ DateTime
Start time of the maintenance activity
25 26 27 |
# File 'lib/oci/opensearch/models/maintenance_details.rb', line 25 def start_time @start_time end |
#state ⇒ String
[Required] State of the maintenance activity
21 22 23 |
# File 'lib/oci/opensearch/models/maintenance_details.rb', line 21 def state @state end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/oci/opensearch/models/maintenance_details.rb', line 36 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'state': :'state', 'start_time': :'startTime', 'end_time': :'endTime', 'notification_email_ids': :'notificationEmailIds' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/oci/opensearch/models/maintenance_details.rb', line 48 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'state': :'String', 'start_time': :'DateTime', 'end_time': :'DateTime', 'notification_email_ids': :'Array<String>' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
117 118 119 120 121 122 123 124 125 |
# File 'lib/oci/opensearch/models/maintenance_details.rb', line 117 def ==(other) return true if equal?(other) self.class == other.class && state == other.state && start_time == other.start_time && end_time == other.end_time && notification_email_ids == other.notification_email_ids end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/oci/opensearch/models/maintenance_details.rb', line 150 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
130 131 132 |
# File 'lib/oci/opensearch/models/maintenance_details.rb', line 130 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
139 140 141 |
# File 'lib/oci/opensearch/models/maintenance_details.rb', line 139 def hash [state, start_time, end_time, notification_email_ids].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
183 184 185 186 187 188 189 190 191 192 |
# File 'lib/oci/opensearch/models/maintenance_details.rb', line 183 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_s ⇒ String
Returns the string representation of the object
177 178 179 |
# File 'lib/oci/opensearch/models/maintenance_details.rb', line 177 def to_s to_hash.to_s end |