Class: Google::Apis::DiscoveryV1::JsonSchema

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/discovery_v1/classes.rb,
lib/google/apis/discovery_v1/representations.rb,
lib/google/apis/discovery_v1/representations.rb

Defined Under Namespace

Classes: Annotations, Variant

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ JsonSchema

Returns a new instance of JsonSchema.



299
300
301
# File 'lib/google/apis/discovery_v1/classes.rb', line 299

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#_refString

A reference to another schema. The value of this property is the "id" of another schema. Corresponds to the JSON property $ref

Returns:

  • (String)


175
176
177
# File 'lib/google/apis/discovery_v1/classes.rb', line 175

def _ref
  @_ref
end

#additional_propertiesGoogle::Apis::DiscoveryV1::JsonSchema

If this is a schema for an object, this property is the schema for any additional properties with dynamic keys on this object. Corresponds to the JSON property additionalProperties



181
182
183
# File 'lib/google/apis/discovery_v1/classes.rb', line 181

def additional_properties
  @additional_properties
end

#annotationsGoogle::Apis::DiscoveryV1::JsonSchema::Annotations

Additional information about this property. Corresponds to the JSON property annotations



186
187
188
# File 'lib/google/apis/discovery_v1/classes.rb', line 186

def annotations
  @annotations
end

#defaultString

The default value of this property (if one exists). Corresponds to the JSON property default

Returns:

  • (String)


191
192
193
# File 'lib/google/apis/discovery_v1/classes.rb', line 191

def default
  @default
end

#deprecatedBoolean Also known as: deprecated?

Whether the parameter is deprecated. Corresponds to the JSON property deprecated

Returns:

  • (Boolean)


196
197
198
# File 'lib/google/apis/discovery_v1/classes.rb', line 196

def deprecated
  @deprecated
end

#descriptionString

A description of this object. Corresponds to the JSON property description

Returns:

  • (String)


202
203
204
# File 'lib/google/apis/discovery_v1/classes.rb', line 202

def description
  @description
end

#enumArray<String>

Values this parameter may take (if it is an enum). Corresponds to the JSON property enum

Returns:

  • (Array<String>)


207
208
209
# File 'lib/google/apis/discovery_v1/classes.rb', line 207

def enum
  @enum
end

#enum_deprecatedArray<Boolean>

The deprecation status for the enums. Each position maps to the corresponding value in the "enum" array. Corresponds to the JSON property enumDeprecated

Returns:

  • (Array<Boolean>)


213
214
215
# File 'lib/google/apis/discovery_v1/classes.rb', line 213

def enum_deprecated
  @enum_deprecated
end

#enum_descriptionsArray<String>

The descriptions for the enums. Each position maps to the corresponding value in the "enum" array. Corresponds to the JSON property enumDescriptions

Returns:

  • (Array<String>)


219
220
221
# File 'lib/google/apis/discovery_v1/classes.rb', line 219

def enum_descriptions
  @enum_descriptions
end

#formatString

An additional regular expression or key that helps constrain the value. For more details see: http://tools.ietf.org/html/draft-zyp-json-schema-03#section- 5.23 Corresponds to the JSON property format

Returns:

  • (String)


226
227
228
# File 'lib/google/apis/discovery_v1/classes.rb', line 226

def format
  @format
end

#idString

Unique identifier for this schema. Corresponds to the JSON property id

Returns:

  • (String)


231
232
233
# File 'lib/google/apis/discovery_v1/classes.rb', line 231

def id
  @id
end

#itemsGoogle::Apis::DiscoveryV1::JsonSchema

If this is a schema for an array, this property is the schema for each element in the array. Corresponds to the JSON property items



237
238
239
# File 'lib/google/apis/discovery_v1/classes.rb', line 237

def items
  @items
end

#locationString

Whether this parameter goes in the query or the path for REST requests. Corresponds to the JSON property location

Returns:

  • (String)


242
243
244
# File 'lib/google/apis/discovery_v1/classes.rb', line 242

