class OCI::DataIntegration::Models::TaskSchedule

A model that holds Schedule and other information required for scheduling a task.

Constants

AUTH_MODE_ENUM
EXPECTED_DURATION_UNIT_ENUM
RETRY_DELAY_UNIT_ENUM

Attributes

auth_mode[R]

The authorization mode for the task. @return [String]

config_provider_delegate[RW]

@return [OCI::DataIntegration::Models::ConfigProvider]

description[RW]

Detailed description for the object. @return [String]

end_time_millis[RW]

The end time in milliseconds. @return [Integer]

expected_duration[RW]

The expected duration of the task execution. @return [Float]

expected_duration_unit[R]

The expected duration unit of the task execution. @return [String]

identifier[RW]

Value can only contain upper case letters, underscore, and numbers. It should begin with upper case letter or underscore. The value can be modified. @return [String]

is_backfill_enabled[RW]

Whether the backfill is enabled @return [BOOLEAN]

is_concurrent_allowed[RW]

Whether the same task can be executed concurrently. @return [BOOLEAN]

is_enabled[RW]

Whether the schedule is enabled. @return [BOOLEAN]

key[RW]

Generated key that can be used in API calls to identify taskSchedule. On scenarios where reference to the taskSchedule is needed, a value can be passed in create. @return [String]

last_run_details[RW]

@return [OCI::DataIntegration::Models::LastRunDetails]

metadata[RW]

@return [OCI::DataIntegration::Models::ObjectMetadata]

model_type[RW]

The type of the object. @return [String]

model_version[RW]

This is a version number that is used by the service to upgrade objects if needed through releases of the service. @return [String]

name[RW]

Free form text without any restriction on permitted characters. Name can have letters, numbers, and special characters. The value is editable and is restricted to 1000 characters. @return [String]

object_status[RW]

The status of an object that can be set to value 1 for shallow references across objects, other values reserved. @return [Integer]

object_version[RW]

This is used by the service for optimistic locking of the object, to prevent multiple users from simultaneously updating the object. @return [Integer]

parent_ref[RW]

@return [OCI::DataIntegration::Models::ParentReference]

retry_attempts[RW]

The number of retry attempts. @return [Integer]

retry_delay[RW]

The retry delay, the unit for measurement is in the property retry delay unit. @return [Float]

retry_delay_unit[R]

The unit for the retry delay. @return [String]

schedule_ref[RW]

@return [OCI::DataIntegration::Models::Schedule]

start_time_millis[RW]

The start time in milliseconds. @return [Integer]

Public Class Methods

attribute_map() click to toggle source

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

