Class: Kubernetes::V1JSONSchemaProps

Inherits:
Object
  • Object
show all
Defined in:
lib/kubernetes/models/v1_json_schema_props.rb

Overview

JSONSchemaProps is a JSON-Schema following Specification Draft 4 (json-schema.org/).

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ V1JSONSchemaProps

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
284
285
286
287
288
289
290
291
292
293
294
295
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
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
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
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 233

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Kubernetes::V1JSONSchemaProps` 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 `Kubernetes::V1JSONSchemaProps`. 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?(:'ref')
    self.ref = attributes[:'ref']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#_notObject

Returns the value of attribute _not.



79
80
81
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 79

def _not
  @_not
end

#additional_itemsObject

JSONSchemaPropsOrBool represents JSONSchemaProps or a boolean value. Defaults to true for the boolean property.



24
25
26
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 24

def additional_items
  @additional_items
end

#additional_propertiesObject

JSONSchemaPropsOrBool represents JSONSchemaProps or a boolean value. Defaults to true for the boolean property.



27
28
29
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 27

def additional_properties
  @additional_properties
end

#all_ofObject

Returns the value of attribute all_of.



29
30
31
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 29

def all_of
  @all_of
end

#any_ofObject

Returns the value of attribute any_of.



31
32
33
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 31

def any_of
  @any_of
end

#defaultObject

default is a default value for undefined object fields. Defaulting is a beta feature under the CustomResourceDefaulting feature gate. Defaulting requires spec.preserveUnknownFields to be false.



34
35
36
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 34

def default
  @default
end

#definitionsObject

Returns the value of attribute definitions.



36
37
38
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 36

def definitions
  @definitions
end

#dependenciesObject

Returns the value of attribute dependencies.



38
39
40
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 38

def dependencies
  @dependencies
end

#descriptionObject

Returns the value of attribute description.



40
41
42
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 40

def description
  @description
end

#enumObject

Returns the value of attribute enum.



42
43
44
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 42

def enum
  @enum
end

#exampleObject

JSON represents any valid JSON value. These types are supported: bool, int64, float64, string, []interface{}, mapinterface{} and nil.



45
46
47
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 45

def example
  @example
end

#exclusive_maximumObject

Returns the value of attribute exclusive_maximum.



47
48
49
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 47

def exclusive_maximum
  @exclusive_maximum
end

#exclusive_minimumObject

Returns the value of attribute exclusive_minimum.



49
50
51
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 49

def exclusive_minimum
  @exclusive_minimum
end

#external_docsObject

Returns the value of attribute external_docs.



51
52
53
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 51

def external_docs
  @external_docs
end

#formatObject

format is an OpenAPI v3 format string. Unknown formats are ignored. The following formats are validated: - bsonobjectid: a bson object ID, i.e. a 24 characters hex string - uri: an URI as parsed by Golang net/url.ParseRequestURI - email: an email address as parsed by Golang net/mail.ParseAddress - hostname: a valid representation for an Internet host name, as defined by RFC 1034, section 3.1 [RFC1034]. - ipv4: an IPv4 IP as parsed by Golang net.ParseIP - ipv6: an IPv6 IP as parsed by Golang net.ParseIP - cidr: a CIDR as parsed by Golang net.ParseCIDR - mac: a MAC address as parsed by Golang net.ParseMAC - uuid: an UUID that allows uppercase defined by the regex (?i)^8-?[0-9a-f]4-?[0-9a-f]4-?[0-9a-f]4-?[0-9a-f]12$ - uuid3: an UUID3 that allows uppercase defined by the regex (?i)^8-?[0-9a-f]4-?33-?[0-9a-f]4-?[0-9a-f]12$ - uuid4: an UUID4 that allows uppercase defined by the regex (?i)^8-?[0-9a-f]4-?43-?[89ab]3-?[0-9a-f]12$ - uuid5: an UUID5 that allows uppercase defined by the regex (?i)^8-?[0-9a-f]4-?53-?[89ab]3-?[0-9a-f]12$ - isbn: an ISBN10 or ISBN13 number string like "0321751043" or "978-0321751041" - isbn10: an ISBN10 number string like "0321751043" - isbn13: an ISBN13 number string like "978-0321751041" - creditcard: a credit card number defined by the regex ^(?:412(?:[0-9]3)?|5[0-9]14|6(?:011|5[0-9])12|3[0-9]13|3(?:0|[68])[0-9]11|(?:2131|1800|35\\d3)\\d11)$ with any non digit characters mixed in - ssn: a U.S. social security number following the regex ^\\d3[- ]?\\d2[- ]?\\d4$ - hexcolor: an hexadecimal color code like "#FFFFFF: following the regex ^#?([0-9a-fA-F]3|[0-9a-fA-F]6)$ - rgbcolor: an RGB color code like rgb like "rgb(255,255,2559" - byte: base64 encoded binary data - password: any kind of string - date: a date string like "2006-01-02" as defined by full-date in RFC3339 - duration: a duration string like "22 ns" as parsed by Golang time.ParseDuration or compatible with Scala duration format - datetime: a date time string like "2014-12-15T19:30:20.000Z" as defined by date-time in RFC3339.



54
55
56
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 54

def format
  @format
end

#idObject

Returns the value of attribute id.



56
57
58
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 56

def id
  @id
end

#itemsObject

JSONSchemaPropsOrArray represents a value that can either be a JSONSchemaProps or an array of JSONSchemaProps. Mainly here for serialization purposes.



59
60
61
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 59

def items
  @items
end

#max_itemsObject

Returns the value of attribute max_items.



61
62
63
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 61

def max_items
  @max_items
end

#max_lengthObject

Returns the value of attribute max_length.



63
64
65
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 63

def max_length
  @max_length
end

#max_propertiesObject

Returns the value of attribute max_properties.



65
66
67
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 65

def max_properties
  @max_properties
end

#maximumObject

Returns the value of attribute maximum.



67
68
69
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 67

def maximum
  @maximum
end

#min_itemsObject

Returns the value of attribute min_items.



69
70
71
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 69

def min_items
  @min_items
end

#min_lengthObject

Returns the value of attribute min_length.



71
72
73
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 71

def min_length
  @min_length
end

#min_propertiesObject

Returns the value of attribute min_properties.



73
74
75
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 73

def min_properties
  @min_properties
end

#minimumObject

Returns the value of attribute minimum.



75
76
77
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 75

def minimum
  @minimum
end

#multiple_ofObject

Returns the value of attribute multiple_of.



77
78
79
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 77

def multiple_of
  @multiple_of
end

#nullableObject

Returns the value of attribute nullable.



81
82
83
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 81

def nullable
  @nullable
end

#one_ofObject

Returns the value of attribute one_of.



83
84
85
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 83

def one_of
  @one_of
end

#patternObject

Returns the value of attribute pattern.



85
86
87
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 85

def pattern
  @pattern
end

#pattern_propertiesObject

Returns the value of attribute pattern_properties.



87
88
89
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 87

def pattern_properties
  @pattern_properties
end

#propertiesObject

Returns the value of attribute properties.



89
90
91
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 89

def properties
  @properties
end

#refObject

Returns the value of attribute ref.



19
20
21
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 19

def ref
  @ref
end

#requiredObject

Returns the value of attribute required.



91
92
93
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 91

def required
  @required
end

#schemaObject

Returns the value of attribute schema.



21
22
23
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 21

def schema
  @schema
end

#titleObject

Returns the value of attribute title.



93
94
95
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 93

def title
  @title
end

#typeObject

Returns the value of attribute type.



95
96
97
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 95

def type
  @type
end

#unique_itemsObject

Returns the value of attribute unique_items.



97
98
99
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 97

def unique_items
  @unique_items
end

#x_kubernetes_embedded_resourceObject

x-kubernetes-embedded-resource defines that the value is an embedded Kubernetes runtime.Object, with TypeMeta and ObjectMeta. The type must be object. It is allowed to further restrict the embedded object. kind, apiVersion and metadata are validated automatically. x-kubernetes-preserve-unknown-fields is allowed to be true, but does not have to be if the object is fully specified (up to kind, apiVersion, metadata).



100
101
102
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 100

def x_kubernetes_embedded_resource
  @x_kubernetes_embedded_resource
end

#x_kubernetes_int_or_stringObject

x-kubernetes-int-or-string specifies that this value is either an integer or a string. If this is true, an empty type is allowed and type as child of anyOf is permitted if following one of the following patterns: 1) anyOf: - type: integer - type: string 2) allOf: - anyOf: - type: integer - type: string - … zero or more



103
104
105
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 103

def x_kubernetes_int_or_string
  @x_kubernetes_int_or_string
end

#x_kubernetes_list_map_keysObject

x-kubernetes-list-map-keys annotates an array with the x-kubernetes-list-type ‘map` by specifying the keys used as the index of the map. This tag MUST only be used on lists that have the "x-kubernetes-list-type" extension set to "map". Also, the values specified for this attribute must be a scalar typed field of the child structure (no nesting is supported). The properties specified must either be required or have a default value, to ensure those properties are present for all list items.



