// Code generated by indigo lexgen tool. DO NOT EDIT MANUALLY. // Lexicon schema: place.atwork.listing package placeatwork import ( "encoding/json" "fmt" appbsky "github.com/bluesky-social/indigo/api/bsky" lexutil "github.com/bluesky-social/indigo/lex/util" "tangled.org/bnewbold.net/atwork-cli/communitylexicon" ) // A job listing type Listing struct { LexiconTypeID string `json:"$type" cborgen:"$type,const=place.atwork.listing"` // applyLink: URL where applicants can apply for the job. ApplyLink *string `json:"applyLink,omitempty" cborgen:"applyLink,omitempty"` // banner: Larger horizontal image to display behind job listing view. Banner *lexutil.LexBlob `json:"banner,omitempty" cborgen:"banner,omitempty"` // description: The description of the job listing. Description string `json:"description" cborgen:"description"` // facets: Annotations of text (mentions, URLs, hashtags, etc). Facets []appbsky.RichtextFacet `json:"facets,omitempty" cborgen:"facets,omitempty"` // locations: Locations that are relevant to the job listing. Locations []Listing_Locations_Elem `json:"locations,omitempty" cborgen:"locations,omitempty"` // notAfter: Client-declared timestamp when the job listing expires. NotAfter string `json:"notAfter" cborgen:"notAfter"` // notBefore: Client-declared timestamp when the job listing becomes visible. NotBefore string `json:"notBefore" cborgen:"notBefore"` // title: The title of the job listing. Title string `json:"title" cborgen:"title"` } type Listing_Locations_Elem struct { LocationHthree *communitylexicon.LocationHthree } func (t *Listing_Locations_Elem) MarshalJSON() ([]byte, error) { if t.LocationHthree != nil { t.LocationHthree.LexiconTypeID = "community.lexicon.location.hthree" return json.Marshal(t.LocationHthree) } return nil, fmt.Errorf("can not marshal empty union as JSON") } func (t *Listing_Locations_Elem) UnmarshalJSON(b []byte) error { typ, err := lexutil.TypeExtract(b) if err != nil { return err } switch typ { case "community.lexicon.location.hthree": t.LocationHthree = new(communitylexicon.LocationHthree) return json.Unmarshal(b, t.LocationHthree) default: return nil } }