# File lib/oci/data_integration/models/task_schedule.rb, line 126
def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'key',
    'model_version': :'modelVersion',
    'model_type': :'modelType',
    'parent_ref': :'parentRef',
    'name': :'name',
    'description': :'description',
    'object_version': :'objectVersion',
    'object_status': :'objectStatus',
    'identifier': :'identifier',
    'schedule_ref': :'scheduleRef',
    'config_provider_delegate': :'configProviderDelegate',
    'is_enabled': :'isEnabled',
    'retry_attempts': :'retryAttempts',
    'retry_delay_unit': :'retryDelayUnit',
    'retry_delay': :'retryDelay',
    'start_time_millis': :'startTimeMillis',
    'end_time_millis': :'endTimeMillis',
    'is_concurrent_allowed': :'isConcurrentAllowed',
    'is_backfill_enabled': :'isBackfillEnabled',
    'auth_mode': :'authMode',
    'expected_duration': :'expectedDuration',
    'expected_duration_unit': :'expectedDurationUnit',
    'last_run_details': :'lastRunDetails',
    'metadata': :'metadata'
    # rubocop:enable Style/SymbolLiteral
  }
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash @option attributes [String] :key The value to assign to the {#key} property @option attributes [String] :model_version The value to assign to the {#model_version} property @option attributes [String] :model_type The value to assign to the {#model_type} property @option attributes [OCI::DataIntegration::Models::ParentReference] :parent_ref The value to assign to the {#parent_ref} property @option attributes [String] :name The value to assign to the {#name} property @option attributes [String] :description The value to assign to the {#description} property @option attributes [Integer] :object_version The value to assign to the {#object_version} property @option attributes [Integer] :object_status The value to assign to the {#object_status} property @option attributes [String] :identifier The value to assign to the {#identifier} property @option attributes [OCI::DataIntegration::Models::Schedule] :schedule_ref The value to assign to the {#schedule_ref} property @option attributes [OCI::DataIntegration::Models::ConfigProvider] :config_provider_delegate The value to assign to the {#config_provider_delegate} property @option attributes [BOOLEAN] :is_enabled The value to assign to the {#is_enabled} property @option attributes [Integer] :retry_attempts The value to assign to the {#retry_attempts} property @option attributes [String] :retry_delay_unit The value to assign to the {#retry_delay_unit} property @option attributes [Float] :retry_delay The value to assign to the {#retry_delay} property @option attributes [Integer] :start_time_millis The value to assign to the {#start_time_millis} property @option attributes [Integer] :end_time_millis The value to assign to the {#end_time_millis} property @option attributes [BOOLEAN] :is_concurrent_allowed The value to assign to the {#is_concurrent_allowed} property @option attributes [BOOLEAN] :is_backfill_enabled The value to assign to the {#is_backfill_enabled} property @option attributes [String] :auth_mode The value to assign to the {#auth_mode} property @option attributes [Float] :expected_duration The value to assign to the {#expected_duration} property @option attributes [String] :expected_duration_unit The value to assign to the {#expected_duration_unit} property @option attributes [OCI::DataIntegration::Models::LastRunDetails] :last_run_details The value to assign to the {#last_run_details} property @option attributes [OCI::DataIntegration::Models::ObjectMetadata] :metadata The value to assign to the {#metadata} property

# File lib/oci/data_integration/models/task_schedule.rb, line 219
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.key = attributes[:'key'] if attributes[:'key']

  self.model_version = attributes[:'modelVersion'] if attributes[:'modelVersion']

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

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

  self.model_type = attributes[:'modelType'] if attributes[:'modelType']

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

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

  self.parent_ref = attributes[:'parentRef'] if attributes[:'parentRef']

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

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

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

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

  self.object_version = attributes[:'objectVersion'] if attributes[:'objectVersion']

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

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

  self.object_status = attributes[:'objectStatus'] if attributes[:'objectStatus']

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

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

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

  self.schedule_ref = attributes[:'scheduleRef'] if attributes[:'scheduleRef']

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

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

  self.config_provider_delegate = attributes[:'configProviderDelegate'] if attributes[:'configProviderDelegate']

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

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

  self.is_enabled = attributes[:'isEnabled'] unless attributes[:'isEnabled'].nil?

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

  self.is_enabled = attributes[:'is_enabled'] unless attributes[:'is_enabled'].nil?

  self.retry_attempts = attributes[:'retryAttempts'] if attributes[:'retryAttempts']

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

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

  self.retry_delay_unit = attributes[:'retryDelayUnit'] if attributes[:'retryDelayUnit']

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

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

  self.retry_delay = attributes[:'retryDelay'] if attributes[:'retryDelay']

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

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

  self.start_time_millis = attributes[:'startTimeMillis'] if attributes[:'startTimeMillis']

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

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

  self.end_time_millis = attributes[:'endTimeMillis'] if attributes[:'endTimeMillis']

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

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

  self.is_concurrent_allowed = attributes[:'isConcurrentAllowed'] unless attributes[:'isConcurrentAllowed'].nil?
  self.is_concurrent_allowed = true if is_concurrent_allowed.nil? && !attributes.key?(:'isConcurrentAllowed') # rubocop:disable Style/StringLiterals

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

  self.is_concurrent_allowed = attributes[:'is_concurrent_allowed'] unless attributes[:'is_concurrent_allowed'].nil?
  self.is_concurrent_allowed = true if is_concurrent_allowed.nil? && !attributes.key?(:'isConcurrentAllowed') && !attributes.key?(:'is_concurrent_allowed') # rubocop:disable Style/StringLiterals

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

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

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

  self.auth_mode = attributes[:'authMode'] if attributes[:'authMode']

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

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

  self.expected_duration = attributes[:'expectedDuration'] if attributes[:'expectedDuration']

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

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

  self.expected_duration_unit = attributes[:'expectedDurationUnit'] if attributes[:'expectedDurationUnit']

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

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

  self.last_run_details = attributes[:'lastRunDetails'] if attributes[:'lastRunDetails']

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

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

  self.metadata = attributes[:'metadata'] if attributes[:'metadata']
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/oci/data_integration/models/task_schedule.rb, line 158
def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'String',
    'model_version': :'String',
    'model_type': :'String',
    'parent_ref': :'OCI::DataIntegration::Models::ParentReference',
    'name': :'String',
    'description': :'String',
    'object_version': :'Integer',
    'object_status': :'Integer',
    'identifier': :'String',
    'schedule_ref': :'OCI::DataIntegration::Models::Schedule',
    'config_provider_delegate': :'OCI::DataIntegration::Models::ConfigProvider',
    'is_enabled': :'BOOLEAN',
    'retry_attempts': :'Integer',
    'retry_delay_unit': :'String',
    'retry_delay': :'Float',
    'start_time_millis': :'Integer',
    'end_time_millis': :'Integer',
    'is_concurrent_allowed': :'BOOLEAN',
    'is_backfill_enabled': :'BOOLEAN',
    'auth_mode': :'String',
    'expected_duration': :'Float',
    'expected_duration_unit': :'String',
    'last_run_details': :'OCI::DataIntegration::Models::LastRunDetails',
    'metadata': :'OCI::DataIntegration::Models::ObjectMetadata'
    # rubocop:enable Style/SymbolLiteral
  }
