Class: SwaggyJenkinsClient::FreeStyleProject

Inherits:
Object
  • Object
show all
Defined in:
lib/swaggy_jenkins/models/free_style_project.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ FreeStyleProject

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
183
184
185
186
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
228
229
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
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 151

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `SwaggyJenkinsClient::FreeStyleProject` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggyJenkinsClient::FreeStyleProject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'_class')
    self._class = attributes[:'_class']
  end

  if attributes.key?(:'name')
    self.name = attributes[:'name']
  end

  if attributes.key?(:'url')
    self.url = attributes[:'url']
  end

  if attributes.key?(:'color')
    self.color = attributes[:'color']
  end

  if attributes.key?(:'actions')
    if (value = attributes[:'actions']).is_a?(Array)
      self.actions = value
    end
  end

  if attributes.key?(:'description')
    self.description = attributes[:'description']
  end

  if attributes.key?(:'display_name')
    self.display_name = attributes[:'display_name']
  end

  if attributes.key?(:'display_name_or_null')
    self.display_name_or_null = attributes[:'display_name_or_null']
  end

  if attributes.key?(:'full_display_name')
    self.full_display_name = attributes[:'full_display_name']
  end

  if attributes.key?(:'full_name')
    self.full_name = attributes[:'full_name']
  end

  if attributes.key?(:'buildable')
    self.buildable = attributes[:'buildable']
  end

  if attributes.key?(:'builds')
    if (value = attributes[:'builds']).is_a?(Array)
      self.builds = value
    end
  end

  if attributes.key?(:'first_build')
    self.first_build = attributes[:'first_build']
  end

  if attributes.key?(:'health_report')
    if (value = attributes[:'health_report']).is_a?(Array)
      self.health_report = value
    end
  end

  if attributes.key?(:'in_queue')
    self.in_queue = attributes[:'in_queue']
  end

  if attributes.key?(:'keep_dependencies')
    self.keep_dependencies = attributes[:'keep_dependencies']
  end

  if attributes.key?(:'last_build')
    self.last_build = attributes[:'last_build']
  end

  if attributes.key?(:'last_completed_build')
    self.last_completed_build = attributes[:'last_completed_build']
  end

  if attributes.key?(:'last_failed_build')
    self.last_failed_build = attributes[:'last_failed_build']
  end

  if attributes.key?(:'last_stable_build')
    self.last_stable_build = attributes[:'last_stable_build']
  end

  if attributes.key?(:'last_successful_build')
    self.last_successful_build = attributes[:'last_successful_build']
  end

  if attributes.key?(:'last_unstable_build')
    self.last_unstable_build = attributes[:'last_unstable_build']
  end

  if attributes.key?(:'last_unsuccessful_build')
    self.last_unsuccessful_build = attributes[:'last_unsuccessful_build']
  end

  if attributes.key?(:'next_build_number')
    self.next_build_number = attributes[:'next_build_number']
  end

  if attributes.key?(:'queue_item')
    self.queue_item = attributes[:'queue_item']
  end

  if attributes.key?(:'concurrent_build')
    self.concurrent_build = attributes[:'concurrent_build']
  end

  if attributes.key?(:'scm')
    self.scm = attributes[:'scm']
  end
end

Instance Attribute Details

#_classObject

Returns the value of attribute _class.



18
19
20
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 18

def _class
  @_class
end

#actionsObject

Returns the value of attribute actions.



26
27
28
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 26

def actions
  @actions
end

#buildableObject

Returns the value of attribute buildable.



38
39
40
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 38

def buildable
  @buildable
end

#buildsObject

Returns the value of attribute builds.



40
41
42
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 40

def builds
  @builds
end

#colorObject

Returns the value of attribute color.



24
25
26
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 24

def color
  @color
end

#concurrent_buildObject

Returns the value of attribute concurrent_build.



68
69
70
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 68

def concurrent_build
  @concurrent_build
end

#descriptionObject

Returns the value of attribute description.



28
29
30
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 28

def description
  @description
end

#display_nameObject

Returns the value of attribute display_name.



30
31
32
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 30

def display_name
  @display_name
end

#display_name_or_nullObject

Returns the value of attribute display_name_or_null.



32
33
34
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 32

def display_name_or_null
  @display_name_or_null
end

#first_buildObject

Returns the value of attribute first_build.



42
43
44
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 42

def first_build
  @first_build
end

#full_display_nameObject

Returns the value of attribute full_display_name.



34
35
36
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 34

def full_display_name
  @full_display_name
end

#full_nameObject

Returns the value of attribute full_name.



36
37
38
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 36

def full_name
  @full_name
end

#health_reportObject

Returns the value of attribute health_report.



44
45
46
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 44

def health_report
  @health_report
end

#in_queueObject

Returns the value of attribute in_queue.



46
47
48
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 46

def in_queue
  @in_queue
end

#keep_dependenciesObject

Returns the value of attribute keep_dependencies.



48
49
50
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 48

def keep_dependencies
  @keep_dependencies
end

#last_buildObject

Returns the value of attribute last_build.



50
51
52
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 50

def last_build
  @last_build
end

#last_completed_buildObject

Returns the value of attribute last_completed_build.



52
53
54
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 52

def last_completed_build
  @last_completed_build
end

#last_failed_buildObject

Returns the value of attribute last_failed_build.



54
55
56
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 54

def last_failed_build
  @last_failed_build
end

#last_stable_buildObject

Returns the value of attribute last_stable_build.



56
57
58
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 56

