Label constructor

  1. @JsonSerializable(includeIfNull: false)
const Label({
  1. @Default(comAtprotoLabelDefsLabel) @JsonKey(name: r'$type') String $type,
  2. @Default(0) int ver,
  3. required String src,
  4. required String uri,
  5. String? cid,
  6. required String val,
  7. @Default(false) bool neg,
  8. required DateTime cts,
  9. DateTime? exp,
  10. List<int>? sig,
  11. @JsonKey(name: r'$unknown') Map<String, dynamic>? $unknown,
})

Implementation

@JsonSerializable(includeIfNull: false)
const factory Label({
  /// The unique namespace for this lex object.
  ///
  /// `com.atproto.label.defs#label`
  @Default(comAtprotoLabelDefsLabel) @JsonKey(name: r'$type') String $type,

  /// The AT Protocol version of the label object.
  @Default(0) int ver,

  /// DID of the actor who created this label.
  required String src,

  /// AT URI of the record, repository (account), or other resource
  /// that this label applies to.
  required String uri,

  /// Optionally, CID specifying the specific version of 'uri' resource
  /// this label applies to.
  String? cid,

  /// The short string name of the value or type of this label.
  required String val,

  /// If true, this is a negation label, overwriting a previous label.
  @Default(false) bool neg,

  /// Timestamp when this label was created.
  required DateTime cts,

  /// Timestamp at which this label expires (no longer applies).
  DateTime? exp,

  /// Signature of dag-cbor encoded label.
  List<int>? sig,

  /// Contains unknown objects not defined in Lexicon.
  @JsonKey(name: r'$unknown') Map<String, dynamic>? $unknown,
}) = _Label;