Class: OCI::Jms::Models::TaskSchedule

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/jms/models/task_schedule.rb

Overview

The properties of a task schedule.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_INACTIVE = 'INACTIVE'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TaskSchedule

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :fleet_id (String)

    The value to assign to the #fleet_id property

  • :name (String)

    The value to assign to the #name property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :created_by (String)

    The value to assign to the #created_by property

  • :execution_recurrences (String)

    The value to assign to the #execution_recurrences property

  • :task_details (OCI::Jms::Models::TaskDetails)

    The value to assign to the #task_details property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :time_last_run (DateTime)

    The value to assign to the #time_last_run property

  • :time_next_run (DateTime)

    The value to assign to the #time_next_run property

  • :time_last_updated (DateTime)

    The value to assign to the #time_last_updated property



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/oci/jms/models/task_schedule.rb', line 119

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

  self.fleet_id = attributes[:'fleetId'] if attributes[:'fleetId']

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

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

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

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

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

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

  self.created_by = attributes[:'createdBy'] if attributes[:'createdBy']

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

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

  self.execution_recurrences = attributes[:'executionRecurrences'] if attributes[:'executionRecurrences']

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

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

  self.task_details = attributes[:'taskDetails'] if attributes[:'taskDetails']

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

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

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

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

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

  self.time_last_run = attributes[:'timeLastRun'] if attributes[:'timeLastRun']

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

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

  self.time_next_run = attributes[:'timeNextRun'] if attributes[:'timeNextRun']

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

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

  self.time_last_updated = attributes[:'timeLastUpdated'] if attributes[:'timeLastUpdated']

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

  self.time_last_updated = attributes[:'time_last_updated'] if attributes[:'time_last_updated']
end

Instance Attribute Details

#created_byString

[Required] Name of the task creator.

Returns:

  • (String)


36
37
38
# File 'lib/oci/jms/models/task_schedule.rb', line 36

def created_by
  @created_by
end

#execution_recurrencesString

[Required] Recurrence specification for the task schedule execution (formatted according to RFC-5545). To run daily for 10 occurrences starts on September 2, 2024 09:00 UTC, it should be 'DTSTART=20240902T090000Z; RRULE:FREQ=DAILY;COUNT=10'. To run every 3 hours from 9:00 AM to 5:00 PM on August 5, 2024 UTC, it should be 'DTSTART=20240805T090000Z;RRULE:FREQ=HOURLY;INTERVAL=3;UNTIL=20240805T170000Z'.

Returns:

  • (String)


42
43
44
# File 'lib/oci/jms/models/task_schedule.rb', line 42

def execution_recurrences
  @execution_recurrences
end

#fleet_idString

[Required] The OCID of the Fleet.

Returns:

  • (String)


24
25
26
# File 'lib/oci/jms/models/task_schedule.rb', line 24

def fleet_id
  @fleet_id
end

#idString

[Required] The OCID to identify this task schedule.

Returns:

  • (String)


20
21
22
# File 'lib/oci/jms/models/task_schedule.rb', line 20

def id
  @id
end

#lifecycle_stateString

[Required] All possible status of task schedule.

Returns:

  • (String)


32
33
34
# File 'lib/oci/jms/models/task_schedule.rb', line 32

def lifecycle_state
  @lifecycle_state
end

#nameString

[Required] The name of the task schedule.

Returns:

  • (String)


28
29
30
# File 'lib/oci/jms/models/task_schedule.rb', line 28

def name
  @name
end

#task_detailsOCI::Jms::Models::TaskDetails

This attribute is required.



46
47
48
# File 'lib/oci/jms/models/task_schedule.rb', line 46

def task_details
  @task_details
end

#time_createdDateTime

[Required] The date and time the task schedule was created (formatted according to RFC3339).

Returns:

  • (DateTime)


50
51
52
# File 'lib/oci/jms/models/task_schedule.rb', line 50

def time_created
  @time_created
end

#time_last_runDateTime

The date and time the task schedule ran last (formatted according to RFC3339).

Returns:

  • (DateTime)


54
55
56
# File 'lib/oci/jms/models/task_schedule.rb', line 54

def time_last_run
  @time_last_run
end

#time_last_updatedDateTime

[Required] The date and time the task schedule was last updated (formatted according to RFC3339).

Returns:

  • (DateTime)


62
63
64
# File 'lib/oci/jms/models/task_schedule.rb', line 62

def time_last_updated
  @time_last_updated
end

#time_next_runDateTime

The date and time the task schedule will run next (formatted according to RFC3339).

Returns:

  • (DateTime)


58
59
60
# File 'lib/oci/jms/models/task_schedule.rb', line 58

def time_next_run
  @time_next_run
end

Class Method Details

.attribute_mapObject

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



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/oci/jms/models/task_schedule.rb', line 65

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'fleet_id': :'fleetId',
    'name': :'name',
    'lifecycle_state': :'lifecycleState',
    'created_by': :'createdBy',
    'execution_recurrences': :'executionRecurrences',
    'task_details': :'taskDetails',
    'time_created': :'timeCreated',
    'time_last_run': :'timeLastRun',
    'time_next_run': :'timeNextRun',
    'time_last_updated': :'timeLastUpdated'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/oci/jms/models/task_schedule.rb', line 84

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'fleet_id': :'String',
    'name': :'String',
    'lifecycle_state': :'String',
    'created_by': :'String',
    'execution_recurrences': :'String',
    'task_details': :'OCI::Jms::Models::TaskDetails',
    'time_created': :'DateTime',
    'time_last_run': :'DateTime',
    'time_next_run': :'DateTime',
    'time_last_updated': :'DateTime'
    # 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



204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/oci/jms/models/task_schedule.rb', line 204

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

  self.class == other.class &&
    id == other.id &&
    fleet_id == other.fleet_id &&
    name == other.name &&
    lifecycle_state == other.lifecycle_state &&
    created_by == other.created_by &&
    execution_recurrences == other.execution_recurrences &&
    task_details == other.task_details &&
    time_created == other.time_created &&
    time_last_run == other.time_last_run &&
    time_next_run == other.time_next_run &&
    time_last_updated == other.time_last_updated
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



244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/oci/jms/models/task_schedule.rb', line 244

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


224
225
226
# File 'lib/oci/jms/models/task_schedule.rb', line 224

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



233
234
235
# File 'lib/oci/jms/models/task_schedule.rb', line 233

def hash
  [id, fleet_id, name, lifecycle_state, created_by, execution_recurrences, task_details, time_created, time_last_run, time_next_run, time_last_updated].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



277
278
279
280
281
282
283
284
285
286
# File 'lib/oci/jms/models/task_schedule.rb', line 277

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



271
272
273
# File 'lib/oci/jms/models/task_schedule.rb', line 271

def to_s
  to_hash.to_s
end