106
107
108
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 106

def x_kubernetes_list_map_keys
  @x_kubernetes_list_map_keys
end

#x_kubernetes_list_typeObject

x-kubernetes-list-type annotates an array to further describe its topology. This extension must only be used on lists and may have 3 possible values: 1) ‘atomic`: the list is treated as a single entity, like a scalar. Atomic lists will be entirely replaced when updated. This extension may be used on any type of list (struct, scalar, …). 2) `set`: Sets are lists that must not have multiple items with the same value. Each value must be a scalar, an object with x-kubernetes-map-type `atomic` or an array with x-kubernetes-list-type `atomic`. 3) `map`: These lists are like maps in that their elements have a non-index key used to identify them. Order is preserved upon merge. The map tag must only be used on a list with elements of type object. Defaults to atomic for arrays.



109
110
111
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 109

def x_kubernetes_list_type
  @x_kubernetes_list_type
end

#x_kubernetes_map_typeObject

x-kubernetes-map-type annotates an object to further describe its topology. This extension must only be used when type is object and may have 2 possible values: 1) ‘granular`: These maps are actual maps (key-value pairs) and each fields are independent from each other (they can each be manipulated by separate actors). This is the default behaviour for all maps. 2) `atomic`: the list is treated as a single entity, like a scalar. Atomic maps will be entirely replaced when updated.



