Class: Imagekitio::Models::CustomMetadataFieldCreateParams::Schema

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

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::CustomMetadataFieldCreateParams::Schema for more details.



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
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
169
170
171
172
173
174
175
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
224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/imagekitio/models/custom_metadata_field_create_params.rb', line 43

class Schema < Imagekitio::Internal::Type::BaseModel
  # @!attribute type
  #   Type of the custom metadata field.
  #
  #   @return [Symbol, Imagekitio::Models::CustomMetadataFieldCreateParams::Schema::Type]
  required :type, enum: -> { Imagekitio::CustomMetadataFieldCreateParams::Schema::Type }

  # @!attribute default_value
  #   The default value for this custom metadata field. This property is only required
  #   if `isValueRequired` property is set to `true`. The value should match the
  #   `type` of custom metadata field.
  #
  #   @return [String, Float, Boolean, Array<String, Float, Boolean>, nil]
  optional :default_value,
           union: -> { Imagekitio::CustomMetadataFieldCreateParams::Schema::DefaultValue },
           api_name: :defaultValue

  # @!attribute is_value_required
  #   Sets this custom metadata field as required. Setting custom metadata fields on
  #   an asset will throw error if the value for all required fields are not present
  #   in upload or update asset API request body.
  #
  #   @return [Boolean, nil]
  optional :is_value_required, Imagekitio::Internal::Type::Boolean, api_name: :isValueRequired

  # @!attribute max_length
  #   Maximum length of string. Only set this property if `type` is set to `Text` or
  #   `Textarea`.
  #
  #   @return [Float, nil]
  optional :max_length, Float, api_name: :maxLength

  # @!attribute max_value
  #   Maximum value of the field. Only set this property if field type is `Date` or
  #   `Number`. For `Date` type field, set the minimum date in ISO8601 string format.
  #   For `Number` type field, set the minimum numeric value.
  #
  #   @return [String, Float, nil]
  optional :max_value,
           union: -> { Imagekitio::CustomMetadataFieldCreateParams::Schema::MaxValue },
           api_name: :maxValue

  # @!attribute min_length
  #   Minimum length of string. Only set this property if `type` is set to `Text` or
  #   `Textarea`.
  #
  #   @return [Float, nil]
  optional :min_length, Float, api_name: :minLength

  # @!attribute min_value
  #   Minimum value of the field. Only set this property if field type is `Date` or
  #   `Number`. For `Date` type field, set the minimum date in ISO8601 string format.
  #   For `Number` type field, set the minimum numeric value.
  #
  #   @return [String, Float, nil]
  optional :min_value,
           union: -> { Imagekitio::CustomMetadataFieldCreateParams::Schema::MinValue },
           api_name: :minValue

  # @!attribute select_options
  #   An array of allowed values. This property is only required if `type` property is
  #   set to `SingleSelect` or `MultiSelect`.
  #
  #   @return [Array<String, Float, Boolean>, nil]
  optional :select_options,
           -> {
             Imagekitio::Internal::Type::ArrayOf[union: Imagekitio::CustomMetadataFieldCreateParams::Schema::SelectOption]
           },
           api_name: :selectOptions

  # @!method initialize(type:, default_value: nil, is_value_required: nil, max_length: nil, max_value: nil, min_length: nil, min_value: nil, select_options: nil)
  #   Some parameter documentations has been truncated, see
  #   {Imagekitio::Models::CustomMetadataFieldCreateParams::Schema} for more details.
  #
  #   @param type [Symbol, Imagekitio::Models::CustomMetadataFieldCreateParams::Schema::Type] Type of the custom metadata field.
  #
  #   @param default_value [String, Float, Boolean, Array<String, Float, Boolean>] The default value for this custom metadata field. This property is only required
  #
  #   @param is_value_required [Boolean] Sets this custom metadata field as required. Setting custom metadata fields on a
  #
  #   @param max_length [Float] Maximum length of string. Only set this property if `type` is set to `Text` or `
  #
  #   @param max_value [String, Float] Maximum value of the field. Only set this property if field type is `Date` or `N
  #
  #   @param min_length [Float] Minimum length of string. Only set this property if `type` is set to `Text` or `
  #
  #   @param min_value [String, Float] Minimum value of the field. Only set this property if field type is `Date` or `N
  #
  #   @param select_options [Array<String, Float, Boolean>] An array of allowed values. This property is only required if `type` property is

  # Type of the custom metadata field.
  #
  # @see Imagekitio::Models::CustomMetadataFieldCreateParams::Schema#type
  module Type
    extend Imagekitio::Internal::Type::Enum

    TEXT = :Text
    TEXTAREA = :Textarea
    NUMBER = :Number
    DATE = :Date
    BOOLEAN = :Boolean
    SINGLE_SELECT = :SingleSelect
    MULTI_SELECT = :MultiSelect

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  # The default value for this custom metadata field. This property is only required
  # if `isValueRequired` property is set to `true`. The value should match the
  # `type` of custom metadata field.
  #
  # @see Imagekitio::Models::CustomMetadataFieldCreateParams::Schema#default_value
  module DefaultValue
    extend Imagekitio::Internal::Type::Union

    variant String

    variant Float

    variant Imagekitio::Internal::Type::Boolean

    # Default value should be of type array when custom metadata field type is set to `MultiSelect`.
    variant -> { Imagekitio::Models::CustomMetadataFieldCreateParams::Schema::DefaultValue::MixedArray }

    module Mixed
      extend Imagekitio::Internal::Type::Union

      variant String

      variant Float

      variant Imagekitio::Internal::Type::Boolean

      # @!method self.variants
      #   @return [Array(String, Float, Boolean)]
    end

    # @!method self.variants
    #   @return [Array(String, Float, Boolean, Array<String, Float, Boolean>)]

    # @type [Imagekitio::Internal::Type::Converter]
    MixedArray =
      Imagekitio::Internal::Type::ArrayOf[union: -> {
        Imagekitio::CustomMetadataFieldCreateParams::Schema::DefaultValue::Mixed
      }]
  end

  # Maximum value of the field. Only set this property if field type is `Date` or
  # `Number`. For `Date` type field, set the minimum date in ISO8601 string format.
  # For `Number` type field, set the minimum numeric value.
  #
  # @see Imagekitio::Models::CustomMetadataFieldCreateParams::Schema#max_value
  module MaxValue
    extend Imagekitio::Internal::Type::Union

    variant String

    variant Float

    # @!method self.variants
    #   @return [Array(String, Float)]
  end

  # Minimum value of the field. Only set this property if field type is `Date` or
  # `Number`. For `Date` type field, set the minimum date in ISO8601 string format.
  # For `Number` type field, set the minimum numeric value.
  #
  # @see Imagekitio::Models::CustomMetadataFieldCreateParams::Schema#min_value
  module MinValue
    extend Imagekitio::Internal::Type::Union

    variant String

    variant Float

    # @!method self.variants
    #   @return [Array(String, Float)]
  end

  module SelectOption
    extend Imagekitio::Internal::Type::Union

    variant String

    variant Float

    variant Imagekitio::Internal::Type::Boolean

    # @!method self.variants
    #   @return [Array(String, Float, Boolean)]
  end
