Class: SwaggyJenkinsClient::FreeStyleProject

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ FreeStyleProject

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
278
279
280
281
282
283
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 156

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
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_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: " + acceptable_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

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



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

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



111
112
113
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 111

def self.acceptable_attributes
  acceptable_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



349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 349

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



149
150
151
152
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 149

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

.openapi_typesObject

Attribute type mapping.



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

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



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
327
328
329
330
331
332
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 302

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

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


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

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



342
343
344
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 342

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



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

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

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



371
372
373
374
375
376
377
378
379
380
381
382
383
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 371

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

#valid?Boolean

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

Returns:

  • (Boolean)

    true if the model is valid



295
296
297
298
# File 'lib/swaggy_jenkins/models/free_style_project.rb', line 295

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