Class: OCI::Jms::Models::TaskScheduleSummary

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

Overview

A summary of the task schedule properties.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TaskScheduleSummary

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



113
114
115
116
117
118
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
# File 'lib/oci/jms/models/task_schedule_summary.rb', line 113

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] The name of the task creator.

Returns:

  • (String)


30
31
32
# File 'lib/oci/jms/models/task_schedule_summary.rb', line 30

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)


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

def execution_recurrences
  @execution_recurrences
end

#fleet_idString

[Required] The OCID of the Fleet.

Returns:

  • (String)


18
19
20
# File 'lib/oci/jms/models/task_schedule_summary.rb', line 18

def fleet_id
  @fleet_id
end

#idString

[Required] The OCID to identify this task schedule.

Returns:

  • (String)


14
15
16
# File 'lib/oci/jms/models/task_schedule_summary.rb', line 14

def id
  @id
end

#lifecycle_stateString

[Required] The current state of the task schedule.

Returns:

  • (String)


26
27
28
# File 'lib/oci/jms/models/task_schedule_summary.rb', line 26

def lifecycle_state
  @lifecycle_state
end

#nameString

[Required] The name of the task schedule.

Returns:

  • (String)


22
23
24
# File 'lib/oci/jms/models/task_schedule_summary.rb', line 22

def name
  @name
end

#task_detailsOCI::Jms::Models::TaskDetails

This attribute is required.



40
41
42
# File 'lib/oci/jms/models/task_schedule_summary.rb', line 40

def task_details
  @task_details
end

#time_createdDateTime

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

Returns:

  • (DateTime)


44
45
46
# File 'lib/oci/jms/models/task_schedule_summary.rb', line 44

def time_created
  @time_created
end

#time_last_runDateTime

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

Returns:

  • (DateTime)


48
49
50
# File 'lib/oci/jms/models/task_schedule_summary.rb', line 48

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)


56
57
58
# File 'lib/oci/jms/models/task_schedule_summary.rb', line 56

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)


52
53
54
# File 'lib/oci/jms/models/task_schedule_summary.rb', line 52

def time_next_run
  @time_next_run
end

Class Method Details

.attribute_mapObject

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



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/oci/jms/models/task_schedule_summary.rb', line 59

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.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/oci/jms/models/task_schedule_summary.rb', line 78

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



185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/oci/jms/models/task_schedule_summary.rb', line 185

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



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/oci/jms/models/task_schedule_summary.rb', line 225

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


205
206
207
# File 'lib/oci/jms/models/task_schedule_summary.rb', line 205

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



214
215
216
# File 'lib/oci/jms/models/task_schedule_summary.rb', line 214

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



258
259
260
261
262
263
264
265
266
267
# File 'lib/oci/jms/models/task_schedule_summary.rb', line 258

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



252
253
254
# File 'lib/oci/jms/models/task_schedule_summary.rb', line 252

def to_s
  to_hash.to_s
end