end

Instance Attribute Details

#default_valueString, ...

The default value for this custom metadata field. This property is only required if ‘isValueRequired` property is set to `true`. The value should match the `type` of custom metadata field.



56
57
58
# File 'lib/imagekitio/models/custom_metadata_field_create_params.rb', line 56

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

#is_value_requiredBoolean?

Sets this custom metadata field as required. Setting custom metadata fields on an asset will throw error if the value for all required fields are not present in upload or update asset API request body.



66
# File 'lib/imagekitio/models/custom_metadata_field_create_params.rb', line 66

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

#max_lengthFloat?

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



73
# File 'lib/imagekitio/models/custom_metadata_field_create_params.rb', line 73

optional :max_length, Float, api_name: :maxLength

#max_valueString, ...

Maximum value of the field. Only set this property if field type is ‘Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value.



81
82
83
# File 'lib/imagekitio/models/custom_metadata_field_create_params.rb', line 81

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

#min_lengthFloat?

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



90
# File 'lib/imagekitio/models/custom_metadata_field_create_params.rb', line 90

optional :min_length, Float, api_name: :minLength

#min_valueString, ...

Minimum value of the field. Only set this property if field type is ‘Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value.



98
99
100
# File 'lib/imagekitio/models/custom_metadata_field_create_params.rb', line 98

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

#select_optionsArray<String, Float, Boolean>?

An array of allowed values. This property is only required if ‘type` property is set to `SingleSelect` or `MultiSelect`.



107
108
109
110
111
# File 'lib/imagekitio/models/custom_metadata_field_create_params.rb', line 107

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

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

Type of the custom metadata field.



48
# File 'lib/imagekitio/models/custom_metadata_field_create_params.rb', line 48

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

Class Method Details

.valuesArray<Symbol>



# File 'lib/imagekitio/models/custom_metadata_field_create_params.rb', line 147

.variantsArray(String, Float)



# File 'lib/imagekitio/models/custom_metadata_field_create_params.rb', line 203