Class: CtdDocumentation::Task

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/ctd_documentation/models/task.rb

Overview

Task Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(allowed_days = SKIP, allowed_run_time_end = SKIP, allowed_run_time_start = SKIP, type = SKIP, end_time = SKIP, interval = SKIP, is_recurring = SKIP, name = SKIP, resource_id = SKIP, site_id = SKIP, status = SKIP, valid = SKIP, start_time = SKIP, assets_count = SKIP, extra_params = SKIP, enabled = SKIP, id = SKIP, last_start_run_time = SKIP, network_id = SKIP, active_type = SKIP) ⇒ Task

Returns a new instance of Task.



187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# File 'lib/ctd_documentation/models/task.rb', line 187

def initialize(allowed_days = SKIP,
               allowed_run_time_end = SKIP,
               allowed_run_time_start = SKIP,
               type = SKIP,
               end_time = SKIP,
               interval = SKIP,
               is_recurring = SKIP,
               name = SKIP,
               resource_id = SKIP,
               site_id = SKIP,
               status = SKIP,
               valid = SKIP,
               start_time = SKIP,
               assets_count = SKIP,
               extra_params = SKIP,
               enabled = SKIP,
               id = SKIP,
               last_start_run_time = SKIP,
               network_id = SKIP,
               active_type = SKIP)
  @allowed_days = allowed_days unless allowed_days == SKIP
  @allowed_run_time_end = allowed_run_time_end unless allowed_run_time_end == SKIP
  @allowed_run_time_start = allowed_run_time_start unless allowed_run_time_start == SKIP
  @type = type unless type == SKIP
  @end_time = end_time unless end_time == SKIP
  @interval = interval unless interval == SKIP
  @is_recurring = is_recurring unless is_recurring == SKIP
  @name = name unless name == SKIP
  @resource_id = resource_id unless resource_id == SKIP
  @site_id = site_id unless site_id == SKIP
  @status = status unless status == SKIP
  @valid = valid unless valid == SKIP
  @start_time = start_time unless start_time == SKIP
  @assets_count = assets_count unless assets_count == SKIP
  @extra_params = extra_params unless extra_params == SKIP
  @enabled = enabled unless enabled == SKIP
  @id = id unless id == SKIP
  @last_start_run_time = last_start_run_time unless last_start_run_time == SKIP
  @network_id = network_id unless network_id == SKIP
  @active_type = active_type unless active_type == SKIP
end

Instance Attribute Details

#active_typeInteger

Indicating 1 for query and 2 for task

Returns:

  • (Integer)


128
129
130
# File 'lib/ctd_documentation/models/task.rb', line 128

def active_type
  @active_type
end

#allowed_daysString

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (String)


16
17
18
# File 'lib/ctd_documentation/models/task.rb', line 16

def allowed_days
  @allowed_days
end

#allowed_run_time_endString

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (String)


22
23
24
# File 'lib/ctd_documentation/models/task.rb', line 22

def allowed_run_time_end
  @allowed_run_time_end
end

#allowed_run_time_startString

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (String)


28
29
30
# File 'lib/ctd_documentation/models/task.rb', line 28

def allowed_run_time_start
  @allowed_run_time_start
end

#assets_countInteger

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (Integer)


94
95
96
# File 'lib/ctd_documentation/models/task.rb', line 94

def assets_count
  @assets_count
end

#enabledTrueClass|FalseClass

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (TrueClass|FalseClass)


106
107
108
# File 'lib/ctd_documentation/models/task.rb', line 106

def enabled
  @enabled
end

#end_timeString

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (String)


40
41
42
# File 'lib/ctd_documentation/models/task.rb', line 40

def end_time
  @end_time
end

#extra_paramsTaskextraparams

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:



100
101
102
# File 'lib/ctd_documentation/models/task.rb', line 100

def extra_params
  @extra_params
end

#idString

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (String)


112
113
114
# File 'lib/ctd_documentation/models/task.rb', line 112

def id
  @id
end

#intervalString

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (String)


46
47
48
# File 'lib/ctd_documentation/models/task.rb', line 46

def interval
  @interval
end

#is_recurringTrueClass|FalseClass

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (TrueClass|FalseClass)


52
53
54
# File 'lib/ctd_documentation/models/task.rb', line 52

def is_recurring
  @is_recurring
end

#last_start_run_timeString

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (String)


118
119
120
# File 'lib/ctd_documentation/models/task.rb', line 118

def last_start_run_time
  @last_start_run_time
end

#nameString

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (String)


58
59
60
# File 'lib/ctd_documentation/models/task.rb', line 58

