Class: Moonbase::Models::Collections::FieldCreateParams::Field::FieldRelation
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Moonbase::Models::Collections::FieldCreateParams::Field::FieldRelation
- Defined in:
- lib/moonbase/models/collections/field_create_params.rb
Defined Under Namespace
Modules: Cardinality, RelationType Classes: AllowedCollection
Instance Attribute Summary collapse
-
#allowed_collections ⇒ Array<Moonbase::Models::Collections::FieldCreateParams::Field::FieldRelation::AllowedCollection>
A list of collection IDs or ‘ref` values that are valid targets for this relation.
-
#cardinality ⇒ Symbol, ...
Whether the field holds a single value (‘one`) or multiple values (`many`).
- #default_values ⇒ Array<Moonbase::Models::RelationValueParam, Moonbase::Models::CurrentMember>?
-
#description ⇒ String?
An optional description of the field’s purpose.
-
#name ⇒ String
The human-readable name for the field.
-
#relation_type ⇒ Symbol, Moonbase::Models::Collections::FieldCreateParams::Field::FieldRelation::RelationType
The type of relationship: ‘one_way` for simple references, or `two_way` for bidirectional relationships.
-
#required ⇒ Boolean?
If ‘true`, items must have a value for this field.
-
#reverse_field_name ⇒ String?
For ‘two_way` relations, the name of the reverse field created on the target collection.
-
#type ⇒ Symbol, :"field/relation"
The field type.
-
#unique ⇒ Boolean?
If ‘true`, values must be unique across all items.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id: nil, ref: nil, type: :collection) ⇒ Object
constructor
A reference to a ‘Collection` used in request bodies.
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(id: nil, ref: nil, type: :collection) ⇒ Object
A reference to a ‘Collection` used in request bodies. Provide at least one of `id` or `ref` to identify the collection.
|
|
# File 'lib/moonbase/models/collections/field_create_params.rb', line 1703
|
Instance Attribute Details
#allowed_collections ⇒ Array<Moonbase::Models::Collections::FieldCreateParams::Field::FieldRelation::AllowedCollection>
A list of collection IDs or ‘ref` values that are valid targets for this relation.
1595 1596 |
# File 'lib/moonbase/models/collections/field_create_params.rb', line 1595 required :allowed_collections, -> { Moonbase::Internal::Type::ArrayOf[Moonbase::Collections::FieldCreateParams::Field::FieldRelation::AllowedCollection] } |
#cardinality ⇒ Symbol, ...
Whether the field holds a single value (‘one`) or multiple values (`many`). Defaults to `one`.
1623 1624 |
# File 'lib/moonbase/models/collections/field_create_params.rb', line 1623 optional :cardinality, enum: -> { Moonbase::Collections::FieldCreateParams::Field::FieldRelation::Cardinality } |
#default_values ⇒ Array<Moonbase::Models::RelationValueParam, Moonbase::Models::CurrentMember>?
1629 1630 |
# File 'lib/moonbase/models/collections/field_create_params.rb', line 1629 optional :default_values, -> { Moonbase::Internal::Type::ArrayOf[union: Moonbase::RelationFieldDefaultValueParam] } |
#description ⇒ String?
An optional description of the field’s purpose.
1636 |
# File 'lib/moonbase/models/collections/field_create_params.rb', line 1636 optional :description, String |
#name ⇒ String
The human-readable name for the field.
1602 |
# File 'lib/moonbase/models/collections/field_create_params.rb', line 1602 required :name, String |
#relation_type ⇒ Symbol, Moonbase::Models::Collections::FieldCreateParams::Field::FieldRelation::RelationType
The type of relationship: ‘one_way` for simple references, or `two_way` for bidirectional relationships.
1609 1610 |
# File 'lib/moonbase/models/collections/field_create_params.rb', line 1609 required :relation_type, enum: -> { Moonbase::Collections::FieldCreateParams::Field::FieldRelation::RelationType } |
#required ⇒ Boolean?
If ‘true`, items must have a value for this field. Defaults to `false`.
1642 |
# File 'lib/moonbase/models/collections/field_create_params.rb', line 1642 optional :required, Moonbase::Internal::Type::Boolean |
#reverse_field_name ⇒ String?
For ‘two_way` relations, the name of the reverse field created on the target collection.
1649 |
# File 'lib/moonbase/models/collections/field_create_params.rb', line 1649 optional :reverse_field_name, String |
#type ⇒ Symbol, :"field/relation"
The field type. Must be ‘field/relation`.
1616 |
# File 'lib/moonbase/models/collections/field_create_params.rb', line 1616 required :type, const: :"field/relation" |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/moonbase/models/collections/field_create_params.rb', line 1724
|