def last_stable_build
  @last_stable_build
end

#last_successful_buildObject

Returns the value of attribute last_successful_build.



58
59
60
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 58

def last_successful_build
  @last_successful_build
end

#last_unstable_buildObject

Returns the value of attribute last_unstable_build.



60
61
62
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 60

def last_unstable_build
  @last_unstable_build
end

#last_unsuccessful_buildObject

Returns the value of attribute last_unsuccessful_build.



62
63
64
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 62

def last_unsuccessful_build
  @last_unsuccessful_build
end

#nameObject

Returns the value of attribute name.



20
21
22
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 20

def name
  @name
end

#next_build_numberObject

Returns the value of attribute next_build_number.



64
65
66
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 64

def next_build_number
  @next_build_number
end

#queue_itemObject

Returns the value of attribute queue_item.



66
67
68
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 66

def queue_item
  @queue_item
end

#scmObject

Returns the value of attribute scm.



70
71
72
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 70

def scm
  @scm
end

#urlObject

Returns the value of attribute url.



22
23
24
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 22

def url
  @url
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 367

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = SwaggyJenkinsClient.const_get(type)
    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



106
107
108
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 106

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 73

def self.attribute_map
  {
    :'_class' => :'_class',
    :'name' => :'name',
    :'url' => :'url',
    :'color' => :'color',
    :'actions' => :'actions',
    :'description' => :'description',
    :'display_name' => :'displayName',
    :'display_name_or_null' => :'displayNameOrNull',
    :'full_display_name' => :'fullDisplayName',
    :'full_name' => :'fullName',
    :'buildable' => :'buildable',
    :'builds' => :'builds',
    :'first_build' => :'firstBuild',
    :'health_report' => :'healthReport',
    :'in_queue' => :'inQueue',
    :'keep_dependencies' => :'keepDependencies',
    :'last_build' => :'lastBuild',
    :'last_completed_build' => :'lastCompletedBuild',
    :'last_failed_build' => :'lastFailedBuild',
    :'last_stable_build' => :'lastStableBuild',
    :'last_successful_build' => :'lastSuccessfulBuild',
    :'last_unstable_build' => :'lastUnstableBuild',
    :'last_unsuccessful_build' => :'lastUnsuccessfulBuild',
    :'next_build_number' => :'nextBuildNumber',
    :'queue_item' => :'queueItem',
    :'concurrent_build' => :'concurrentBuild',
    :'scm' => :'scm'
  }
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



343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 343

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



144
145
146
147
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 144

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



111
112
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
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 111

def self.openapi_types
  {
    :'_class' => :'String',
    :'name' => :'String',
    :'url' => :'String',
    :'color' => :'String',
    :'actions' => :'Array<FreeStyleProjectactions>',
    :'description' => :'String',
    :'display_name' => :'String',
    :'display_name_or_null' => :'String',
    :'full_display_name' => :'String',
    :'full_name' => :'String',
    :'buildable' => :'Boolean',
    :'builds' => :'Array<FreeStyleBuild>',
    :'first_build' => :'FreeStyleBuild',
    :'health_report' => :'Array<FreeStyleProjecthealthReport>',
    :'in_queue' => :'Boolean',
    :'keep_dependencies' => :'Boolean',
    :'last_build' => :'FreeStyleBuild',
    :'last_completed_build' => :'FreeStyleBuild',
    :'last_failed_build' => :'String',
    :'last_stable_build' => :'FreeStyleBuild',
    :'last_successful_build' => :'FreeStyleBuild',
    :'last_unstable_build' => :'String',
    :'last_unsuccessful_build' => :'String',
    :'next_build_number' => :'Integer',
    :'queue_item' => :'String',
    :'concurrent_build' => :'Boolean',
    :'scm' => :'NullSCM'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 296

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      _class == o._class &&
      name == o.name &&
      url == o.url &&
      color == o.color &&
      actions == o.actions &&
      description == o.description &&
      display_name == o.display_name &&
      display_name_or_null == o.display_name_or_null &&
      full_display_name == o.full_display_name &&
      full_name == o.full_name &&
      buildable == o.buildable &&
      builds == o.builds &&
      first_build == o.first_build &&
      health_report == o.health_report &&
      in_queue == o.in_queue &&
      keep_dependencies == o.keep_dependencies &&
      last_build == o.last_build &&
      last_completed_build == o.last_completed_build &&
      last_failed_build == o.last_failed_build &&
      last_stable_build == o.last_stable_build &&
      last_successful_build == o.last_successful_build &&
      last_unstable_build == o.last_unstable_build &&
      last_unsuccessful_build == o.last_unsuccessful_build &&
      next_build_number == o.next_build_number &&
      queue_item == o.queue_item &&
      concurrent_build == o.concurrent_build &&
      scm == o.scm
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



438
439
440
441
442
443
444
445
446
447
448
449
450
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 438

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

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


330
331
332
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 330

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



336
337
338
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 336

def hash
  [_class, name, url, color, actions, description, display_name, display_name_or_null, full_display_name, full_name, buildable, builds, first_build, health_report, in_queue, keep_dependencies, last_build, last_completed_build, last_failed_build, last_stable_build, last_successful_build, last_unstable_build, last_unsuccessful_build, next_build_number, queue_item, concurrent_build, scm].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



281
282
283
284
285
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 281

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



414
415
416
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 414

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



420
421
422
423
424
425
426
427
428
429
430
431
432
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 420

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



408
409
410
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 408

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



289
290
291
292
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 289

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  true
end