end

Public Instance Methods

==(other) click to toggle source

Checks equality by comparing each attribute. @param [Object] other the other object to be compared

# File lib/oci/data_integration/models/task_schedule.rb, line 400
def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    key == other.key &&
    model_version == other.model_version &&
    model_type == other.model_type &&
    parent_ref == other.parent_ref &&
    name == other.name &&
    description == other.description &&
    object_version == other.object_version &&
    object_status == other.object_status &&
    identifier == other.identifier &&
    schedule_ref == other.schedule_ref &&
    config_provider_delegate == other.config_provider_delegate &&
    is_enabled == other.is_enabled &&
    retry_attempts == other.retry_attempts &&
    retry_delay_unit == other.retry_delay_unit &&
    retry_delay == other.retry_delay &&
    start_time_millis == other.start_time_millis &&
    end_time_millis == other.end_time_millis &&
    is_concurrent_allowed == other.is_concurrent_allowed &&
    is_backfill_enabled == other.is_backfill_enabled &&
    auth_mode == other.auth_mode &&
    expected_duration == other.expected_duration &&
    expected_duration_unit == other.expected_duration_unit &&
    last_run_details == other.last_run_details &&
    metadata == other.metadata
end
auth_mode=(auth_mode) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] auth_mode Object to be assigned

# File lib/oci/data_integration/models/task_schedule.rb, line 371
def auth_mode=(auth_mode)
  # rubocop:disable Style/ConditionalAssignment
  if auth_mode && !AUTH_MODE_ENUM.include?(auth_mode)
    OCI.logger.debug("Unknown value for 'auth_mode' [" + auth_mode + "]. Mapping to 'AUTH_MODE_UNKNOWN_ENUM_VALUE'") if OCI.logger
    @auth_mode = AUTH_MODE_UNKNOWN_ENUM_VALUE
  else
    @auth_mode = auth_mode
  end
  # rubocop:enable Style/ConditionalAssignment
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/oci/data_integration/models/task_schedule.rb, line 453
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) click to toggle source

@see the `==` method @param [Object] other the other object to be compared

# File lib/oci/data_integration/models/task_schedule.rb, line 433
def eql?(other)
  self == other
end
expected_duration_unit=(expected_duration_unit) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] expected_duration_unit Object to be assigned

# File lib/oci/data_integration/models/task_schedule.rb, line 384
def expected_duration_unit=(expected_duration_unit)
  # rubocop:disable Style/ConditionalAssignment
  if expected_duration_unit && !EXPECTED_DURATION_UNIT_ENUM.include?(expected_duration_unit)
    OCI.logger.debug("Unknown value for 'expected_duration_unit' [" + expected_duration_unit + "]. Mapping to 'EXPECTED_DURATION_UNIT_UNKNOWN_ENUM_VALUE'") if OCI.logger
    @expected_duration_unit = EXPECTED_DURATION_UNIT_UNKNOWN_ENUM_VALUE
  else
    @expected_duration_unit = expected_duration_unit
  end
  # rubocop:enable Style/ConditionalAssignment
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Fixnum] Hash code

# File lib/oci/data_integration/models/task_schedule.rb, line 442
def hash
  [key, model_version, model_type, parent_ref, name, description, object_version, object_status, identifier, schedule_ref, config_provider_delegate, is_enabled, retry_attempts, retry_delay_unit, retry_delay, start_time_millis, end_time_millis, is_concurrent_allowed, is_backfill_enabled, auth_mode, expected_duration, expected_duration_unit, last_run_details, metadata].hash
end
retry_delay_unit=(retry_delay_unit) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] retry_delay_unit Object to be assigned

# File lib/oci/data_integration/models/task_schedule.rb, line 358
def retry_delay_unit=(retry_delay_unit)
  # rubocop:disable Style/ConditionalAssignment
  if retry_delay_unit && !RETRY_DELAY_UNIT_ENUM.include?(retry_delay_unit)
    OCI.logger.debug("Unknown value for 'retry_delay_unit' [" + retry_delay_unit + "]. Mapping to 'RETRY_DELAY_UNIT_UNKNOWN_ENUM_VALUE'") if OCI.logger
    @retry_delay_unit = RETRY_DELAY_UNIT_UNKNOWN_ENUM_VALUE
  else
    @retry_delay_unit = retry_delay_unit
  end
  # rubocop:enable Style/ConditionalAssignment
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/oci/data_integration/models/task_schedule.rb, line 486
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() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/oci/data_integration/models/task_schedule.rb, line 480
def to_s
  to_hash.to_s
end

Private Instance Methods

_to_hash(value) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# File lib/oci/data_integration/models/task_schedule.rb, line 503
def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end