112
113
114
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 112

def x_kubernetes_map_type
  @x_kubernetes_map_type
end

#x_kubernetes_preserve_unknown_fieldsObject

x-kubernetes-preserve-unknown-fields stops the API server decoding step from pruning fields which are not specified in the validation schema. This affects fields recursively, but switches back to normal pruning behaviour if nested properties or additionalProperties are specified in the schema. This can either be true or undefined. False is forbidden.



115
116
117
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 115

def x_kubernetes_preserve_unknown_fields
  @x_kubernetes_preserve_unknown_fields
end

#x_kubernetes_validationsObject

x-kubernetes-validations describes a list of validation rules written in the CEL expression language.



118
119
120
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 118

def x_kubernetes_validations
  @x_kubernetes_validations
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



171
172
173
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 171

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



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
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 121

def self.attribute_map
  {
    :'ref' => :'$ref',
    :'schema' => :'$schema',
    :'additional_items' => :'additionalItems',
    :'additional_properties' => :'additionalProperties',
    :'all_of' => :'allOf',
    :'any_of' => :'anyOf',
    :'default' => :'default',
    :'definitions' => :'definitions',
    :'dependencies' => :'dependencies',
    :'description' => :'description',
    :'enum' => :'enum',
    :'example' => :'example',
    :'exclusive_maximum' => :'exclusiveMaximum',
    :'exclusive_minimum' => :'exclusiveMinimum',
    :'external_docs' => :'externalDocs',
    :'format' => :'format',
    :'id' => :'id',
    :'items' => :'items',
    :'max_items' => :'maxItems',
    :'max_length' => :'maxLength',
    :'max_properties' => :'maxProperties',
    :'maximum' => :'maximum',
    :'min_items' => :'minItems',
    :'min_length' => :'minLength',
    :'min_properties' => :'minProperties',
    :'minimum' => :'minimum',
    :'multiple_of' => :'multipleOf',
    :'_not' => :'not',
    :'nullable' => :'nullable',
    :'one_of' => :'oneOf',
    :'pattern' => :'pattern',
    :'pattern_properties' => :'patternProperties',
    :'properties' => :'properties',
    :'required' => :'required',
    :'title' => :'title',
    :'type' => :'type',
    :'unique_items' => :'uniqueItems',
    :'x_kubernetes_embedded_resource' => :'x-kubernetes-embedded-resource',
    :'x_kubernetes_int_or_string' => :'x-kubernetes-int-or-string',
    :'x_kubernetes_list_map_keys' => :'x-kubernetes-list-map-keys',
    :'x_kubernetes_list_type' => :'x-kubernetes-list-type',
    :'x_kubernetes_map_type' => :'x-kubernetes-map-type',
    :'x_kubernetes_preserve_unknown_fields' => :'x-kubernetes-preserve-unknown-fields',
    :'x_kubernetes_validations' => :'x-kubernetes-validations'
  }
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



524
525
526
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 524

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



226
227
228
229
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 226

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

.openapi_typesObject

Attribute type mapping.



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
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 176

