Class Schema.Builder

  • All Implemented Interfaces:

    
    public abstract class Schema.Builder
    
                        

    Builder for Schema.

    • Constructor Detail

      • Schema.Builder

        Schema.Builder()
    • Method Detail

      • anyOf

         abstract Schema.Builder anyOf(List<Schema> anyOf)

        Setter for anyOf.

        anyOf: Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.

      • anyOf

        @CanIgnoreReturnValue() Schema.Builder anyOf(Array<Schema> anyOf)

        Setter for anyOf.

        anyOf: Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.

      • anyOf

        @CanIgnoreReturnValue() Schema.Builder anyOf(Array<Schema.Builder> anyOfBuilders)

        Setter for anyOf builder.

        anyOf: Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.

      • default_

         abstract Schema.Builder default_(Object default_)

        Setter for default_.

        default_: Optional. Default value to use if the field is not specified.

      • description

         abstract Schema.Builder description(String description)

        Setter for description.

        description: Optional. Describes the data. The model uses this field to understand the purpose of the schema and how to use it. It is a best practice to provide a clear and descriptive explanation for the schema and its properties here, rather than in the prompt.

      • enum_

         abstract Schema.Builder enum_(List<String> enum_)

        Setter for enum_.

        enum_: Optional. Possible values of the field. This field can be used to restrict a value to a fixed set of values. To mark a field as an enum, set `format` to `enum` and provide the list of possible values in `enum`. For example: 1. To define directions: `{type:STRING, format:enum, enum:["EAST", "NORTH", "SOUTH", "WEST"]}` 2. To define apartment numbers: `{type:INTEGER, format:enum, enum:["101", "201", "301"]}`

      • enum_

        @CanIgnoreReturnValue() Schema.Builder enum_(Array<String> enum_)

        Setter for enum_.

        enum_: Optional. Possible values of the field. This field can be used to restrict a value to a fixed set of values. To mark a field as an enum, set `format` to `enum` and provide the list of possible values in `enum`. For example: 1. To define directions: `{type:STRING, format:enum, enum:["EAST", "NORTH", "SOUTH", "WEST"]}` 2. To define apartment numbers: `{type:INTEGER, format:enum, enum:["101", "201", "301"]}`

      • example

         abstract Schema.Builder example(Object example)

        Setter for example.

        example: Optional. Example of an instance of this schema.

      • format

         abstract Schema.Builder format(String format)

        Setter for format.

        format: Optional. The format of the data. For `NUMBER` type, format can be `float` or `double`. For `INTEGER` type, format can be `int32` or `int64`. For `STRING` type, format can be `email`, `byte`, `date`, `date-time`, `password`, and other formats to further refine the data type.

      • items

         abstract Schema.Builder items(Schema items)

        Setter for items.

        items: Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array.

      • items

        @CanIgnoreReturnValue() Schema.Builder items(Schema.Builder itemsBuilder)

        Setter for items builder.

        items: Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array.

      • maxItems

         abstract Schema.Builder maxItems(Long maxItems)

        Setter for maxItems.

        maxItems: Optional. If type is `ARRAY`, `max_items` specifies the maximum number of items in an array.

      • maxLength

         abstract Schema.Builder maxLength(Long maxLength)

        Setter for maxLength.

        maxLength: Optional. If type is `STRING`, `max_length` specifies the maximum length of the string.

      • maxProperties

         abstract Schema.Builder maxProperties(Long maxProperties)

        Setter for maxProperties.

        maxProperties: Optional. If type is `OBJECT`, `max_properties` specifies the maximum number of properties that can be provided.

      • maximum

         abstract Schema.Builder maximum(Double maximum)

        Setter for maximum.

        maximum: Optional. If type is `INTEGER` or `NUMBER`, `maximum` specifies the maximum allowed value.

      • minItems

         abstract Schema.Builder minItems(Long minItems)

        Setter for minItems.

        minItems: Optional. If type is `ARRAY`, `min_items` specifies the minimum number of items in an array.

      • minLength

         abstract Schema.Builder minLength(Long minLength)

        Setter for minLength.

        minLength: Optional. If type is `STRING`, `min_length` specifies the minimum length of the string.

      • minProperties

         abstract Schema.Builder minProperties(Long minProperties)

        Setter for minProperties.

        minProperties: Optional. If type is `OBJECT`, `min_properties` specifies the minimum number of properties that can be provided.

      • minimum

         abstract Schema.Builder minimum(Double minimum)

        Setter for minimum.

        minimum: Optional. If type is `INTEGER` or `NUMBER`, `minimum` specifies the minimum allowed value.

      • nullable

         abstract Schema.Builder nullable(boolean nullable)

        Setter for nullable.

        nullable: Optional. Indicates if the value of this field can be null.

      • pattern

         abstract Schema.Builder pattern(String pattern)

        Setter for pattern.

        pattern: Optional. If type is `STRING`, `pattern` specifies a regular expression that the string must match.

      • properties

         abstract Schema.Builder properties(Map<String, Schema> properties)

        Setter for properties.

        properties: Optional. If type is `OBJECT`, `properties` is a map of property names to schema definitions for each property of the object.

      • propertyOrdering

         abstract Schema.Builder propertyOrdering(List<String> propertyOrdering)

        Setter for propertyOrdering.

        propertyOrdering: Optional. Order of properties displayed or used where order matters. This is not a standard field in OpenAPI specification, but can be used to control the order of properties.

      • propertyOrdering

        @CanIgnoreReturnValue() Schema.Builder propertyOrdering(Array<String> propertyOrdering)

        Setter for propertyOrdering.

        propertyOrdering: Optional. Order of properties displayed or used where order matters. This is not a standard field in OpenAPI specification, but can be used to control the order of properties.

      • required

         abstract Schema.Builder required(List<String> required)

        Setter for required.

        required: Optional. If type is `OBJECT`, `required` lists the names of properties that must be present.

      • required

        @CanIgnoreReturnValue() Schema.Builder required(Array<String> required)

        Setter for required.

        required: Optional. If type is `OBJECT`, `required` lists the names of properties that must be present.

      • type

         abstract Schema.Builder type(Type type)

        Setter for type.

        type: Optional. Data type of the schema field.

      • type

        @CanIgnoreReturnValue() Schema.Builder type(Type.Known knownType)

        Setter for type given a known enum.

        type: Optional. Data type of the schema field.

      • type

        @CanIgnoreReturnValue() Schema.Builder type(String type)

        Setter for type given a string.

        type: Optional. Data type of the schema field.