Class: OCI::ComputeCloudAtCustomer::Models::CreateCccScheduleEvent
- Inherits:
-
Object
- Object
- OCI::ComputeCloudAtCustomer::Models::CreateCccScheduleEvent
- Defined in:
- lib/oci/compute_cloud_at_customer/models/create_ccc_schedule_event.rb
Overview
A period where upgrades may be applied to Compute Cloud@Customer infrastructures associated with the schedule. All upgrade windows may not be used.
Instance Attribute Summary collapse
-
#description ⇒ String
[Required] A description of the Compute Cloud@Customer upgrade schedule time block.
-
#schedule_event_duration ⇒ String
[Required] The duration of this block of time.
-
#schedule_event_recurrences ⇒ String
Frequency of recurrence of schedule block.
-
#time_start ⇒ DateTime
[Required] The date and time when the Compute Cloud@Customer upgrade schedule event starts, inclusive.
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 = {}) ⇒ CreateCccScheduleEvent
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 = {}) ⇒ CreateCccScheduleEvent
Initializes the object
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 96 |
# File 'lib/oci/compute_cloud_at_customer/models/create_ccc_schedule_event.rb', line 71 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.description = attributes[:'description'] if attributes[:'description'] self.time_start = attributes[:'timeStart'] if attributes[:'timeStart'] raise 'You cannot provide both :timeStart and :time_start' if attributes.key?(:'timeStart') && attributes.key?(:'time_start') self.time_start = attributes[:'time_start'] if attributes[:'time_start'] self.schedule_event_duration = attributes[:'scheduleEventDuration'] if attributes[:'scheduleEventDuration'] raise 'You cannot provide both :scheduleEventDuration and :schedule_event_duration' if attributes.key?(:'scheduleEventDuration') && attributes.key?(:'schedule_event_duration') self.schedule_event_duration = attributes[:'schedule_event_duration'] if attributes[:'schedule_event_duration'] self.schedule_event_recurrences = attributes[:'scheduleEventRecurrences'] if attributes[:'scheduleEventRecurrences'] raise 'You cannot provide both :scheduleEventRecurrences and :schedule_event_recurrences' if attributes.key?(:'scheduleEventRecurrences') && attributes.key?(:'schedule_event_recurrences') self.schedule_event_recurrences = attributes[:'schedule_event_recurrences'] if attributes[:'schedule_event_recurrences'] end |
Instance Attribute Details
#description ⇒ String
[Required] A description of the Compute Cloud@Customer upgrade schedule time block.
15 16 17 |
# File 'lib/oci/compute_cloud_at_customer/models/create_ccc_schedule_event.rb', line 15 def description @description end |
#schedule_event_duration ⇒ String
[Required] The duration of this block of time. The duration must be specified and be of the ISO-8601 format for durations.
28 29 30 |
# File 'lib/oci/compute_cloud_at_customer/models/create_ccc_schedule_event.rb', line 28 def schedule_event_duration @schedule_event_duration end |
#schedule_event_recurrences ⇒ String
Frequency of recurrence of schedule block. When this field is not included, the event is assumed to be a one time occurrence. The frequency field is strictly parsed and must conform to RFC-5545 formatting for recurrences.
35 36 37 |
# File 'lib/oci/compute_cloud_at_customer/models/create_ccc_schedule_event.rb', line 35 def schedule_event_recurrences @schedule_event_recurrences end |
#time_start ⇒ DateTime
[Required] The date and time when the Compute Cloud@Customer upgrade schedule event starts, inclusive. An RFC3339 formatted UTC datetime string. For an event with recurrences, this is the date that a recurrence can start being applied.
22 23 24 |
# File 'lib/oci/compute_cloud_at_customer/models/create_ccc_schedule_event.rb', line 22 def time_start @time_start end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/oci/compute_cloud_at_customer/models/create_ccc_schedule_event.rb', line 38 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'description': :'description', 'time_start': :'timeStart', 'schedule_event_duration': :'scheduleEventDuration', 'schedule_event_recurrences': :'scheduleEventRecurrences' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/oci/compute_cloud_at_customer/models/create_ccc_schedule_event.rb', line 50 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'description': :'String', 'time_start': :'DateTime', 'schedule_event_duration': :'String', 'schedule_event_recurrences': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
105 106 107 108 109 110 111 112 113 |
# File 'lib/oci/compute_cloud_at_customer/models/create_ccc_schedule_event.rb', line 105 def ==(other) return true if equal?(other) self.class == other.class && description == other.description && time_start == other.time_start && schedule_event_duration == other.schedule_event_duration && schedule_event_recurrences == other.schedule_event_recurrences end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/oci/compute_cloud_at_customer/models/create_ccc_schedule_event.rb', line 138 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
118 119 120 |
# File 'lib/oci/compute_cloud_at_customer/models/create_ccc_schedule_event.rb', line 118 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
127 128 129 |
# File 'lib/oci/compute_cloud_at_customer/models/create_ccc_schedule_event.rb', line 127 def hash [description, time_start, schedule_event_duration, schedule_event_recurrences].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
171 172 173 174 175 176 177 178 179 180 |
# File 'lib/oci/compute_cloud_at_customer/models/create_ccc_schedule_event.rb', line 171 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
165 166 167 |
# File 'lib/oci/compute_cloud_at_customer/models/create_ccc_schedule_event.rb', line 165 def to_s to_hash.to_s end |