Class: OCI::DataScience::Models::ScheduleIntervalTrigger

Inherits:
ScheduleTrigger show all
Defined in:
lib/oci/data_science/models/schedule_interval_trigger.rb

Overview

The interval schedule trigger.

Constant Summary collapse

FREQUENCY_ENUM =
[
  FREQUENCY_HOURLY = 'HOURLY'.freeze,
  FREQUENCY_DAILY = 'DAILY'.freeze,
  FREQUENCY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Constants inherited from ScheduleTrigger

OCI::DataScience::Models::ScheduleTrigger::TRIGGER_TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from ScheduleTrigger

#time_end, #time_start, #trigger_type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ScheduleTrigger

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ ScheduleIntervalTrigger

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :time_start (DateTime)

    The value to assign to the #time_start proprety

  • :time_end (DateTime)

    The value to assign to the #time_end proprety

  • :frequency (String)

    The value to assign to the #frequency property

  • :interval (Integer)

    The value to assign to the #interval property

  • :initial_jitter_in_minutes (Integer)

    The value to assign to the #initial_jitter_in_minutes property

  • :is_random_start_time (BOOLEAN)

    The value to assign to the #is_random_start_time property



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/oci/data_science/models/schedule_interval_trigger.rb', line 86

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  attributes['triggerType'] = 'INTERVAL'

  super(attributes)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

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

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

  self.initial_jitter_in_minutes = attributes[:'initialJitterInMinutes'] if attributes[:'initialJitterInMinutes']

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

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

  self.is_random_start_time = attributes[:'isRandomStartTime'] unless attributes[:'isRandomStartTime'].nil?
  self.is_random_start_time = false if is_random_start_time.nil? && !attributes.key?(:'isRandomStartTime') # rubocop:disable Style/StringLiterals

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

  self.is_random_start_time = attributes[:'is_random_start_time'] unless attributes[:'is_random_start_time'].nil?
  self.is_random_start_time = false if is_random_start_time.nil? && !attributes.key?(:'isRandomStartTime') && !attributes.key?(:'is_random_start_time') # rubocop:disable Style/StringLiterals
end

Instance Attribute Details

#frequencyString

[Required] The type of frequency

Returns:

  • (String)


21
22
23
# File 'lib/oci/data_science/models/schedule_interval_trigger.rb', line 21

def frequency
  @frequency
end

#initial_jitter_in_minutesInteger

Maximum number of minutes after timeStart that the scheduler may use to randomly select the first execution time. This value is considered only when isRandomStartTime is true. This value applies only to the initial execution; subsequent executions remain deterministic based on the resolved first trigger time. If timeStart is null, the service resolves the effective start time using the current time. The initial jitter window is then applied once to that resolved start time to determine the first execution time. If not provided and isRandomStartTime is true, the service defaults the jitter window to half of the configured interval duration. The value must not exceed the configured interval duration.

Returns:

  • (Integer)


36
37
38
# File 'lib/oci/data_science/models/schedule_interval_trigger.rb', line 36

def initial_jitter_in_minutes
  @initial_jitter_in_minutes
end

#intervalInteger

[Required] The interval of frequency.

Returns:

  • (Integer)


25
26
27
# File 'lib/oci/data_science/models/schedule_interval_trigger.rb', line 25

def interval
  @interval
end

#is_random_start_timeBOOLEAN

when true, system generates a randomized first start time between timeStart and timeStart + initialJitterInMinutes. if timeStart is null, the current time is used as the base start time.

Returns:

  • (BOOLEAN)


42
43
44
# File 'lib/oci/data_science/models/schedule_interval_trigger.rb', line 42

def is_random_start_time
  @is_random_start_time
end

Class Method Details

.attribute_mapObject

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



45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/oci/data_science/models/schedule_interval_trigger.rb', line 45

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'trigger_type': :'triggerType',
    'time_start': :'timeStart',
    'time_end': :'timeEnd',
    'frequency': :'frequency',
    'interval': :'interval',
    'initial_jitter_in_minutes': :'initialJitterInMinutes',
    'is_random_start_time': :'isRandomStartTime'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/oci/data_science/models/schedule_interval_trigger.rb', line 60

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'trigger_type': :'String',
    'time_start': :'DateTime',
    'time_end': :'DateTime',
    'frequency': :'String',
    'interval': :'Integer',
    'initial_jitter_in_minutes': :'Integer',
    'is_random_start_time': :'BOOLEAN'
    # 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



135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/oci/data_science/models/schedule_interval_trigger.rb', line 135

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

  self.class == other.class &&
    trigger_type == other.trigger_type &&
    time_start == other.time_start &&
    time_end == other.time_end &&
    frequency == other.frequency &&
    interval == other.interval &&
    initial_jitter_in_minutes == other.initial_jitter_in_minutes &&
    is_random_start_time == other.is_random_start_time
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



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# File 'lib/oci/data_science/models/schedule_interval_trigger.rb', line 171

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


151
152
153
# File 'lib/oci/data_science/models/schedule_interval_trigger.rb', line 151

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



160
161
162
# File 'lib/oci/data_science/models/schedule_interval_trigger.rb', line 160

def hash
  [trigger_type, time_start, time_end, frequency, interval, initial_jitter_in_minutes, is_random_start_time].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



204
205
206
207
208
209
210
211
212
213
# File 'lib/oci/data_science/models/schedule_interval_trigger.rb', line 204

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



198
199
200
# File 'lib/oci/data_science/models/schedule_interval_trigger.rb', line 198

def to_s
  to_hash.to_s
end