Class: SwaggyJenkinsClient::Hudson
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- SwaggyJenkinsClient::Hudson
- Defined in:
- lib/swaggy_jenkins/models/hudson.rb
Instance Attribute Summary collapse
-
#_class ⇒ Object
Returns the value of attribute _class.
-
#assigned_labels ⇒ Object
Returns the value of attribute assigned_labels.
-
#description ⇒ Object
Returns the value of attribute description.
-
#jobs ⇒ Object
Returns the value of attribute jobs.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#node_description ⇒ Object
Returns the value of attribute node_description.
-
#node_name ⇒ Object
Returns the value of attribute node_name.
-
#num_executors ⇒ Object
Returns the value of attribute num_executors.
-
#primary_view ⇒ Object
Returns the value of attribute primary_view.
-
#quieting_down ⇒ Object
Returns the value of attribute quieting_down.
-
#slave_agent_port ⇒ Object
Returns the value of attribute slave_agent_port.
-
#unlabeled_load ⇒ Object
Returns the value of attribute unlabeled_load.
-
#use_crumbs ⇒ Object
Returns the value of attribute use_crumbs.
-
#use_security ⇒ Object
Returns the value of attribute use_security.
-
#views ⇒ Object
Returns the value of attribute views.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Hudson
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ Hudson
Initializes the object
108 109 110 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 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 183 184 185 186 187 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 108 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `SwaggyJenkinsClient::Hudson` 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::Hudson`. 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?(:'assigned_labels') if (value = attributes[:'assigned_labels']).is_a?(Array) self.assigned_labels = value end end if attributes.key?(:'mode') self.mode = attributes[:'mode'] end if attributes.key?(:'node_description') self.node_description = attributes[:'node_description'] end if attributes.key?(:'node_name') self.node_name = attributes[:'node_name'] end if attributes.key?(:'num_executors') self.num_executors = attributes[:'num_executors'] end if attributes.key?(:'description') self.description = attributes[:'description'] end if attributes.key?(:'jobs') if (value = attributes[:'jobs']).is_a?(Array) self.jobs = value end end if attributes.key?(:'primary_view') self.primary_view = attributes[:'primary_view'] end if attributes.key?(:'quieting_down') self.quieting_down = attributes[:'quieting_down'] end if attributes.key?(:'slave_agent_port') self.slave_agent_port = attributes[:'slave_agent_port'] end if attributes.key?(:'unlabeled_load') self.unlabeled_load = attributes[:'unlabeled_load'] end if attributes.key?(:'use_crumbs') self.use_crumbs = attributes[:'use_crumbs'] end if attributes.key?(:'use_security') self.use_security = attributes[:'use_security'] end if attributes.key?(:'views') if (value = attributes[:'views']).is_a?(Array) self.views = value end end end |
Instance Attribute Details
#_class ⇒ Object
Returns the value of attribute _class.
18 19 20 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 18 def _class @_class end |
#assigned_labels ⇒ Object
Returns the value of attribute assigned_labels.
20 21 22 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 20 def assigned_labels @assigned_labels end |
#description ⇒ Object
Returns the value of attribute description.
30 31 32 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 30 def description @description end |
#jobs ⇒ Object
Returns the value of attribute jobs.
32 33 34 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 32 def jobs @jobs end |
#mode ⇒ Object
Returns the value of attribute mode.
22 23 24 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 22 def mode @mode end |
#node_description ⇒ Object
Returns the value of attribute node_description.
24 25 26 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 24 def node_description @node_description end |
#node_name ⇒ Object
Returns the value of attribute node_name.
26 27 28 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 26 def node_name @node_name end |
#num_executors ⇒ Object
Returns the value of attribute num_executors.
28 29 30 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 28 def num_executors @num_executors end |
#primary_view ⇒ Object
Returns the value of attribute primary_view.
34 35 36 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 34 def primary_view @primary_view end |
#quieting_down ⇒ Object
Returns the value of attribute quieting_down.
36 37 38 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 36 def quieting_down @quieting_down end |
#slave_agent_port ⇒ Object
Returns the value of attribute slave_agent_port.
38 39 40 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 38 def slave_agent_port @slave_agent_port end |
#unlabeled_load ⇒ Object
Returns the value of attribute unlabeled_load.
40 41 42 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 40 def unlabeled_load @unlabeled_load end |
#use_crumbs ⇒ Object
Returns the value of attribute use_crumbs.
42 43 44 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 42 def use_crumbs @use_crumbs end |
#use_security ⇒ Object
Returns the value of attribute use_security.
44 45 46 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 44 def use_security @use_security end |
#views ⇒ Object
Returns the value of attribute views.
46 47 48 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 46 def views @views end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
70 71 72 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 70 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
75 76 77 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 75 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 49 def self.attribute_map { :'_class' => :'_class', :'assigned_labels' => :'assignedLabels', :'mode' => :'mode', :'node_description' => :'nodeDescription', :'node_name' => :'nodeName', :'num_executors' => :'numExecutors', :'description' => :'description', :'jobs' => :'jobs', :'primary_view' => :'primaryView', :'quieting_down' => :'quietingDown', :'slave_agent_port' => :'slaveAgentPort', :'unlabeled_load' => :'unlabeledLoad', :'use_crumbs' => :'useCrumbs', :'use_security' => :'useSecurity', :'views' => :'views' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 241 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_nullable ⇒ Object
List of attributes with nullable: true
101 102 103 104 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 101 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 80 def self.openapi_types { :'_class' => :'String', :'assigned_labels' => :'Array<HudsonassignedLabels>', :'mode' => :'String', :'node_description' => :'String', :'node_name' => :'String', :'num_executors' => :'Integer', :'description' => :'String', :'jobs' => :'Array<FreeStyleProject>', :'primary_view' => :'AllView', :'quieting_down' => :'Boolean', :'slave_agent_port' => :'Integer', :'unlabeled_load' => :'UnlabeledLoadStatistics', :'use_crumbs' => :'Boolean', :'use_security' => :'Boolean', :'views' => :'Array<AllView>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 206 def ==(o) return true if self.equal?(o) self.class == o.class && _class == o._class && assigned_labels == o.assigned_labels && mode == o.mode && node_description == o.node_description && node_name == o.node_name && num_executors == o.num_executors && description == o.description && jobs == o.jobs && primary_view == o.primary_view && quieting_down == o.quieting_down && slave_agent_port == o.slave_agent_port && unlabeled_load == o.unlabeled_load && use_crumbs == o.use_crumbs && use_security == o.use_security && views == o.views end |
#eql?(o) ⇒ Boolean
228 229 230 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 228 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
234 235 236 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 234 def hash [_class, assigned_labels, mode, node_description, node_name, num_executors, description, jobs, primary_view, quieting_down, slave_agent_port, unlabeled_load, use_crumbs, use_security, views].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
191 192 193 194 195 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 191 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
263 264 265 266 267 268 269 270 271 272 273 274 275 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 263 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
199 200 201 202 |
# File 'lib/swaggy_jenkins/models/hudson.rb', line 199 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' true end |