Class: OCI::ComputeCloudAtCustomer::Models::CccScheduleEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/compute_cloud_at_customer/models/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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CccScheduleEvent

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :name (String)

    The value to assign to the #name property

  • :description (String)

    The value to assign to the #description property

  • :time_start (DateTime)

    The value to assign to the #time_start property

  • :schedule_event_duration (String)

    The value to assign to the #schedule_event_duration property

  • :schedule_event_recurrences (String)

    The value to assign to the #schedule_event_recurrences property



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/oci/compute_cloud_at_customer/models/ccc_schedule_event.rb', line 78

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

  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

#descriptionString

[Required] A description of the Compute Cloud@Customer upgrade schedule time block.

Returns:

  • (String)


19
20
21
# File 'lib/oci/compute_cloud_at_customer/models/ccc_schedule_event.rb', line 19

def description
  @description
end

#nameString

[Required] Generated name associated with the event.

Returns:

  • (String)


15
16
17
# File 'lib/oci/compute_cloud_at_customer/models/ccc_schedule_event.rb', line 15

def name
  @name
end

#schedule_event_durationString

[Required] The duration of this block of time. The duration must be specified and be of the ISO-8601 format for durations.

Returns:

  • (String)


32
33
34
# File 'lib/oci/compute_cloud_at_customer/models/ccc_schedule_event.rb', line 32

def schedule_event_duration
  @schedule_event_duration
end

#schedule_event_recurrencesString

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.

Returns:

  • (String)


39
40
41
# File 'lib/oci/compute_cloud_at_customer/models/ccc_schedule_event.rb', line 39

def schedule_event_recurrences
  @schedule_event_recurrences
end

#time_startDateTime

[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.

Returns:

  • (DateTime)


26
27
28
# File 'lib/oci/compute_cloud_at_customer/models/ccc_schedule_event.rb', line 26

def time_start
  @time_start
end

Class Method Details

.attribute_mapObject

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



42
43
44
45
46
47
48
49
50
51
52
# File 'lib/oci/compute_cloud_at_customer/models/ccc_schedule_event.rb', line 42

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'name',
    'description': :'description',
    'time_start': :'timeStart',
    'schedule_event_duration': :'scheduleEventDuration',
    'schedule_event_recurrences': :'scheduleEventRecurrences'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



55
56
57
58
59
60
61
62
63
64
65
# File 'lib/oci/compute_cloud_at_customer/models/ccc_schedule_event.rb', line 55

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'String',
    '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.

Parameters:

  • other (Object)

    the other object to be compared



114
115
116
117
118
119
120
121
122
123
# File 'lib/oci/compute_cloud_at_customer/models/ccc_schedule_event.rb', line 114

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

  self.class == other.class &&
    name == other.name &&
    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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/oci/compute_cloud_at_customer/models/ccc_schedule_event.rb', line 148

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


128
129
130
# File 'lib/oci/compute_cloud_at_customer/models/ccc_schedule_event.rb', line 128

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



137
138
139
# File 'lib/oci/compute_cloud_at_customer/models/ccc_schedule_event.rb', line 137

def hash
  [name, description, time_start, schedule_event_duration, schedule_event_recurrences].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



181
182
183
184
185
186
187
188
189
190
# File 'lib/oci/compute_cloud_at_customer/models/ccc_schedule_event.rb', line 181

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



175
176
177
# File 'lib/oci/compute_cloud_at_customer/models/ccc_schedule_event.rb', line 175

def to_s
  to_hash.to_s
end