// Code generated by glex; DO NOT EDIT. // Lexicon schema: place.stream.server.upsertStorage package placestream import ( "context" "io" glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) type ServerUpsertStorage_Input struct { LexiconTypeID string `json:"$type,omitempty"` // isActive: Whether backup storage is currently active. IsActive *bool `json:"isActive,omitempty"` // url: S3 storage URL in format: s3+https://ACCESS_KEY:SECRET_KEY@endpoint/bucket Url *string `json:"url,omitempty"` } // RecordTypeID implements glex.Record. func (t *ServerUpsertStorage_Input) RecordTypeID() string { return "place.stream.server.upsertStorage" } func (t *ServerUpsertStorage_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } // stamp $type on a copy so marshal never mutates the record cp := *t cp.LexiconTypeID = "place.stream.server.upsertStorage" return glex.MarshalCBOR(w, &cp) } func (t *ServerUpsertStorage_Input) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } type ServerUpsertStorage_Output struct { LexiconTypeID string `json:"$type,omitempty"` Storage ServerDefs_Storage `json:"storage"` } // RecordTypeID implements glex.Record. func (t *ServerUpsertStorage_Output) RecordTypeID() string { return "place.stream.server.upsertStorage" } func (t *ServerUpsertStorage_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } // stamp $type on a copy so marshal never mutates the record cp := *t cp.LexiconTypeID = "place.stream.server.upsertStorage" return glex.MarshalCBOR(w, &cp) } func (t *ServerUpsertStorage_Output) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } // ServerUpsertStorage calls the XRPC method "place.stream.server.upsertStorage". // // Create or update S3 storage configuration for backups. func ServerUpsertStorage(ctx context.Context, c glex.LexClient, input *ServerUpsertStorage_Input) (*ServerUpsertStorage_Output, error) { var out ServerUpsertStorage_Output if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.server.upsertStorage", nil, input, &out); err != nil { return nil, err } return &out, nil }