api/tangled: sync with lexgen #758

merged
opened by boltless.me targeting master from push-pqwvxtlpsvpt

we might need a CI or Bot to do this automatically

Changed files
+61 -3
api
+3 -2
api/tangled/actorprofile.go
···
Location *string `json:"location,omitempty" cborgen:"location,omitempty"`
// pinnedRepositories: Any ATURI, it is up to appviews to validate these fields.
PinnedRepositories []string `json:"pinnedRepositories,omitempty" cborgen:"pinnedRepositories,omitempty"`
-
Stats []string `json:"stats,omitempty" cborgen:"stats,omitempty"`
-
Pronouns *string `json:"pronouns,omitempty" cborgen:"pronouns,omitempty"`
+
// pronouns: Preferred gender pronouns.
+
Pronouns *string `json:"pronouns,omitempty" cborgen:"pronouns,omitempty"`
+
Stats []string `json:"stats,omitempty" cborgen:"stats,omitempty"`
}
+58 -1
api/tangled/cbor_gen.go
···
}
cw := cbg.NewCborWriter(w)
-
fieldCount := 7
+
fieldCount := 8
if t.Description == nil {
fieldCount--
···
fieldCount--
}
+
if t.Pronouns == nil {
+
fieldCount--
+
}
+
if t.Stats == nil {
fieldCount--
}
···
}
}
+
// t.Pronouns (string) (string)
+
if t.Pronouns != nil {
+
+
if len("pronouns") > 1000000 {
+
return xerrors.Errorf("Value in field \"pronouns\" was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("pronouns"))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string("pronouns")); err != nil {
+
return err
+
}
+
+
if t.Pronouns == nil {
+
if _, err := cw.Write(cbg.CborNull); err != nil {
+
return err
+
}
+
} else {
+
if len(*t.Pronouns) > 1000000 {
+
return xerrors.Errorf("Value in field t.Pronouns was too long")
+
}
+
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Pronouns))); err != nil {
+
return err
+
}
+
if _, err := cw.WriteString(string(*t.Pronouns)); err != nil {
+
return err
+
}
+
}
+
}
+
// t.Description (string) (string)
if t.Description != nil {
···
t.Location = (*string)(&sval)
}
}
+
// t.Pronouns (string) (string)
+
case "pronouns":
+
+
{
+
b, err := cr.ReadByte()
+
if err != nil {
+
return err
+
}
+
if b != cbg.CborNull[0] {
+
if err := cr.UnreadByte(); err != nil {
+
return err
+
}
+
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
+
if err != nil {
+
return err
+
}
+
+
t.Pronouns = (*string)(&sval)
+
}
+
}
// t.Description (string) (string)
case "description":