Class: Moonbase::Models::RelationField
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Moonbase::Models::RelationField
- Defined in:
- lib/moonbase/models/relation_field.rb
Defined Under Namespace
Modules: Cardinality, Kind, RelationType
Instance Attribute Summary collapse
-
#allowed_collections ⇒ Array<Moonbase::Models::CollectionPointer>
The set of collections that are valid targets for this relation.
-
#cardinality ⇒ Symbol, Moonbase::Models::RelationField::Cardinality
Specifies whether the field can hold a single value (‘one`) or multiple values (`many`).
-
#created_at ⇒ Time
Time at which the object was created, as an ISO 8601 timestamp in UTC.
- #default_values ⇒ Array<Moonbase::Models::SingleLineTextValue, Moonbase::Models::MultiLineTextValue, Moonbase::Models::IdentifierValue, Moonbase::Models::IntegerValue, Moonbase::Models::FloatValue, Moonbase::Models::MonetaryValue, Moonbase::Models::PercentageValue, Moonbase::Models::BooleanValue, Moonbase::Models::EmailValue, Moonbase::Models::URLValue, Moonbase::Models::DomainValue, Moonbase::Models::SocialXValue, Moonbase::Models::SocialLinkedInValue, Moonbase::Models::TelephoneNumber, Moonbase::Models::GeoValue, Moonbase::Models::DateValue, Moonbase::Models::CurrentDate, Moonbase::Models::DatetimeValue, Moonbase::Models::CurrentDatetime, Moonbase::Models::ChoiceValue, Moonbase::Models::FunnelStepValue, Moonbase::Models::RelationValue, Moonbase::Models::CurrentMember>
-
#description ⇒ String?
An optional, longer-form description of the field’s purpose.
-
#id ⇒ String
Unique identifier for the object.
-
#kind ⇒ Symbol, Moonbase::Models::RelationField::Kind
‘system` fields are managed by Moonbase, `inverse` fields are the reverse side of a two-way relation, and `custom` fields are user-created.
-
#name ⇒ String
The human-readable name of the field (e.g., “Account”).
-
#readonly ⇒ Boolean
If ‘true`, the value of this field is system-managed and cannot be updated via the API.
-
#ref ⇒ String
A unique, stable, machine-readable identifier for the field within its collection (e.g., ‘account`).
-
#relation_type ⇒ Symbol, Moonbase::Models::RelationField::RelationType
The type of relationship.
-
#required ⇒ Boolean
If ‘true`, this field must have a value.
-
#reverse_field_name ⇒ String?
The name given to auto-created reverse fields on target collections.
-
#reverse_fields ⇒ Array<Moonbase::Models::FieldPointer>?
A list of reverse fields created on each target collection.
-
#source_field ⇒ Moonbase::Models::FieldPointer?
A reference to the source field that manages this reverse field.
-
#type ⇒ Symbol, :"field/relation"
The data type of the field.
-
#unique ⇒ Boolean
If ‘true`, values for this field must be unique across all items in the collection.
-
#updated_at ⇒ Time
Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, allowed_collections:, cardinality:, created_at:, default_values:, kind:, name:, readonly:, ref:, relation_type:, required:, unique:, updated_at:, description: nil, reverse_field_name: nil, reverse_fields: nil, source_field: nil, type: :"field/relation") ⇒ Object
constructor
Some parameter documentations has been truncated, see RelationField for more details.
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:, allowed_collections:, cardinality:, created_at:, default_values:, kind:, name:, readonly:, ref:, relation_type:, required:, unique:, updated_at:, description: nil, reverse_field_name: nil, reverse_fields: nil, source_field: nil, type: :"field/relation") ⇒ Object
Some parameter documentations has been truncated, see Moonbase::Models::RelationField for more details.
A field that creates a link between items in different collections, enabling cross-collection relationships.
|
|
# File 'lib/moonbase/models/relation_field.rb', line 122
|
Instance Attribute Details
#allowed_collections ⇒ Array<Moonbase::Models::CollectionPointer>
The set of collections that are valid targets for this relation.
16 |
# File 'lib/moonbase/models/relation_field.rb', line 16 required :allowed_collections, -> { Moonbase::Internal::Type::ArrayOf[Moonbase::CollectionPointer] } |
#cardinality ⇒ Symbol, Moonbase::Models::RelationField::Cardinality
Specifies whether the field can hold a single value (‘one`) or multiple values (`many`).
23 |
# File 'lib/moonbase/models/relation_field.rb', line 23 required :cardinality, enum: -> { Moonbase::RelationField::Cardinality } |
#created_at ⇒ Time
Time at which the object was created, as an ISO 8601 timestamp in UTC.
29 |
# File 'lib/moonbase/models/relation_field.rb', line 29 required :created_at, Time |
#default_values ⇒ Array<Moonbase::Models::SingleLineTextValue, Moonbase::Models::MultiLineTextValue, Moonbase::Models::IdentifierValue, Moonbase::Models::IntegerValue, Moonbase::Models::FloatValue, Moonbase::Models::MonetaryValue, Moonbase::Models::PercentageValue, Moonbase::Models::BooleanValue, Moonbase::Models::EmailValue, Moonbase::Models::URLValue, Moonbase::Models::DomainValue, Moonbase::Models::SocialXValue, Moonbase::Models::SocialLinkedInValue, Moonbase::Models::TelephoneNumber, Moonbase::Models::GeoValue, Moonbase::Models::DateValue, Moonbase::Models::CurrentDate, Moonbase::Models::DatetimeValue, Moonbase::Models::CurrentDatetime, Moonbase::Models::ChoiceValue, Moonbase::Models::FunnelStepValue, Moonbase::Models::RelationValue, Moonbase::Models::CurrentMember>
34 |
# File 'lib/moonbase/models/relation_field.rb', line 34 required :default_values, -> { Moonbase::Internal::Type::ArrayOf[union: Moonbase::FieldDefaultValue] } |
#description ⇒ String?
An optional, longer-form description of the field’s purpose.
99 |
# File 'lib/moonbase/models/relation_field.rb', line 99 optional :description, String |
#id ⇒ String
Unique identifier for the object.
10 |
# File 'lib/moonbase/models/relation_field.rb', line 10 required :id, String |
#kind ⇒ Symbol, Moonbase::Models::RelationField::Kind
‘system` fields are managed by Moonbase, `inverse` fields are the reverse side of a two-way relation, and `custom` fields are user-created.
41 |
# File 'lib/moonbase/models/relation_field.rb', line 41 required :kind, enum: -> { Moonbase::RelationField::Kind } |
#name ⇒ String
The human-readable name of the field (e.g., “Account”).
47 |
# File 'lib/moonbase/models/relation_field.rb', line 47 required :name, String |
#readonly ⇒ Boolean
If ‘true`, the value of this field is system-managed and cannot be updated via the API.
54 |
# File 'lib/moonbase/models/relation_field.rb', line 54 required :readonly, Moonbase::Internal::Type::Boolean |
#ref ⇒ String
A unique, stable, machine-readable identifier for the field within its collection (e.g., ‘account`).
61 |
# File 'lib/moonbase/models/relation_field.rb', line 61 required :ref, String |
#relation_type ⇒ Symbol, Moonbase::Models::RelationField::RelationType
The type of relationship. Can be ‘one_way` for simple references or `two_way` for bidirectional relationships.
68 |
# File 'lib/moonbase/models/relation_field.rb', line 68 required :relation_type, enum: -> { Moonbase::RelationField::RelationType } |
#required ⇒ Boolean
If ‘true`, this field must have a value.
74 |
# File 'lib/moonbase/models/relation_field.rb', line 74 required :required, Moonbase::Internal::Type::Boolean |
#reverse_field_name ⇒ String?
The name given to auto-created reverse fields on target collections. Only present on ‘two_way` source fields.
106 |
# File 'lib/moonbase/models/relation_field.rb', line 106 optional :reverse_field_name, String |
#reverse_fields ⇒ Array<Moonbase::Models::FieldPointer>?
A list of reverse fields created on each target collection. Only present on ‘two_way` source fields.
113 |
# File 'lib/moonbase/models/relation_field.rb', line 113 optional :reverse_fields, -> { Moonbase::Internal::Type::ArrayOf[Moonbase::FieldPointer] } |
#source_field ⇒ Moonbase::Models::FieldPointer?
A reference to the source field that manages this reverse field. Only present on reverse (contingent) fields.
120 |
# File 'lib/moonbase/models/relation_field.rb', line 120 optional :source_field, -> { Moonbase::FieldPointer } |
#type ⇒ Symbol, :"field/relation"
The data type of the field. Always ‘field/relation` for this field.
80 |
# File 'lib/moonbase/models/relation_field.rb', line 80 required :type, const: :"field/relation" |
#unique ⇒ Boolean
If ‘true`, values for this field must be unique across all items in the collection.
87 |
# File 'lib/moonbase/models/relation_field.rb', line 87 required :unique, Moonbase::Internal::Type::Boolean |
#updated_at ⇒ Time
Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
93 |
# File 'lib/moonbase/models/relation_field.rb', line 93 required :updated_at, Time |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/moonbase/models/relation_field.rb', line 175
|