Class: Imagekitio::Models::CustomMetadataField::Schema

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/imagekitio/models/custom_metadata_field.rb

Overview

See Also:

Defined Under Namespace

Modules: DefaultValue, MaxValue, MinValue, SelectOption, Type

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(type: , default_value: nil, is_value_required: nil, max_length: nil, max_value: nil, min_length: nil, min_value: nil, select_options: nil) ⇒ Object

Some parameter documentations has been truncated, see Imagekitio::Models::CustomMetadataField::Schema for more details.

An object that describes the rules for the custom metadata field value.

Parameters:

  • type (Symbol, Imagekitio::Models::CustomMetadataField::Schema::Type) (defaults to: )

    Type of the custom metadata field.

  • default_value (String, Float, Boolean, Array<String, Float, Boolean>) (defaults to: nil)

    The default value for this custom metadata field. Data type of default value dep

  • is_value_required (Boolean) (defaults to: nil)

    Specifies if the this custom metadata field is required or not.

  • max_length (Float) (defaults to: nil)

    Maximum length of string. Only set if ‘type` is set to `Text` or `Textarea`.

  • max_value (String, Float) (defaults to: nil)

    Maximum value of the field. Only set if field type is ‘Date` or `Number`. For `D

  • min_length (Float) (defaults to: nil)

    Minimum length of string. Only set if ‘type` is set to `Text` or `Textarea`.

  • min_value (String, Float) (defaults to: nil)

    Minimum value of the field. Only set if field type is ‘Date` or `Number`. For `D

  • select_options (Array<String, Float, Boolean>) (defaults to: nil)

    An array of allowed values when field type is ‘SingleSelect` or `MultiSelect`.



# File 'lib/imagekitio/models/custom_metadata_field.rb', line 117

Instance Attribute Details

#default_valueString, ...

The default value for this custom metadata field. Data type of default value depends on the field type.

Returns:

  • (String, Float, Boolean, Array<String, Float, Boolean>, nil)


61
62
63
# File 'lib/imagekitio/models/custom_metadata_field.rb', line 61

optional :default_value,
union: -> { Imagekitio::CustomMetadataField::Schema::DefaultValue },
api_name: :defaultValue

#is_value_requiredBoolean?

Specifies if the this custom metadata field is required or not.

Returns:

  • (Boolean, nil)


69
# File 'lib/imagekitio/models/custom_metadata_field.rb', line 69

optional :is_value_required, Imagekitio::Internal::Type::Boolean, api_name: :isValueRequired

#max_lengthFloat?

Maximum length of string. Only set if ‘type` is set to `Text` or `Textarea`.

Returns:

  • (Float, nil)


75
# File 'lib/imagekitio/models/custom_metadata_field.rb', line 75

optional :max_length, Float, api_name: :maxLength

#max_valueString, ...

Maximum value of the field. Only set if field type is ‘Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value.

Returns:

  • (String, Float, nil)


83
84
85
86
87
# File 'lib/imagekitio/models/custom_metadata_field.rb', line 83

optional :max_value,
union: -> {
  Imagekitio::CustomMetadataField::Schema::MaxValue
},
api_name: :maxValue

#min_lengthFloat?

Minimum length of string. Only set if ‘type` is set to `Text` or `Textarea`.

Returns:

  • (Float, nil)


93
# File 'lib/imagekitio/models/custom_metadata_field.rb', line 93

optional :min_length, Float, api_name: :minLength

#min_valueString, ...

Minimum value of the field. Only set if field type is ‘Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value.

Returns:

  • (String, Float, nil)


101
102
103
104
105
# File 'lib/imagekitio/models/custom_metadata_field.rb', line 101

optional :min_value,
union: -> {
  Imagekitio::CustomMetadataField::Schema::MinValue
},
api_name: :minValue

#select_optionsArray<String, Float, Boolean>?

An array of allowed values when field type is ‘SingleSelect` or `MultiSelect`.

Returns:

  • (Array<String, Float, Boolean>, nil)


111
112
113
114
115
# File 'lib/imagekitio/models/custom_metadata_field.rb', line 111

optional :select_options,
-> {
  Imagekitio::Internal::Type::ArrayOf[union: Imagekitio::CustomMetadataField::Schema::SelectOption]
},
api_name: :selectOptions

#typeSymbol, Imagekitio::Models::CustomMetadataField::Schema::Type

Type of the custom metadata field.



54
# File 'lib/imagekitio/models/custom_metadata_field.rb', line 54

required :type, enum: -> { Imagekitio::CustomMetadataField::Schema::Type }

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/imagekitio/models/custom_metadata_field.rb', line 153

.variantsArray(String, Float)

Returns:

  • (Array(String, Float))


# File 'lib/imagekitio/models/custom_metadata_field.rb', line 208