class Google::Apis::DiscoveryV1::JsonSchema

Attributes

_ref[RW]

A reference to another schema. The value of this property is the “id” of another schema. Corresponds to the JSON property `$ref` @return [String]

additional_properties[RW]

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` @return [Google::Apis::DiscoveryV1::JsonSchema]

annotations[RW]

Additional information about this property. Corresponds to the JSON property `annotations` @return [Google::Apis::DiscoveryV1::JsonSchema::Annotations]

base_ref[RW]
default[RW]

The default value of this property (if one exists). Corresponds to the JSON property `default` @return [String]

description[RW]

A description of this object. Corresponds to the JSON property `description` @return [String]

discriminant[RW]
discriminant_value[RW]
enum[RW]

Values this parameter may take (if it is an enum). Corresponds to the JSON property `enum` @return [Array<String>]

enum_descriptions[RW]

The descriptions for the enums. Each position maps to the corresponding value in the “enum” array. Corresponds to the JSON property `enumDescriptions` @return [Array<String>]

format[RW]

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

generated_class_name[RW]
generated_name[RW]
id[RW]

Unique identifier for this schema. Corresponds to the JSON property `id` @return [String]

items[RW]

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` @return [Google::Apis::DiscoveryV1::JsonSchema]

location[RW]

Whether this parameter goes in the query or the path for REST requests. Corresponds to the JSON property `location` @return [String]

maximum[RW]

The maximum value of this parameter. Corresponds to the JSON property `maximum` @return [String]

minimum[RW]

The minimum value of this parameter. Corresponds to the JSON property `minimum` @return [String]

name[RW]
parent[RW]
path[RW]
pattern[RW]

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

properties[RW]

If this is a schema for an object, list the schema for each property of this object. Corresponds to the JSON property `properties` @return [Hash<String,Google::Apis::DiscoveryV1::JsonSchema>]

read_only[RW]

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` @return [Boolean]

read_only?[RW]

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` @return [Boolean]

repeated[RW]

Whether this parameter may appear multiple times. Corresponds to the JSON property `repeated` @return [Boolean]

repeated?[RW]

Whether this parameter may appear multiple times. Corresponds to the JSON property `repeated` @return [Boolean]

required[RW]

Whether the parameter is required. Corresponds to the JSON property `required` @return [Boolean]

required?[RW]

Whether the parameter is required. Corresponds to the JSON property `required` @return [Boolean]

type[RW]

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` @return [String]

variant[RW]

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` @return [Google::Apis::DiscoveryV1::JsonSchema::Variant]

Public Class Methods

new(**args) click to toggle source
# File generated/google/apis/discovery_v1/classes.rb, line 287
def initialize(**args)
   update!(**args)
end

Public Instance Methods

generated_type() click to toggle source
# File lib/google/apis/generator/model.rb, line 49
def generated_type
  case type
  when 'string', 'boolean', 'number', 'integer', 'any'
    return 'DateTime' if format == 'date-time'
    return 'Date' if format == 'date'
    return TYPE_MAP[type]
  when 'array'
    return sprintf('Array<%s>', items.generated_type)
  when 'hash'
    return sprintf('Hash<String,%s>', additional_properties.generated_type)
  when 'object'
    return qualified_name
  end
end
qualified_name() click to toggle source
# File lib/google/apis/generator/model.rb, line 45
def qualified_name
  parent.qualified_name + '::' + generated_class_name
end
update!(**args) click to toggle source

Update properties of this object

# File generated/google/apis/discovery_v1/classes.rb, line 292
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)
  @description = args[:description] if args.key?(:description)
  @enum = args[:enum] if args.key?(:enum)
  @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