def location
  @location
end

#maximumString

The maximum value of this parameter. Corresponds to the JSON property maximum

Returns:

  • (String)


247
248
249
# File 'lib/google/apis/discovery_v1/classes.rb', line 247

def maximum
  @maximum
end

#minimumString

The minimum value of this parameter. Corresponds to the JSON property minimum

Returns:

  • (String)


252
253
254
# File 'lib/google/apis/discovery_v1/classes.rb', line 252

def minimum
  @minimum
end

#patternString

The regular expression this parameter must conform to. Uses Java 6 regex format: http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html Corresponds to the JSON property pattern

Returns:

  • (String)


258
259
260
# File 'lib/google/apis/discovery_v1/classes.rb', line 258

def pattern
  @pattern
end

#propertiesHash<String,Google::Apis::DiscoveryV1::JsonSchema>

If this is a schema for an object, list the schema for each property of this object. Corresponds to the JSON property properties

Returns:



264
265
266
# File 'lib/google/apis/discovery_v1/classes.rb', line 264

def properties
  @properties
end

#read_onlyBoolean Also known as: read_only?

The value is read-only, generated by the service. The value cannot be modified by the client. If the value is included in a POST, PUT, or PATCH request, it is ignored by the service. Corresponds to the JSON property readOnly

Returns:

  • (Boolean)


271
272
273
# File 'lib/google/apis/discovery_v1/classes.rb', line 271

def read_only
  @read_only
end

#repeatedBoolean Also known as: repeated?

Whether this parameter may appear multiple times. Corresponds to the JSON property repeated

Returns:

  • (Boolean)


277
278
279
# File 'lib/google/apis/discovery_v1/classes.rb', line 277

def repeated
  @repeated
end

#requiredBoolean Also known as: required?

Whether the parameter is required. Corresponds to the JSON property required

Returns:

  • (Boolean)


283
284
285
# File 'lib/google/apis/discovery_v1/classes.rb', line 283

def required
  @required
end

#typeString

The value type for this schema. A list of values can be found here: http:// tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1 Corresponds to the JSON property type

Returns:

  • (String)


290
291
292
# File 'lib/google/apis/discovery_v1/classes.rb', line 290

def type
  @type
end

#variantGoogle::Apis::DiscoveryV1::JsonSchema::Variant

In a variant data type, the value of one property is used to determine how to interpret the entire entity. Its value must exist in a map of descriminant values to schema names. Corresponds to the JSON property variant



297
298
299
# File 'lib/google/apis/discovery_v1/classes.rb', line 297

def variant
  @variant
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
# File 'lib/google/apis/discovery_v1/classes.rb', line 304

def update!(**args)
  @_ref = args[:_ref] if args.key?(:_ref)
  @additional_properties = args[:additional_properties] if args.key?(:additional_properties)
  @annotations = args[:annotations] if args.key?(:annotations)
  @default = args[:default] if args.key?(:default)
  @deprecated = args[:deprecated] if args.key?(:deprecated)
  @description = args[:description] if args.key?(:description)
  @enum = args[:enum] if args.key?(:enum)
  @enum_deprecated = args[:enum_deprecated] if args.key?(:enum_deprecated)
  @enum_descriptions = args[:enum_descriptions] if args.key?(:enum_descriptions)
  @format = args[:format] if args.key?(:format)
  @id = args[:id] if args.key?(:id)
  @items = args[:items] if args.key?(:items)
  @location = args[:location] if args.key?(:location)
  @maximum = args[:maximum] if args.key?(:maximum)
  @minimum = args[:minimum] if args.key?(:minimum)
  @pattern = args[:pattern] if args.key?(:pattern)
  @properties = args[:properties] if args.key?(:properties)
  @read_only = args[:read_only] if args.key?(:read_only)
  @repeated = args[:repeated] if args.key?(:repeated)
  @required = args[:required] if args.key?(:required)
  @type = args[:type] if args.key?(:type)
  @variant = args[:variant] if args.key?(:variant)
end