def self.openapi_types
  {
    :'ref' => :'String',
    :'schema' => :'String',
    :'additional_items' => :'Object',
    :'additional_properties' => :'Object',
    :'all_of' => :'Array<V1JSONSchemaProps>',
    :'any_of' => :'Array<V1JSONSchemaProps>',
    :'default' => :'Object',
    :'definitions' => :'Hash<String, V1JSONSchemaProps>',
    :'dependencies' => :'Hash<String, Object>',
    :'description' => :'String',
    :'enum' => :'Array<Object>',
    :'example' => :'Object',
    :'exclusive_maximum' => :'Boolean',
    :'exclusive_minimum' => :'Boolean',
    :'external_docs' => :'V1ExternalDocumentation',
    :'format' => :'String',
    :'id' => :'String',
    :'items' => :'Object',
    :'max_items' => :'Integer',
    :'max_length' => :'Integer',
    :'max_properties' => :'Integer',
    :'maximum' => :'Float',
    :'min_items' => :'Integer',
    :'min_length' => :'Integer',
    :'min_properties' => :'Integer',
    :'minimum' => :'Float',
    :'multiple_of' => :'Float',
    :'_not' => :'V1JSONSchemaProps',
    :'nullable' => :'Boolean',
    :'one_of' => :'Array<V1JSONSchemaProps>',
    :'pattern' => :'String',
    :'pattern_properties' => :'Hash<String, V1JSONSchemaProps>',
    :'properties' => :'Hash<String, V1JSONSchemaProps>',
    :'required' => :'Array<String>',
    :'title' => :'String',
    :'type' => :'String',
    :'unique_items' => :'Boolean',
    :'x_kubernetes_embedded_resource' => :'Boolean',
    :'x_kubernetes_int_or_string' => :'Boolean',
    :'x_kubernetes_list_map_keys' => :'Array<String>',
    :'x_kubernetes_list_type' => :'String',
    :'x_kubernetes_map_type' => :'String',
    :'x_kubernetes_preserve_unknown_fields' => :'Boolean',
    :'x_kubernetes_validations' => :'Array<V1ValidationRule>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 460

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      ref == o.ref &&
      schema == o.schema &&
      additional_items == o.additional_items &&
      additional_properties == o.additional_properties &&
      all_of == o.all_of &&
      any_of == o.any_of &&
      default == o.default &&
      definitions == o.definitions &&
      dependencies == o.dependencies &&
      description == o.description &&
      enum == o.enum &&
      example == o.example &&
      exclusive_maximum == o.exclusive_maximum &&
      exclusive_minimum == o.exclusive_minimum &&
      external_docs == o.external_docs &&
      format == o.format &&
      id == o.id &&
      items == o.items &&
      max_items == o.max_items &&
      max_length == o.max_length &&
      max_properties == o.max_properties &&
      maximum == o.maximum &&
      min_items == o.min_items &&
      min_length == o.min_length &&
      min_properties == o.min_properties &&
      minimum == o.minimum &&
      multiple_of == o.multiple_of &&
      _not == o._not &&
      nullable == o.nullable &&
      one_of == o.one_of &&
      pattern == o.pattern &&
      pattern_properties == o.pattern_properties &&
      properties == o.properties &&
      required == o.required &&
      title == o.title &&
      type == o.type &&
      unique_items == o.unique_items &&
      x_kubernetes_embedded_resource == o.x_kubernetes_embedded_resource &&
      x_kubernetes_int_or_string == o.x_kubernetes_int_or_string &&
      x_kubernetes_list_map_keys == o.x_kubernetes_list_map_keys &&
      x_kubernetes_list_type == o.x_kubernetes_list_type &&
      x_kubernetes_map_type == o.x_kubernetes_map_type &&
      x_kubernetes_preserve_unknown_fields == o.x_kubernetes_preserve_unknown_fields &&
      x_kubernetes_validations == o.x_kubernetes_validations
end

#_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



554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 554

def _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 = Kubernetes.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
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



625
626
627
628
629
630
631
632
633
634
635
636
637
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 625

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

#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



531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 531

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{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[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


511
512
513
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 511

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



517
518
519
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 517

def hash
  [ref, schema, additional_items, additional_properties, all_of, any_of, default, definitions, dependencies, description, enum, example, exclusive_maximum, exclusive_minimum, external_docs, format, id, items, max_items, max_length, max_properties, maximum, min_items, min_length, min_properties, minimum, multiple_of, _not, nullable, one_of, pattern, pattern_properties, properties, required, title, type, unique_items, x_kubernetes_embedded_resource, x_kubernetes_int_or_string, x_kubernetes_list_map_keys, x_kubernetes_list_type, x_kubernetes_map_type, x_kubernetes_preserve_unknown_fields, x_kubernetes_validations].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



447
448
449
450
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 447

def list_invalid_properties
  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



601
602
603
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 601

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



607
608
609
610
611
612
613
614
615
616
617
618
619
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 607

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



595
596
597
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 595

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



454
455
456
# File 'lib/kubernetes/models/v1_json_schema_props.rb', line 454

def valid?
  true
end