def name
  @name
end

#network_idInteger

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (Integer)


124
125
126
# File 'lib/ctd_documentation/models/task.rb', line 124

def network_id
  @network_id
end

#resource_idString

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (String)


64
65
66
# File 'lib/ctd_documentation/models/task.rb', line 64

def resource_id
  @resource_id
end

#site_idFloat

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (Float)


70
71
72
# File 'lib/ctd_documentation/models/task.rb', line 70

def site_id
  @site_id
end

#start_timeString

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (String)


88
89
90
# File 'lib/ctd_documentation/models/task.rb', line 88

def start_time
  @start_time
end

#statusString

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (String)


76
77
78
# File 'lib/ctd_documentation/models/task.rb', line 76

def status
  @status
end

#typeInteger

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (Integer)


34
35
36
# File 'lib/ctd_documentation/models/task.rb', line 34

def type
  @type
end

#validTrueClass|FalseClass

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (TrueClass|FalseClass)


82
83
84
# File 'lib/ctd_documentation/models/task.rb', line 82

def valid
  @valid
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# File 'lib/ctd_documentation/models/task.rb', line 230

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.

  allowed_days = hash.key?('allowed_days') ? hash['allowed_days'] : SKIP
  allowed_run_time_end =
    hash.key?('allowed_run_time_end') ? hash['allowed_run_time_end'] : SKIP
  allowed_run_time_start =
    hash.key?('allowed_run_time_start') ? hash['allowed_run_time_start'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  end_time = hash.key?('end_time') ? hash['end_time'] : SKIP
  interval = hash.key?('interval') ? hash['interval'] : SKIP
  is_recurring = hash.key?('is_recurring') ? hash['is_recurring'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  resource_id = hash.key?('resource_id') ? hash['resource_id'] : SKIP
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  valid = hash.key?('valid') ? hash['valid'] : SKIP
  start_time = hash.key?('start_time') ? hash['start_time'] : SKIP
  assets_count = hash.key?('assets_count') ? hash['assets_count'] : SKIP
  extra_params = Taskextraparams.from_hash(hash['extra_params']) if hash['extra_params']
  enabled = hash.key?('enabled') ? hash['enabled'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  last_start_run_time =
    hash.key?('last_start_run_time') ? hash['last_start_run_time'] : SKIP
  network_id = hash.key?('network_id') ? hash['network_id'] : SKIP
  active_type = hash.key?('active_type') ? hash['active_type'] : SKIP

  # Create object from extracted values.

  Task.new(allowed_days,
           allowed_run_time_end,
           allowed_run_time_start,
           type,
           end_time,
           interval,
           is_recurring,
           name,
           resource_id,
           site_id,
           status,
           valid,
           start_time,
           assets_count,
           extra_params,
           enabled,
           id,
           last_start_run_time,
           network_id,
           active_type)
end

.namesObject

A mapping from model property names to API property names.



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/ctd_documentation/models/task.rb', line 131

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['allowed_days'] = 'allowed_days'
  @_hash['allowed_run_time_end'] = 'allowed_run_time_end'
  @_hash['allowed_run_time_start'] = 'allowed_run_time_start'
  @_hash['type'] = 'type'
  @_hash['end_time'] = 'end_time'
  @_hash['interval'] = 'interval'
  @_hash['is_recurring'] = 'is_recurring'
  @_hash['name'] = 'name'
  @_hash['resource_id'] = 'resource_id'
  @_hash['site_id'] = 'site_id'
  @_hash['status'] = 'status'
  @_hash['valid'] = 'valid'
  @_hash['start_time'] = 'start_time'
  @_hash['assets_count'] = 'assets_count'
  @_hash['extra_params'] = 'extra_params'
  @_hash['enabled'] = 'enabled'
  @_hash['id'] = 'id'
  @_hash['last_start_run_time'] = 'last_start_run_time'
  @_hash['network_id'] = 'network_id'
  @_hash['active_type'] = 'active_type'
  @_hash
end

.nullablesObject

An array for nullable fields



183
184
185
# File 'lib/ctd_documentation/models/task.rb', line 183

def self.nullables
  []
end

.optionalsObject

An array for optional fields



157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/ctd_documentation/models/task.rb', line 157

def self.optionals
  %w[
    allowed_days
    allowed_run_time_end
    allowed_run_time_start
    type
    end_time
    interval
    is_recurring
    name
    resource_id
    site_id
    status
    valid
    start_time
    assets_count
    extra_params
    enabled
    id
    last_start_run_time
    network_id
    active_type
  ]
end