Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type BelieveService
- type BelieveSubmitParams
- type BelieveSubmitParamsSituationType
- type BelieveSubmitResponse
- type Biscuit
- type BiscuitListParams
- type BiscuitService
- func (r *BiscuitService) Get(ctx context.Context, biscuitID string, opts ...option.RequestOption) (res *Biscuit, err error)
- func (r *BiscuitService) GetFresh(ctx context.Context, opts ...option.RequestOption) (res *Biscuit, err error)
- func (r *BiscuitService) List(ctx context.Context, query BiscuitListParams, opts ...option.RequestOption) (res *pagination.SkipLimitPage[Biscuit], err error)
- func (r *BiscuitService) ListAutoPaging(ctx context.Context, query BiscuitListParams, opts ...option.RequestOption) *pagination.SkipLimitPageAutoPager[Biscuit]
- type BiscuitType
- type Character
- type CharacterListParams
- type CharacterNewParams
- type CharacterNewParamsSalaryGbpUnion
- type CharacterRole
- type CharacterService
- func (r *CharacterService) Delete(ctx context.Context, characterID string, opts ...option.RequestOption) (err error)
- func (r *CharacterService) Get(ctx context.Context, characterID string, opts ...option.RequestOption) (res *Character, err error)
- func (r *CharacterService) GetQuotes(ctx context.Context, characterID string, opts ...option.RequestOption) (res *[]string, err error)
- func (r *CharacterService) List(ctx context.Context, query CharacterListParams, opts ...option.RequestOption) (res *pagination.SkipLimitPage[Character], err error)
- func (r *CharacterService) ListAutoPaging(ctx context.Context, query CharacterListParams, opts ...option.RequestOption) *pagination.SkipLimitPageAutoPager[Character]
- func (r *CharacterService) New(ctx context.Context, body CharacterNewParams, opts ...option.RequestOption) (res *Character, err error)
- func (r *CharacterService) Update(ctx context.Context, characterID string, body CharacterUpdateParams, ...) (res *Character, err error)
- type CharacterUpdateParams
- type CharacterUpdateParamsSalaryGbpUnion
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) GetWelcome(ctx context.Context, opts ...option.RequestOption) (res *GetWelcomeResponse, err error)
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type ClientService
- type ClientWService
- type Coach
- type CoachMemberType
- type CoachSpecialty
- type CoachingPrinciple
- type CoachingPrincipleListParams
- type CoachingPrincipleService
- func (r *CoachingPrincipleService) Get(ctx context.Context, principleID string, opts ...option.RequestOption) (res *CoachingPrinciple, err error)
- func (r *CoachingPrincipleService) GetRandom(ctx context.Context, opts ...option.RequestOption) (res *CoachingPrinciple, err error)
- func (r *CoachingPrincipleService) List(ctx context.Context, query CoachingPrincipleListParams, ...) (res *pagination.SkipLimitPage[CoachingPrinciple], err error)
- func (r *CoachingPrincipleService) ListAutoPaging(ctx context.Context, query CoachingPrincipleListParams, ...) *pagination.SkipLimitPageAutoPager[CoachingPrinciple]
- type CoachingService
- type ConflictResolveParams
- type ConflictResolveParamsConflictType
- type ConflictResolveResponse
- type ConflictService
- type EmotionalStats
- type EmotionalStatsParam
- type Episode
- type EpisodeGetWisdomResponse
- type EpisodeListParams
- type EpisodeNewParams
- type EpisodeService
- func (r *EpisodeService) Delete(ctx context.Context, episodeID string, opts ...option.RequestOption) (err error)
- func (r *EpisodeService) Get(ctx context.Context, episodeID string, opts ...option.RequestOption) (res *Episode, err error)
- func (r *EpisodeService) GetWisdom(ctx context.Context, episodeID string, opts ...option.RequestOption) (res *EpisodeGetWisdomResponse, err error)
- func (r *EpisodeService) List(ctx context.Context, query EpisodeListParams, opts ...option.RequestOption) (res *pagination.SkipLimitPage[Episode], err error)
- func (r *EpisodeService) ListAutoPaging(ctx context.Context, query EpisodeListParams, opts ...option.RequestOption) *pagination.SkipLimitPageAutoPager[Episode]
- func (r *EpisodeService) New(ctx context.Context, body EpisodeNewParams, opts ...option.RequestOption) (res *Episode, err error)
- func (r *EpisodeService) Update(ctx context.Context, episodeID string, body EpisodeUpdateParams, ...) (res *Episode, err error)
- type EpisodeUpdateParams
- type EquipmentManager
- type EquipmentManagerMemberType
- type Error
- type FileUpload
- type GeoLocation
- type GeoLocationParam
- type GetWelcomeResponse
- type GrowthArc
- type GrowthArcParam
- type HealthCheckResponse
- type HealthService
- type League
- type Match
- type MatchCommentaryService
- type MatchCommentaryStreamResponse
- type MatchCompletedWebhookEvent
- type MatchCompletedWebhookEventData
- type MatchCompletedWebhookEventEventType
- type MatchGetLessonResponse
- type MatchGetTurningPointsResponse
- type MatchListParams
- type MatchNewParams
- type MatchNewParamsTicketRevenueGbpUnion
- type MatchResult
- type MatchService
- func (r *MatchService) Delete(ctx context.Context, matchID string, opts ...option.RequestOption) (err error)
- func (r *MatchService) Get(ctx context.Context, matchID string, opts ...option.RequestOption) (res *Match, err error)
- func (r *MatchService) GetLesson(ctx context.Context, matchID string, opts ...option.RequestOption) (res *MatchGetLessonResponse, err error)
- func (r *MatchService) GetTurningPoints(ctx context.Context, matchID string, opts ...option.RequestOption) (res *[]MatchGetTurningPointsResponse, err error)
- func (r *MatchService) List(ctx context.Context, query MatchListParams, opts ...option.RequestOption) (res *pagination.SkipLimitPage[Match], err error)
- func (r *MatchService) ListAutoPaging(ctx context.Context, query MatchListParams, opts ...option.RequestOption) *pagination.SkipLimitPageAutoPager[Match]
- func (r *MatchService) New(ctx context.Context, body MatchNewParams, opts ...option.RequestOption) (res *Match, err error)
- func (r *MatchService) StreamLive(ctx context.Context, query MatchStreamLiveParams, opts ...option.RequestOption) (err error)
- func (r *MatchService) Update(ctx context.Context, matchID string, body MatchUpdateParams, ...) (res *Match, err error)
- type MatchStreamLiveParams
- type MatchType
- type MatchUpdateParams
- type MatchUpdateParamsTicketRevenueGbpUnion
- type MedicalSpecialty
- type MedicalStaff
- type MedicalStaffMemberType
- type PaginatedResponse
- type PaginatedResponseQuote
- type PepTalkGetParams
- type PepTalkGetResponse
- type PepTalkGetResponseChunk
- type PepTalkService
- type Player
- type PlayerMemberType
- type Position
- type PressService
- type PressSimulateParams
- type PressSimulateResponse
- type Quote
- type QuoteGetRandomParams
- type QuoteListByCharacterParams
- type QuoteListByThemeParams
- type QuoteListParams
- type QuoteMoment
- type QuoteNewParams
- type QuoteService
- func (r *QuoteService) Delete(ctx context.Context, quoteID string, opts ...option.RequestOption) (err error)
- func (r *QuoteService) Get(ctx context.Context, quoteID string, opts ...option.RequestOption) (res *Quote, err error)
- func (r *QuoteService) GetRandom(ctx context.Context, query QuoteGetRandomParams, opts ...option.RequestOption) (res *Quote, err error)
- func (r *QuoteService) List(ctx context.Context, query QuoteListParams, opts ...option.RequestOption) (res *pagination.SkipLimitPage[Quote], err error)
- func (r *QuoteService) ListAutoPaging(ctx context.Context, query QuoteListParams, opts ...option.RequestOption) *pagination.SkipLimitPageAutoPager[Quote]
- func (r *QuoteService) ListByCharacter(ctx context.Context, characterID string, query QuoteListByCharacterParams, ...) (res *pagination.SkipLimitPage[Quote], err error)
- func (r *QuoteService) ListByCharacterAutoPaging(ctx context.Context, characterID string, query QuoteListByCharacterParams, ...) *pagination.SkipLimitPageAutoPager[Quote]
- func (r *QuoteService) ListByTheme(ctx context.Context, theme QuoteTheme, query QuoteListByThemeParams, ...) (res *pagination.SkipLimitPage[Quote], err error)
- func (r *QuoteService) ListByThemeAutoPaging(ctx context.Context, theme QuoteTheme, query QuoteListByThemeParams, ...) *pagination.SkipLimitPageAutoPager[Quote]
- func (r *QuoteService) New(ctx context.Context, body QuoteNewParams, opts ...option.RequestOption) (res *Quote, err error)
- func (r *QuoteService) Update(ctx context.Context, quoteID string, body QuoteUpdateParams, ...) (res *Quote, err error)
- type QuoteTheme
- type QuoteUpdateParams
- type ReframeService
- type ReframeTransformNegativeThoughtsParams
- type ReframeTransformNegativeThoughtsResponse
- type RegisteredWebhook
- type StreamService
- type StreamTestConnectionResponse
- type Team
- type TeamGetCultureResponse
- type TeamListParams
- type TeamLogoDeleteParams
- type TeamLogoDownloadParams
- type TeamLogoDownloadResponse
- type TeamLogoService
- func (r *TeamLogoService) Delete(ctx context.Context, fileID string, body TeamLogoDeleteParams, ...) (err error)
- func (r *TeamLogoService) Download(ctx context.Context, fileID string, query TeamLogoDownloadParams, ...) (res *TeamLogoDownloadResponse, err error)
- func (r *TeamLogoService) Upload(ctx context.Context, teamID string, body TeamLogoUploadParams, ...) (res *FileUpload, err error)
- type TeamLogoUploadParams
- type TeamMemberGetResponseUnion
- func (u TeamMemberGetResponseUnion) AsAny() anyTeamMemberGetResponse
- func (u TeamMemberGetResponseUnion) AsCoach() (v Coach)
- func (u TeamMemberGetResponseUnion) AsEquipmentManager() (v EquipmentManager)
- func (u TeamMemberGetResponseUnion) AsMedicalStaff() (v MedicalStaff)
- func (u TeamMemberGetResponseUnion) AsPlayer() (v Player)
- func (u TeamMemberGetResponseUnion) RawJSON() string
- func (r *TeamMemberGetResponseUnion) UnmarshalJSON(data []byte) error
- type TeamMemberListCoachesParams
- type TeamMemberListParams
- type TeamMemberListParamsMemberType
- type TeamMemberListPlayersParams
- type TeamMemberListResponseUnion
- func (u TeamMemberListResponseUnion) AsAny() anyTeamMemberListResponse
- func (u TeamMemberListResponseUnion) AsCoach() (v Coach)
- func (u TeamMemberListResponseUnion) AsEquipmentManager() (v EquipmentManager)
- func (u TeamMemberListResponseUnion) AsMedicalStaff() (v MedicalStaff)
- func (u TeamMemberListResponseUnion) AsPlayer() (v Player)
- func (u TeamMemberListResponseUnion) RawJSON() string
- func (r *TeamMemberListResponseUnion) UnmarshalJSON(data []byte) error
- type TeamMemberListStaffParams
- type TeamMemberListStaffResponseUnion
- type TeamMemberNewParams
- type TeamMemberNewParamsMemberCoach
- type TeamMemberNewParamsMemberEquipmentManager
- type TeamMemberNewParamsMemberMedicalStaff
- type TeamMemberNewParamsMemberPlayer
- type TeamMemberNewResponseUnion
- func (u TeamMemberNewResponseUnion) AsAny() anyTeamMemberNewResponse
- func (u TeamMemberNewResponseUnion) AsCoach() (v Coach)
- func (u TeamMemberNewResponseUnion) AsEquipmentManager() (v EquipmentManager)
- func (u TeamMemberNewResponseUnion) AsMedicalStaff() (v MedicalStaff)
- func (u TeamMemberNewResponseUnion) AsPlayer() (v Player)
- func (u TeamMemberNewResponseUnion) RawJSON() string
- func (r *TeamMemberNewResponseUnion) UnmarshalJSON(data []byte) error
- type TeamMemberService
- func (r *TeamMemberService) Delete(ctx context.Context, memberID string, opts ...option.RequestOption) (err error)
- func (r *TeamMemberService) Get(ctx context.Context, memberID string, opts ...option.RequestOption) (res *TeamMemberGetResponseUnion, err error)
- func (r *TeamMemberService) List(ctx context.Context, query TeamMemberListParams, opts ...option.RequestOption) (res *pagination.SkipLimitPage[TeamMemberListResponseUnion], err error)
- func (r *TeamMemberService) ListAutoPaging(ctx context.Context, query TeamMemberListParams, opts ...option.RequestOption) *pagination.SkipLimitPageAutoPager[TeamMemberListResponseUnion]
- func (r *TeamMemberService) ListCoaches(ctx context.Context, query TeamMemberListCoachesParams, ...) (res *pagination.SkipLimitPage[Coach], err error)
- func (r *TeamMemberService) ListCoachesAutoPaging(ctx context.Context, query TeamMemberListCoachesParams, ...) *pagination.SkipLimitPageAutoPager[Coach]
- func (r *TeamMemberService) ListPlayers(ctx context.Context, query TeamMemberListPlayersParams, ...) (res *pagination.SkipLimitPage[Player], err error)
- func (r *TeamMemberService) ListPlayersAutoPaging(ctx context.Context, query TeamMemberListPlayersParams, ...) *pagination.SkipLimitPageAutoPager[Player]
- func (r *TeamMemberService) ListStaff(ctx context.Context, query TeamMemberListStaffParams, ...) (res *pagination.SkipLimitPage[TeamMemberListStaffResponseUnion], err error)
- func (r *TeamMemberService) ListStaffAutoPaging(ctx context.Context, query TeamMemberListStaffParams, ...) *pagination.SkipLimitPageAutoPager[TeamMemberListStaffResponseUnion]
- func (r *TeamMemberService) New(ctx context.Context, body TeamMemberNewParams, opts ...option.RequestOption) (res *TeamMemberNewResponseUnion, err error)
- func (r *TeamMemberService) Update(ctx context.Context, memberID string, body TeamMemberUpdateParams, ...) (res *TeamMemberUpdateResponseUnion, err error)
- type TeamMemberTransferredWebhookEvent
- type TeamMemberTransferredWebhookEventData
- type TeamMemberTransferredWebhookEventEventType
- type TeamMemberUpdateParams
- type TeamMemberUpdateParamsUpdatesCoachUpdate
- type TeamMemberUpdateParamsUpdatesEquipmentManagerUpdate
- type TeamMemberUpdateParamsUpdatesMedicalStaffUpdate
- type TeamMemberUpdateParamsUpdatesPlayerUpdate
- type TeamMemberUpdateResponseUnion
- func (u TeamMemberUpdateResponseUnion) AsAny() anyTeamMemberUpdateResponse
- func (u TeamMemberUpdateResponseUnion) AsCoach() (v Coach)
- func (u TeamMemberUpdateResponseUnion) AsEquipmentManager() (v EquipmentManager)
- func (u TeamMemberUpdateResponseUnion) AsMedicalStaff() (v MedicalStaff)
- func (u TeamMemberUpdateResponseUnion) AsPlayer() (v Player)
- func (u TeamMemberUpdateResponseUnion) RawJSON() string
- func (r *TeamMemberUpdateResponseUnion) UnmarshalJSON(data []byte) error
- type TeamNewParams
- type TeamNewParamsAnnualBudgetGbpUnion
- type TeamService
- func (r *TeamService) Delete(ctx context.Context, teamID string, opts ...option.RequestOption) (err error)
- func (r *TeamService) Get(ctx context.Context, teamID string, opts ...option.RequestOption) (res *Team, err error)
- func (r *TeamService) GetCulture(ctx context.Context, teamID string, opts ...option.RequestOption) (res *TeamGetCultureResponse, err error)
- func (r *TeamService) GetRivals(ctx context.Context, teamID string, opts ...option.RequestOption) (res *[]Team, err error)
- func (r *TeamService) List(ctx context.Context, query TeamListParams, opts ...option.RequestOption) (res *pagination.SkipLimitPage[Team], err error)
- func (r *TeamService) ListAutoPaging(ctx context.Context, query TeamListParams, opts ...option.RequestOption) *pagination.SkipLimitPageAutoPager[Team]
- func (r *TeamService) ListLogos(ctx context.Context, teamID string, opts ...option.RequestOption) (res *[]FileUpload, err error)
- func (r *TeamService) New(ctx context.Context, body TeamNewParams, opts ...option.RequestOption) (res *Team, err error)
- func (r *TeamService) Update(ctx context.Context, teamID string, body TeamUpdateParams, ...) (res *Team, err error)
- type TeamUpdateParams
- type TeamUpdateParamsAnnualBudgetGbpUnion
- type TeamValues
- type TeamValuesParam
- type TurningPoint
- type TurningPointParam
- type UnwrapWebhookEventUnion
- func (u UnwrapWebhookEventUnion) AsAny() anyUnwrapWebhookEvent
- func (u UnwrapWebhookEventUnion) AsMatchCompleted() (v MatchCompletedWebhookEvent)
- func (u UnwrapWebhookEventUnion) AsTeamMemberTransferred() (v TeamMemberTransferredWebhookEvent)
- func (u UnwrapWebhookEventUnion) RawJSON() string
- func (r *UnwrapWebhookEventUnion) UnmarshalJSON(data []byte) error
- type UnwrapWebhookEventUnionData
- type VersionGetResponse
- type VersionService
- type WebhookDeleteResponse
- type WebhookNewParams
- type WebhookNewResponse
- type WebhookService
- func (r *WebhookService) Delete(ctx context.Context, webhookID string, opts ...option.RequestOption) (res *WebhookDeleteResponse, err error)
- func (r *WebhookService) Get(ctx context.Context, webhookID string, opts ...option.RequestOption) (res *RegisteredWebhook, err error)
- func (r *WebhookService) List(ctx context.Context, opts ...option.RequestOption) (res *[]RegisteredWebhook, err error)
- func (r *WebhookService) New(ctx context.Context, body WebhookNewParams, opts ...option.RequestOption) (res *WebhookNewResponse, err error)
- func (r *WebhookService) TriggerEvent(ctx context.Context, body WebhookTriggerEventParams, ...) (res *WebhookTriggerEventResponse, err error)
- func (r *WebhookService) Unwrap(payload []byte, opts ...option.RequestOption) (*UnwrapWebhookEventUnion, error)
- type WebhookTriggerEventParams
- type WebhookTriggerEventParamsEventType
- type WebhookTriggerEventParamsPayloadMatchCompleted
- type WebhookTriggerEventParamsPayloadMatchCompletedData
- type WebhookTriggerEventParamsPayloadTeamMemberTransferred
- type WebhookTriggerEventParamsPayloadTeamMemberTransferredData
- type WebhookTriggerEventParamsPayloadUnion
- type WebhookTriggerEventResponse
- type WebhookTriggerEventResponseDelivery
- type WebhookTriggerEventResponseEventType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (BELIEVE_API_KEY, BELIEVE_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type BelieveService ¶
type BelieveService struct {
Options []option.RequestOption
}
BelieveService contains methods and other services that help with interacting with the believe API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBelieveService method instead.
func NewBelieveService ¶
func NewBelieveService(opts ...option.RequestOption) (r BelieveService)
NewBelieveService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*BelieveService) Submit ¶
func (r *BelieveService) Submit(ctx context.Context, body BelieveSubmitParams, opts ...option.RequestOption) (res *BelieveSubmitResponse, err error)
Submit your situation and receive Ted Lasso-style motivational guidance.
type BelieveSubmitParams ¶
type BelieveSubmitParams struct {
// Describe your situation
Situation string `json:"situation,required"`
// Type of situation
//
// Any of "work_challenge", "personal_setback", "team_conflict", "self_doubt",
// "big_decision", "failure", "new_beginning", "relationship".
SituationType BelieveSubmitParamsSituationType `json:"situation_type,omitzero,required"`
// Additional context
Context param.Opt[string] `json:"context,omitzero"`
// How intense is the response needed (1=gentle, 10=full Ted)
Intensity param.Opt[int64] `json:"intensity,omitzero"`
// contains filtered or unexported fields
}
func (BelieveSubmitParams) MarshalJSON ¶
func (r BelieveSubmitParams) MarshalJSON() (data []byte, err error)
func (*BelieveSubmitParams) UnmarshalJSON ¶
func (r *BelieveSubmitParams) UnmarshalJSON(data []byte) error
type BelieveSubmitParamsSituationType ¶
type BelieveSubmitParamsSituationType string
Type of situation
const ( BelieveSubmitParamsSituationTypeWorkChallenge BelieveSubmitParamsSituationType = "work_challenge" BelieveSubmitParamsSituationTypePersonalSetback BelieveSubmitParamsSituationType = "personal_setback" BelieveSubmitParamsSituationTypeTeamConflict BelieveSubmitParamsSituationType = "team_conflict" BelieveSubmitParamsSituationTypeSelfDoubt BelieveSubmitParamsSituationType = "self_doubt" BelieveSubmitParamsSituationTypeBigDecision BelieveSubmitParamsSituationType = "big_decision" BelieveSubmitParamsSituationTypeFailure BelieveSubmitParamsSituationType = "failure" BelieveSubmitParamsSituationTypeNewBeginning BelieveSubmitParamsSituationType = "new_beginning" BelieveSubmitParamsSituationTypeRelationship BelieveSubmitParamsSituationType = "relationship" )
type BelieveSubmitResponse ¶
type BelieveSubmitResponse struct {
// Suggested action to take
ActionSuggestion string `json:"action_suggestion,required"`
// Your current believe-o-meter score
BelieveScore int64 `json:"believe_score,required"`
// A reminder to have a goldfish memory when needed
GoldfishWisdom string `json:"goldfish_wisdom,required"`
// A relevant Ted Lasso quote
RelevantQuote string `json:"relevant_quote,required"`
// Ted's motivational response
TedResponse string `json:"ted_response,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ActionSuggestion respjson.Field
BelieveScore respjson.Field
GoldfishWisdom respjson.Field
RelevantQuote respjson.Field
TedResponse respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response from the Believe Engine.
func (BelieveSubmitResponse) RawJSON ¶
func (r BelieveSubmitResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BelieveSubmitResponse) UnmarshalJSON ¶
func (r *BelieveSubmitResponse) UnmarshalJSON(data []byte) error
type Biscuit ¶
type Biscuit struct {
// Biscuit identifier
ID string `json:"id,required"`
// Message that comes with the biscuit
Message string `json:"message,required"`
// What this biscuit pairs well with
PairsWellWith string `json:"pairs_well_with,required"`
// A handwritten note from Ted
TedNote string `json:"ted_note,required"`
// Type of biscuit
//
// Any of "classic", "shortbread", "chocolate_chip", "oatmeal_raisin".
Type BiscuitType `json:"type,required"`
// How warm and fresh (1-10)
WarmthLevel int64 `json:"warmth_level,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Message respjson.Field
PairsWellWith respjson.Field
TedNote respjson.Field
Type respjson.Field
WarmthLevel respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A biscuit from Ted.
func (*Biscuit) UnmarshalJSON ¶
type BiscuitListParams ¶
type BiscuitListParams struct {
// Maximum number of items to return (max: 100)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Number of items to skip (offset)
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BiscuitListParams) URLQuery ¶
func (r BiscuitListParams) URLQuery() (v url.Values, err error)
URLQuery serializes BiscuitListParams's query parameters as `url.Values`.
type BiscuitService ¶
type BiscuitService struct {
Options []option.RequestOption
}
BiscuitService contains methods and other services that help with interacting with the believe API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBiscuitService method instead.
func NewBiscuitService ¶
func NewBiscuitService(opts ...option.RequestOption) (r BiscuitService)
NewBiscuitService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*BiscuitService) Get ¶
func (r *BiscuitService) Get(ctx context.Context, biscuitID string, opts ...option.RequestOption) (res *Biscuit, err error)
Get a specific type of biscuit by ID.
func (*BiscuitService) GetFresh ¶
func (r *BiscuitService) GetFresh(ctx context.Context, opts ...option.RequestOption) (res *Biscuit, err error)
Get a single fresh biscuit with a personalized message from Ted.
func (*BiscuitService) List ¶
func (r *BiscuitService) List(ctx context.Context, query BiscuitListParams, opts ...option.RequestOption) (res *pagination.SkipLimitPage[Biscuit], err error)
Get a paginated list of Ted's famous homemade biscuits! Each comes with a heartwarming message.
func (*BiscuitService) ListAutoPaging ¶
func (r *BiscuitService) ListAutoPaging(ctx context.Context, query BiscuitListParams, opts ...option.RequestOption) *pagination.SkipLimitPageAutoPager[Biscuit]
Get a paginated list of Ted's famous homemade biscuits! Each comes with a heartwarming message.
type BiscuitType ¶
type BiscuitType string
Type of biscuit
const ( BiscuitTypeClassic BiscuitType = "classic" BiscuitTypeShortbread BiscuitType = "shortbread" BiscuitTypeChocolateChip BiscuitType = "chocolate_chip" BiscuitTypeOatmealRaisin BiscuitType = "oatmeal_raisin" )
type Character ¶
type Character struct {
// Unique identifier
ID string `json:"id,required"`
// Character background and history
Background string `json:"background,required"`
// Emotional intelligence stats
EmotionalStats EmotionalStats `json:"emotional_stats,required"`
// Character's full name
Name string `json:"name,required"`
// Key personality traits
PersonalityTraits []string `json:"personality_traits,required"`
// Character's role
//
// Any of "coach", "player", "owner", "manager", "staff", "journalist", "family",
// "friend", "fan", "other".
Role CharacterRole `json:"role,required"`
// Character's date of birth
DateOfBirth time.Time `json:"date_of_birth,nullable" format:"date"`
// Character's email address
Email string `json:"email,nullable" format:"email"`
// Character development across seasons
GrowthArcs []GrowthArc `json:"growth_arcs"`
// Height in meters
HeightMeters float64 `json:"height_meters,nullable"`
// URL to character's profile image
ProfileImageURL string `json:"profile_image_url,nullable" format:"uri"`
// Annual salary in GBP
SalaryGbp string `json:"salary_gbp,nullable"`
// Memorable quotes from this character
SignatureQuotes []string `json:"signature_quotes"`
// ID of the team they belong to
TeamID string `json:"team_id,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Background respjson.Field
EmotionalStats respjson.Field
Name respjson.Field
PersonalityTraits respjson.Field
Role respjson.Field
DateOfBirth respjson.Field
Email respjson.Field
GrowthArcs respjson.Field
HeightMeters respjson.Field
ProfileImageURL respjson.Field
SalaryGbp respjson.Field
SignatureQuotes respjson.Field
TeamID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Full character model with ID.
func (*Character) UnmarshalJSON ¶
type CharacterListParams ¶
type CharacterListParams struct {
// Minimum optimism score
MinOptimism param.Opt[int64] `query:"min_optimism,omitzero" json:"-"`
// Filter by team ID
TeamID param.Opt[string] `query:"team_id,omitzero" json:"-"`
// Maximum number of items to return (max: 100)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Number of items to skip (offset)
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// Filter by role
//
// Any of "coach", "player", "owner", "manager", "staff", "journalist", "family",
// "friend", "fan", "other".
Role CharacterRole `query:"role,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (CharacterListParams) URLQuery ¶
func (r CharacterListParams) URLQuery() (v url.Values, err error)
URLQuery serializes CharacterListParams's query parameters as `url.Values`.
type CharacterNewParams ¶
type CharacterNewParams struct {
// Character background and history
Background string `json:"background,required"`
// Emotional intelligence stats
EmotionalStats EmotionalStatsParam `json:"emotional_stats,omitzero,required"`
// Character's full name
Name string `json:"name,required"`
// Key personality traits
PersonalityTraits []string `json:"personality_traits,omitzero,required"`
// Character's role
//
// Any of "coach", "player", "owner", "manager", "staff", "journalist", "family",
// "friend", "fan", "other".
Role CharacterRole `json:"role,omitzero,required"`
// Character's date of birth
DateOfBirth param.Opt[time.Time] `json:"date_of_birth,omitzero" format:"date"`
// Character's email address
Email param.Opt[string] `json:"email,omitzero" format:"email"`
// Height in meters
HeightMeters param.Opt[float64] `json:"height_meters,omitzero"`
// URL to character's profile image
ProfileImageURL param.Opt[string] `json:"profile_image_url,omitzero" format:"uri"`
// ID of the team they belong to
TeamID param.Opt[string] `json:"team_id,omitzero"`
// Annual salary in GBP
SalaryGbp CharacterNewParamsSalaryGbpUnion `json:"salary_gbp,omitzero"`
// Character development across seasons
GrowthArcs []GrowthArcParam `json:"growth_arcs,omitzero"`
// Memorable quotes from this character
SignatureQuotes []string `json:"signature_quotes,omitzero"`
// contains filtered or unexported fields
}
func (CharacterNewParams) MarshalJSON ¶
func (r CharacterNewParams) MarshalJSON() (data []byte, err error)
func (*CharacterNewParams) UnmarshalJSON ¶
func (r *CharacterNewParams) UnmarshalJSON(data []byte) error
type CharacterNewParamsSalaryGbpUnion ¶
type CharacterNewParamsSalaryGbpUnion struct {
OfFloat param.Opt[float64] `json:",omitzero,inline"`
OfString param.Opt[string] `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (CharacterNewParamsSalaryGbpUnion) MarshalJSON ¶
func (u CharacterNewParamsSalaryGbpUnion) MarshalJSON() ([]byte, error)
func (*CharacterNewParamsSalaryGbpUnion) UnmarshalJSON ¶
func (u *CharacterNewParamsSalaryGbpUnion) UnmarshalJSON(data []byte) error
type CharacterRole ¶
type CharacterRole string
Roles characters can have.
const ( CharacterRoleCoach CharacterRole = "coach" CharacterRolePlayer CharacterRole = "player" CharacterRoleOwner CharacterRole = "owner" CharacterRoleManager CharacterRole = "manager" CharacterRoleStaff CharacterRole = "staff" CharacterRoleJournalist CharacterRole = "journalist" CharacterRoleFamily CharacterRole = "family" CharacterRoleFriend CharacterRole = "friend" CharacterRoleFan CharacterRole = "fan" CharacterRoleOther CharacterRole = "other" )
type CharacterService ¶
type CharacterService struct {
Options []option.RequestOption
}
CharacterService contains methods and other services that help with interacting with the believe API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCharacterService method instead.
func NewCharacterService ¶
func NewCharacterService(opts ...option.RequestOption) (r CharacterService)
NewCharacterService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*CharacterService) Delete ¶
func (r *CharacterService) Delete(ctx context.Context, characterID string, opts ...option.RequestOption) (err error)
Remove a character from the database.
func (*CharacterService) Get ¶
func (r *CharacterService) Get(ctx context.Context, characterID string, opts ...option.RequestOption) (res *Character, err error)
Retrieve detailed information about a specific character.
func (*CharacterService) GetQuotes ¶
func (r *CharacterService) GetQuotes(ctx context.Context, characterID string, opts ...option.RequestOption) (res *[]string, err error)
Get all signature quotes from a specific character.
func (*CharacterService) List ¶
func (r *CharacterService) List(ctx context.Context, query CharacterListParams, opts ...option.RequestOption) (res *pagination.SkipLimitPage[Character], err error)
Get a paginated list of Ted Lasso characters.
func (*CharacterService) ListAutoPaging ¶
func (r *CharacterService) ListAutoPaging(ctx context.Context, query CharacterListParams, opts ...option.RequestOption) *pagination.SkipLimitPageAutoPager[Character]
Get a paginated list of Ted Lasso characters.
func (*CharacterService) New ¶
func (r *CharacterService) New(ctx context.Context, body CharacterNewParams, opts ...option.RequestOption) (res *Character, err error)
Add a new character to the Ted Lasso universe.
func (*CharacterService) Update ¶
func (r *CharacterService) Update(ctx context.Context, characterID string, body CharacterUpdateParams, opts ...option.RequestOption) (res *Character, err error)
Update specific fields of an existing character.
type CharacterUpdateParams ¶
type CharacterUpdateParams struct {
Background param.Opt[string] `json:"background,omitzero"`
DateOfBirth param.Opt[time.Time] `json:"date_of_birth,omitzero" format:"date"`
Email param.Opt[string] `json:"email,omitzero" format:"email"`
HeightMeters param.Opt[float64] `json:"height_meters,omitzero"`
Name param.Opt[string] `json:"name,omitzero"`
ProfileImageURL param.Opt[string] `json:"profile_image_url,omitzero" format:"uri"`
TeamID param.Opt[string] `json:"team_id,omitzero"`
GrowthArcs []GrowthArcParam `json:"growth_arcs,omitzero"`
PersonalityTraits []string `json:"personality_traits,omitzero"`
SalaryGbp CharacterUpdateParamsSalaryGbpUnion `json:"salary_gbp,omitzero"`
SignatureQuotes []string `json:"signature_quotes,omitzero"`
// Emotional intelligence statistics for a character.
EmotionalStats EmotionalStatsParam `json:"emotional_stats,omitzero"`
// Roles characters can have.
//
// Any of "coach", "player", "owner", "manager", "staff", "journalist", "family",
// "friend", "fan", "other".
Role CharacterRole `json:"role,omitzero"`
// contains filtered or unexported fields
}
func (CharacterUpdateParams) MarshalJSON ¶
func (r CharacterUpdateParams) MarshalJSON() (data []byte, err error)
func (*CharacterUpdateParams) UnmarshalJSON ¶
func (r *CharacterUpdateParams) UnmarshalJSON(data []byte) error
type CharacterUpdateParamsSalaryGbpUnion ¶
type CharacterUpdateParamsSalaryGbpUnion struct {
OfFloat param.Opt[float64] `json:",omitzero,inline"`
OfString param.Opt[string] `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (CharacterUpdateParamsSalaryGbpUnion) MarshalJSON ¶
func (u CharacterUpdateParamsSalaryGbpUnion) MarshalJSON() ([]byte, error)
func (*CharacterUpdateParamsSalaryGbpUnion) UnmarshalJSON ¶
func (u *CharacterUpdateParamsSalaryGbpUnion) UnmarshalJSON(data []byte) error
type Client ¶
type Client struct {
Options []option.RequestOption
Characters CharacterService
Teams TeamService
Matches MatchService
Episodes EpisodeService
Quotes QuoteService
Believe BelieveService
Conflicts ConflictService
Reframe ReframeService
Press PressService
Coaching CoachingService
Biscuits BiscuitService
PepTalk PepTalkService
Stream StreamService
TeamMembers TeamMemberService
Webhooks WebhookService
Health HealthService
Version VersionService
Client ClientService
}
Client creates a struct with services and top level methods that help with interacting with the believe API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (BELIEVE_API_KEY, BELIEVE_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) GetWelcome ¶
func (r *Client) GetWelcome(ctx context.Context, opts ...option.RequestOption) (res *GetWelcomeResponse, err error)
Get a warm welcome and overview of available endpoints.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type ClientService ¶
type ClientService struct {
Options []option.RequestOption
Ws ClientWService
}
ClientService contains methods and other services that help with interacting with the believe API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewClientService method instead.
func NewClientService ¶
func NewClientService(opts ...option.RequestOption) (r ClientService)
NewClientService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type ClientWService ¶
type ClientWService struct {
Options []option.RequestOption
}
ClientWService contains methods and other services that help with interacting with the believe API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewClientWService method instead.
func NewClientWService ¶
func NewClientWService(opts ...option.RequestOption) (r ClientWService)
NewClientWService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ClientWService) Test ¶ added in v0.2.0
func (r *ClientWService) Test(ctx context.Context, opts ...option.RequestOption) (err error)
Simple WebSocket test endpoint for connectivity testing.
Connect to test WebSocket functionality. The server will:
1. Send a welcome message on connection 2. Echo back any message you send
## Example
```javascript const ws = new WebSocket("ws://localhost:8000/ws/test"); ws.onmessage = (event) => console.log(event.data); ws.send("Hello!"); // Server responds with echo ```
type Coach ¶
type Coach struct {
// Unique identifier for this team membership
ID string `json:"id,required"`
// ID of the character (references /characters/{id})
CharacterID string `json:"character_id,required"`
// Coaching specialty/role
//
// Any of "head_coach", "assistant_coach", "goalkeeping_coach", "fitness_coach",
// "tactical_analyst".
Specialty CoachSpecialty `json:"specialty,required"`
// ID of the team they belong to
TeamID string `json:"team_id,required"`
// Number of years with the current team
YearsWithTeam int64 `json:"years_with_team,required"`
// Coaching certifications and licenses
Certifications []string `json:"certifications"`
// Discriminator field indicating this is a coach
//
// Any of "coach".
MemberType CoachMemberType `json:"member_type"`
// Career win rate (0.0 to 1.0)
WinRate float64 `json:"win_rate,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CharacterID respjson.Field
Specialty respjson.Field
TeamID respjson.Field
YearsWithTeam respjson.Field
Certifications respjson.Field
MemberType respjson.Field
WinRate respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Full coach model with ID.
func (*Coach) UnmarshalJSON ¶
type CoachMemberType ¶
type CoachMemberType string
Discriminator field indicating this is a coach
const (
CoachMemberTypeCoach CoachMemberType = "coach"
)
type CoachSpecialty ¶
type CoachSpecialty string
Coaching specialties.
const ( CoachSpecialtyHeadCoach CoachSpecialty = "head_coach" CoachSpecialtyAssistantCoach CoachSpecialty = "assistant_coach" CoachSpecialtyGoalkeepingCoach CoachSpecialty = "goalkeeping_coach" CoachSpecialtyFitnessCoach CoachSpecialty = "fitness_coach" CoachSpecialtyTacticalAnalyst CoachSpecialty = "tactical_analyst" )
type CoachingPrinciple ¶
type CoachingPrinciple struct {
// Principle identifier
ID string `json:"id,required"`
// How to apply this principle
Application string `json:"application,required"`
// Example from the show
ExampleFromShow string `json:"example_from_show,required"`
// What this principle means
Explanation string `json:"explanation,required"`
// The coaching principle
Principle string `json:"principle,required"`
// Related Ted quote
TedQuote string `json:"ted_quote,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Application respjson.Field
ExampleFromShow respjson.Field
Explanation respjson.Field
Principle respjson.Field
TedQuote respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A Ted Lasso coaching principle.
func (CoachingPrinciple) RawJSON ¶
func (r CoachingPrinciple) RawJSON() string
Returns the unmodified JSON received from the API
func (*CoachingPrinciple) UnmarshalJSON ¶
func (r *CoachingPrinciple) UnmarshalJSON(data []byte) error
type CoachingPrincipleListParams ¶
type CoachingPrincipleListParams struct {
// Maximum number of items to return (max: 100)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Number of items to skip (offset)
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (CoachingPrincipleListParams) URLQuery ¶
func (r CoachingPrincipleListParams) URLQuery() (v url.Values, err error)
URLQuery serializes CoachingPrincipleListParams's query parameters as `url.Values`.
type CoachingPrincipleService ¶
type CoachingPrincipleService struct {
Options []option.RequestOption
}
CoachingPrincipleService contains methods and other services that help with interacting with the believe API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCoachingPrincipleService method instead.
func NewCoachingPrincipleService ¶
func NewCoachingPrincipleService(opts ...option.RequestOption) (r CoachingPrincipleService)
NewCoachingPrincipleService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*CoachingPrincipleService) Get ¶
func (r *CoachingPrincipleService) Get(ctx context.Context, principleID string, opts ...option.RequestOption) (res *CoachingPrinciple, err error)
Get details about a specific coaching principle.
func (*CoachingPrincipleService) GetRandom ¶
func (r *CoachingPrincipleService) GetRandom(ctx context.Context, opts ...option.RequestOption) (res *CoachingPrinciple, err error)
Get a random coaching principle to inspire your day.
func (*CoachingPrincipleService) List ¶
func (r *CoachingPrincipleService) List(ctx context.Context, query CoachingPrincipleListParams, opts ...option.RequestOption) (res *pagination.SkipLimitPage[CoachingPrinciple], err error)
Get a paginated list of Ted Lasso's core coaching principles and philosophy.
func (*CoachingPrincipleService) ListAutoPaging ¶
func (r *CoachingPrincipleService) ListAutoPaging(ctx context.Context, query CoachingPrincipleListParams, opts ...option.RequestOption) *pagination.SkipLimitPageAutoPager[CoachingPrinciple]
Get a paginated list of Ted Lasso's core coaching principles and philosophy.
type CoachingService ¶
type CoachingService struct {
Options []option.RequestOption
Principles CoachingPrincipleService
}
CoachingService contains methods and other services that help with interacting with the believe API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCoachingService method instead.
func NewCoachingService ¶
func NewCoachingService(opts ...option.RequestOption) (r CoachingService)
NewCoachingService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type ConflictResolveParams ¶
type ConflictResolveParams struct {
// Type of conflict
//
// Any of "interpersonal", "team_dynamics", "leadership", "ego",
// "miscommunication", "competition".
ConflictType ConflictResolveParamsConflictType `json:"conflict_type,omitzero,required"`
// Describe the conflict
Description string `json:"description,required"`
// Who is involved in the conflict
PartiesInvolved []string `json:"parties_involved,omitzero,required"`
// What you've already tried
AttemptsMade []string `json:"attempts_made,omitzero"`
// contains filtered or unexported fields
}
func (ConflictResolveParams) MarshalJSON ¶
func (r ConflictResolveParams) MarshalJSON() (data []byte, err error)
func (*ConflictResolveParams) UnmarshalJSON ¶
func (r *ConflictResolveParams) UnmarshalJSON(data []byte) error
type ConflictResolveParamsConflictType ¶
type ConflictResolveParamsConflictType string
Type of conflict
const ( ConflictResolveParamsConflictTypeInterpersonal ConflictResolveParamsConflictType = "interpersonal" ConflictResolveParamsConflictTypeTeamDynamics ConflictResolveParamsConflictType = "team_dynamics" ConflictResolveParamsConflictTypeLeadership ConflictResolveParamsConflictType = "leadership" ConflictResolveParamsConflictTypeEgo ConflictResolveParamsConflictType = "ego" ConflictResolveParamsConflictTypeMiscommunication ConflictResolveParamsConflictType = "miscommunication" ConflictResolveParamsConflictTypeCompetition ConflictResolveParamsConflictType = "competition" )
type ConflictResolveResponse ¶
type ConflictResolveResponse struct {
// A folksy metaphor to remember
BarbecueSauceWisdom string `json:"barbecue_sauce_wisdom,required"`
// Understanding the root cause
Diagnosis string `json:"diagnosis,required"`
// Advice from the Diamond Dogs support group
DiamondDogsAdvice string `json:"diamond_dogs_advice,required"`
// What resolution could look like
PotentialOutcome string `json:"potential_outcome,required"`
// Concrete steps to resolve the conflict
StepsToResolution []string `json:"steps_to_resolution,required"`
// How Ted would handle this
TedApproach string `json:"ted_approach,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
BarbecueSauceWisdom respjson.Field
Diagnosis respjson.Field
DiamondDogsAdvice respjson.Field
PotentialOutcome respjson.Field
StepsToResolution respjson.Field
TedApproach respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Conflict resolution response.
func (ConflictResolveResponse) RawJSON ¶
func (r ConflictResolveResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConflictResolveResponse) UnmarshalJSON ¶
func (r *ConflictResolveResponse) UnmarshalJSON(data []byte) error
type ConflictService ¶
type ConflictService struct {
Options []option.RequestOption
}
ConflictService contains methods and other services that help with interacting with the believe API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewConflictService method instead.
func NewConflictService ¶
func NewConflictService(opts ...option.RequestOption) (r ConflictService)
NewConflictService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ConflictService) Resolve ¶
func (r *ConflictService) Resolve(ctx context.Context, body ConflictResolveParams, opts ...option.RequestOption) (res *ConflictResolveResponse, err error)
Get Ted Lasso-style advice for resolving conflicts.
type EmotionalStats ¶
type EmotionalStats struct {
// Level of curiosity over judgment (0-100)
Curiosity int64 `json:"curiosity,required"`
// Capacity for empathy (0-100)
Empathy int64 `json:"empathy,required"`
// Level of optimism (0-100)
Optimism int64 `json:"optimism,required"`
// Bounce-back ability (0-100)
Resilience int64 `json:"resilience,required"`
// Willingness to be vulnerable (0-100)
Vulnerability int64 `json:"vulnerability,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Curiosity respjson.Field
Empathy respjson.Field
Optimism respjson.Field
Resilience respjson.Field
Vulnerability respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Emotional intelligence statistics for a character.
func (EmotionalStats) RawJSON ¶
func (r EmotionalStats) RawJSON() string
Returns the unmodified JSON received from the API
func (EmotionalStats) ToParam ¶
func (r EmotionalStats) ToParam() EmotionalStatsParam
ToParam converts this EmotionalStats to a EmotionalStatsParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with EmotionalStatsParam.Overrides()
func (*EmotionalStats) UnmarshalJSON ¶
func (r *EmotionalStats) UnmarshalJSON(data []byte) error
type EmotionalStatsParam ¶
type EmotionalStatsParam struct {
// Level of curiosity over judgment (0-100)
Curiosity int64 `json:"curiosity,required"`
// Capacity for empathy (0-100)
Empathy int64 `json:"empathy,required"`
// Level of optimism (0-100)
Optimism int64 `json:"optimism,required"`
// Bounce-back ability (0-100)
Resilience int64 `json:"resilience,required"`
// Willingness to be vulnerable (0-100)
Vulnerability int64 `json:"vulnerability,required"`
// contains filtered or unexported fields
}
Emotional intelligence statistics for a character.
The properties Curiosity, Empathy, Optimism, Resilience, Vulnerability are required.
func (EmotionalStatsParam) MarshalJSON ¶
func (r EmotionalStatsParam) MarshalJSON() (data []byte, err error)
func (*EmotionalStatsParam) UnmarshalJSON ¶
func (r *EmotionalStatsParam) UnmarshalJSON(data []byte) error
type Episode ¶
type Episode struct {
// Unique identifier (format: s##e##)
ID string `json:"id,required"`
// Original air date
AirDate time.Time `json:"air_date,required" format:"date"`
// Characters with significant development
CharacterFocus []string `json:"character_focus,required"`
// Episode director
Director string `json:"director,required"`
// Episode number within season
EpisodeNumber int64 `json:"episode_number,required"`
// Central theme of the episode
MainTheme string `json:"main_theme,required"`
// Episode runtime in minutes
RuntimeMinutes int64 `json:"runtime_minutes,required"`
// Season number
Season int64 `json:"season,required"`
// Brief plot synopsis
Synopsis string `json:"synopsis,required"`
// Key piece of Ted wisdom from the episode
TedWisdom string `json:"ted_wisdom,required"`
// Episode title
Title string `json:"title,required"`
// Episode writer(s)
Writer string `json:"writer,required"`
// Notable biscuits with the boss scene
BiscuitsWithBossMoment string `json:"biscuits_with_boss_moment,nullable"`
// Standout moments from the episode
MemorableMoments []string `json:"memorable_moments"`
// US viewership in millions
UsViewersMillions float64 `json:"us_viewers_millions,nullable"`
// Viewer rating out of 10
ViewerRating float64 `json:"viewer_rating,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AirDate respjson.Field
CharacterFocus respjson.Field
Director respjson.Field
EpisodeNumber respjson.Field
MainTheme respjson.Field
RuntimeMinutes respjson.Field
Season respjson.Field
Synopsis respjson.Field
TedWisdom respjson.Field
Title respjson.Field
Writer respjson.Field
BiscuitsWithBossMoment respjson.Field
MemorableMoments respjson.Field
UsViewersMillions respjson.Field
ViewerRating respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Full episode model with ID.
func (*Episode) UnmarshalJSON ¶
type EpisodeListParams ¶
type EpisodeListParams struct {
// Filter by character focus (character ID)
CharacterFocus param.Opt[string] `query:"character_focus,omitzero" json:"-"`
// Filter by season
Season param.Opt[int64] `query:"season,omitzero" json:"-"`
// Maximum number of items to return (max: 100)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Number of items to skip (offset)
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (EpisodeListParams) URLQuery ¶
func (r EpisodeListParams) URLQuery() (v url.Values, err error)
URLQuery serializes EpisodeListParams's query parameters as `url.Values`.
type EpisodeNewParams ¶
type EpisodeNewParams struct {
// Original air date
AirDate time.Time `json:"air_date,required" format:"date"`
// Characters with significant development
CharacterFocus []string `json:"character_focus,omitzero,required"`
// Episode director
Director string `json:"director,required"`
// Episode number within season
EpisodeNumber int64 `json:"episode_number,required"`
// Central theme of the episode
MainTheme string `json:"main_theme,required"`
// Episode runtime in minutes
RuntimeMinutes int64 `json:"runtime_minutes,required"`
// Season number
Season int64 `json:"season,required"`
// Brief plot synopsis
Synopsis string `json:"synopsis,required"`
// Key piece of Ted wisdom from the episode
TedWisdom string `json:"ted_wisdom,required"`
// Episode title
Title string `json:"title,required"`
// Episode writer(s)
Writer string `json:"writer,required"`
// Notable biscuits with the boss scene
BiscuitsWithBossMoment param.Opt[string] `json:"biscuits_with_boss_moment,omitzero"`
// US viewership in millions
UsViewersMillions param.Opt[float64] `json:"us_viewers_millions,omitzero"`
// Viewer rating out of 10
ViewerRating param.Opt[float64] `json:"viewer_rating,omitzero"`
// Standout moments from the episode
MemorableMoments []string `json:"memorable_moments,omitzero"`
// contains filtered or unexported fields
}
func (EpisodeNewParams) MarshalJSON ¶
func (r EpisodeNewParams) MarshalJSON() (data []byte, err error)
func (*EpisodeNewParams) UnmarshalJSON ¶
func (r *EpisodeNewParams) UnmarshalJSON(data []byte) error
type EpisodeService ¶
type EpisodeService struct {
Options []option.RequestOption
}
EpisodeService contains methods and other services that help with interacting with the believe API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEpisodeService method instead.
func NewEpisodeService ¶
func NewEpisodeService(opts ...option.RequestOption) (r EpisodeService)
NewEpisodeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*EpisodeService) Delete ¶
func (r *EpisodeService) Delete(ctx context.Context, episodeID string, opts ...option.RequestOption) (err error)
Remove an episode from the database.
func (*EpisodeService) Get ¶
func (r *EpisodeService) Get(ctx context.Context, episodeID string, opts ...option.RequestOption) (res *Episode, err error)
Retrieve detailed information about a specific episode.
func (*EpisodeService) GetWisdom ¶
func (r *EpisodeService) GetWisdom(ctx context.Context, episodeID string, opts ...option.RequestOption) (res *EpisodeGetWisdomResponse, err error)
Get Ted's wisdom and memorable moments from a specific episode.
func (*EpisodeService) List ¶
func (r *EpisodeService) List(ctx context.Context, query EpisodeListParams, opts ...option.RequestOption) (res *pagination.SkipLimitPage[Episode], err error)
Get a paginated list of all Ted Lasso episodes with optional filtering by season.
func (*EpisodeService) ListAutoPaging ¶
func (r *EpisodeService) ListAutoPaging(ctx context.Context, query EpisodeListParams, opts ...option.RequestOption) *pagination.SkipLimitPageAutoPager[Episode]
Get a paginated list of all Ted Lasso episodes with optional filtering by season.
func (*EpisodeService) New ¶
func (r *EpisodeService) New(ctx context.Context, body EpisodeNewParams, opts ...option.RequestOption) (res *Episode, err error)
Add a new episode to the series.
func (*EpisodeService) Update ¶
func (r *EpisodeService) Update(ctx context.Context, episodeID string, body EpisodeUpdateParams, opts ...option.RequestOption) (res *Episode, err error)
Update specific fields of an existing episode.
type EpisodeUpdateParams ¶
type EpisodeUpdateParams struct {
AirDate param.Opt[time.Time] `json:"air_date,omitzero" format:"date"`
BiscuitsWithBossMoment param.Opt[string] `json:"biscuits_with_boss_moment,omitzero"`
Director param.Opt[string] `json:"director,omitzero"`
EpisodeNumber param.Opt[int64] `json:"episode_number,omitzero"`
MainTheme param.Opt[string] `json:"main_theme,omitzero"`
RuntimeMinutes param.Opt[int64] `json:"runtime_minutes,omitzero"`
Season param.Opt[int64] `json:"season,omitzero"`
Synopsis param.Opt[string] `json:"synopsis,omitzero"`
TedWisdom param.Opt[string] `json:"ted_wisdom,omitzero"`
Title param.Opt[string] `json:"title,omitzero"`
UsViewersMillions param.Opt[float64] `json:"us_viewers_millions,omitzero"`
ViewerRating param.Opt[float64] `json:"viewer_rating,omitzero"`
Writer param.Opt[string] `json:"writer,omitzero"`
CharacterFocus []string `json:"character_focus,omitzero"`
MemorableMoments []string `json:"memorable_moments,omitzero"`
// contains filtered or unexported fields
}
func (EpisodeUpdateParams) MarshalJSON ¶
func (r EpisodeUpdateParams) MarshalJSON() (data []byte, err error)
func (*EpisodeUpdateParams) UnmarshalJSON ¶
func (r *EpisodeUpdateParams) UnmarshalJSON(data []byte) error
type EquipmentManager ¶
type EquipmentManager struct {
// Unique identifier for this team membership
ID string `json:"id,required"`
// ID of the character (references /characters/{id})
CharacterID string `json:"character_id,required"`
// ID of the team they belong to
TeamID string `json:"team_id,required"`
// Number of years with the current team
YearsWithTeam int64 `json:"years_with_team,required"`
// Whether this is the head equipment manager
IsHeadKitman bool `json:"is_head_kitman"`
// Discriminator field indicating this is an equipment manager
//
// Any of "equipment_manager".
MemberType EquipmentManagerMemberType `json:"member_type"`
// List of responsibilities
Responsibilities []string `json:"responsibilities"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CharacterID respjson.Field
TeamID respjson.Field
YearsWithTeam respjson.Field
IsHeadKitman respjson.Field
MemberType respjson.Field
Responsibilities respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Full equipment manager model with ID.
func (EquipmentManager) RawJSON ¶
func (r EquipmentManager) RawJSON() string
Returns the unmodified JSON received from the API
func (*EquipmentManager) UnmarshalJSON ¶
func (r *EquipmentManager) UnmarshalJSON(data []byte) error
type EquipmentManagerMemberType ¶
type EquipmentManagerMemberType string
Discriminator field indicating this is an equipment manager
const (
EquipmentManagerMemberTypeEquipmentManager EquipmentManagerMemberType = "equipment_manager"
)
type FileUpload ¶
type FileUpload struct {
ChecksumSha256 string `json:"checksum_sha256,required"`
ContentType string `json:"content_type,required"`
FileID string `json:"file_id,required" format:"uuid"`
Filename string `json:"filename,required"`
SizeBytes int64 `json:"size_bytes,required"`
UploadedAt time.Time `json:"uploaded_at,required" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ChecksumSha256 respjson.Field
ContentType respjson.Field
FileID respjson.Field
Filename respjson.Field
SizeBytes respjson.Field
UploadedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response model for file uploads.
func (FileUpload) RawJSON ¶
func (r FileUpload) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileUpload) UnmarshalJSON ¶
func (r *FileUpload) UnmarshalJSON(data []byte) error
type GeoLocation ¶
type GeoLocation struct {
// Latitude in degrees
Latitude float64 `json:"latitude,required"`
// Longitude in degrees
Longitude float64 `json:"longitude,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Latitude respjson.Field
Longitude respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Geographic coordinates for a location.
func (GeoLocation) RawJSON ¶
func (r GeoLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (GeoLocation) ToParam ¶
func (r GeoLocation) ToParam() GeoLocationParam
ToParam converts this GeoLocation to a GeoLocationParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with GeoLocationParam.Overrides()
func (*GeoLocation) UnmarshalJSON ¶
func (r *GeoLocation) UnmarshalJSON(data []byte) error
type GeoLocationParam ¶
type GeoLocationParam struct {
// Latitude in degrees
Latitude float64 `json:"latitude,required"`
// Longitude in degrees
Longitude float64 `json:"longitude,required"`
// contains filtered or unexported fields
}
Geographic coordinates for a location.
The properties Latitude, Longitude are required.
func (GeoLocationParam) MarshalJSON ¶
func (r GeoLocationParam) MarshalJSON() (data []byte, err error)
func (*GeoLocationParam) UnmarshalJSON ¶
func (r *GeoLocationParam) UnmarshalJSON(data []byte) error
type GetWelcomeResponse ¶
type GetWelcomeResponse = any
type GrowthArc ¶
type GrowthArc struct {
// Key breakthrough moment
Breakthrough string `json:"breakthrough,required"`
// Main challenge faced
Challenge string `json:"challenge,required"`
// Where the character ends up
EndingPoint string `json:"ending_point,required"`
// Season number
Season int64 `json:"season,required"`
// Where the character starts emotionally
StartingPoint string `json:"starting_point,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Breakthrough respjson.Field
Challenge respjson.Field
EndingPoint respjson.Field
Season respjson.Field
StartingPoint respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Character development arc.
func (GrowthArc) ToParam ¶
func (r GrowthArc) ToParam() GrowthArcParam
ToParam converts this GrowthArc to a GrowthArcParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with GrowthArcParam.Overrides()
func (*GrowthArc) UnmarshalJSON ¶
type GrowthArcParam ¶
type GrowthArcParam struct {
// Key breakthrough moment
Breakthrough string `json:"breakthrough,required"`
// Main challenge faced
Challenge string `json:"challenge,required"`
// Where the character ends up
EndingPoint string `json:"ending_point,required"`
// Season number
Season int64 `json:"season,required"`
// Where the character starts emotionally
StartingPoint string `json:"starting_point,required"`
// contains filtered or unexported fields
}
Character development arc.
The properties Breakthrough, Challenge, EndingPoint, Season, StartingPoint are required.
func (GrowthArcParam) MarshalJSON ¶
func (r GrowthArcParam) MarshalJSON() (data []byte, err error)
func (*GrowthArcParam) UnmarshalJSON ¶
func (r *GrowthArcParam) UnmarshalJSON(data []byte) error
type HealthCheckResponse ¶
type HealthCheckResponse = any
type HealthService ¶
type HealthService struct {
Options []option.RequestOption
}
HealthService contains methods and other services that help with interacting with the believe API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewHealthService method instead.
func NewHealthService ¶
func NewHealthService(opts ...option.RequestOption) (r HealthService)
NewHealthService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*HealthService) Check ¶
func (r *HealthService) Check(ctx context.Context, opts ...option.RequestOption) (res *HealthCheckResponse, err error)
Check if the API is running and healthy.
type League ¶
type League string
Football leagues.
const ( LeaguePremierLeague League = "Premier League" LeagueChampionship League = "Championship" LeagueLeagueOne League = "League One" LeagueLeagueTwo League = "League Two" LeagueLaLiga League = "La Liga" LeagueSerieA League = "Serie A" LeagueBundesliga League = "Bundesliga" LeagueLigue1 League = "Ligue 1" )
type Match ¶
type Match struct {
// Unique identifier
ID string `json:"id,required"`
// Away team ID
AwayTeamID string `json:"away_team_id,required"`
// Match date and time
Date time.Time `json:"date,required" format:"date-time"`
// Home team ID
HomeTeamID string `json:"home_team_id,required"`
// Type of match
//
// Any of "league", "cup", "friendly", "playoff", "final".
MatchType MatchType `json:"match_type,required"`
// Match attendance
Attendance int64 `json:"attendance,nullable"`
// Away team score
AwayScore int64 `json:"away_score"`
// Episode ID where this match is featured
EpisodeID string `json:"episode_id,nullable"`
// Home team score
HomeScore int64 `json:"home_score"`
// The life lesson learned from this match
LessonLearned string `json:"lesson_learned,nullable"`
// Home team possession percentage
PossessionPercentage float64 `json:"possession_percentage,nullable"`
// Match result from home team perspective
//
// Any of "win", "loss", "draw", "pending".
Result MatchResult `json:"result"`
// Ted's inspirational halftime speech
TedHalftimeSpeech string `json:"ted_halftime_speech,nullable"`
// Total ticket revenue in GBP
TicketRevenueGbp string `json:"ticket_revenue_gbp,nullable"`
// Key moments that changed the match
TurningPoints []TurningPoint `json:"turning_points"`
// Temperature at kickoff in Celsius
WeatherTempCelsius float64 `json:"weather_temp_celsius,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AwayTeamID respjson.Field
Date respjson.Field
HomeTeamID respjson.Field
MatchType respjson.Field
Attendance respjson.Field
AwayScore respjson.Field
EpisodeID respjson.Field
HomeScore respjson.Field
LessonLearned respjson.Field
PossessionPercentage respjson.Field
Result respjson.Field
TedHalftimeSpeech respjson.Field
TicketRevenueGbp respjson.Field
TurningPoints respjson.Field
WeatherTempCelsius respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Full match model with ID.
func (*Match) UnmarshalJSON ¶
type MatchCommentaryService ¶
type MatchCommentaryService struct {
Options []option.RequestOption
}
MatchCommentaryService contains methods and other services that help with interacting with the believe API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMatchCommentaryService method instead.
func NewMatchCommentaryService ¶
func NewMatchCommentaryService(opts ...option.RequestOption) (r MatchCommentaryService)
NewMatchCommentaryService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*MatchCommentaryService) Stream ¶
func (r *MatchCommentaryService) Stream(ctx context.Context, matchID string, opts ...option.RequestOption) (res *MatchCommentaryStreamResponse, err error)
Stream live match commentary for a specific match. Uses Server-Sent Events (SSE) to stream commentary events in real-time.
type MatchCommentaryStreamResponse ¶
type MatchCommentaryStreamResponse = any
type MatchCompletedWebhookEvent ¶
type MatchCompletedWebhookEvent struct {
// When the event was created
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
// Data payload for a match completed event.
Data MatchCompletedWebhookEventData `json:"data,required"`
// Unique identifier for this event
EventID string `json:"event_id,required" format:"uuid"`
// The type of webhook event
//
// Any of "match.completed".
EventType MatchCompletedWebhookEventEventType `json:"event_type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
Data respjson.Field
EventID respjson.Field
EventType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Webhook event sent when a match completes.
func (MatchCompletedWebhookEvent) RawJSON ¶
func (r MatchCompletedWebhookEvent) RawJSON() string
Returns the unmodified JSON received from the API
func (*MatchCompletedWebhookEvent) UnmarshalJSON ¶
func (r *MatchCompletedWebhookEvent) UnmarshalJSON(data []byte) error
type MatchCompletedWebhookEventData ¶
type MatchCompletedWebhookEventData struct {
// Final away team score
AwayScore int64 `json:"away_score,required"`
// Away team ID
AwayTeamID string `json:"away_team_id,required"`
// When the match completed
CompletedAt time.Time `json:"completed_at,required" format:"date-time"`
// Final home team score
HomeScore int64 `json:"home_score,required"`
// Home team ID
HomeTeamID string `json:"home_team_id,required"`
// Unique match identifier
MatchID string `json:"match_id,required"`
// Type of match
//
// Any of "league", "cup", "friendly", "playoff", "final".
MatchType string `json:"match_type,required"`
// Match result from home team perspective
//
// Any of "home_win", "away_win", "draw".
Result string `json:"result,required"`
// Ted's post-match wisdom
TedPostMatchQuote string `json:"ted_post_match_quote,required"`
// Ted's lesson from the match
LessonLearned string `json:"lesson_learned,nullable"`
// Player of the match (if awarded)
ManOfTheMatch string `json:"man_of_the_match,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AwayScore respjson.Field
AwayTeamID respjson.Field
CompletedAt respjson.Field
HomeScore respjson.Field
HomeTeamID respjson.Field
MatchID respjson.Field
MatchType respjson.Field
Result respjson.Field
TedPostMatchQuote respjson.Field
LessonLearned respjson.Field
ManOfTheMatch respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Data payload for a match completed event.
func (MatchCompletedWebhookEventData) RawJSON ¶
func (r MatchCompletedWebhookEventData) RawJSON() string
Returns the unmodified JSON received from the API
func (*MatchCompletedWebhookEventData) UnmarshalJSON ¶
func (r *MatchCompletedWebhookEventData) UnmarshalJSON(data []byte) error
type MatchCompletedWebhookEventEventType ¶
type MatchCompletedWebhookEventEventType string
The type of webhook event
const (
MatchCompletedWebhookEventEventTypeMatchCompleted MatchCompletedWebhookEventEventType = "match.completed"
)
type MatchGetLessonResponse ¶
type MatchListParams ¶
type MatchListParams struct {
// Filter by team (home or away)
TeamID param.Opt[string] `query:"team_id,omitzero" json:"-"`
// Maximum number of items to return (max: 100)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Number of items to skip (offset)
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// Filter by match type
//
// Any of "league", "cup", "friendly", "playoff", "final".
MatchType MatchType `query:"match_type,omitzero" json:"-"`
// Filter by result
//
// Any of "win", "loss", "draw", "pending".
Result MatchResult `query:"result,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (MatchListParams) URLQuery ¶
func (r MatchListParams) URLQuery() (v url.Values, err error)
URLQuery serializes MatchListParams's query parameters as `url.Values`.
type MatchNewParams ¶
type MatchNewParams struct {
// Away team ID
AwayTeamID string `json:"away_team_id,required"`
// Match date and time
Date time.Time `json:"date,required" format:"date-time"`
// Home team ID
HomeTeamID string `json:"home_team_id,required"`
// Type of match
//
// Any of "league", "cup", "friendly", "playoff", "final".
MatchType MatchType `json:"match_type,omitzero,required"`
// Match attendance
Attendance param.Opt[int64] `json:"attendance,omitzero"`
// Episode ID where this match is featured
EpisodeID param.Opt[string] `json:"episode_id,omitzero"`
// The life lesson learned from this match
LessonLearned param.Opt[string] `json:"lesson_learned,omitzero"`
// Home team possession percentage
PossessionPercentage param.Opt[float64] `json:"possession_percentage,omitzero"`
// Ted's inspirational halftime speech
TedHalftimeSpeech param.Opt[string] `json:"ted_halftime_speech,omitzero"`
// Temperature at kickoff in Celsius
WeatherTempCelsius param.Opt[float64] `json:"weather_temp_celsius,omitzero"`
// Away team score
AwayScore param.Opt[int64] `json:"away_score,omitzero"`
// Home team score
HomeScore param.Opt[int64] `json:"home_score,omitzero"`
// Total ticket revenue in GBP
TicketRevenueGbp MatchNewParamsTicketRevenueGbpUnion `json:"ticket_revenue_gbp,omitzero"`
// Match result from home team perspective
//
// Any of "win", "loss", "draw", "pending".
Result MatchResult `json:"result,omitzero"`
// Key moments that changed the match
TurningPoints []TurningPointParam `json:"turning_points,omitzero"`
// contains filtered or unexported fields
}
func (MatchNewParams) MarshalJSON ¶
func (r MatchNewParams) MarshalJSON() (data []byte, err error)
func (*MatchNewParams) UnmarshalJSON ¶
func (r *MatchNewParams) UnmarshalJSON(data []byte) error
type MatchNewParamsTicketRevenueGbpUnion ¶
type MatchNewParamsTicketRevenueGbpUnion struct {
OfFloat param.Opt[float64] `json:",omitzero,inline"`
OfString param.Opt[string] `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (MatchNewParamsTicketRevenueGbpUnion) MarshalJSON ¶
func (u MatchNewParamsTicketRevenueGbpUnion) MarshalJSON() ([]byte, error)
func (*MatchNewParamsTicketRevenueGbpUnion) UnmarshalJSON ¶
func (u *MatchNewParamsTicketRevenueGbpUnion) UnmarshalJSON(data []byte) error
type MatchResult ¶
type MatchResult string
Match result types.
const ( MatchResultWin MatchResult = "win" MatchResultLoss MatchResult = "loss" MatchResultDraw MatchResult = "draw" MatchResultPending MatchResult = "pending" )
type MatchService ¶
type MatchService struct {
Options []option.RequestOption
Commentary MatchCommentaryService
}
MatchService contains methods and other services that help with interacting with the believe API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMatchService method instead.
func NewMatchService ¶
func NewMatchService(opts ...option.RequestOption) (r MatchService)
NewMatchService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*MatchService) Delete ¶
func (r *MatchService) Delete(ctx context.Context, matchID string, opts ...option.RequestOption) (err error)
Remove a match from the database.
func (*MatchService) Get ¶
func (r *MatchService) Get(ctx context.Context, matchID string, opts ...option.RequestOption) (res *Match, err error)
Retrieve detailed information about a specific match.
func (*MatchService) GetLesson ¶
func (r *MatchService) GetLesson(ctx context.Context, matchID string, opts ...option.RequestOption) (res *MatchGetLessonResponse, err error)
Get the life lesson learned from a specific match.
func (*MatchService) GetTurningPoints ¶
func (r *MatchService) GetTurningPoints(ctx context.Context, matchID string, opts ...option.RequestOption) (res *[]MatchGetTurningPointsResponse, err error)
Get all turning points from a specific match.
func (*MatchService) List ¶
func (r *MatchService) List(ctx context.Context, query MatchListParams, opts ...option.RequestOption) (res *pagination.SkipLimitPage[Match], err error)
Get a paginated list of all matches with optional filtering.
func (*MatchService) ListAutoPaging ¶
func (r *MatchService) ListAutoPaging(ctx context.Context, query MatchListParams, opts ...option.RequestOption) *pagination.SkipLimitPageAutoPager[Match]
Get a paginated list of all matches with optional filtering.
func (*MatchService) New ¶
func (r *MatchService) New(ctx context.Context, body MatchNewParams, opts ...option.RequestOption) (res *Match, err error)
Schedule a new match.
func (*MatchService) StreamLive ¶
func (r *MatchService) StreamLive(ctx context.Context, query MatchStreamLiveParams, opts ...option.RequestOption) (err error)
WebSocket endpoint for real-time live match simulation.
Connect to receive a stream of match events as they happen in a simulated football match.
## Connection
Connect via WebSocket with optional query parameters to customize the simulation.
## Example WebSocket URL
``` ws://localhost:8000/matches/live?home_team=AFC%20Richmond&away_team=Manchester%20City&speed=2.0&excitement_level=7 ```
## Server Messages
The server sends JSON messages with these types:
- `match_start` - When the match begins - `match_event` - For each match event (goals, fouls, cards, etc.) - `match_end` - When the match concludes - `error` - If an error occurs - `pong` - Response to client ping
## Client Messages
Send JSON to control the simulation:
- `{"action": "ping"}` - Keep-alive, server responds with `{"type": "pong"}` - `{"action": "pause"}` - Pause the simulation - `{"action": "resume"}` - Resume a paused simulation - `{"action": "set_speed", "speed": 2.0}` - Change playback speed (0.1-10.0) - `{"action": "get_status"}` - Request current match status
func (*MatchService) Update ¶
func (r *MatchService) Update(ctx context.Context, matchID string, body MatchUpdateParams, opts ...option.RequestOption) (res *Match, err error)
Update specific fields of an existing match (e.g., update score).
type MatchStreamLiveParams ¶
type MatchStreamLiveParams struct {
// Away team name
AwayTeam param.Opt[string] `query:"away_team,omitzero" json:"-"`
// How eventful the match should be (1=boring, 10=chaos)
ExcitementLevel param.Opt[int64] `query:"excitement_level,omitzero" json:"-"`
// Home team name
HomeTeam param.Opt[string] `query:"home_team,omitzero" json:"-"`
// Simulation speed multiplier (1.0 = real-time)
Speed param.Opt[float64] `query:"speed,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (MatchStreamLiveParams) URLQuery ¶
func (r MatchStreamLiveParams) URLQuery() (v url.Values, err error)
URLQuery serializes MatchStreamLiveParams's query parameters as `url.Values`.
type MatchUpdateParams ¶
type MatchUpdateParams struct {
Attendance param.Opt[int64] `json:"attendance,omitzero"`
AwayScore param.Opt[int64] `json:"away_score,omitzero"`
AwayTeamID param.Opt[string] `json:"away_team_id,omitzero"`
Date param.Opt[time.Time] `json:"date,omitzero" format:"date-time"`
EpisodeID param.Opt[string] `json:"episode_id,omitzero"`
HomeScore param.Opt[int64] `json:"home_score,omitzero"`
HomeTeamID param.Opt[string] `json:"home_team_id,omitzero"`
LessonLearned param.Opt[string] `json:"lesson_learned,omitzero"`
PossessionPercentage param.Opt[float64] `json:"possession_percentage,omitzero"`
TedHalftimeSpeech param.Opt[string] `json:"ted_halftime_speech,omitzero"`
WeatherTempCelsius param.Opt[float64] `json:"weather_temp_celsius,omitzero"`
TicketRevenueGbp MatchUpdateParamsTicketRevenueGbpUnion `json:"ticket_revenue_gbp,omitzero"`
TurningPoints []TurningPointParam `json:"turning_points,omitzero"`
// Types of matches.
//
// Any of "league", "cup", "friendly", "playoff", "final".
MatchType MatchType `json:"match_type,omitzero"`
// Match result types.
//
// Any of "win", "loss", "draw", "pending".
Result MatchResult `json:"result,omitzero"`
// contains filtered or unexported fields
}
func (MatchUpdateParams) MarshalJSON ¶
func (r MatchUpdateParams) MarshalJSON() (data []byte, err error)
func (*MatchUpdateParams) UnmarshalJSON ¶
func (r *MatchUpdateParams) UnmarshalJSON(data []byte) error
type MatchUpdateParamsTicketRevenueGbpUnion ¶
type MatchUpdateParamsTicketRevenueGbpUnion struct {
OfFloat param.Opt[float64] `json:",omitzero,inline"`
OfString param.Opt[string] `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (MatchUpdateParamsTicketRevenueGbpUnion) MarshalJSON ¶
func (u MatchUpdateParamsTicketRevenueGbpUnion) MarshalJSON() ([]byte, error)
func (*MatchUpdateParamsTicketRevenueGbpUnion) UnmarshalJSON ¶
func (u *MatchUpdateParamsTicketRevenueGbpUnion) UnmarshalJSON(data []byte) error
type MedicalSpecialty ¶
type MedicalSpecialty string
Medical staff specialties.
const ( MedicalSpecialtyTeamDoctor MedicalSpecialty = "team_doctor" MedicalSpecialtyPhysiotherapist MedicalSpecialty = "physiotherapist" MedicalSpecialtySportsPsychologist MedicalSpecialty = "sports_psychologist" MedicalSpecialtyNutritionist MedicalSpecialty = "nutritionist" MedicalSpecialtyMassageTherapist MedicalSpecialty = "massage_therapist" )
type MedicalStaff ¶
type MedicalStaff struct {
// Unique identifier for this team membership
ID string `json:"id,required"`
// ID of the character (references /characters/{id})
CharacterID string `json:"character_id,required"`
// Medical specialty
//
// Any of "team_doctor", "physiotherapist", "sports_psychologist", "nutritionist",
// "massage_therapist".
Specialty MedicalSpecialty `json:"specialty,required"`
// ID of the team they belong to
TeamID string `json:"team_id,required"`
// Number of years with the current team
YearsWithTeam int64 `json:"years_with_team,required"`
// Professional license number
LicenseNumber string `json:"license_number,nullable"`
// Discriminator field indicating this is medical staff
//
// Any of "medical_staff".
MemberType MedicalStaffMemberType `json:"member_type"`
// Medical qualifications and degrees
Qualifications []string `json:"qualifications"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CharacterID respjson.Field
Specialty respjson.Field
TeamID respjson.Field
YearsWithTeam respjson.Field
LicenseNumber respjson.Field
MemberType respjson.Field
Qualifications respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Full medical staff model with ID.
func (MedicalStaff) RawJSON ¶
func (r MedicalStaff) RawJSON() string
Returns the unmodified JSON received from the API
func (*MedicalStaff) UnmarshalJSON ¶
func (r *MedicalStaff) UnmarshalJSON(data []byte) error
type MedicalStaffMemberType ¶
type MedicalStaffMemberType string
Discriminator field indicating this is medical staff
const (
MedicalStaffMemberTypeMedicalStaff MedicalStaffMemberType = "medical_staff"
)
type PaginatedResponse ¶
type PaginatedResponse struct {
Data []Episode `json:"data,required"`
// Whether there are more items after this page.
HasMore bool `json:"has_more,required"`
Limit int64 `json:"limit,required"`
// Current page number (1-indexed, for display purposes).
Page int64 `json:"page,required"`
// Total number of pages.
Pages int64 `json:"pages,required"`
Skip int64 `json:"skip,required"`
Total int64 `json:"total,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
HasMore respjson.Field
Limit respjson.Field
Page respjson.Field
Pages respjson.Field
Skip respjson.Field
Total respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PaginatedResponse) RawJSON ¶
func (r PaginatedResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*PaginatedResponse) UnmarshalJSON ¶
func (r *PaginatedResponse) UnmarshalJSON(data []byte) error
type PaginatedResponseQuote ¶
type PaginatedResponseQuote struct {
Data []Quote `json:"data,required"`
// Whether there are more items after this page.
HasMore bool `json:"has_more,required"`
Limit int64 `json:"limit,required"`
// Current page number (1-indexed, for display purposes).
Page int64 `json:"page,required"`
// Total number of pages.
Pages int64 `json:"pages,required"`
Skip int64 `json:"skip,required"`
Total int64 `json:"total,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
HasMore respjson.Field
Limit respjson.Field
Page respjson.Field
Pages respjson.Field
Skip respjson.Field
Total respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PaginatedResponseQuote) RawJSON ¶
func (r PaginatedResponseQuote) RawJSON() string
Returns the unmodified JSON received from the API
func (*PaginatedResponseQuote) UnmarshalJSON ¶
func (r *PaginatedResponseQuote) UnmarshalJSON(data []byte) error
type PepTalkGetParams ¶
type PepTalkGetParams struct {
// If true, returns SSE stream instead of full response
Stream param.Opt[bool] `query:"stream,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (PepTalkGetParams) URLQuery ¶
func (r PepTalkGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes PepTalkGetParams's query parameters as `url.Values`.
type PepTalkGetResponse ¶
type PepTalkGetResponse struct {
// Individual chunks of the pep talk
Chunks []PepTalkGetResponseChunk `json:"chunks,required"`
// The full pep talk text
Text string `json:"text,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Chunks respjson.Field
Text respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A complete pep talk response.
func (PepTalkGetResponse) RawJSON ¶
func (r PepTalkGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*PepTalkGetResponse) UnmarshalJSON ¶
func (r *PepTalkGetResponse) UnmarshalJSON(data []byte) error
type PepTalkGetResponseChunk ¶
type PepTalkGetResponseChunk struct {
// Chunk sequence number
ChunkID int64 `json:"chunk_id,required"`
// Is this the final chunk
IsFinal bool `json:"is_final,required"`
// The text of this chunk
Text string `json:"text,required"`
// The emotional purpose of this chunk (e.g., greeting, acknowledgment, wisdom,
// affirmation, encouragement)
EmotionalBeat string `json:"emotional_beat,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ChunkID respjson.Field
IsFinal respjson.Field
Text respjson.Field
EmotionalBeat respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A chunk of a streaming pep talk from Ted.
func (PepTalkGetResponseChunk) RawJSON ¶
func (r PepTalkGetResponseChunk) RawJSON() string
Returns the unmodified JSON received from the API
func (*PepTalkGetResponseChunk) UnmarshalJSON ¶
func (r *PepTalkGetResponseChunk) UnmarshalJSON(data []byte) error
type PepTalkService ¶
type PepTalkService struct {
Options []option.RequestOption
}
PepTalkService contains methods and other services that help with interacting with the believe API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPepTalkService method instead.
func NewPepTalkService ¶
func NewPepTalkService(opts ...option.RequestOption) (r PepTalkService)
NewPepTalkService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PepTalkService) Get ¶
func (r *PepTalkService) Get(ctx context.Context, query PepTalkGetParams, opts ...option.RequestOption) (res *PepTalkGetResponse, err error)
Get a motivational pep talk from Ted Lasso himself. By default returns the complete pep talk. Add `?stream=true` to get Server-Sent Events (SSE) streaming the pep talk chunk by chunk.
type Player ¶
type Player struct {
// Unique identifier for this team membership
ID string `json:"id,required"`
// ID of the character (references /characters/{id})
CharacterID string `json:"character_id,required"`
// Jersey/shirt number
JerseyNumber int64 `json:"jersey_number,required"`
// Playing position on the field
//
// Any of "goalkeeper", "defender", "midfielder", "forward".
Position Position `json:"position,required"`
// ID of the team they belong to
TeamID string `json:"team_id,required"`
// Number of years with the current team
YearsWithTeam int64 `json:"years_with_team,required"`
// Total assists for the team
Assists int64 `json:"assists"`
// Total goals scored for the team
GoalsScored int64 `json:"goals_scored"`
// Whether this player is team captain
IsCaptain bool `json:"is_captain"`
// Discriminator field indicating this is a player
//
// Any of "player".
MemberType PlayerMemberType `json:"member_type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CharacterID respjson.Field
JerseyNumber respjson.Field
Position respjson.Field
TeamID respjson.Field
YearsWithTeam respjson.Field
Assists respjson.Field
GoalsScored respjson.Field
IsCaptain respjson.Field
MemberType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Full player model with ID.
func (*Player) UnmarshalJSON ¶
type PlayerMemberType ¶
type PlayerMemberType string
Discriminator field indicating this is a player
const (
PlayerMemberTypePlayer PlayerMemberType = "player"
)
type PressService ¶
type PressService struct {
Options []option.RequestOption
}
PressService contains methods and other services that help with interacting with the believe API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPressService method instead.
func NewPressService ¶
func NewPressService(opts ...option.RequestOption) (r PressService)
NewPressService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PressService) Simulate ¶
func (r *PressService) Simulate(ctx context.Context, body PressSimulateParams, opts ...option.RequestOption) (res *PressSimulateResponse, err error)
Get Ted's response to press conference questions.
type PressSimulateParams ¶
type PressSimulateParams struct {
// The press question to answer
Question string `json:"question,required"`
// Topic category
Topic param.Opt[string] `json:"topic,omitzero"`
// Is this a hostile question from Trent Crimm?
Hostile param.Opt[bool] `json:"hostile,omitzero"`
// contains filtered or unexported fields
}
func (PressSimulateParams) MarshalJSON ¶
func (r PressSimulateParams) MarshalJSON() (data []byte, err error)
func (*PressSimulateParams) UnmarshalJSON ¶
func (r *PressSimulateParams) UnmarshalJSON(data []byte) error
type PressSimulateResponse ¶
type PressSimulateResponse struct {
// The actual wisdom beneath the humor
ActualWisdom string `json:"actual_wisdom,required"`
// How Ted would dodge a follow-up
FollowUpDodge string `json:"follow_up_dodge,required"`
// How reporters would react
ReporterReaction string `json:"reporter_reaction,required"`
// Ted's press conference answer
Response string `json:"response,required"`
// Humorous deflection if appropriate
DeflectionHumor string `json:"deflection_humor,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ActualWisdom respjson.Field
FollowUpDodge respjson.Field
ReporterReaction respjson.Field
Response respjson.Field
DeflectionHumor respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Ted's press conference response.
func (PressSimulateResponse) RawJSON ¶
func (r PressSimulateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*PressSimulateResponse) UnmarshalJSON ¶
func (r *PressSimulateResponse) UnmarshalJSON(data []byte) error
type Quote ¶
type Quote struct {
// Unique identifier
ID string `json:"id,required"`
// ID of the character who said it
CharacterID string `json:"character_id,required"`
// Context in which the quote was said
Context string `json:"context,required"`
// Type of moment when the quote was said
//
// Any of "halftime_speech", "press_conference", "locker_room", "training",
// "biscuits_with_boss", "pub", "one_on_one", "celebration", "crisis", "casual",
// "confrontation".
MomentType QuoteMoment `json:"moment_type,required"`
// The quote text
Text string `json:"text,required"`
// Primary theme of the quote
//
// Any of "belief", "teamwork", "curiosity", "kindness", "resilience",
// "vulnerability", "growth", "humor", "wisdom", "leadership", "love",
// "forgiveness", "philosophy", "romance", "cultural-pride",
// "cultural-differences", "antagonism", "celebration", "identity", "isolation",
// "power", "sacrifice", "standards", "confidence", "conflict", "honesty",
// "integrity".
Theme QuoteTheme `json:"theme,required"`
// Episode where the quote appears
EpisodeID string `json:"episode_id,nullable"`
// Whether this quote is humorous
IsFunny bool `json:"is_funny"`
// Whether this quote is inspirational
IsInspirational bool `json:"is_inspirational"`
// Popularity/virality score (0-100)
PopularityScore float64 `json:"popularity_score,nullable"`
// Additional themes
SecondaryThemes []QuoteTheme `json:"secondary_themes"`
TimesShared int64 `json:"times_shared,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CharacterID respjson.Field
Context respjson.Field
MomentType respjson.Field
Text respjson.Field
Theme respjson.Field
EpisodeID respjson.Field
IsFunny respjson.Field
IsInspirational respjson.Field
PopularityScore respjson.Field
SecondaryThemes respjson.Field
TimesShared respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Full quote model with ID.
func (*Quote) UnmarshalJSON ¶
type QuoteGetRandomParams ¶
type QuoteGetRandomParams struct {
// Filter by character
CharacterID param.Opt[string] `query:"character_id,omitzero" json:"-"`
// Filter inspirational quotes
Inspirational param.Opt[bool] `query:"inspirational,omitzero" json:"-"`
// Filter by theme
//
// Any of "belief", "teamwork", "curiosity", "kindness", "resilience",
// "vulnerability", "growth", "humor", "wisdom", "leadership", "love",
// "forgiveness", "philosophy", "romance", "cultural-pride",
// "cultural-differences", "antagonism", "celebration", "identity", "isolation",
// "power", "sacrifice", "standards", "confidence", "conflict", "honesty",
// "integrity".
Theme QuoteTheme `query:"theme,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (QuoteGetRandomParams) URLQuery ¶
func (r QuoteGetRandomParams) URLQuery() (v url.Values, err error)
URLQuery serializes QuoteGetRandomParams's query parameters as `url.Values`.
type QuoteListByCharacterParams ¶
type QuoteListByCharacterParams struct {
// Maximum number of items to return (max: 100)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Number of items to skip (offset)
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (QuoteListByCharacterParams) URLQuery ¶
func (r QuoteListByCharacterParams) URLQuery() (v url.Values, err error)
URLQuery serializes QuoteListByCharacterParams's query parameters as `url.Values`.
type QuoteListByThemeParams ¶
type QuoteListByThemeParams struct {
// Maximum number of items to return (max: 100)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Number of items to skip (offset)
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (QuoteListByThemeParams) URLQuery ¶
func (r QuoteListByThemeParams) URLQuery() (v url.Values, err error)
URLQuery serializes QuoteListByThemeParams's query parameters as `url.Values`.
type QuoteListParams ¶
type QuoteListParams struct {
// Filter by character
CharacterID param.Opt[string] `query:"character_id,omitzero" json:"-"`
// Filter funny quotes
Funny param.Opt[bool] `query:"funny,omitzero" json:"-"`
// Filter inspirational quotes
Inspirational param.Opt[bool] `query:"inspirational,omitzero" json:"-"`
// Maximum number of items to return (max: 100)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Number of items to skip (offset)
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// Filter by moment type
//
// Any of "halftime_speech", "press_conference", "locker_room", "training",
// "biscuits_with_boss", "pub", "one_on_one", "celebration", "crisis", "casual",
// "confrontation".
MomentType QuoteMoment `query:"moment_type,omitzero" json:"-"`
// Filter by theme
//
// Any of "belief", "teamwork", "curiosity", "kindness", "resilience",
// "vulnerability", "growth", "humor", "wisdom", "leadership", "love",
// "forgiveness", "philosophy", "romance", "cultural-pride",
// "cultural-differences", "antagonism", "celebration", "identity", "isolation",
// "power", "sacrifice", "standards", "confidence", "conflict", "honesty",
// "integrity".
Theme QuoteTheme `query:"theme,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (QuoteListParams) URLQuery ¶
func (r QuoteListParams) URLQuery() (v url.Values, err error)
URLQuery serializes QuoteListParams's query parameters as `url.Values`.
type QuoteMoment ¶
type QuoteMoment string
Types of moments when quotes occur.
const ( QuoteMomentHalftimeSpeech QuoteMoment = "halftime_speech" QuoteMomentPressConference QuoteMoment = "press_conference" QuoteMomentLockerRoom QuoteMoment = "locker_room" QuoteMomentTraining QuoteMoment = "training" QuoteMomentBiscuitsWithBoss QuoteMoment = "biscuits_with_boss" QuoteMomentPub QuoteMoment = "pub" QuoteMomentOneOnOne QuoteMoment = "one_on_one" QuoteMomentCelebration QuoteMoment = "celebration" QuoteMomentCrisis QuoteMoment = "crisis" QuoteMomentCasual QuoteMoment = "casual" QuoteMomentConfrontation QuoteMoment = "confrontation" )
type QuoteNewParams ¶
type QuoteNewParams struct {
// ID of the character who said it
CharacterID string `json:"character_id,required"`
// Context in which the quote was said
Context string `json:"context,required"`
// Type of moment when the quote was said
//
// Any of "halftime_speech", "press_conference", "locker_room", "training",
// "biscuits_with_boss", "pub", "one_on_one", "celebration", "crisis", "casual",
// "confrontation".
MomentType QuoteMoment `json:"moment_type,omitzero,required"`
// The quote text
Text string `json:"text,required"`
// Primary theme of the quote
//
// Any of "belief", "teamwork", "curiosity", "kindness", "resilience",
// "vulnerability", "growth", "humor", "wisdom", "leadership", "love",
// "forgiveness", "philosophy", "romance", "cultural-pride",
// "cultural-differences", "antagonism", "celebration", "identity", "isolation",
// "power", "sacrifice", "standards", "confidence", "conflict", "honesty",
// "integrity".
Theme QuoteTheme `json:"theme,omitzero,required"`
// Episode where the quote appears
EpisodeID param.Opt[string] `json:"episode_id,omitzero"`
// Popularity/virality score (0-100)
PopularityScore param.Opt[float64] `json:"popularity_score,omitzero"`
TimesShared param.Opt[int64] `json:"times_shared,omitzero"`
// Whether this quote is humorous
IsFunny param.Opt[bool] `json:"is_funny,omitzero"`
// Whether this quote is inspirational
IsInspirational param.Opt[bool] `json:"is_inspirational,omitzero"`
// Additional themes
SecondaryThemes []QuoteTheme `json:"secondary_themes,omitzero"`
// contains filtered or unexported fields
}
func (QuoteNewParams) MarshalJSON ¶
func (r QuoteNewParams) MarshalJSON() (data []byte, err error)
func (*QuoteNewParams) UnmarshalJSON ¶
func (r *QuoteNewParams) UnmarshalJSON(data []byte) error
type QuoteService ¶
type QuoteService struct {
Options []option.RequestOption
}
QuoteService contains methods and other services that help with interacting with the believe API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewQuoteService method instead.
func NewQuoteService ¶
func NewQuoteService(opts ...option.RequestOption) (r QuoteService)
NewQuoteService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*QuoteService) Delete ¶
func (r *QuoteService) Delete(ctx context.Context, quoteID string, opts ...option.RequestOption) (err error)
Remove a quote from the collection.
func (*QuoteService) Get ¶
func (r *QuoteService) Get(ctx context.Context, quoteID string, opts ...option.RequestOption) (res *Quote, err error)
Retrieve a specific quote by its ID.
func (*QuoteService) GetRandom ¶
func (r *QuoteService) GetRandom(ctx context.Context, query QuoteGetRandomParams, opts ...option.RequestOption) (res *Quote, err error)
Get a random Ted Lasso quote, optionally filtered.
func (*QuoteService) List ¶
func (r *QuoteService) List(ctx context.Context, query QuoteListParams, opts ...option.RequestOption) (res *pagination.SkipLimitPage[Quote], err error)
Get a paginated list of all memorable Ted Lasso quotes with optional filtering.
func (*QuoteService) ListAutoPaging ¶
func (r *QuoteService) ListAutoPaging(ctx context.Context, query QuoteListParams, opts ...option.RequestOption) *pagination.SkipLimitPageAutoPager[Quote]
Get a paginated list of all memorable Ted Lasso quotes with optional filtering.
func (*QuoteService) ListByCharacter ¶
func (r *QuoteService) ListByCharacter(ctx context.Context, characterID string, query QuoteListByCharacterParams, opts ...option.RequestOption) (res *pagination.SkipLimitPage[Quote], err error)
Get a paginated list of quotes from a specific character.
func (*QuoteService) ListByCharacterAutoPaging ¶
func (r *QuoteService) ListByCharacterAutoPaging(ctx context.Context, characterID string, query QuoteListByCharacterParams, opts ...option.RequestOption) *pagination.SkipLimitPageAutoPager[Quote]
Get a paginated list of quotes from a specific character.
func (*QuoteService) ListByTheme ¶
func (r *QuoteService) ListByTheme(ctx context.Context, theme QuoteTheme, query QuoteListByThemeParams, opts ...option.RequestOption) (res *pagination.SkipLimitPage[Quote], err error)
Get a paginated list of quotes related to a specific theme.
func (*QuoteService) ListByThemeAutoPaging ¶
func (r *QuoteService) ListByThemeAutoPaging(ctx context.Context, theme QuoteTheme, query QuoteListByThemeParams, opts ...option.RequestOption) *pagination.SkipLimitPageAutoPager[Quote]
Get a paginated list of quotes related to a specific theme.
func (*QuoteService) New ¶
func (r *QuoteService) New(ctx context.Context, body QuoteNewParams, opts ...option.RequestOption) (res *Quote, err error)
Add a new memorable quote to the collection.
func (*QuoteService) Update ¶
func (r *QuoteService) Update(ctx context.Context, quoteID string, body QuoteUpdateParams, opts ...option.RequestOption) (res *Quote, err error)
Update specific fields of an existing quote.
type QuoteTheme ¶
type QuoteTheme string
Themes that quotes can be categorized under.
const ( QuoteThemeBelief QuoteTheme = "belief" QuoteThemeTeamwork QuoteTheme = "teamwork" QuoteThemeCuriosity QuoteTheme = "curiosity" QuoteThemeKindness QuoteTheme = "kindness" QuoteThemeResilience QuoteTheme = "resilience" QuoteThemeVulnerability QuoteTheme = "vulnerability" QuoteThemeGrowth QuoteTheme = "growth" QuoteThemeHumor QuoteTheme = "humor" QuoteThemeWisdom QuoteTheme = "wisdom" QuoteThemeLeadership QuoteTheme = "leadership" QuoteThemeLove QuoteTheme = "love" QuoteThemeForgiveness QuoteTheme = "forgiveness" QuoteThemePhilosophy QuoteTheme = "philosophy" QuoteThemeRomance QuoteTheme = "romance" QuoteThemeCulturalPride QuoteTheme = "cultural-pride" QuoteThemeCulturalDifferences QuoteTheme = "cultural-differences" QuoteThemeAntagonism QuoteTheme = "antagonism" QuoteThemeCelebration QuoteTheme = "celebration" QuoteThemeIdentity QuoteTheme = "identity" QuoteThemeIsolation QuoteTheme = "isolation" QuoteThemePower QuoteTheme = "power" QuoteThemeSacrifice QuoteTheme = "sacrifice" QuoteThemeStandards QuoteTheme = "standards" QuoteThemeConfidence QuoteTheme = "confidence" QuoteThemeConflict QuoteTheme = "conflict" QuoteThemeHonesty QuoteTheme = "honesty" QuoteThemeIntegrity QuoteTheme = "integrity" )
type QuoteUpdateParams ¶
type QuoteUpdateParams struct {
CharacterID param.Opt[string] `json:"character_id,omitzero"`
Context param.Opt[string] `json:"context,omitzero"`
EpisodeID param.Opt[string] `json:"episode_id,omitzero"`
IsFunny param.Opt[bool] `json:"is_funny,omitzero"`
IsInspirational param.Opt[bool] `json:"is_inspirational,omitzero"`
PopularityScore param.Opt[float64] `json:"popularity_score,omitzero"`
Text param.Opt[string] `json:"text,omitzero"`
SecondaryThemes []QuoteTheme `json:"secondary_themes,omitzero"`
// Types of moments when quotes occur.
//
// Any of "halftime_speech", "press_conference", "locker_room", "training",
// "biscuits_with_boss", "pub", "one_on_one", "celebration", "crisis", "casual",
// "confrontation".
MomentType QuoteMoment `json:"moment_type,omitzero"`
// Themes that quotes can be categorized under.
//
// Any of "belief", "teamwork", "curiosity", "kindness", "resilience",
// "vulnerability", "growth", "humor", "wisdom", "leadership", "love",
// "forgiveness", "philosophy", "romance", "cultural-pride",
// "cultural-differences", "antagonism", "celebration", "identity", "isolation",
// "power", "sacrifice", "standards", "confidence", "conflict", "honesty",
// "integrity".
Theme QuoteTheme `json:"theme,omitzero"`
// contains filtered or unexported fields
}
func (QuoteUpdateParams) MarshalJSON ¶
func (r QuoteUpdateParams) MarshalJSON() (data []byte, err error)
func (*QuoteUpdateParams) UnmarshalJSON ¶
func (r *QuoteUpdateParams) UnmarshalJSON(data []byte) error
type ReframeService ¶
type ReframeService struct {
Options []option.RequestOption
}
ReframeService contains methods and other services that help with interacting with the believe API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewReframeService method instead.
func NewReframeService ¶
func NewReframeService(opts ...option.RequestOption) (r ReframeService)
NewReframeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ReframeService) TransformNegativeThoughts ¶
func (r *ReframeService) TransformNegativeThoughts(ctx context.Context, body ReframeTransformNegativeThoughtsParams, opts ...option.RequestOption) (res *ReframeTransformNegativeThoughtsResponse, err error)
Transform negative thoughts into positive perspectives with Ted's help.
type ReframeTransformNegativeThoughtsParams ¶
type ReframeTransformNegativeThoughtsParams struct {
// The negative thought to reframe
NegativeThought string `json:"negative_thought,required"`
// Is this a recurring thought?
Recurring param.Opt[bool] `json:"recurring,omitzero"`
// contains filtered or unexported fields
}
func (ReframeTransformNegativeThoughtsParams) MarshalJSON ¶
func (r ReframeTransformNegativeThoughtsParams) MarshalJSON() (data []byte, err error)
func (*ReframeTransformNegativeThoughtsParams) UnmarshalJSON ¶
func (r *ReframeTransformNegativeThoughtsParams) UnmarshalJSON(data []byte) error
type ReframeTransformNegativeThoughtsResponse ¶
type ReframeTransformNegativeThoughtsResponse struct {
// A daily affirmation to practice
DailyAffirmation string `json:"daily_affirmation,required"`
// The original negative thought
OriginalThought string `json:"original_thought,required"`
// The thought reframed positively
ReframedThought string `json:"reframed_thought,required"`
// Ted's take on this thought
TedPerspective string `json:"ted_perspective,required"`
// Dr. Sharon's therapeutic insight
DrSharonInsight string `json:"dr_sharon_insight,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DailyAffirmation respjson.Field
OriginalThought respjson.Field
ReframedThought respjson.Field
TedPerspective respjson.Field
DrSharonInsight respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Reframed perspective response.
func (ReframeTransformNegativeThoughtsResponse) RawJSON ¶
func (r ReframeTransformNegativeThoughtsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ReframeTransformNegativeThoughtsResponse) UnmarshalJSON ¶
func (r *ReframeTransformNegativeThoughtsResponse) UnmarshalJSON(data []byte) error
type RegisteredWebhook ¶
type RegisteredWebhook struct {
// Unique webhook identifier
ID string `json:"id,required"`
// When the webhook was registered
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
// List of event types this webhook is subscribed to
//
// Any of "match.completed", "team_member.transferred".
EventTypes []string `json:"event_types,required"`
// The secret key for verifying webhook signatures (base64 encoded)
Secret string `json:"secret,required"`
// The URL to send webhook events to
URL string `json:"url,required" format:"uri"`
// Optional description for this webhook
Description string `json:"description,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
EventTypes respjson.Field
Secret respjson.Field
URL respjson.Field
Description respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A registered webhook endpoint.
func (RegisteredWebhook) RawJSON ¶
func (r RegisteredWebhook) RawJSON() string
Returns the unmodified JSON received from the API
func (*RegisteredWebhook) UnmarshalJSON ¶
func (r *RegisteredWebhook) UnmarshalJSON(data []byte) error
type StreamService ¶
type StreamService struct {
Options []option.RequestOption
}
StreamService contains methods and other services that help with interacting with the believe API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewStreamService method instead.
func NewStreamService ¶
func NewStreamService(opts ...option.RequestOption) (r StreamService)
NewStreamService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*StreamService) TestConnection ¶
func (r *StreamService) TestConnection(ctx context.Context, opts ...option.RequestOption) (res *StreamTestConnectionResponse, err error)
A simple SSE test endpoint that streams numbers 1-5.
type StreamTestConnectionResponse ¶
type StreamTestConnectionResponse = any
type Team ¶
type Team struct {
// Unique identifier
ID string `json:"id,required"`
// Team culture/morale score (0-100)
CultureScore int64 `json:"culture_score,required"`
// Year the club was founded
FoundedYear int64 `json:"founded_year,required"`
// Current league
//
// Any of "Premier League", "Championship", "League One", "League Two", "La Liga",
// "Serie A", "Bundesliga", "Ligue 1".
League League `json:"league,required"`
// Team name
Name string `json:"name,required"`
// Home stadium name
Stadium string `json:"stadium,required"`
// Team's core values
Values TeamValues `json:"values,required"`
// Annual budget in GBP
AnnualBudgetGbp string `json:"annual_budget_gbp,nullable"`
// Average match attendance
AverageAttendance float64 `json:"average_attendance,nullable"`
// Team contact email
ContactEmail string `json:"contact_email,nullable" format:"email"`
// Whether the team is currently active
IsActive bool `json:"is_active"`
// Team nickname
Nickname string `json:"nickname,nullable"`
// Primary team color (hex)
PrimaryColor string `json:"primary_color,nullable"`
// List of rival team IDs
RivalTeams []string `json:"rival_teams"`
// Secondary team color (hex)
SecondaryColor string `json:"secondary_color,nullable"`
// Geographic coordinates for a location.
StadiumLocation GeoLocation `json:"stadium_location,nullable"`
// Official team website
Website string `json:"website,nullable" format:"uri"`
// Season win percentage
WinPercentage float64 `json:"win_percentage,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CultureScore respjson.Field
FoundedYear respjson.Field
League respjson.Field
Name respjson.Field
Stadium respjson.Field
Values respjson.Field
AnnualBudgetGbp respjson.Field
AverageAttendance respjson.Field
ContactEmail respjson.Field
IsActive respjson.Field
Nickname respjson.Field
PrimaryColor respjson.Field
RivalTeams respjson.Field
SecondaryColor respjson.Field
StadiumLocation respjson.Field
Website respjson.Field
WinPercentage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Full team model with ID.
func (*Team) UnmarshalJSON ¶
type TeamGetCultureResponse ¶
type TeamListParams ¶
type TeamListParams struct {
// Minimum culture score
MinCultureScore param.Opt[int64] `query:"min_culture_score,omitzero" json:"-"`
// Maximum number of items to return (max: 100)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Number of items to skip (offset)
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// Filter by league
//
// Any of "Premier League", "Championship", "League One", "League Two", "La Liga",
// "Serie A", "Bundesliga", "Ligue 1".
League League `query:"league,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (TeamListParams) URLQuery ¶
func (r TeamListParams) URLQuery() (v url.Values, err error)
URLQuery serializes TeamListParams's query parameters as `url.Values`.
type TeamLogoDeleteParams ¶
type TeamLogoDeleteParams struct {
TeamID string `path:"team_id,required" json:"-"`
// contains filtered or unexported fields
}
type TeamLogoDownloadParams ¶
type TeamLogoDownloadParams struct {
TeamID string `path:"team_id,required" json:"-"`
// contains filtered or unexported fields
}
type TeamLogoDownloadResponse ¶
type TeamLogoDownloadResponse = any
type TeamLogoService ¶
type TeamLogoService struct {
Options []option.RequestOption
}
TeamLogoService contains methods and other services that help with interacting with the believe API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTeamLogoService method instead.
func NewTeamLogoService ¶
func NewTeamLogoService(opts ...option.RequestOption) (r TeamLogoService)
NewTeamLogoService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*TeamLogoService) Delete ¶
func (r *TeamLogoService) Delete(ctx context.Context, fileID string, body TeamLogoDeleteParams, opts ...option.RequestOption) (err error)
Delete a team's logo.
func (*TeamLogoService) Download ¶
func (r *TeamLogoService) Download(ctx context.Context, fileID string, query TeamLogoDownloadParams, opts ...option.RequestOption) (res *TeamLogoDownloadResponse, err error)
Download a team's logo by file ID.
func (*TeamLogoService) Upload ¶
func (r *TeamLogoService) Upload(ctx context.Context, teamID string, body TeamLogoUploadParams, opts ...option.RequestOption) (res *FileUpload, err error)
Upload a logo image for a team. Accepts image files (jpg, png, gif, webp).
type TeamLogoUploadParams ¶
type TeamLogoUploadParams struct {
// Logo image file
File io.Reader `json:"file,omitzero,required" format:"binary"`
// contains filtered or unexported fields
}
func (TeamLogoUploadParams) MarshalMultipart ¶
func (r TeamLogoUploadParams) MarshalMultipart() (data []byte, contentType string, err error)
type TeamMemberGetResponseUnion ¶
type TeamMemberGetResponseUnion struct {
ID string `json:"id"`
CharacterID string `json:"character_id"`
// This field is from variant [Player].
JerseyNumber int64 `json:"jersey_number"`
// This field is from variant [Player].
Position Position `json:"position"`
TeamID string `json:"team_id"`
YearsWithTeam int64 `json:"years_with_team"`
// This field is from variant [Player].
Assists int64 `json:"assists"`
// This field is from variant [Player].
GoalsScored int64 `json:"goals_scored"`
// This field is from variant [Player].
IsCaptain bool `json:"is_captain"`
// Any of "player", "coach", "medical_staff", "equipment_manager".
MemberType string `json:"member_type"`
Specialty string `json:"specialty"`
// This field is from variant [Coach].
Certifications []string `json:"certifications"`
// This field is from variant [Coach].
WinRate float64 `json:"win_rate"`
// This field is from variant [MedicalStaff].
LicenseNumber string `json:"license_number"`
// This field is from variant [MedicalStaff].
Qualifications []string `json:"qualifications"`
// This field is from variant [EquipmentManager].
IsHeadKitman bool `json:"is_head_kitman"`
// This field is from variant [EquipmentManager].
Responsibilities []string `json:"responsibilities"`
JSON struct {
ID respjson.Field
CharacterID respjson.Field
JerseyNumber respjson.Field
Position respjson.Field
TeamID respjson.Field
YearsWithTeam respjson.Field
Assists respjson.Field
GoalsScored respjson.Field
IsCaptain respjson.Field
MemberType respjson.Field
Specialty respjson.Field
Certifications respjson.Field
WinRate respjson.Field
LicenseNumber respjson.Field
Qualifications respjson.Field
IsHeadKitman respjson.Field
Responsibilities respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
TeamMemberGetResponseUnion contains all possible properties and values from Player, Coach, MedicalStaff, EquipmentManager.
Use the TeamMemberGetResponseUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (TeamMemberGetResponseUnion) AsAny ¶
func (u TeamMemberGetResponseUnion) AsAny() anyTeamMemberGetResponse
Use the following switch statement to find the correct variant
switch variant := TeamMemberGetResponseUnion.AsAny().(type) {
case believe.Player:
case believe.Coach:
case believe.MedicalStaff:
case believe.EquipmentManager:
default:
fmt.Errorf("no variant present")
}
func (TeamMemberGetResponseUnion) AsCoach ¶
func (u TeamMemberGetResponseUnion) AsCoach() (v Coach)
func (TeamMemberGetResponseUnion) AsEquipmentManager ¶
func (u TeamMemberGetResponseUnion) AsEquipmentManager() (v EquipmentManager)
func (TeamMemberGetResponseUnion) AsMedicalStaff ¶
func (u TeamMemberGetResponseUnion) AsMedicalStaff() (v MedicalStaff)
func (TeamMemberGetResponseUnion) AsPlayer ¶
func (u TeamMemberGetResponseUnion) AsPlayer() (v Player)
func (TeamMemberGetResponseUnion) RawJSON ¶
func (u TeamMemberGetResponseUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*TeamMemberGetResponseUnion) UnmarshalJSON ¶
func (r *TeamMemberGetResponseUnion) UnmarshalJSON(data []byte) error
type TeamMemberListCoachesParams ¶
type TeamMemberListCoachesParams struct {
// Filter by team ID
TeamID param.Opt[string] `query:"team_id,omitzero" json:"-"`
// Maximum number of items to return (max: 100)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Number of items to skip (offset)
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// Filter by specialty
//
// Any of "head_coach", "assistant_coach", "goalkeeping_coach", "fitness_coach",
// "tactical_analyst".
Specialty CoachSpecialty `query:"specialty,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (TeamMemberListCoachesParams) URLQuery ¶
func (r TeamMemberListCoachesParams) URLQuery() (v url.Values, err error)
URLQuery serializes TeamMemberListCoachesParams's query parameters as `url.Values`.
type TeamMemberListParams ¶
type TeamMemberListParams struct {
// Filter by team ID
TeamID param.Opt[string] `query:"team_id,omitzero" json:"-"`
// Maximum number of items to return (max: 100)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Number of items to skip (offset)
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// Filter by member type
//
// Any of "player", "coach", "medical_staff", "equipment_manager".
MemberType TeamMemberListParamsMemberType `query:"member_type,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (TeamMemberListParams) URLQuery ¶
func (r TeamMemberListParams) URLQuery() (v url.Values, err error)
URLQuery serializes TeamMemberListParams's query parameters as `url.Values`.
type TeamMemberListParamsMemberType ¶
type TeamMemberListParamsMemberType string
Filter by member type
const ( TeamMemberListParamsMemberTypePlayer TeamMemberListParamsMemberType = "player" TeamMemberListParamsMemberTypeCoach TeamMemberListParamsMemberType = "coach" TeamMemberListParamsMemberTypeMedicalStaff TeamMemberListParamsMemberType = "medical_staff" TeamMemberListParamsMemberTypeEquipmentManager TeamMemberListParamsMemberType = "equipment_manager" )
type TeamMemberListPlayersParams ¶
type TeamMemberListPlayersParams struct {
// Filter by team ID
TeamID param.Opt[string] `query:"team_id,omitzero" json:"-"`
// Maximum number of items to return (max: 100)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Number of items to skip (offset)
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// Filter by position
//
// Any of "goalkeeper", "defender", "midfielder", "forward".
Position Position `query:"position,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (TeamMemberListPlayersParams) URLQuery ¶
func (r TeamMemberListPlayersParams) URLQuery() (v url.Values, err error)
URLQuery serializes TeamMemberListPlayersParams's query parameters as `url.Values`.
type TeamMemberListResponseUnion ¶
type TeamMemberListResponseUnion struct {
ID string `json:"id"`
CharacterID string `json:"character_id"`
// This field is from variant [Player].
JerseyNumber int64 `json:"jersey_number"`
// This field is from variant [Player].
Position Position `json:"position"`
TeamID string `json:"team_id"`
YearsWithTeam int64 `json:"years_with_team"`
// This field is from variant [Player].
Assists int64 `json:"assists"`
// This field is from variant [Player].
GoalsScored int64 `json:"goals_scored"`
// This field is from variant [Player].
IsCaptain bool `json:"is_captain"`
// Any of "player", "coach", "medical_staff", "equipment_manager".
MemberType string `json:"member_type"`
Specialty string `json:"specialty"`
// This field is from variant [Coach].
Certifications []string `json:"certifications"`
// This field is from variant [Coach].
WinRate float64 `json:"win_rate"`
// This field is from variant [MedicalStaff].
LicenseNumber string `json:"license_number"`
// This field is from variant [MedicalStaff].
Qualifications []string `json:"qualifications"`
// This field is from variant [EquipmentManager].
IsHeadKitman bool `json:"is_head_kitman"`
// This field is from variant [EquipmentManager].
Responsibilities []string `json:"responsibilities"`
JSON struct {
ID respjson.Field
CharacterID respjson.Field
JerseyNumber respjson.Field
Position respjson.Field
TeamID respjson.Field
YearsWithTeam respjson.Field
Assists respjson.Field
GoalsScored respjson.Field
IsCaptain respjson.Field
MemberType respjson.Field
Specialty respjson.Field
Certifications respjson.Field
WinRate respjson.Field
LicenseNumber respjson.Field
Qualifications respjson.Field
IsHeadKitman respjson.Field
Responsibilities respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
TeamMemberListResponseUnion contains all possible properties and values from Player, Coach, MedicalStaff, EquipmentManager.
Use the TeamMemberListResponseUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (TeamMemberListResponseUnion) AsAny ¶
func (u TeamMemberListResponseUnion) AsAny() anyTeamMemberListResponse
Use the following switch statement to find the correct variant
switch variant := TeamMemberListResponseUnion.AsAny().(type) {
case believe.Player:
case believe.Coach:
case believe.MedicalStaff:
case believe.EquipmentManager:
default:
fmt.Errorf("no variant present")
}
func (TeamMemberListResponseUnion) AsCoach ¶
func (u TeamMemberListResponseUnion) AsCoach() (v Coach)
func (TeamMemberListResponseUnion) AsEquipmentManager ¶
func (u TeamMemberListResponseUnion) AsEquipmentManager() (v EquipmentManager)
func (TeamMemberListResponseUnion) AsMedicalStaff ¶
func (u TeamMemberListResponseUnion) AsMedicalStaff() (v MedicalStaff)
func (TeamMemberListResponseUnion) AsPlayer ¶
func (u TeamMemberListResponseUnion) AsPlayer() (v Player)
func (TeamMemberListResponseUnion) RawJSON ¶
func (u TeamMemberListResponseUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*TeamMemberListResponseUnion) UnmarshalJSON ¶
func (r *TeamMemberListResponseUnion) UnmarshalJSON(data []byte) error
type TeamMemberListStaffParams ¶
type TeamMemberListStaffParams struct {
// Filter by team ID
TeamID param.Opt[string] `query:"team_id,omitzero" json:"-"`
// Maximum number of items to return (max: 100)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Number of items to skip (offset)
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (TeamMemberListStaffParams) URLQuery ¶
func (r TeamMemberListStaffParams) URLQuery() (v url.Values, err error)
URLQuery serializes TeamMemberListStaffParams's query parameters as `url.Values`.
type TeamMemberListStaffResponseUnion ¶
type TeamMemberListStaffResponseUnion struct {
ID string `json:"id"`
CharacterID string `json:"character_id"`
// This field is from variant [MedicalStaff].
Specialty MedicalSpecialty `json:"specialty"`
TeamID string `json:"team_id"`
YearsWithTeam int64 `json:"years_with_team"`
// This field is from variant [MedicalStaff].
LicenseNumber string `json:"license_number"`
MemberType string `json:"member_type"`
// This field is from variant [MedicalStaff].
Qualifications []string `json:"qualifications"`
// This field is from variant [EquipmentManager].
IsHeadKitman bool `json:"is_head_kitman"`
// This field is from variant [EquipmentManager].
Responsibilities []string `json:"responsibilities"`
JSON struct {
ID respjson.Field
CharacterID respjson.Field
Specialty respjson.Field
TeamID respjson.Field
YearsWithTeam respjson.Field
LicenseNumber respjson.Field
MemberType respjson.Field
Qualifications respjson.Field
IsHeadKitman respjson.Field
Responsibilities respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
TeamMemberListStaffResponseUnion contains all possible properties and values from MedicalStaff, EquipmentManager.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (TeamMemberListStaffResponseUnion) AsEquipmentManager ¶
func (u TeamMemberListStaffResponseUnion) AsEquipmentManager() (v EquipmentManager)
func (TeamMemberListStaffResponseUnion) AsMedicalStaff ¶
func (u TeamMemberListStaffResponseUnion) AsMedicalStaff() (v MedicalStaff)
func (TeamMemberListStaffResponseUnion) RawJSON ¶
func (u TeamMemberListStaffResponseUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*TeamMemberListStaffResponseUnion) UnmarshalJSON ¶
func (r *TeamMemberListStaffResponseUnion) UnmarshalJSON(data []byte) error
type TeamMemberNewParams ¶
type TeamMemberNewParams struct {
// This field is a request body variant, only one variant field can be set. A
// football player on the team.
OfPlayer *TeamMemberNewParamsMemberPlayer `json:",inline"`
// This field is a request body variant, only one variant field can be set. A coach
// or coaching staff member.
OfCoach *TeamMemberNewParamsMemberCoach `json:",inline"`
// This field is a request body variant, only one variant field can be set. Medical
// and wellness staff member.
OfMedicalStaff *TeamMemberNewParamsMemberMedicalStaff `json:",inline"`
// This field is a request body variant, only one variant field can be set.
// Equipment and kit management staff.
OfEquipmentManager *TeamMemberNewParamsMemberEquipmentManager `json:",inline"`
// contains filtered or unexported fields
}
func (TeamMemberNewParams) MarshalJSON ¶
func (u TeamMemberNewParams) MarshalJSON() ([]byte, error)
func (*TeamMemberNewParams) UnmarshalJSON ¶
func (r *TeamMemberNewParams) UnmarshalJSON(data []byte) error
type TeamMemberNewParamsMemberCoach ¶
type TeamMemberNewParamsMemberCoach struct {
// ID of the character (references /characters/{id})
CharacterID string `json:"character_id,required"`
// Coaching specialty/role
//
// Any of "head_coach", "assistant_coach", "goalkeeping_coach", "fitness_coach",
// "tactical_analyst".
Specialty CoachSpecialty `json:"specialty,omitzero,required"`
// ID of the team they belong to
TeamID string `json:"team_id,required"`
// Number of years with the current team
YearsWithTeam int64 `json:"years_with_team,required"`
// Career win rate (0.0 to 1.0)
WinRate param.Opt[float64] `json:"win_rate,omitzero"`
// Coaching certifications and licenses
Certifications []string `json:"certifications,omitzero"`
// Discriminator field indicating this is a coach
//
// Any of "coach".
MemberType string `json:"member_type,omitzero"`
// contains filtered or unexported fields
}
A coach or coaching staff member.
The properties CharacterID, Specialty, TeamID, YearsWithTeam are required.
func (TeamMemberNewParamsMemberCoach) MarshalJSON ¶
func (r TeamMemberNewParamsMemberCoach) MarshalJSON() (data []byte, err error)
func (*TeamMemberNewParamsMemberCoach) UnmarshalJSON ¶
func (r *TeamMemberNewParamsMemberCoach) UnmarshalJSON(data []byte) error
type TeamMemberNewParamsMemberEquipmentManager ¶
type TeamMemberNewParamsMemberEquipmentManager struct {
// ID of the character (references /characters/{id})
CharacterID string `json:"character_id,required"`
// ID of the team they belong to
TeamID string `json:"team_id,required"`
// Number of years with the current team
YearsWithTeam int64 `json:"years_with_team,required"`
// Whether this is the head equipment manager
IsHeadKitman param.Opt[bool] `json:"is_head_kitman,omitzero"`
// Discriminator field indicating this is an equipment manager
//
// Any of "equipment_manager".
MemberType string `json:"member_type,omitzero"`
// List of responsibilities
Responsibilities []string `json:"responsibilities,omitzero"`
// contains filtered or unexported fields
}
Equipment and kit management staff.
The properties CharacterID, TeamID, YearsWithTeam are required.
func (TeamMemberNewParamsMemberEquipmentManager) MarshalJSON ¶
func (r TeamMemberNewParamsMemberEquipmentManager) MarshalJSON() (data []byte, err error)
func (*TeamMemberNewParamsMemberEquipmentManager) UnmarshalJSON ¶
func (r *TeamMemberNewParamsMemberEquipmentManager) UnmarshalJSON(data []byte) error
type TeamMemberNewParamsMemberMedicalStaff ¶
type TeamMemberNewParamsMemberMedicalStaff struct {
// ID of the character (references /characters/{id})
CharacterID string `json:"character_id,required"`
// Medical specialty
//
// Any of "team_doctor", "physiotherapist", "sports_psychologist", "nutritionist",
// "massage_therapist".
Specialty MedicalSpecialty `json:"specialty,omitzero,required"`
// ID of the team they belong to
TeamID string `json:"team_id,required"`
// Number of years with the current team
YearsWithTeam int64 `json:"years_with_team,required"`
// Professional license number
LicenseNumber param.Opt[string] `json:"license_number,omitzero"`
// Discriminator field indicating this is medical staff
//
// Any of "medical_staff".
MemberType string `json:"member_type,omitzero"`
// Medical qualifications and degrees
Qualifications []string `json:"qualifications,omitzero"`
// contains filtered or unexported fields
}
Medical and wellness staff member.
The properties CharacterID, Specialty, TeamID, YearsWithTeam are required.
func (TeamMemberNewParamsMemberMedicalStaff) MarshalJSON ¶
func (r TeamMemberNewParamsMemberMedicalStaff) MarshalJSON() (data []byte, err error)
func (*TeamMemberNewParamsMemberMedicalStaff) UnmarshalJSON ¶
func (r *TeamMemberNewParamsMemberMedicalStaff) UnmarshalJSON(data []byte) error
type TeamMemberNewParamsMemberPlayer ¶
type TeamMemberNewParamsMemberPlayer struct {
// ID of the character (references /characters/{id})
CharacterID string `json:"character_id,required"`
// Jersey/shirt number
JerseyNumber int64 `json:"jersey_number,required"`
// Playing position on the field
//
// Any of "goalkeeper", "defender", "midfielder", "forward".
Position Position `json:"position,omitzero,required"`
// ID of the team they belong to
TeamID string `json:"team_id,required"`
// Number of years with the current team
YearsWithTeam int64 `json:"years_with_team,required"`
// Total assists for the team
Assists param.Opt[int64] `json:"assists,omitzero"`
// Total goals scored for the team
GoalsScored param.Opt[int64] `json:"goals_scored,omitzero"`
// Whether this player is team captain
IsCaptain param.Opt[bool] `json:"is_captain,omitzero"`
// Discriminator field indicating this is a player
//
// Any of "player".
MemberType string `json:"member_type,omitzero"`
// contains filtered or unexported fields
}
A football player on the team.
The properties CharacterID, JerseyNumber, Position, TeamID, YearsWithTeam are required.
func (TeamMemberNewParamsMemberPlayer) MarshalJSON ¶
func (r TeamMemberNewParamsMemberPlayer) MarshalJSON() (data []byte, err error)
func (*TeamMemberNewParamsMemberPlayer) UnmarshalJSON ¶
func (r *TeamMemberNewParamsMemberPlayer) UnmarshalJSON(data []byte) error
type TeamMemberNewResponseUnion ¶
type TeamMemberNewResponseUnion struct {
ID string `json:"id"`
CharacterID string `json:"character_id"`
// This field is from variant [Player].
JerseyNumber int64 `json:"jersey_number"`
// This field is from variant [Player].
Position Position `json:"position"`
TeamID string `json:"team_id"`
YearsWithTeam int64 `json:"years_with_team"`
// This field is from variant [Player].
Assists int64 `json:"assists"`
// This field is from variant [Player].
GoalsScored int64 `json:"goals_scored"`
// This field is from variant [Player].
IsCaptain bool `json:"is_captain"`
// Any of "player", "coach", "medical_staff", "equipment_manager".
MemberType string `json:"member_type"`
Specialty string `json:"specialty"`
// This field is from variant [Coach].
Certifications []string `json:"certifications"`
// This field is from variant [Coach].
WinRate float64 `json:"win_rate"`
// This field is from variant [MedicalStaff].
LicenseNumber string `json:"license_number"`
// This field is from variant [MedicalStaff].
Qualifications []string `json:"qualifications"`
// This field is from variant [EquipmentManager].
IsHeadKitman bool `json:"is_head_kitman"`
// This field is from variant [EquipmentManager].
Responsibilities []string `json:"responsibilities"`
JSON struct {
ID respjson.Field
CharacterID respjson.Field
JerseyNumber respjson.Field
Position respjson.Field
TeamID respjson.Field
YearsWithTeam respjson.Field
Assists respjson.Field
GoalsScored respjson.Field
IsCaptain respjson.Field
MemberType respjson.Field
Specialty respjson.Field
Certifications respjson.Field
WinRate respjson.Field
LicenseNumber respjson.Field
Qualifications respjson.Field
IsHeadKitman respjson.Field
Responsibilities respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
TeamMemberNewResponseUnion contains all possible properties and values from Player, Coach, MedicalStaff, EquipmentManager.
Use the TeamMemberNewResponseUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (TeamMemberNewResponseUnion) AsAny ¶
func (u TeamMemberNewResponseUnion) AsAny() anyTeamMemberNewResponse
Use the following switch statement to find the correct variant
switch variant := TeamMemberNewResponseUnion.AsAny().(type) {
case believe.Player:
case believe.Coach:
case believe.MedicalStaff:
case believe.EquipmentManager:
default:
fmt.Errorf("no variant present")
}
func (TeamMemberNewResponseUnion) AsCoach ¶
func (u TeamMemberNewResponseUnion) AsCoach() (v Coach)
func (TeamMemberNewResponseUnion) AsEquipmentManager ¶
func (u TeamMemberNewResponseUnion) AsEquipmentManager() (v EquipmentManager)
func (TeamMemberNewResponseUnion) AsMedicalStaff ¶
func (u TeamMemberNewResponseUnion) AsMedicalStaff() (v MedicalStaff)
func (TeamMemberNewResponseUnion) AsPlayer ¶
func (u TeamMemberNewResponseUnion) AsPlayer() (v Player)
func (TeamMemberNewResponseUnion) RawJSON ¶
func (u TeamMemberNewResponseUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*TeamMemberNewResponseUnion) UnmarshalJSON ¶
func (r *TeamMemberNewResponseUnion) UnmarshalJSON(data []byte) error
type TeamMemberService ¶
type TeamMemberService struct {
Options []option.RequestOption
}
TeamMemberService contains methods and other services that help with interacting with the believe API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTeamMemberService method instead.
func NewTeamMemberService ¶
func NewTeamMemberService(opts ...option.RequestOption) (r TeamMemberService)
NewTeamMemberService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*TeamMemberService) Delete ¶
func (r *TeamMemberService) Delete(ctx context.Context, memberID string, opts ...option.RequestOption) (err error)
Remove a team member from the roster.
func (*TeamMemberService) Get ¶
func (r *TeamMemberService) Get(ctx context.Context, memberID string, opts ...option.RequestOption) (res *TeamMemberGetResponseUnion, err error)
Retrieve detailed information about a specific team member.
The response is a **union type (oneOf)** - the actual shape depends on the member's type:
- **player**: Includes position, jersey_number, goals_scored, assists, is_captain
- **coach**: Includes specialty, certifications, win_rate
- **medical_staff**: Includes specialty, qualifications, license_number
- **equipment_manager**: Includes responsibilities, is_head_kitman
Use `character_id` to fetch full character details from `/characters/{character_id}`.
func (*TeamMemberService) List ¶
func (r *TeamMemberService) List(ctx context.Context, query TeamMemberListParams, opts ...option.RequestOption) (res *pagination.SkipLimitPage[TeamMemberListResponseUnion], err error)
Get a paginated list of all team members.
This endpoint demonstrates **union types (oneOf)** in the response. Each team member can be one of: Player, Coach, MedicalStaff, or EquipmentManager. The `member_type` field acts as a discriminator to determine the shape of each object.
func (*TeamMemberService) ListAutoPaging ¶
func (r *TeamMemberService) ListAutoPaging(ctx context.Context, query TeamMemberListParams, opts ...option.RequestOption) *pagination.SkipLimitPageAutoPager[TeamMemberListResponseUnion]
Get a paginated list of all team members.
This endpoint demonstrates **union types (oneOf)** in the response. Each team member can be one of: Player, Coach, MedicalStaff, or EquipmentManager. The `member_type` field acts as a discriminator to determine the shape of each object.
func (*TeamMemberService) ListCoaches ¶
func (r *TeamMemberService) ListCoaches(ctx context.Context, query TeamMemberListCoachesParams, opts ...option.RequestOption) (res *pagination.SkipLimitPage[Coach], err error)
Get only coaches (filtered subset of team members).
func (*TeamMemberService) ListCoachesAutoPaging ¶
func (r *TeamMemberService) ListCoachesAutoPaging(ctx context.Context, query TeamMemberListCoachesParams, opts ...option.RequestOption) *pagination.SkipLimitPageAutoPager[Coach]
Get only coaches (filtered subset of team members).
func (*TeamMemberService) ListPlayers ¶
func (r *TeamMemberService) ListPlayers(ctx context.Context, query TeamMemberListPlayersParams, opts ...option.RequestOption) (res *pagination.SkipLimitPage[Player], err error)
Get only players (filtered subset of team members).
func (*TeamMemberService) ListPlayersAutoPaging ¶
func (r *TeamMemberService) ListPlayersAutoPaging(ctx context.Context, query TeamMemberListPlayersParams, opts ...option.RequestOption) *pagination.SkipLimitPageAutoPager[Player]
Get only players (filtered subset of team members).
func (*TeamMemberService) ListStaff ¶
func (r *TeamMemberService) ListStaff(ctx context.Context, query TeamMemberListStaffParams, opts ...option.RequestOption) (res *pagination.SkipLimitPage[TeamMemberListStaffResponseUnion], err error)
Get all staff members (medical staff and equipment managers).
This demonstrates a **narrower union type** - the response is oneOf MedicalStaff or EquipmentManager.
func (*TeamMemberService) ListStaffAutoPaging ¶
func (r *TeamMemberService) ListStaffAutoPaging(ctx context.Context, query TeamMemberListStaffParams, opts ...option.RequestOption) *pagination.SkipLimitPageAutoPager[TeamMemberListStaffResponseUnion]
Get all staff members (medical staff and equipment managers).
This demonstrates a **narrower union type** - the response is oneOf MedicalStaff or EquipmentManager.
func (*TeamMemberService) New ¶
func (r *TeamMemberService) New(ctx context.Context, body TeamMemberNewParams, opts ...option.RequestOption) (res *TeamMemberNewResponseUnion, err error)
Add a new team member to a team.
The request body is a **union type (oneOf)** - you must include the `member_type` discriminator field:
- `"member_type": "player"` - Creates a player (requires position, jersey_number, etc.)
- `"member_type": "coach"` - Creates a coach (requires specialty, etc.)
- `"member_type": "medical_staff"` - Creates medical staff (requires medical specialty, etc.)
- `"member_type": "equipment_manager"` - Creates equipment manager (requires responsibilities, etc.)
The `character_id` field references an existing character from `/characters/{id}`.
**Example for creating a player:**
```json
{
"member_type": "player",
"character_id": "sam-obisanya",
"team_id": "afc-richmond",
"years_with_team": 2,
"position": "midfielder",
"jersey_number": 24,
"goals_scored": 12,
"assists": 15
}
```
func (*TeamMemberService) Update ¶
func (r *TeamMemberService) Update(ctx context.Context, memberID string, body TeamMemberUpdateParams, opts ...option.RequestOption) (res *TeamMemberUpdateResponseUnion, err error)
Update specific fields of an existing team member. Fields vary by member type.
type TeamMemberTransferredWebhookEvent ¶
type TeamMemberTransferredWebhookEvent struct {
// When the event was created
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
// Data payload for a team member transfer event.
Data TeamMemberTransferredWebhookEventData `json:"data,required"`
// Unique identifier for this event
EventID string `json:"event_id,required" format:"uuid"`
// The type of webhook event
//
// Any of "team_member.transferred".
EventType TeamMemberTransferredWebhookEventEventType `json:"event_type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
Data respjson.Field
EventID respjson.Field
EventType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Webhook event sent when a team member (player, coach, staff) transfers between teams.
func (TeamMemberTransferredWebhookEvent) RawJSON ¶
func (r TeamMemberTransferredWebhookEvent) RawJSON() string
Returns the unmodified JSON received from the API
func (*TeamMemberTransferredWebhookEvent) UnmarshalJSON ¶
func (r *TeamMemberTransferredWebhookEvent) UnmarshalJSON(data []byte) error
type TeamMemberTransferredWebhookEventData ¶
type TeamMemberTransferredWebhookEventData struct {
// ID of the character (links to /characters)
CharacterID string `json:"character_id,required"`
// Name of the character
CharacterName string `json:"character_name,required"`
// Type of team member
//
// Any of "player", "coach", "medical_staff", "equipment_manager".
MemberType string `json:"member_type,required"`
// ID of the team involved
TeamID string `json:"team_id,required"`
// ID of the team member
TeamMemberID string `json:"team_member_id,required"`
// Name of the team involved
TeamName string `json:"team_name,required"`
// Ted's reaction to the transfer
TedReaction string `json:"ted_reaction,required"`
// Whether the member joined or departed
//
// Any of "joined", "departed".
TransferType string `json:"transfer_type,required"`
// Previous team ID (for joins from another team)
PreviousTeamID string `json:"previous_team_id,nullable"`
// Previous team name (for joins from another team)
PreviousTeamName string `json:"previous_team_name,nullable"`
// Transfer fee in GBP (for players)
TransferFeeGbp string `json:"transfer_fee_gbp,nullable"`
// Years spent with previous team
YearsWithPreviousTeam int64 `json:"years_with_previous_team,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CharacterID respjson.Field
CharacterName respjson.Field
MemberType respjson.Field
TeamID respjson.Field
TeamMemberID respjson.Field
TeamName respjson.Field
TedReaction respjson.Field
TransferType respjson.Field
PreviousTeamID respjson.Field
PreviousTeamName respjson.Field
TransferFeeGbp respjson.Field
YearsWithPreviousTeam respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Data payload for a team member transfer event.
func (TeamMemberTransferredWebhookEventData) RawJSON ¶
func (r TeamMemberTransferredWebhookEventData) RawJSON() string
Returns the unmodified JSON received from the API
func (*TeamMemberTransferredWebhookEventData) UnmarshalJSON ¶
func (r *TeamMemberTransferredWebhookEventData) UnmarshalJSON(data []byte) error
type TeamMemberTransferredWebhookEventEventType ¶
type TeamMemberTransferredWebhookEventEventType string
The type of webhook event
const (
TeamMemberTransferredWebhookEventEventTypeTeamMemberTransferred TeamMemberTransferredWebhookEventEventType = "team_member.transferred"
)
type TeamMemberUpdateParams ¶
type TeamMemberUpdateParams struct {
// This field is a request body variant, only one variant field can be set. Update
// model for players.
OfPlayerUpdate *TeamMemberUpdateParamsUpdatesPlayerUpdate `json:",inline"`
// This field is a request body variant, only one variant field can be set. Update
// model for coaches.
OfCoachUpdate *TeamMemberUpdateParamsUpdatesCoachUpdate `json:",inline"`
// This field is a request body variant, only one variant field can be set. Update
// model for medical staff.
OfMedicalStaffUpdate *TeamMemberUpdateParamsUpdatesMedicalStaffUpdate `json:",inline"`
// This field is a request body variant, only one variant field can be set. Update
// model for equipment managers.
OfEquipmentManagerUpdate *TeamMemberUpdateParamsUpdatesEquipmentManagerUpdate `json:",inline"`
// contains filtered or unexported fields
}
func (TeamMemberUpdateParams) MarshalJSON ¶
func (u TeamMemberUpdateParams) MarshalJSON() ([]byte, error)
func (*TeamMemberUpdateParams) UnmarshalJSON ¶
func (r *TeamMemberUpdateParams) UnmarshalJSON(data []byte) error
type TeamMemberUpdateParamsUpdatesCoachUpdate ¶
type TeamMemberUpdateParamsUpdatesCoachUpdate struct {
TeamID param.Opt[string] `json:"team_id,omitzero"`
WinRate param.Opt[float64] `json:"win_rate,omitzero"`
YearsWithTeam param.Opt[int64] `json:"years_with_team,omitzero"`
Certifications []string `json:"certifications,omitzero"`
// Coaching specialties.
//
// Any of "head_coach", "assistant_coach", "goalkeeping_coach", "fitness_coach",
// "tactical_analyst".
Specialty CoachSpecialty `json:"specialty,omitzero"`
// contains filtered or unexported fields
}
Update model for coaches.
func (TeamMemberUpdateParamsUpdatesCoachUpdate) MarshalJSON ¶
func (r TeamMemberUpdateParamsUpdatesCoachUpdate) MarshalJSON() (data []byte, err error)
func (*TeamMemberUpdateParamsUpdatesCoachUpdate) UnmarshalJSON ¶
func (r *TeamMemberUpdateParamsUpdatesCoachUpdate) UnmarshalJSON(data []byte) error
type TeamMemberUpdateParamsUpdatesEquipmentManagerUpdate ¶
type TeamMemberUpdateParamsUpdatesEquipmentManagerUpdate struct {
IsHeadKitman param.Opt[bool] `json:"is_head_kitman,omitzero"`
TeamID param.Opt[string] `json:"team_id,omitzero"`
YearsWithTeam param.Opt[int64] `json:"years_with_team,omitzero"`
Responsibilities []string `json:"responsibilities,omitzero"`
// contains filtered or unexported fields
}
Update model for equipment managers.
func (TeamMemberUpdateParamsUpdatesEquipmentManagerUpdate) MarshalJSON ¶
func (r TeamMemberUpdateParamsUpdatesEquipmentManagerUpdate) MarshalJSON() (data []byte, err error)
func (*TeamMemberUpdateParamsUpdatesEquipmentManagerUpdate) UnmarshalJSON ¶
func (r *TeamMemberUpdateParamsUpdatesEquipmentManagerUpdate) UnmarshalJSON(data []byte) error
type TeamMemberUpdateParamsUpdatesMedicalStaffUpdate ¶
type TeamMemberUpdateParamsUpdatesMedicalStaffUpdate struct {
LicenseNumber param.Opt[string] `json:"license_number,omitzero"`
TeamID param.Opt[string] `json:"team_id,omitzero"`
YearsWithTeam param.Opt[int64] `json:"years_with_team,omitzero"`
Qualifications []string `json:"qualifications,omitzero"`
// Medical staff specialties.
//
// Any of "team_doctor", "physiotherapist", "sports_psychologist", "nutritionist",
// "massage_therapist".
Specialty MedicalSpecialty `json:"specialty,omitzero"`
// contains filtered or unexported fields
}
Update model for medical staff.
func (TeamMemberUpdateParamsUpdatesMedicalStaffUpdate) MarshalJSON ¶
func (r TeamMemberUpdateParamsUpdatesMedicalStaffUpdate) MarshalJSON() (data []byte, err error)
func (*TeamMemberUpdateParamsUpdatesMedicalStaffUpdate) UnmarshalJSON ¶
func (r *TeamMemberUpdateParamsUpdatesMedicalStaffUpdate) UnmarshalJSON(data []byte) error
type TeamMemberUpdateParamsUpdatesPlayerUpdate ¶
type TeamMemberUpdateParamsUpdatesPlayerUpdate struct {
Assists param.Opt[int64] `json:"assists,omitzero"`
GoalsScored param.Opt[int64] `json:"goals_scored,omitzero"`
IsCaptain param.Opt[bool] `json:"is_captain,omitzero"`
JerseyNumber param.Opt[int64] `json:"jersey_number,omitzero"`
TeamID param.Opt[string] `json:"team_id,omitzero"`
YearsWithTeam param.Opt[int64] `json:"years_with_team,omitzero"`
// Football positions for players.
//
// Any of "goalkeeper", "defender", "midfielder", "forward".
Position Position `json:"position,omitzero"`
// contains filtered or unexported fields
}
Update model for players.
func (TeamMemberUpdateParamsUpdatesPlayerUpdate) MarshalJSON ¶
func (r TeamMemberUpdateParamsUpdatesPlayerUpdate) MarshalJSON() (data []byte, err error)
func (*TeamMemberUpdateParamsUpdatesPlayerUpdate) UnmarshalJSON ¶
func (r *TeamMemberUpdateParamsUpdatesPlayerUpdate) UnmarshalJSON(data []byte) error
type TeamMemberUpdateResponseUnion ¶
type TeamMemberUpdateResponseUnion struct {
ID string `json:"id"`
CharacterID string `json:"character_id"`
// This field is from variant [Player].
JerseyNumber int64 `json:"jersey_number"`
// This field is from variant [Player].
Position Position `json:"position"`
TeamID string `json:"team_id"`
YearsWithTeam int64 `json:"years_with_team"`
// This field is from variant [Player].
Assists int64 `json:"assists"`
// This field is from variant [Player].
GoalsScored int64 `json:"goals_scored"`
// This field is from variant [Player].
IsCaptain bool `json:"is_captain"`
// Any of "player", "coach", "medical_staff", "equipment_manager".
MemberType string `json:"member_type"`
Specialty string `json:"specialty"`
// This field is from variant [Coach].
Certifications []string `json:"certifications"`
// This field is from variant [Coach].
WinRate float64 `json:"win_rate"`
// This field is from variant [MedicalStaff].
LicenseNumber string `json:"license_number"`
// This field is from variant [MedicalStaff].
Qualifications []string `json:"qualifications"`
// This field is from variant [EquipmentManager].
IsHeadKitman bool `json:"is_head_kitman"`
// This field is from variant [EquipmentManager].
Responsibilities []string `json:"responsibilities"`
JSON struct {
ID respjson.Field
CharacterID respjson.Field
JerseyNumber respjson.Field
Position respjson.Field
TeamID respjson.Field
YearsWithTeam respjson.Field
Assists respjson.Field
GoalsScored respjson.Field
IsCaptain respjson.Field
MemberType respjson.Field
Specialty respjson.Field
Certifications respjson.Field
WinRate respjson.Field
LicenseNumber respjson.Field
Qualifications respjson.Field
IsHeadKitman respjson.Field
Responsibilities respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
TeamMemberUpdateResponseUnion contains all possible properties and values from Player, Coach, MedicalStaff, EquipmentManager.
Use the TeamMemberUpdateResponseUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (TeamMemberUpdateResponseUnion) AsAny ¶
func (u TeamMemberUpdateResponseUnion) AsAny() anyTeamMemberUpdateResponse
Use the following switch statement to find the correct variant
switch variant := TeamMemberUpdateResponseUnion.AsAny().(type) {
case believe.Player:
case believe.Coach:
case believe.MedicalStaff:
case believe.EquipmentManager:
default:
fmt.Errorf("no variant present")
}
func (TeamMemberUpdateResponseUnion) AsCoach ¶
func (u TeamMemberUpdateResponseUnion) AsCoach() (v Coach)
func (TeamMemberUpdateResponseUnion) AsEquipmentManager ¶
func (u TeamMemberUpdateResponseUnion) AsEquipmentManager() (v EquipmentManager)
func (TeamMemberUpdateResponseUnion) AsMedicalStaff ¶
func (u TeamMemberUpdateResponseUnion) AsMedicalStaff() (v MedicalStaff)
func (TeamMemberUpdateResponseUnion) AsPlayer ¶
func (u TeamMemberUpdateResponseUnion) AsPlayer() (v Player)
func (TeamMemberUpdateResponseUnion) RawJSON ¶
func (u TeamMemberUpdateResponseUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*TeamMemberUpdateResponseUnion) UnmarshalJSON ¶
func (r *TeamMemberUpdateResponseUnion) UnmarshalJSON(data []byte) error
type TeamNewParams ¶
type TeamNewParams struct {
// Team culture/morale score (0-100)
CultureScore int64 `json:"culture_score,required"`
// Year the club was founded
FoundedYear int64 `json:"founded_year,required"`
// Current league
//
// Any of "Premier League", "Championship", "League One", "League Two", "La Liga",
// "Serie A", "Bundesliga", "Ligue 1".
League League `json:"league,omitzero,required"`
// Team name
Name string `json:"name,required"`
// Home stadium name
Stadium string `json:"stadium,required"`
// Team's core values
Values TeamValuesParam `json:"values,omitzero,required"`
// Average match attendance
AverageAttendance param.Opt[float64] `json:"average_attendance,omitzero"`
// Team contact email
ContactEmail param.Opt[string] `json:"contact_email,omitzero" format:"email"`
// Team nickname
Nickname param.Opt[string] `json:"nickname,omitzero"`
// Primary team color (hex)
PrimaryColor param.Opt[string] `json:"primary_color,omitzero"`
// Secondary team color (hex)
SecondaryColor param.Opt[string] `json:"secondary_color,omitzero"`
// Official team website
Website param.Opt[string] `json:"website,omitzero" format:"uri"`
// Season win percentage
WinPercentage param.Opt[float64] `json:"win_percentage,omitzero"`
// Whether the team is currently active
IsActive param.Opt[bool] `json:"is_active,omitzero"`
// Annual budget in GBP
AnnualBudgetGbp TeamNewParamsAnnualBudgetGbpUnion `json:"annual_budget_gbp,omitzero"`
// List of rival team IDs
RivalTeams []string `json:"rival_teams,omitzero"`
// Geographic coordinates for a location.
StadiumLocation GeoLocationParam `json:"stadium_location,omitzero"`
// contains filtered or unexported fields
}
func (TeamNewParams) MarshalJSON ¶
func (r TeamNewParams) MarshalJSON() (data []byte, err error)
func (*TeamNewParams) UnmarshalJSON ¶
func (r *TeamNewParams) UnmarshalJSON(data []byte) error
type TeamNewParamsAnnualBudgetGbpUnion ¶
type TeamNewParamsAnnualBudgetGbpUnion struct {
OfFloat param.Opt[float64] `json:",omitzero,inline"`
OfString param.Opt[string] `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (TeamNewParamsAnnualBudgetGbpUnion) MarshalJSON ¶
func (u TeamNewParamsAnnualBudgetGbpUnion) MarshalJSON() ([]byte, error)
func (*TeamNewParamsAnnualBudgetGbpUnion) UnmarshalJSON ¶
func (u *TeamNewParamsAnnualBudgetGbpUnion) UnmarshalJSON(data []byte) error
type TeamService ¶
type TeamService struct {
Options []option.RequestOption
Logo TeamLogoService
}
TeamService contains methods and other services that help with interacting with the believe API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTeamService method instead.
func NewTeamService ¶
func NewTeamService(opts ...option.RequestOption) (r TeamService)
NewTeamService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*TeamService) Delete ¶
func (r *TeamService) Delete(ctx context.Context, teamID string, opts ...option.RequestOption) (err error)
Remove a team from the database (relegation to oblivion).
func (*TeamService) Get ¶
func (r *TeamService) Get(ctx context.Context, teamID string, opts ...option.RequestOption) (res *Team, err error)
Retrieve detailed information about a specific team.
func (*TeamService) GetCulture ¶
func (r *TeamService) GetCulture(ctx context.Context, teamID string, opts ...option.RequestOption) (res *TeamGetCultureResponse, err error)
Get detailed culture and values information for a team.
func (*TeamService) GetRivals ¶
func (r *TeamService) GetRivals(ctx context.Context, teamID string, opts ...option.RequestOption) (res *[]Team, err error)
Get all rival teams for a specific team.
func (*TeamService) List ¶
func (r *TeamService) List(ctx context.Context, query TeamListParams, opts ...option.RequestOption) (res *pagination.SkipLimitPage[Team], err error)
Get a paginated list of all teams with optional filtering by league or culture score.
func (*TeamService) ListAutoPaging ¶
func (r *TeamService) ListAutoPaging(ctx context.Context, query TeamListParams, opts ...option.RequestOption) *pagination.SkipLimitPageAutoPager[Team]
Get a paginated list of all teams with optional filtering by league or culture score.
func (*TeamService) ListLogos ¶
func (r *TeamService) ListLogos(ctx context.Context, teamID string, opts ...option.RequestOption) (res *[]FileUpload, err error)
List all uploaded logos for a team.
func (*TeamService) New ¶
func (r *TeamService) New(ctx context.Context, body TeamNewParams, opts ...option.RequestOption) (res *Team, err error)
Add a new team to the league.
func (*TeamService) Update ¶
func (r *TeamService) Update(ctx context.Context, teamID string, body TeamUpdateParams, opts ...option.RequestOption) (res *Team, err error)
Update specific fields of an existing team.
type TeamUpdateParams ¶
type TeamUpdateParams struct {
AverageAttendance param.Opt[float64] `json:"average_attendance,omitzero"`
ContactEmail param.Opt[string] `json:"contact_email,omitzero" format:"email"`
CultureScore param.Opt[int64] `json:"culture_score,omitzero"`
FoundedYear param.Opt[int64] `json:"founded_year,omitzero"`
IsActive param.Opt[bool] `json:"is_active,omitzero"`
Name param.Opt[string] `json:"name,omitzero"`
Nickname param.Opt[string] `json:"nickname,omitzero"`
PrimaryColor param.Opt[string] `json:"primary_color,omitzero"`
SecondaryColor param.Opt[string] `json:"secondary_color,omitzero"`
Stadium param.Opt[string] `json:"stadium,omitzero"`
Website param.Opt[string] `json:"website,omitzero" format:"uri"`
WinPercentage param.Opt[float64] `json:"win_percentage,omitzero"`
AnnualBudgetGbp TeamUpdateParamsAnnualBudgetGbpUnion `json:"annual_budget_gbp,omitzero"`
RivalTeams []string `json:"rival_teams,omitzero"`
// Football leagues.
//
// Any of "Premier League", "Championship", "League One", "League Two", "La Liga",
// "Serie A", "Bundesliga", "Ligue 1".
League League `json:"league,omitzero"`
// Geographic coordinates for a location.
StadiumLocation GeoLocationParam `json:"stadium_location,omitzero"`
// Core values that define a team's culture.
Values TeamValuesParam `json:"values,omitzero"`
// contains filtered or unexported fields
}
func (TeamUpdateParams) MarshalJSON ¶
func (r TeamUpdateParams) MarshalJSON() (data []byte, err error)
func (*TeamUpdateParams) UnmarshalJSON ¶
func (r *TeamUpdateParams) UnmarshalJSON(data []byte) error
type TeamUpdateParamsAnnualBudgetGbpUnion ¶
type TeamUpdateParamsAnnualBudgetGbpUnion struct {
OfFloat param.Opt[float64] `json:",omitzero,inline"`
OfString param.Opt[string] `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (TeamUpdateParamsAnnualBudgetGbpUnion) MarshalJSON ¶
func (u TeamUpdateParamsAnnualBudgetGbpUnion) MarshalJSON() ([]byte, error)
func (*TeamUpdateParamsAnnualBudgetGbpUnion) UnmarshalJSON ¶
func (u *TeamUpdateParamsAnnualBudgetGbpUnion) UnmarshalJSON(data []byte) error
type TeamValues ¶
type TeamValues struct {
// The team's primary guiding value
PrimaryValue string `json:"primary_value,required"`
// Supporting values
SecondaryValues []string `json:"secondary_values,required"`
// Team's motivational motto
TeamMotto string `json:"team_motto,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
PrimaryValue respjson.Field
SecondaryValues respjson.Field
TeamMotto respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Core values that define a team's culture.
func (TeamValues) RawJSON ¶
func (r TeamValues) RawJSON() string
Returns the unmodified JSON received from the API
func (TeamValues) ToParam ¶
func (r TeamValues) ToParam() TeamValuesParam
ToParam converts this TeamValues to a TeamValuesParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with TeamValuesParam.Overrides()
func (*TeamValues) UnmarshalJSON ¶
func (r *TeamValues) UnmarshalJSON(data []byte) error
type TeamValuesParam ¶
type TeamValuesParam struct {
// The team's primary guiding value
PrimaryValue string `json:"primary_value,required"`
// Supporting values
SecondaryValues []string `json:"secondary_values,omitzero,required"`
// Team's motivational motto
TeamMotto string `json:"team_motto,required"`
// contains filtered or unexported fields
}
Core values that define a team's culture.
The properties PrimaryValue, SecondaryValues, TeamMotto are required.
func (TeamValuesParam) MarshalJSON ¶
func (r TeamValuesParam) MarshalJSON() (data []byte, err error)
func (*TeamValuesParam) UnmarshalJSON ¶
func (r *TeamValuesParam) UnmarshalJSON(data []byte) error
type TurningPoint ¶
type TurningPoint struct {
// What happened
Description string `json:"description,required"`
// How this affected the team emotionally
EmotionalImpact string `json:"emotional_impact,required"`
// Minute of the match
Minute int64 `json:"minute,required"`
// Character ID who was central to this moment
CharacterInvolved string `json:"character_involved,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Description respjson.Field
EmotionalImpact respjson.Field
Minute respjson.Field
CharacterInvolved respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A pivotal moment in a match.
func (TurningPoint) RawJSON ¶
func (r TurningPoint) RawJSON() string
Returns the unmodified JSON received from the API
func (TurningPoint) ToParam ¶
func (r TurningPoint) ToParam() TurningPointParam
ToParam converts this TurningPoint to a TurningPointParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with TurningPointParam.Overrides()
func (*TurningPoint) UnmarshalJSON ¶
func (r *TurningPoint) UnmarshalJSON(data []byte) error
type TurningPointParam ¶
type TurningPointParam struct {
// What happened
Description string `json:"description,required"`
// How this affected the team emotionally
EmotionalImpact string `json:"emotional_impact,required"`
// Minute of the match
Minute int64 `json:"minute,required"`
// Character ID who was central to this moment
CharacterInvolved param.Opt[string] `json:"character_involved,omitzero"`
// contains filtered or unexported fields
}
A pivotal moment in a match.
The properties Description, EmotionalImpact, Minute are required.
func (TurningPointParam) MarshalJSON ¶
func (r TurningPointParam) MarshalJSON() (data []byte, err error)
func (*TurningPointParam) UnmarshalJSON ¶
func (r *TurningPointParam) UnmarshalJSON(data []byte) error
type UnwrapWebhookEventUnion ¶
type UnwrapWebhookEventUnion struct {
CreatedAt time.Time `json:"created_at"`
// This field is a union of [MatchCompletedWebhookEventData],
// [TeamMemberTransferredWebhookEventData]
Data UnwrapWebhookEventUnionData `json:"data"`
EventID string `json:"event_id"`
// Any of "match.completed", "team_member.transferred".
EventType string `json:"event_type"`
JSON struct {
CreatedAt respjson.Field
Data respjson.Field
EventID respjson.Field
EventType respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UnwrapWebhookEventUnion contains all possible properties and values from MatchCompletedWebhookEvent, TeamMemberTransferredWebhookEvent.
Use the UnwrapWebhookEventUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (UnwrapWebhookEventUnion) AsAny ¶
func (u UnwrapWebhookEventUnion) AsAny() anyUnwrapWebhookEvent
Use the following switch statement to find the correct variant
switch variant := UnwrapWebhookEventUnion.AsAny().(type) {
case believe.MatchCompletedWebhookEvent:
case believe.TeamMemberTransferredWebhookEvent:
default:
fmt.Errorf("no variant present")
}
func (UnwrapWebhookEventUnion) AsMatchCompleted ¶
func (u UnwrapWebhookEventUnion) AsMatchCompleted() (v MatchCompletedWebhookEvent)
func (UnwrapWebhookEventUnion) AsTeamMemberTransferred ¶
func (u UnwrapWebhookEventUnion) AsTeamMemberTransferred() (v TeamMemberTransferredWebhookEvent)
func (UnwrapWebhookEventUnion) RawJSON ¶
func (u UnwrapWebhookEventUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*UnwrapWebhookEventUnion) UnmarshalJSON ¶
func (r *UnwrapWebhookEventUnion) UnmarshalJSON(data []byte) error
type UnwrapWebhookEventUnionData ¶
type UnwrapWebhookEventUnionData struct {
// This field is from variant [MatchCompletedWebhookEventData].
AwayScore int64 `json:"away_score"`
// This field is from variant [MatchCompletedWebhookEventData].
AwayTeamID string `json:"away_team_id"`
// This field is from variant [MatchCompletedWebhookEventData].
CompletedAt time.Time `json:"completed_at"`
// This field is from variant [MatchCompletedWebhookEventData].
HomeScore int64 `json:"home_score"`
// This field is from variant [MatchCompletedWebhookEventData].
HomeTeamID string `json:"home_team_id"`
// This field is from variant [MatchCompletedWebhookEventData].
MatchID string `json:"match_id"`
// This field is from variant [MatchCompletedWebhookEventData].
MatchType string `json:"match_type"`
// This field is from variant [MatchCompletedWebhookEventData].
Result string `json:"result"`
// This field is from variant [MatchCompletedWebhookEventData].
TedPostMatchQuote string `json:"ted_post_match_quote"`
// This field is from variant [MatchCompletedWebhookEventData].
LessonLearned string `json:"lesson_learned"`
// This field is from variant [MatchCompletedWebhookEventData].
ManOfTheMatch string `json:"man_of_the_match"`
// This field is from variant [TeamMemberTransferredWebhookEventData].
CharacterID string `json:"character_id"`
// This field is from variant [TeamMemberTransferredWebhookEventData].
CharacterName string `json:"character_name"`
// This field is from variant [TeamMemberTransferredWebhookEventData].
MemberType string `json:"member_type"`
// This field is from variant [TeamMemberTransferredWebhookEventData].
TeamID string `json:"team_id"`
// This field is from variant [TeamMemberTransferredWebhookEventData].
TeamMemberID string `json:"team_member_id"`
// This field is from variant [TeamMemberTransferredWebhookEventData].
TeamName string `json:"team_name"`
// This field is from variant [TeamMemberTransferredWebhookEventData].
TedReaction string `json:"ted_reaction"`
// This field is from variant [TeamMemberTransferredWebhookEventData].
TransferType string `json:"transfer_type"`
// This field is from variant [TeamMemberTransferredWebhookEventData].
PreviousTeamID string `json:"previous_team_id"`
// This field is from variant [TeamMemberTransferredWebhookEventData].
PreviousTeamName string `json:"previous_team_name"`
// This field is from variant [TeamMemberTransferredWebhookEventData].
TransferFeeGbp string `json:"transfer_fee_gbp"`
// This field is from variant [TeamMemberTransferredWebhookEventData].
YearsWithPreviousTeam int64 `json:"years_with_previous_team"`
JSON struct {
AwayScore respjson.Field
AwayTeamID respjson.Field
CompletedAt respjson.Field
HomeScore respjson.Field
HomeTeamID respjson.Field
MatchID respjson.Field
MatchType respjson.Field
Result respjson.Field
TedPostMatchQuote respjson.Field
LessonLearned respjson.Field
ManOfTheMatch respjson.Field
CharacterID respjson.Field
CharacterName respjson.Field
MemberType respjson.Field
TeamID respjson.Field
TeamMemberID respjson.Field
TeamName respjson.Field
TedReaction respjson.Field
TransferType respjson.Field
PreviousTeamID respjson.Field
PreviousTeamName respjson.Field
TransferFeeGbp respjson.Field
YearsWithPreviousTeam respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UnwrapWebhookEventUnionData is an implicit subunion of UnwrapWebhookEventUnion. UnwrapWebhookEventUnionData provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the UnwrapWebhookEventUnion.
func (*UnwrapWebhookEventUnionData) UnmarshalJSON ¶
func (r *UnwrapWebhookEventUnionData) UnmarshalJSON(data []byte) error
type VersionGetResponse ¶
type VersionGetResponse = any
type VersionService ¶
type VersionService struct {
Options []option.RequestOption
}
VersionService contains methods and other services that help with interacting with the believe API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVersionService method instead.
func NewVersionService ¶
func NewVersionService(opts ...option.RequestOption) (r VersionService)
NewVersionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*VersionService) Get ¶
func (r *VersionService) Get(ctx context.Context, opts ...option.RequestOption) (res *VersionGetResponse, err error)
Get detailed information about API versioning.
type WebhookDeleteResponse ¶
type WebhookNewParams ¶
type WebhookNewParams struct {
// The URL to send webhook events to
URL string `json:"url,required" format:"uri"`
// Optional description for this webhook
Description param.Opt[string] `json:"description,omitzero"`
// List of event types to subscribe to. If not provided, subscribes to all events.
//
// Any of "match.completed", "team_member.transferred".
EventTypes []string `json:"event_types,omitzero"`
// contains filtered or unexported fields
}
func (WebhookNewParams) MarshalJSON ¶
func (r WebhookNewParams) MarshalJSON() (data []byte, err error)
func (*WebhookNewParams) UnmarshalJSON ¶
func (r *WebhookNewParams) UnmarshalJSON(data []byte) error
type WebhookNewResponse ¶
type WebhookNewResponse struct {
// The registered webhook details
Webhook RegisteredWebhook `json:"webhook,required"`
// Status message
Message string `json:"message"`
// Ted's reaction
TedSays string `json:"ted_says"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Webhook respjson.Field
Message respjson.Field
TedSays respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response after registering a webhook.
func (WebhookNewResponse) RawJSON ¶
func (r WebhookNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookNewResponse) UnmarshalJSON ¶
func (r *WebhookNewResponse) UnmarshalJSON(data []byte) error
type WebhookService ¶
type WebhookService struct {
Options []option.RequestOption
}
WebhookService contains methods and other services that help with interacting with the believe API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWebhookService method instead.
func NewWebhookService ¶
func NewWebhookService(opts ...option.RequestOption) (r WebhookService)
NewWebhookService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*WebhookService) Delete ¶
func (r *WebhookService) Delete(ctx context.Context, webhookID string, opts ...option.RequestOption) (res *WebhookDeleteResponse, err error)
Unregister a webhook endpoint. It will no longer receive events.
func (*WebhookService) Get ¶
func (r *WebhookService) Get(ctx context.Context, webhookID string, opts ...option.RequestOption) (res *RegisteredWebhook, err error)
Get details of a specific webhook endpoint.
func (*WebhookService) List ¶
func (r *WebhookService) List(ctx context.Context, opts ...option.RequestOption) (res *[]RegisteredWebhook, err error)
Get a list of all registered webhook endpoints.
func (*WebhookService) New ¶
func (r *WebhookService) New(ctx context.Context, body WebhookNewParams, opts ...option.RequestOption) (res *WebhookNewResponse, err error)
Register a new webhook endpoint to receive event notifications.
## Event Types
Available event types to subscribe to:
- `match.completed` - Fired when a football match ends - `team_member.transferred` - Fired when a player/coach joins or leaves a team
If no event types are specified, the webhook will receive all event types.
## Webhook Signatures
All webhook deliveries include Standard Webhooks signature headers:
- `webhook-id` - Unique message identifier - `webhook-timestamp` - Unix timestamp of when the webhook was sent - `webhook-signature` - HMAC-SHA256 signature in format `v1,{base64_signature}`
Store the returned `secret` securely - you'll need it to verify webhook signatures.
func (*WebhookService) TriggerEvent ¶
func (r *WebhookService) TriggerEvent(ctx context.Context, body WebhookTriggerEventParams, opts ...option.RequestOption) (res *WebhookTriggerEventResponse, err error)
Trigger a webhook event and deliver it to all subscribed endpoints.
This endpoint is useful for testing your webhook integration. It will:
1. Generate an event with the specified type and payload 2. Find all webhooks subscribed to that event type 3. Send a POST request to each webhook URL with signature headers 4. Return the delivery results
## Event Payload
You can provide a custom payload, or leave it empty to use a sample payload.
## Webhook Signature Headers
Each webhook delivery includes:
- `webhook-id` - Unique event identifier (e.g., `evt_abc123...`) - `webhook-timestamp` - Unix timestamp - `webhook-signature` - HMAC-SHA256 signature (`v1,{base64}`)
To verify signatures, compute:
``` signature = HMAC-SHA256(
key = base64_decode(secret_without_prefix),
message = "{timestamp}.{raw_json_payload}"
) ```
func (*WebhookService) Unwrap ¶
func (r *WebhookService) Unwrap(payload []byte, opts ...option.RequestOption) (*UnwrapWebhookEventUnion, error)
type WebhookTriggerEventParams ¶
type WebhookTriggerEventParams struct {
// The type of event to trigger
//
// Any of "match.completed", "team_member.transferred".
EventType WebhookTriggerEventParamsEventType `json:"event_type,omitzero,required"`
// Optional event payload. If not provided, a sample payload will be generated.
Payload WebhookTriggerEventParamsPayloadUnion `json:"payload,omitzero"`
// contains filtered or unexported fields
}
func (WebhookTriggerEventParams) MarshalJSON ¶
func (r WebhookTriggerEventParams) MarshalJSON() (data []byte, err error)
func (*WebhookTriggerEventParams) UnmarshalJSON ¶
func (r *WebhookTriggerEventParams) UnmarshalJSON(data []byte) error
type WebhookTriggerEventParamsEventType ¶
type WebhookTriggerEventParamsEventType string
The type of event to trigger
const ( WebhookTriggerEventParamsEventTypeMatchCompleted WebhookTriggerEventParamsEventType = "match.completed" WebhookTriggerEventParamsEventTypeTeamMemberTransferred WebhookTriggerEventParamsEventType = "team_member.transferred" )
type WebhookTriggerEventParamsPayloadMatchCompleted ¶
type WebhookTriggerEventParamsPayloadMatchCompleted struct {
// Event data
Data WebhookTriggerEventParamsPayloadMatchCompletedData `json:"data,omitzero,required"`
// The type of webhook event
//
// Any of "match.completed".
EventType string `json:"event_type,omitzero"`
// contains filtered or unexported fields
}
Payload for match.completed event.
The property Data is required.
func (WebhookTriggerEventParamsPayloadMatchCompleted) MarshalJSON ¶
func (r WebhookTriggerEventParamsPayloadMatchCompleted) MarshalJSON() (data []byte, err error)
func (*WebhookTriggerEventParamsPayloadMatchCompleted) UnmarshalJSON ¶
func (r *WebhookTriggerEventParamsPayloadMatchCompleted) UnmarshalJSON(data []byte) error
type WebhookTriggerEventParamsPayloadMatchCompletedData ¶
type WebhookTriggerEventParamsPayloadMatchCompletedData struct {
// Final away team score
AwayScore int64 `json:"away_score,required"`
// Away team ID
AwayTeamID string `json:"away_team_id,required"`
// When the match completed
CompletedAt time.Time `json:"completed_at,required" format:"date-time"`
// Final home team score
HomeScore int64 `json:"home_score,required"`
// Home team ID
HomeTeamID string `json:"home_team_id,required"`
// Unique match identifier
MatchID string `json:"match_id,required"`
// Type of match
//
// Any of "league", "cup", "friendly", "playoff", "final".
MatchType string `json:"match_type,omitzero,required"`
// Match result from home team perspective
//
// Any of "home_win", "away_win", "draw".
Result string `json:"result,omitzero,required"`
// Ted's post-match wisdom
TedPostMatchQuote string `json:"ted_post_match_quote,required"`
// Ted's lesson from the match
LessonLearned param.Opt[string] `json:"lesson_learned,omitzero"`
// Player of the match (if awarded)
ManOfTheMatch param.Opt[string] `json:"man_of_the_match,omitzero"`
// contains filtered or unexported fields
}
Event data
The properties AwayScore, AwayTeamID, CompletedAt, HomeScore, HomeTeamID, MatchID, MatchType, Result, TedPostMatchQuote are required.
func (WebhookTriggerEventParamsPayloadMatchCompletedData) MarshalJSON ¶
func (r WebhookTriggerEventParamsPayloadMatchCompletedData) MarshalJSON() (data []byte, err error)
func (*WebhookTriggerEventParamsPayloadMatchCompletedData) UnmarshalJSON ¶
func (r *WebhookTriggerEventParamsPayloadMatchCompletedData) UnmarshalJSON(data []byte) error
type WebhookTriggerEventParamsPayloadTeamMemberTransferred ¶
type WebhookTriggerEventParamsPayloadTeamMemberTransferred struct {
// Event data
Data WebhookTriggerEventParamsPayloadTeamMemberTransferredData `json:"data,omitzero,required"`
// The type of webhook event
//
// Any of "team_member.transferred".
EventType string `json:"event_type,omitzero"`
// contains filtered or unexported fields
}
Payload for team_member.transferred event.
The property Data is required.
func (WebhookTriggerEventParamsPayloadTeamMemberTransferred) MarshalJSON ¶
func (r WebhookTriggerEventParamsPayloadTeamMemberTransferred) MarshalJSON() (data []byte, err error)
func (*WebhookTriggerEventParamsPayloadTeamMemberTransferred) UnmarshalJSON ¶
func (r *WebhookTriggerEventParamsPayloadTeamMemberTransferred) UnmarshalJSON(data []byte) error
type WebhookTriggerEventParamsPayloadTeamMemberTransferredData ¶
type WebhookTriggerEventParamsPayloadTeamMemberTransferredData struct {
// ID of the character (links to /characters)
CharacterID string `json:"character_id,required"`
// Name of the character
CharacterName string `json:"character_name,required"`
// Type of team member
//
// Any of "player", "coach", "medical_staff", "equipment_manager".
MemberType string `json:"member_type,omitzero,required"`
// ID of the team involved
TeamID string `json:"team_id,required"`
// ID of the team member
TeamMemberID string `json:"team_member_id,required"`
// Name of the team involved
TeamName string `json:"team_name,required"`
// Ted's reaction to the transfer
TedReaction string `json:"ted_reaction,required"`
// Whether the member joined or departed
//
// Any of "joined", "departed".
TransferType string `json:"transfer_type,omitzero,required"`
// Previous team ID (for joins from another team)
PreviousTeamID param.Opt[string] `json:"previous_team_id,omitzero"`
// Previous team name (for joins from another team)
PreviousTeamName param.Opt[string] `json:"previous_team_name,omitzero"`
// Transfer fee in GBP (for players)
TransferFeeGbp param.Opt[string] `json:"transfer_fee_gbp,omitzero"`
// Years spent with previous team
YearsWithPreviousTeam param.Opt[int64] `json:"years_with_previous_team,omitzero"`
// contains filtered or unexported fields
}
Event data
The properties CharacterID, CharacterName, MemberType, TeamID, TeamMemberID, TeamName, TedReaction, TransferType are required.
func (WebhookTriggerEventParamsPayloadTeamMemberTransferredData) MarshalJSON ¶
func (r WebhookTriggerEventParamsPayloadTeamMemberTransferredData) MarshalJSON() (data []byte, err error)
func (*WebhookTriggerEventParamsPayloadTeamMemberTransferredData) UnmarshalJSON ¶
func (r *WebhookTriggerEventParamsPayloadTeamMemberTransferredData) UnmarshalJSON(data []byte) error
type WebhookTriggerEventParamsPayloadUnion ¶
type WebhookTriggerEventParamsPayloadUnion struct {
OfMatchCompleted *WebhookTriggerEventParamsPayloadMatchCompleted `json:",omitzero,inline"`
OfTeamMemberTransferred *WebhookTriggerEventParamsPayloadTeamMemberTransferred `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (WebhookTriggerEventParamsPayloadUnion) MarshalJSON ¶
func (u WebhookTriggerEventParamsPayloadUnion) MarshalJSON() ([]byte, error)
func (*WebhookTriggerEventParamsPayloadUnion) UnmarshalJSON ¶
func (u *WebhookTriggerEventParamsPayloadUnion) UnmarshalJSON(data []byte) error
type WebhookTriggerEventResponse ¶
type WebhookTriggerEventResponse struct {
// Results of webhook deliveries
Deliveries []WebhookTriggerEventResponseDelivery `json:"deliveries,required"`
// Unique event identifier
EventID string `json:"event_id,required"`
// The type of event triggered
//
// Any of "match.completed", "team_member.transferred".
EventType WebhookTriggerEventResponseEventType `json:"event_type,required"`
// Number of successful deliveries
SuccessfulDeliveries int64 `json:"successful_deliveries,required"`
// Ted's reaction
TedSays string `json:"ted_says,required"`
// Total number of webhooks that received this event
TotalWebhooks int64 `json:"total_webhooks,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Deliveries respjson.Field
EventID respjson.Field
EventType respjson.Field
SuccessfulDeliveries respjson.Field
TedSays respjson.Field
TotalWebhooks respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response after triggering webhook events.
func (WebhookTriggerEventResponse) RawJSON ¶
func (r WebhookTriggerEventResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookTriggerEventResponse) UnmarshalJSON ¶
func (r *WebhookTriggerEventResponse) UnmarshalJSON(data []byte) error
type WebhookTriggerEventResponseDelivery ¶
type WebhookTriggerEventResponseDelivery struct {
// Whether delivery was successful
Success bool `json:"success,required"`
// URL the webhook was sent to
URL string `json:"url,required"`
// ID of the webhook
WebhookID string `json:"webhook_id,required"`
// Error message if delivery failed
Error string `json:"error,nullable"`
// HTTP status code from the endpoint
StatusCode int64 `json:"status_code,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
URL respjson.Field
WebhookID respjson.Field
Error respjson.Field
StatusCode respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Result of delivering a webhook to a single endpoint.
func (WebhookTriggerEventResponseDelivery) RawJSON ¶
func (r WebhookTriggerEventResponseDelivery) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookTriggerEventResponseDelivery) UnmarshalJSON ¶
func (r *WebhookTriggerEventResponseDelivery) UnmarshalJSON(data []byte) error
type WebhookTriggerEventResponseEventType ¶
type WebhookTriggerEventResponseEventType string
The type of event triggered
const ( WebhookTriggerEventResponseEventTypeMatchCompleted WebhookTriggerEventResponseEventType = "match.completed" WebhookTriggerEventResponseEventTypeTeamMemberTransferred WebhookTriggerEventResponseEventType = "team_member.transferred" )
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
|
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package. |
|
packages
|
|
|
shared
|
|