fork of indigo with slightly nicer lexgen

codegen: contentmode in feeddefs (#911)

authored by hailey.at and committed by GitHub e1d4639a 268994bb

Changed files
+60 -1
api
+58 -1
api/bsky/cbor_gen.go
··· 4786 4786 } 4787 4787 4788 4788 cw := cbg.NewCborWriter(w) 4789 - fieldCount := 9 4789 + fieldCount := 10 4790 4790 4791 4791 if t.AcceptsInteractions == nil { 4792 4792 fieldCount-- 4793 4793 } 4794 4794 4795 4795 if t.Avatar == nil { 4796 + fieldCount-- 4797 + } 4798 + 4799 + if t.ContentMode == nil { 4796 4800 fieldCount-- 4797 4801 } 4798 4802 ··· 4913 4917 } 4914 4918 if _, err := cw.WriteString(string(t.CreatedAt)); err != nil { 4915 4919 return err 4920 + } 4921 + 4922 + // t.ContentMode (string) (string) 4923 + if t.ContentMode != nil { 4924 + 4925 + if len("contentMode") > 1000000 { 4926 + return xerrors.Errorf("Value in field \"contentMode\" was too long") 4927 + } 4928 + 4929 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("contentMode"))); err != nil { 4930 + return err 4931 + } 4932 + if _, err := cw.WriteString(string("contentMode")); err != nil { 4933 + return err 4934 + } 4935 + 4936 + if t.ContentMode == nil { 4937 + if _, err := cw.Write(cbg.CborNull); err != nil { 4938 + return err 4939 + } 4940 + } else { 4941 + if len(*t.ContentMode) > 1000000 { 4942 + return xerrors.Errorf("Value in field t.ContentMode was too long") 4943 + } 4944 + 4945 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.ContentMode))); err != nil { 4946 + return err 4947 + } 4948 + if _, err := cw.WriteString(string(*t.ContentMode)); err != nil { 4949 + return err 4950 + } 4951 + } 4916 4952 } 4917 4953 4918 4954 // t.Description (string) (string) ··· 5139 5175 } 5140 5176 5141 5177 t.CreatedAt = string(sval) 5178 + } 5179 + // t.ContentMode (string) (string) 5180 + case "contentMode": 5181 + 5182 + { 5183 + b, err := cr.ReadByte() 5184 + if err != nil { 5185 + return err 5186 + } 5187 + if b != cbg.CborNull[0] { 5188 + if err := cr.UnreadByte(); err != nil { 5189 + return err 5190 + } 5191 + 5192 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 5193 + if err != nil { 5194 + return err 5195 + } 5196 + 5197 + t.ContentMode = (*string)(&sval) 5198 + } 5142 5199 } 5143 5200 // t.Description (string) (string) 5144 5201 case "description":
+1
api/bsky/feeddefs.go
··· 80 80 AcceptsInteractions *bool `json:"acceptsInteractions,omitempty" cborgen:"acceptsInteractions,omitempty"` 81 81 Avatar *string `json:"avatar,omitempty" cborgen:"avatar,omitempty"` 82 82 Cid string `json:"cid" cborgen:"cid"` 83 + ContentMode *string `json:"contentMode,omitempty" cborgen:"contentMode,omitempty"` 83 84 Creator *ActorDefs_ProfileView `json:"creator" cborgen:"creator"` 84 85 Description *string `json:"description,omitempty" cborgen:"description,omitempty"` 85 86 DescriptionFacets []*RichtextFacet `json:"descriptionFacets,omitempty" cborgen:"descriptionFacets,omitempty"`
+1
api/bsky/feedgenerator.go
··· 24 24 // acceptsInteractions: Declaration that a feed accepts feedback interactions from a client through app.bsky.feed.sendInteractions 25 25 AcceptsInteractions *bool `json:"acceptsInteractions,omitempty" cborgen:"acceptsInteractions,omitempty"` 26 26 Avatar *util.LexBlob `json:"avatar,omitempty" cborgen:"avatar,omitempty"` 27 + ContentMode *string `json:"contentMode,omitempty" cborgen:"contentMode,omitempty"` 27 28 CreatedAt string `json:"createdAt" cborgen:"createdAt"` 28 29 Description *string `json:"description,omitempty" cborgen:"description,omitempty"` 29 30 DescriptionFacets []*RichtextFacet `json:"descriptionFacets,omitempty" cborgen:"descriptionFacets,omitempty"`